本文整理汇总了PHP中t3lib_BEfunc::getListGroupNames方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::getListGroupNames方法的具体用法?PHP t3lib_BEfunc::getListGroupNames怎么用?PHP t3lib_BEfunc::getListGroupNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::getListGroupNames方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doEdit
/**
* Creating form for editing the permissions ($this->edit = true)
* (Adding content to internal content variable)
*
* @return void
*/
public function doEdit()
{
global $BE_USER, $LANG;
if ($BE_USER->workspace != 0) {
// Adding section with the permission setting matrix:
$lockedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $LANG->getLL('WorkspaceWarningText'), $LANG->getLL('WorkspaceWarning'), t3lib_FlashMessage::WARNING);
t3lib_FlashMessageQueue::addMessage($lockedMessage);
}
// Get usernames and groupnames
$beGroupArray = t3lib_BEfunc::getListGroupNames('title,uid');
$beGroupKeys = array_keys($beGroupArray);
$beUserArray = t3lib_BEfunc::getUserNames();
if (!$GLOBALS['BE_USER']->isAdmin()) {
$beUserArray = t3lib_BEfunc::blindUserNames($beUserArray, $beGroupKeys, 1);
}
$beGroupArray_o = $beGroupArray = t3lib_BEfunc::getGroupNames();
if (!$GLOBALS['BE_USER']->isAdmin()) {
$beGroupArray = t3lib_BEfunc::blindGroupNames($beGroupArray_o, $beGroupKeys, 1);
}
$firstGroup = $beGroupKeys[0] ? $beGroupArray[$beGroupKeys[0]] : '';
// data of the first group, the user is member of
// Owner selector:
$options = '';
$userset = 0;
// flag: is set if the page-userid equals one from the user-list
foreach ($beUserArray as $uid => $row) {
if ($uid == $this->pageinfo['perms_userid']) {
$userset = 1;
$selected = ' selected="selected"';
} else {
$selected = '';
}
$options .= '
<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['username']) . '</option>';
}
$options = '
<option value="0"></option>' . $options;
$selector = '
<select name="data[pages][' . $this->id . '][perms_userid]">
' . $options . '
</select>';
$this->content .= $this->doc->section($LANG->getLL('Owner') . ':', $selector);
// Group selector:
$options = '';
$userset = 0;
foreach ($beGroupArray as $uid => $row) {
if ($uid == $this->pageinfo['perms_groupid']) {
$userset = 1;
$selected = ' selected="selected"';
} else {
$selected = '';
}
$options .= '
<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['title']) . '</option>';
}
if (!$userset && $this->pageinfo['perms_groupid']) {
// If the group was not set AND there is a group for the page
$options = '
<option value="' . $this->pageinfo['perms_groupid'] . '" selected="selected">' . htmlspecialchars($beGroupArray_o[$this->pageinfo['perms_groupid']]['title']) . '</option>' . $options;
}
$options = '
<option value="0"></option>' . $options;
$selector = '
<select name="data[pages][' . $this->id . '][perms_groupid]">
' . $options . '
</select>';
$this->content .= $this->doc->divider(5);
$this->content .= $this->doc->section($LANG->getLL('Group') . ':', $selector);
// Permissions checkbox matrix:
$code = '
<table border="0" cellspacing="2" cellpadding="0" id="typo3-permissionMatrix">
<tr>
<td></td>
<td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('1', 1)) . '</td>
<td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('16', 1)) . '</td>
<td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('2', 1)) . '</td>
<td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('4', 1)) . '</td>
<td class="bgColor2">' . str_replace(' ', '<br />', $LANG->getLL('8', 1)) . '</td>
</tr>
<tr>
<td align="right" class="bgColor2">' . $LANG->getLL('Owner', 1) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_user', 1) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_user', 5) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_user', 2) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_user', 3) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_user', 4) . '</td>
</tr>
<tr>
<td align="right" class="bgColor2">' . $LANG->getLL('Group', 1) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_group', 1) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_group', 5) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_group', 2) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_group', 3) . '</td>
<td class="bgColor-20">' . $this->printCheckBox('perms_group', 4) . '</td>
//.........这里部分代码省略.........
示例2: doEdit
/**
* Creating form for editing the permissions ($this->edit = true)
* (Adding content to internal content variable)
*
* @return void
*/
function doEdit()
{
global $BE_USER, $LANG;
// get ACL configuration
$beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
if ($beAclConfig['disableOldPermissionSystem']) {
$disableOldPermissionSystem = 1;
} else {
$disableOldPermissionSystem = 0;
}
$LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php');
// Get usernames and groupnames
$be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
$groupArray = array_keys($be_group_Array);
$be_user_Array = t3lib_BEfunc::getUserNames();
if (!$GLOBALS['BE_USER']->isAdmin()) {
$be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 1);
}
$be_group_Array_o = $be_group_Array = t3lib_BEfunc::getGroupNames();
if (!$GLOBALS['BE_USER']->isAdmin()) {
$be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array_o, $groupArray, 1);
}
$firstGroup = $groupArray[0] ? $be_group_Array[$groupArray[0]] : '';
// data of the first group, the user is member of
// set JavaScript
$subPagesData = '';
// generate list if record is available on subpages, if yes, enter the id
$this->content .= '<script src="../../../' . t3lib_extMgm::extRelPath('be_acl') . 'res/acl.js" type="text/javascript">
' . $subPagesData . '
</script>';
// Owner selector:
$options = '';
$userset = 0;
// flag: is set if the page-userid equals one from the user-list
foreach ($be_user_Array as $uid => $row) {
if ($uid == $this->pageinfo['perms_userid']) {
$userset = 1;
$selected = ' selected="selected"';
} else {
$selected = '';
}
$options .= '
<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['username']) . '</option>';
}
$options = '
<option value="0"></option>' . $options;
// hide selector if not needed
if ($disableOldPermissionSystem) {
$hidden = ' style="display:none;" ';
} else {
$hidden = '';
}
$selector = '
<select name="data[pages][' . $this->id . '][perms_userid]" ' . $hidden . '>
' . $options . '
</select>';
if ($disableOldPermissionSystem) {
$this->content .= $selector;
} else {
$this->content .= $this->doc->section($LANG->getLL('Owner') . ':', $selector);
}
// Group selector:
$options = '';
$userset = 0;
foreach ($be_group_Array as $uid => $row) {
if ($uid == $this->pageinfo['perms_groupid']) {
$userset = 1;
$selected = ' selected="selected"';
} else {
$selected = '';
}
$options .= '
<option value="' . $uid . '"' . $selected . '>' . htmlspecialchars($row['title']) . '</option>';
}
if (!$userset && $this->pageinfo['perms_groupid']) {
// If the group was not set AND there is a group for the page
$options = '
<option value="' . $this->pageinfo['perms_groupid'] . '" selected="selected">' . htmlspecialchars($be_group_Array_o[$this->pageinfo['perms_groupid']]['title']) . '</option>' . $options;
}
$options = '
<option value="0"></option>' . $options;
$selector = '
<select name="data[pages][' . $this->id . '][perms_groupid]" ' . $hidden . '>
' . $options . '
</select>';
if ($disableOldPermissionSystem) {
$this->content .= $selector;
} else {
$this->content .= $this->doc->divider(5);
$this->content .= $this->doc->section($LANG->getLL('Group') . ':', $selector);
}
// Permissions checkbox matrix:
$code = '
<input type="hidden" name="pageID" value="' . $this->id . '" />
//.........这里部分代码省略.........
示例3: displayWorkspaceOverview
/**
* Rendering the overview of versions in the current workspace
*
* @return string HTML (table)
* @see typo3/mod/user/ws/index.php for sister function!
*/
function displayWorkspaceOverview()
{
// Initialize variables:
$this->showWorkspaceCol = $GLOBALS['BE_USER']->workspace === 0 && $this->MOD_SETTINGS['display'] <= -98;
// Get usernames and groupnames
$be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
$groupArray = array_keys($be_group_Array);
$this->be_user_Array = t3lib_BEfunc::getUserNames();
if (!$GLOBALS['BE_USER']->isAdmin()) {
$this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, $groupArray, 1);
}
// Initialize Workspace ID and filter-value:
if ($GLOBALS['BE_USER']->workspace === 0) {
$wsid = $this->details ? -99 : $this->MOD_SETTINGS['display'];
// Set wsid to the value from the menu (displaying content of other workspaces)
$filter = $this->details ? 0 : $this->MOD_SETTINGS['filter'];
} else {
$wsid = $GLOBALS['BE_USER']->workspace;
$filter = 0;
}
// Initialize workspace object and request all pending versions:
$wslibObj = t3lib_div::makeInstance('wslib');
// Selecting ALL versions belonging to the workspace:
$versions = $wslibObj->selectVersionsInWorkspace($wsid, $filter, -99, $this->uid);
// $this->uid is the page id of LIVE record.
// Traverse versions and build page-display array:
$pArray = array();
foreach ($versions as $table => $records) {
foreach ($records as $rec) {
$pageIdField = $table === 'pages' ? 't3ver_oid' : 'realpid';
$this->displayWorkspaceOverview_setInPageArray($pArray, $table, $rec);
}
}
// Make header of overview:
$tableRows = array();
if (count($pArray)) {
$tableRows[] = '
<tr class="bgColor5 tableheader">
' . ($this->diffOnly ? '' : '<td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('liveVersion') . '</td>') . '
<td nowrap="nowrap" colspan="2">' . $GLOBALS['LANG']->getLL('wsVersions') . '</td>
<td nowrap="nowrap"' . ($this->diffOnly ? ' colspan="2"' : ' colspan="4"') . '>' . $GLOBALS['LANG']->getLL('controls') . '</td>
</tr>';
// Add lines from overview:
$tableRows = array_merge($tableRows, $this->displayWorkspaceOverview_list($pArray));
$table = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding workspace-overview">' . implode('', $tableRows) . '</table>';
} else {
$table = '';
}
$linkBack = t3lib_div::_GP('returnUrl') ? '<a href="' . htmlspecialchars(t3lib_div::_GP('returnUrl')) . '" class="typo3-goBack">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . $GLOBALS['LANG']->getLL('goBack', TRUE) . '</a><br /><br />' : '';
$resetDiffOnly = $this->diffOnly ? '<a href="index.php?id=' . intval($this->id) . '" class="typo3-goBack">' . $GLOBALS['LANG']->getLL('showAllInformation') . '</a><br /><br />' : '';
$versionSelector = $GLOBALS['BE_USER']->workspace ? $this->doc->getVersionSelector($this->id) : '';
return $versionSelector . $linkBack . $resetDiffOnly . $table . $this->markupNewOriginals();
}
示例4: processUserAndGroups
/**
* Callback function to blind user and group accounts. Used as <code>itemsProcFunc</code> in <code>$TCA</code>.
*
* @param array $conf Configuration array. The following elements are set:<ul><li>items - initial set of items (empty in our case)</li><li>config - field config from <code>$TCA</code></li><li>TSconfig - this function name</li><li>table - table name</li><li>row - record row (???)</li><li>field - field name</li></ul>
* @param object $tceforms <code>t3lib_div::TCEforms</code> object
* @return void
*/
function processUserAndGroups($conf, $tceforms)
{
// Get usernames and groupnames
$be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
$groupArray = array_keys($be_group_Array);
$be_user_Array = t3lib_BEfunc::getUserNames();
$be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 1);
// users
$title = $GLOBALS['LANG']->sL($GLOBALS['TCA']['be_users']['ctrl']['title']);
foreach ($be_user_Array as $uid => $user) {
$conf['items'][] = array($user['username'] . ' (' . $title . ')', 'be_users_' . $user['uid'], t3lib_iconWorks::getIcon('be_users', $user));
}
// Process groups only if necessary -- save time!
if (strstr($conf['config']['mod_ws_allowed'], 'be_groups')) {
// groups
$be_group_Array = $be_group_Array_o = t3lib_BEfunc::getGroupNames();
$be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array_o, $groupArray, 1);
$title = $GLOBALS['LANG']->sL($GLOBALS['TCA']['be_groups']['ctrl']['title']);
foreach ($be_group_Array as $uid => $group) {
$conf['items'][] = array($group['title'] . ' (' . $title . ')', 'be_groups_' . $group['uid'], t3lib_iconWorks::getIcon('be_groups', $user));
}
}
}
示例5: initVars
/**
* Initializes several class variables
*
* @return void
*/
function initVars()
{
// Init users
$be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
$groupArray = array_keys($be_group_Array);
// Need 'admin' field for t3lib_iconWorks::getIconImage()
$this->be_user_Array = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,admin,workspace_perms');
if (!$GLOBALS['BE_USER']->isAdmin()) {
$this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, $groupArray, 1);
}
// If another page module was specified, replace the default Page module with the new one
$newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
$this->pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Setting publish access permission for workspace:
$this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace);
// FIXME Should be $this->workspaceId here?
}
示例6: main
/**
* Main function for Workspace Manager module.
*
* @return void
*/
function main()
{
global $LANG, $BE_USER, $BACK_PATH;
// See if we need to switch workspace
$changeWorkspace = t3lib_div::_GET('changeWorkspace');
if ($changeWorkspace != '') {
$BE_USER->setWorkspace($changeWorkspace);
$this->content .= $this->doc->wrapScriptTags('top.location.href="' . $BACK_PATH . t3lib_BEfunc::getBackendScript() . '";');
} else {
// Starting page:
$this->content .= $this->doc->header($LANG->getLL('title'));
$this->content .= $this->doc->spacer(5);
// Get usernames and groupnames
$be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
$groupArray = array_keys($be_group_Array);
// Need 'admin' field for t3lib_iconWorks::getIconImage()
$this->be_user_Array_full = $this->be_user_Array = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,admin,workspace_perms');
if (!$GLOBALS['BE_USER']->isAdmin()) {
$this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, $groupArray, 1);
}
// Build top menu:
$menuItems = array();
$menuItems[] = array('label' => $LANG->getLL('menuitem_review'), 'content' => $this->moduleContent_publish());
$menuItems[] = array('label' => $LANG->getLL('menuitem_workspaces'), 'content' => $this->moduleContent_workspaceList());
// Add hidden fields and create tabs:
$content = $this->doc->getDynTabMenu($menuItems, 'user_ws');
$this->content .= $this->doc->section('', $content, 0, 1);
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
// $markers['CSH'] = $docHeaderButtons['csh'];
}
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->startPage($LANG->getLL('title'));
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
示例7: 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 = t3lib_BEfunc::getListGroupNames('title,uid');
$beGroupKeys = array_keys($beGroups);
$beGroupsO = $beGroups = t3lib_BEfunc::getGroupNames();
if (!$GLOBALS['BE_USER']->isAdmin()) {
$beGroups = t3lib_BEfunc::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">' . t3lib_iconWorks::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">' . t3lib_iconWorks::getSpriteIcon('actions-document-close') . '</a>';
$ret = $selector . $saveButton . $cancelButton;
return $ret;
}