[TASK] Improve output of EXT:beuser > Permissions > Edit 29/34429/4
authorGeorg Ringer <georg.ringer@gmail.com>
Fri, 21 Nov 2014 09:00:37 +0000 (10:00 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 21 Nov 2014 10:02:06 +0000 (11:02 +0100)
* Abort link should be rendered as a button
* Preview link was empty
* If no groups are there, don't render the select box
* Add backlink in toolbar

Change-Id: I913bf3ebc2784206afe285ceeb9691231cafcaf9
Resolves: #63122
Releases: master
Reviewed-on: http://review.typo3.org/34429
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/beuser/Classes/Controller/PermissionController.php
typo3/sysext/beuser/Resources/Private/Language/locallang_mod_permission.xlf
typo3/sysext/beuser/Resources/Private/Templates/Permission/Edit.html

index 521ae66..606d904 100644 (file)
@@ -21,6 +21,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 
 /**
@@ -98,6 +99,22 @@ class PermissionController extends ActionController {
        }
 
        /**
+        * Initializes view
+        *
+        * @param ViewInterface $view The view to be initialized
+        * @return void
+        */
+       protected function initializeView(ViewInterface $view) {
+               $view->assign(
+                               'previewUrl',
+                               BackendUtility::viewonclick(
+                                       $this->pageInfo['uid'], $GLOBALS['BACK_PATH'],
+                                       BackendUtility::BEgetRootLine($this->pageInfo['uid'])
+                               )
+                       );
+       }
+
+       /**
         * Index action
         *
         * @return void
@@ -108,13 +125,7 @@ class PermissionController extends ActionController {
                        if ($this->getBackendUser()->isAdmin() && !$this->id) {
                                $this->pageInfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
                        }
-                       $this->view->assign(
-                               'previewUrl',
-                               BackendUtility::viewonclick(
-                                       $this->pageInfo['uid'], $GLOBALS['BACK_PATH'],
-                                       BackendUtility::BEgetRootLine($this->pageInfo['uid'])
-                               )
-                       );
+
                        $this->view->assign('versionSelector', $this->getVersionSelector($this->id, TRUE));
                        if ($this->getBackendUser()->workspace != 0) {
                                // Adding section with the permission setting matrix:
index 0338287..ca32e42 100644 (file)
                        <trans-unit id="deleted" xml:space="preserve">
                                <source>deleted</source>
                        </trans-unit>
+                       <trans-unit id="noGroups" xml:space="preserve">
+                               <source>No user groups exist.</source>
+                       </trans-unit>
                </body>
        </file>
 </xliff>
index 01ec6e5..41e85e0 100644 (file)
@@ -3,6 +3,7 @@
 <f:layout name="Permission" />
 
 <f:section name="iconButtons">
+       <f:be.buttons.icon uri="{f:uri.action(action:'index')}" icon="actions-view-go-up" />
        <a href="#" onclick="{previewUrl}" title="{f:translate(key: 'LLL:EXT:lang/locallang_core.xlf:labels.showPage')}"><bu:spriteManagerIcon iconName="actions-document-view" /></a>
 </f:section>
 
                </div>
 
                <h3><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Group" /></h3>
-               <div class="form-group">
-                       <f:form.select name="data[pages][{id}][perms_groupid]" options="{beGroupData}" value="{currentBeGroup}" />
-               </div>
+               <f:if condition="{f:count(subject:beGroupData)} > 1">
+                       <f:then>
+                               <div class="form-group">
+                                       <f:form.select name="data[pages][{id}][perms_groupid]" options="{beGroupData}" value="{currentBeGroup}" />
+                               </div>
+                       </f:then>
+                       <f:else>
+                               <div class="alert alert-notice"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:noGroups" /></div>
+                       </f:else>
+               </f:if>
+
 
                <table class="t3-table" id="typo3-permissionMatrix">
                        <thead>
@@ -73,7 +82,7 @@
 
                <f:form.hidden name="depth" value="{depth}" />
                <f:form.submit name="submit" value="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Save')}" />
-               <f:link.action action="index" arguments="{id: id}"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Abort" /></f:link.action>
+               <f:link.action class="btn btn-default" action="index" arguments="{id: id}"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Abort" /></f:link.action>
 
                <f:form.hidden name="redirect" value="{f:uri.action(action: 'index', arguments: {lastEdited: id, id: returnId})}" />
        </f:form>