当前位置: 首页>>代码示例>>PHP>>正文


PHP BackendUtility::getGroupNames方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::getGroupNames方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::getGroupNames方法的具体用法?PHP BackendUtility::getGroupNames怎么用?PHP BackendUtility::getGroupNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Backend\Utility\BackendUtility的用法示例。


在下文中一共展示了BackendUtility::getGroupNames方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: select

 /**
  * Populates the "object_id" field of a "tx_beacl_acl" record depending on
  * whether the field "type" is set to "User" or "Group"
  *
  * @param		array		field configuration
  * @param		object
  * @return	void
  */
 function select(&$PA, $fobj)
 {
     global $BE_USER;
     if (!array_key_exists('row', $PA)) {
         return;
     }
     if (!array_key_exists('type', $PA['row'])) {
         return;
     }
     // Resetting the SELECT field items
     $PA['items'] = array(0 => array(0 => '', 1 => ''));
     // Get users or groups - The function copies functionality of the method acl_objectSelector()
     // of ux_SC_mod_web_perm_index class as for non-admins it returns only:
     // 1) Users which are members of the groups of the current user.
     // 2) Groups that the current user is a member of.
     switch ($PA['row']['type'][0]) {
         // In case users shall be returned
         case '0':
             $items = BackendUtility::getUserNames();
             if (!$GLOBALS['BE_USER']->isAdmin()) {
                 $items = BackendUtility::blindUserNames($items, $BE_USER->userGroupsUID, 1);
             }
             foreach ($items as $row) {
                 $PA['items'][] = array(0 => $row['username'], 1 => $row['uid']);
             }
             break;
             // In case groups shall be returned
         // In case groups shall be returned
         case '1':
             $items = BackendUtility::getGroupNames();
             if (!$GLOBALS['BE_USER']->isAdmin()) {
                 $items = BackendUtility::blindGroupNames($items, $BE_USER->userGroupsUID, 1);
             }
             foreach ($items as $row) {
                 $PA['items'][] = array(0 => $row['title'], 1 => $row['uid']);
             }
             break;
         default:
             return;
     }
     return;
 }
开发者ID:kaystrobach,项目名称:TYPO3.be_acl,代码行数:50,代码来源:GroupSelector.php

示例2: indexAction

 /**
  * Index action
  *
  * @return void
  */
 public function indexAction()
 {
     if (!$this->id) {
         $this->pageInfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
     }
     if ($this->getBackendUser()->workspace != 0) {
         // Adding section with the permission setting matrix:
         $this->addFlashMessage(LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarningText', 'beuser'), LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:WorkspaceWarning', 'beuser'), FlashMessage::WARNING);
     }
     // depth options
     $depthOptions = array();
     $url = $this->uriBuilder->reset()->setArguments(array('action' => 'index', 'depth' => '__DEPTH__', 'id' => $this->id))->buildBackendUri();
     foreach (array(1, 2, 3, 4, 10) as $depthLevel) {
         $depthOptions[$depthLevel] = $depthLevel . ' ' . LocalizationUtility::translate('LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:levels', 'beuser');
     }
     $this->view->assign('depthBaseUrl', $url);
     $this->view->assign('depth', $this->depth);
     $this->view->assign('depthOptions', $depthOptions);
     $beUserArray = BackendUtility::getUserNames();
     $this->view->assign('beUsers', $beUserArray);
     $beGroupArray = BackendUtility::getGroupNames();
     $this->view->assign('beGroups', $beGroupArray);
     /** @var $tree PageTreeView */
     $tree = GeneralUtility::makeInstance(PageTreeView::class);
     $tree->init();
     $tree->addField('perms_user', true);
     $tree->addField('perms_group', true);
     $tree->addField('perms_everybody', true);
     $tree->addField('perms_userid', true);
     $tree->addField('perms_groupid', true);
     $tree->addField('hidden');
     $tree->addField('fe_group');
     $tree->addField('starttime');
     $tree->addField('endtime');
     $tree->addField('editlock');
     // Create the tree from $this->id
     if ($this->id) {
         $tree->tree[] = array('row' => $this->pageInfo, 'HTML' => $tree->getIcon($this->id));
     } else {
         $tree->tree[] = array('row' => $this->pageInfo, 'HTML' => $tree->getRootIcon($this->pageInfo));
     }
     $tree->getTree($this->id, $this->depth);
     $this->view->assign('viewTree', $tree->tree);
     // CSH for permissions setting
     $this->view->assign('cshItem', BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module'));
 }
开发者ID:CDRO,项目名称:TYPO3.CMS,代码行数:51,代码来源:PermissionController.php

示例3: renderGroupSelector

 /**
  * Generate the group selector element
  *
  * @param integer $page The page id to change the user for
  * @param integer $groupUid The page group uid
  * @param string $username The username to display
  * @return string The html select element
  */
 protected function renderGroupSelector($page, $groupUid, $groupname = '')
 {
     // Get usernames
     $beGroups = BackendUtility::getListGroupNames('title,uid');
     $beGroupKeys = array_keys($beGroups);
     $beGroupsO = $beGroups = BackendUtility::getGroupNames();
     if (!$GLOBALS['BE_USER']->isAdmin()) {
         $beGroups = BackendUtility::blindGroupNames($beGroupsO, $beGroupKeys, 1);
     }
     // Group selector:
     $options = '';
     // flag: is set if the page-groupid equals one from the group-list
     $userset = 0;
     // Loop through the groups
     foreach ($beGroups as $uid => $row) {
         if ($uid == $groupUid) {
             $userset = 1;
             $selected = ' selected="selected"';
         } else {
             $selected = '';
         }
         $options .= '<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['title']) . '</option>';
     }
     // If the group was not set AND there is a group for the page
     if (!$userset && $groupUid) {
         $options = '<option value="' . $groupUid . '" selected="selected">' . htmlspecialchars($beGroupsO[$groupUid]['title']) . '</option>' . $options;
     }
     $elementId = 'g_' . $page;
     $options = '<option value="0"></option>' . $options;
     $selector = '<select name="new_page_group" id="new_page_group">' . $options . '</select>';
     $saveButton = '<a onclick="WebPermissions.changeGroup(' . $page . ', ' . $groupUid . ', \'' . $elementId . '\');" title="Change group">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-save') . '</a>';
     $cancelButton = '<a onclick="WebPermissions.restoreGroup(' . $page . ', ' . $groupUid . ', \'' . ($groupname == '' ? '<span class=not_set>[not set]</span>' : htmlspecialchars($groupname)) . '\', \'' . $elementId . '\');" title="Cancel">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close') . '</a>';
     $ret = $selector . $saveButton . $cancelButton;
     return $ret;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:43,代码来源:PermissionAjaxController.php

示例4: createUserAndGroupListForSelectOptions

 /**
  * Create options for the user / group drop down.
  * This is not moved to a repository by intention to not mix up this 'meta' data
  * with real repository work
  *
  * @return array Key is the option name, value its label
  */
 protected function createUserAndGroupListForSelectOptions()
 {
     $userGroupArray = array();
     // Two meta entries: 'all' and 'self'
     $userGroupArray[0] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('allUsers', 'Belog');
     $userGroupArray[-1] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('self', 'Belog');
     // List of groups, key is gr-'uid'
     $groups = \TYPO3\CMS\Backend\Utility\BackendUtility::getGroupNames();
     foreach ($groups as $group) {
         $userGroupArray['gr-' . $group['uid']] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('group', 'Belog') . ' ' . $group['title'];
     }
     // List of users, key is us-'uid'
     $users = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
     foreach ($users as $user) {
         $userGroupArray['us-' . $user['uid']] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('user', 'Belog') . ' ' . $user['username'];
     }
     return $userGroupArray;
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:25,代码来源:AbstractController.php

示例5: renderGroupSelector

 /**
  * Generate the group selector element
  *
  * @param int $page The page id to change the user for
  * @param int $groupUid The page group uid
  * @param string $groupname The groupname to display
  * @return string The html select element
  */
 protected function renderGroupSelector($page, $groupUid, $groupname = '')
 {
     $page = (int) $page;
     $groupUid = (int) $groupUid;
     // Get usernames
     $beGroupsO = $beGroups = BackendUtility::getGroupNames();
     // Group selector:
     $options = '';
     // flag: is set if the page-groupid equals one from the group-list
     $userset = 0;
     // Loop through the groups
     foreach ($beGroups as $uid => $row) {
         $uid = (int) $uid;
         if ($uid === $groupUid) {
             $userset = 1;
             $selected = ' selected="selected"';
         } else {
             $selected = '';
         }
         $options .= '<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['title']) . '</option>';
     }
     // If the group was not set AND there is a group for the page
     if (!$userset && $groupUid) {
         $options = '<option value="' . $groupUid . '" selected="selected">' . htmlspecialchars($beGroupsO[$groupUid]['title']) . '</option>' . $options;
     }
     $elementId = 'g_' . $page;
     $options = '<option value="0"></option>' . $options;
     $selector = '<select name="new_page_group" id="new_page_group">' . $options . '</select>';
     $saveButton = '<a class="savegroup btn btn-default" data-page="' . $page . '" data-group="' . $groupUid . '" data-element-id="' . $elementId . '" title="Change group">' . $this->iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL)->render() . '</a>';
     $cancelButton = '<a class="restoregroup btn btn-default" data-page="' . $page . '" data-group="' . $groupUid . '" data-element-id="' . $elementId . '"' . (!empty($groupname) ? ' data-groupname="' . htmlspecialchars($groupname) . '"' : '') . ' title="Cancel">' . $this->iconFactory->getIcon('actions-document-close', Icon::SIZE_SMALL)->render() . '</a>';
     return '<span id="' . $elementId . '">' . $selector . '<span class="btn-group">' . $saveButton . $cancelButton . '</span>' . '</span>';
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:40,代码来源:PermissionAjaxController.php

示例6: notEdit

    /**
     * Showing the permissions in a tree ($this->edit = false)
     * (Adding content to internal content variable).
     *
     * @return void
     */
    public function notEdit()
    {
        $backendUser = $this->getBackendUser();
        $language = $this->getLanguageService();
        // stores which depths already have their last item
        $depthStop = array();
        $lastDepth = 0;
        // Get usernames and groupnames: The arrays we get in return contains only
        // 1) users which are members of the groups of the current user,
        // 2) groups that the current user is member of
        $beGroupKeys = $backendUser->userGroupsUID;
        $beUserArray = BackendUtility::getUserNames();
        if (!$backendUser->isAdmin()) {
            $beUserArray = BackendUtility::blindUserNames($beUserArray, $beGroupKeys, 0);
        }
        $beGroupArray = BackendUtility::getGroupNames();
        if (!$backendUser->isAdmin()) {
            $beGroupArray = BackendUtility::blindGroupNames($beGroupArray, $beGroupKeys, 0);
        }
        // Length of strings:
        $tLen = 20;
        // Selector for depth:
        $code = $language->getLL('Depth') . ': ';
        $code .= BackendUtility::getFuncMenu($this->categoryUid, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']);
        $this->content .= $this->doc->section('', $code);
        // Initialize tree object:
        /**
         * Category tree.
         *
         * @var \CommerceTeam\Commerce\Tree\CategoryTree $tree
         */
        $tree = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Tree\\CategoryTree');
        $tree->setBare();
        $tree->init();
        $tree->readRecursively($this->categoryUid, $this->MOD_SETTINGS['depth']);
        // Creating top icon; the current page
        $rootIcon = IconUtility::getSpriteIcon('apps-pagetree-root');
        // Create the tree from $this->categoryUid:
        $tree->getTree();
        $tree = $tree->getRecordsAsArray($this->categoryUid);
        // Make header of table:
        $code = '
			<thead>
				<tr>
					<th colspan="2">&nbsp;</th>
					<th>' . $language->getLL('Owner', true) . '</th>
					<th align="center">' . $language->getLL('Group', true) . '</th>
					<th align="center">' . $language->getLL('Everybody', true) . '</th>
					<th align="center">' . $language->getLL('EditLock', true) . '</th>
				</tr>
			</thead>
		';
        // Traverse tree:
        foreach ($tree as $data) {
            $cells = array();
            $pageId = $data['row']['uid'];
            // Background colors:
            $bgCol = $this->lastEdited == $pageId ? ' class="bgColor-20"' : '';
            // User/Group names:
            $userId = $data['row']['perms_userid'];
            $userName = $beUserArray[$userId] ? $beUserArray[$userId]['username'] : $userId;
            if ($userId && !$beUserArray[$userId]) {
                $userName = PermissionAjaxController::renderOwnername($pageId, $userId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20)), false);
            } else {
                $userName = PermissionAjaxController::renderOwnername($pageId, $userId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20)));
            }
            $groupId = $data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : '';
            $groupName = $beGroupArray[$groupId] ? $beGroupArray[$groupId]['title'] : $groupId;
            if ($groupId && !$beGroupArray[$groupId]) {
                $groupName = PermissionAjaxController::renderGroupname($pageId, $groupId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20)), false);
            } else {
                $groupName = PermissionAjaxController::renderGroupname($pageId, $groupId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20)));
            }
            // Seeing if editing of permissions are allowed for that page:
            $editPermsAllowed = $userId == $backendUser->user['uid'] || $backendUser->isAdmin();
            // First column:
            // @todo check for better solution
            $plusMinusIcon = '';
            // Add PM only if we are not looking at the root
            if ($data['depth'] > 0) {
                // Add simple join-images for categories that are deeper level than 1
                if ($data['depth'] > 1) {
                    $k = $data['depth'];
                    for ($j = 1; $j < $k; ++$j) {
                        if (!array_key_exists($j, $depthStop) || $depthStop[$j] != 1) {
                            $plusMinusIcon .= IconUtility::getSpriteIcon('treeline-line');
                        } elseif ($depthStop[$j] == 1) {
                            $plusMinusIcon .= IconUtility::getSpriteIcon('treeline-blank');
                        }
                    }
                }
                if ($lastDepth > $data['depth']) {
                    for ($j = $data['depth'] + 1; $j <= $lastDepth; ++$j) {
                        $depthStop[$j] = 0;
//.........这里部分代码省略.........
开发者ID:BenjaminBeck,项目名称:commerce,代码行数:101,代码来源:PermissionModuleController.php

示例7: notEdit

    /**
     * Showing the permissions in a tree ($this->edit = FALSE)
     * (Adding content to internal content variable)
     *
     * @return void
     */
    public function notEdit()
    {
        // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
        $beGroupKeys = $GLOBALS['BE_USER']->userGroupsUID;
        $beUserArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $beUserArray = \TYPO3\CMS\Backend\Utility\BackendUtility::blindUserNames($beUserArray, $beGroupKeys, 0);
        }
        $beGroupArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getGroupNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $beGroupArray = \TYPO3\CMS\Backend\Utility\BackendUtility::blindGroupNames($beGroupArray, $beGroupKeys, 0);
        }
        // Length of strings:
        $tLen = $this->MOD_SETTINGS['mode'] == 'perms' ? 20 : 30;
        // Selector for depth:
        $code = $GLOBALS['LANG']->getLL('Depth') . ': ';
        $code .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']);
        $this->content .= $this->doc->section('', $code);
        $this->content .= $this->doc->spacer(5);
        // Initialize tree object:
        $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView');
        $tree->init('AND ' . $this->perms_clause);
        $tree->addField('perms_user', 1);
        $tree->addField('perms_group', 1);
        $tree->addField('perms_everybody', 1);
        $tree->addField('perms_userid', 1);
        $tree->addField('perms_groupid', 1);
        $tree->addField('hidden');
        $tree->addField('fe_group');
        $tree->addField('starttime');
        $tree->addField('endtime');
        $tree->addField('editlock');
        // Creating top icon; the current page
        $HTML = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $this->pageinfo);
        $tree->tree[] = array('row' => $this->pageinfo, 'HTML' => $HTML);
        // Create the tree from $this->id:
        $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], '');
        // Make header of table:
        $code = '';
        if ($this->MOD_SETTINGS['mode'] == 'perms') {
            $code .= '
				<tr class="t3-row-header">
					<td colspan="2">&nbsp;</td>
					<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td>' . $GLOBALS['LANG']->getLL('Owner', TRUE) . '</td>
					<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $GLOBALS['LANG']->getLL('Group', TRUE) . '</td>
					<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $GLOBALS['LANG']->getLL('Everybody', TRUE) . '</td>
					<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $GLOBALS['LANG']->getLL('EditLock', TRUE) . '</td>
				</tr>
			';
        } else {
            $code .= '
				<tr class="t3-row-header">
					<td colspan="2">&nbsp;</td>
					<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center" nowrap="nowrap">' . $GLOBALS['LANG']->getLL('User', TRUE) . ': ' . htmlspecialchars($GLOBALS['BE_USER']->user['username']) . '</td>
					' . (!$GLOBALS['BE_USER']->isAdmin() ? '<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $GLOBALS['LANG']->getLL('EditLock', TRUE) . '</td>' : '') . '
				</tr>';
        }
        // Traverse tree:
        foreach ($tree->tree as $data) {
            $cells = array();
            $pageId = $data['row']['uid'];
            // Background colors:
            $bgCol = $this->lastEdited == $pageId ? ' class="bgColor-20"' : '';
            $lE_bgCol = $bgCol;
            // User/Group names:
            $userName = $beUserArray[$data['row']['perms_userid']] ? $beUserArray[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? $data['row']['perms_userid'] : '');
            if ($data['row']['perms_userid'] && !$beUserArray[$data['row']['perms_userid']]) {
                $userName = \TYPO3\CMS\Perm\Controller\PermissionAjaxController::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($userName, 20)), FALSE);
            } else {
                $userName = \TYPO3\CMS\Perm\Controller\PermissionAjaxController::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($userName, 20)));
            }
            $groupName = $beGroupArray[$data['row']['perms_groupid']] ? $beGroupArray[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : '');
            if ($data['row']['perms_groupid'] && !$beGroupArray[$data['row']['perms_groupid']]) {
                $groupName = \TYPO3\CMS\Perm\Controller\PermissionAjaxController::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($groupName, 20)), FALSE);
            } else {
                $groupName = \TYPO3\CMS\Perm\Controller\PermissionAjaxController::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($groupName, 20)));
            }
            // Seeing if editing of permissions are allowed for that page:
            $editPermsAllowed = $data['row']['perms_userid'] == $GLOBALS['BE_USER']->user['uid'] || $GLOBALS['BE_USER']->isAdmin();
            // First column:
            $cellAttrib = $data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '';
            $cells[] = '
					<td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) . '>' . $data['HTML'] . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($data['row']['title'], $tLen)) . '&nbsp;</td>';
            // "Edit permissions" -icon
            if ($editPermsAllowed && $pageId) {
                $aHref = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_perm') . '&mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . ($data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId) . '&return_id=' . $this->id . '&edit=1';
                $cells[] = '
					<td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '" title="' . $GLOBALS['LANG']->getLL('ch_permissions', 1) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '</a></td>';
//.........这里部分代码省略.........
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:101,代码来源:PermissionModuleController.php

示例8: array

 /**
  * outputs a selector for users / groups, returns current ACLs
  *
  * @param    integer        type of ACL. 0 -> user, 1 -> group
  * @param    string        Pointer where the display code is stored
  * @param    array        configuration of ACLs
  * @return    array        list of groups/users where the ACLs will be shown
  */
 function acl_objectSelector($type, &$displayPointer, $conf)
 {
     global $BE_USER;
     $aclObjects = array();
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_beacl_acl.object_id AS object_id, tx_beacl_acl.type AS type', 'tx_beacl_acl, be_groups, be_users', 'tx_beacl_acl.type=' . intval($type) . ' AND ((tx_beacl_acl.object_id=be_groups.uid AND tx_beacl_acl.type=1) OR (tx_beacl_acl.object_id=be_users.uid AND tx_beacl_acl.type=0))', '', 'be_groups.title ASC, be_users.realname ASC');
     while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         $aclObjects[] = $result['object_id'];
     }
     $aclObjects = array_unique($aclObjects);
     // advanced selector disabled
     if (!$conf['enableFilterSelector']) {
         return $aclObjects;
     }
     if (!empty($aclObjects)) {
         // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
         $groupArray = $BE_USER->userGroupsUID;
         $be_user_Array = BackendUtility::getUserNames();
         if (!$GLOBALS['BE_USER']->isAdmin()) {
             $be_user_Array = BackendUtility::blindUserNames($be_user_Array, $groupArray, 0);
         }
         $be_group_Array = BackendUtility::getGroupNames();
         if (!$GLOBALS['BE_USER']->isAdmin()) {
             $be_group_Array = BackendUtility::blindGroupNames($be_group_Array, $groupArray, 0);
         }
         // get current selection from UC, merge data, write it back to UC
         $currentSelection = is_array($BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type]) ? $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] : array();
         $currentSelectionOverride_raw = GeneralUtility::_GP('tx_beacl_objsel');
         $currentSelectionOverride = array();
         if (is_array($currentSelectionOverride_raw[$type])) {
             foreach ($currentSelectionOverride_raw[$type] as $tmp) {
                 $currentSelectionOverride[$tmp] = $tmp;
             }
         }
         if ($currentSelectionOverride) {
             $currentSelection = $currentSelectionOverride;
         }
         $BE_USER->uc['moduleData']['txbeacl_aclSelector'][$type] = $currentSelection;
         $BE_USER->writeUC($BE_USER->uc);
         // display selector
         $displayCode = '<select size="' . \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(count($aclObjects), 5, 15) . '" name="tx_beacl_objsel[' . $type . '][]" multiple="multiple">';
         foreach ($aclObjects as $singleObjectId) {
             if ($type == 0) {
                 $tmpnam = $be_user_Array[$singleObjectId]['username'];
             } else {
                 $tmpnam = $be_group_Array[$singleObjectId]['title'];
             }
             $displayCode .= '<option value="' . $singleObjectId . '" ' . (@in_array($singleObjectId, $currentSelection) ? 'selected' : '') . '>' . $tmpnam . '</option>';
         }
         $displayCode .= '</select>';
         $displayCode .= '<br /><input type="button" value="' . $GLOBALS['LANG']->getLL('aclObjSelUpdate') . '" onClick="document.editform.action=document.location; document.editform.submit()" /><p />';
         // create section
         switch ($type) {
             case 0:
                 $tmpnam = 'aclUsers';
                 break;
             default:
                 $tmpnam = 'aclGroups';
                 break;
         }
         $displayPointer = $this->doc->section($GLOBALS['LANG']->getLL($tmpnam, 1), $displayCode);
         return $currentSelection;
     }
     return NULL;
 }
开发者ID:kaystrobach,项目名称:TYPO3.be_acl,代码行数:72,代码来源:PermissionModuleController.php


注:本文中的TYPO3\CMS\Backend\Utility\BackendUtility::getGroupNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。