本文整理汇总了PHP中LeftAndMain::menu_title_for_class方法的典型用法代码示例。如果您正苦于以下问题:PHP LeftAndMain::menu_title_for_class方法的具体用法?PHP LeftAndMain::menu_title_for_class怎么用?PHP LeftAndMain::menu_title_for_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeftAndMain
的用法示例。
在下文中一共展示了LeftAndMain::menu_title_for_class方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Breadcrumbs
/**
* @return ArrayList
*/
public function Breadcrumbs($unlinked = false)
{
$defaultTitle = LeftAndMain::menu_title_for_class('CodeBankIPAgreement');
$title = _t('CodeBankIPAgreement.MENUTITLE', $defaultTitle);
$items = new ArrayList(array(new ArrayData(array('Title' => $title, 'Link' => $unlinked ? false : 'admin/codeBank/show/' . $this->currentPageID()))));
$record = $this->currentPage();
if ($record && $record->exists()) {
if ($record->hasExtension('Hierarchy')) {
$ancestors = $record->getAncestors();
$ancestors = new ArrayList(array_reverse($ancestors->toArray()));
$ancestors->push($record);
foreach ($ancestors as $ancestor) {
$items->push(new ArrayData(array('Title' => $ancestor->Title, 'Link' => $unlinked ? false : Controller::join_links($this->Link('show'), $ancestor->ID))));
}
} else {
$items->push(new ArrayData(array('Title' => $record->Title, 'Link' => $unlinked ? false : Controller::join_links($this->Link('show'), $record->ID))));
}
}
return $items;
}
示例2: providePermissions
/**
* Provides custom permissions to the Security section
*
* @return array
*/
public function providePermissions()
{
$title = _t("Mandrill.MENUTITLE", LeftAndMain::menu_title_for_class('Mandrill'));
return array("CMS_ACCESS_Mandrill" => array('name' => _t('Mandrill.ACCESS', "Access to '{title}' section", array('title' => $title)), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('Mandrill.ACCESS_HELP', 'Allow use of Mandrill admin section')));
}
示例3: providePermissions
function providePermissions()
{
$perms = array("CMS_ACCESS_LeftAndMain" => array('name' => _t('CMSMain.ACCESSALLINTERFACES', 'Access to all CMS sections'), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('CMSMain.ACCESSALLINTERFACESHELP', 'Overrules more specific access settings.'), 'sort' => -100));
// Add any custom ModelAdmin subclasses. Can't put this on ModelAdmin itself
// since its marked abstract, and needs to be singleton instanciated.
foreach (ClassInfo::subclassesFor('ModelAdmin') as $i => $class) {
if ($class == 'ModelAdmin') {
continue;
}
if (ClassInfo::classImplements($class, 'TestOnly')) {
continue;
}
$title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class));
$perms["CMS_ACCESS_" . $class] = array('name' => _t('CMSMain.ACCESS', "Access to '{title}' section", "Item in permission selection identifying the admin section. Example: Access to 'Files & Images'", array('title' => $title)), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'));
}
return $perms;
}
示例4: providePermissions
public function providePermissions()
{
$title = _t("SecurityAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
return array("CMS_ACCESS_SecurityAdmin" => array('name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('SecurityAdmin.ACCESS_HELP', 'Allow viewing, adding and editing users, as well as assigning permissions and roles to them.')), 'EDIT_PERMISSIONS' => array('name' => _t('SecurityAdmin.EDITPERMISSIONS', 'Manage permissions for groups'), 'category' => _t('Permissions.PERMISSIONS_CATEGORY', 'Roles and access permissions'), 'help' => _t('SecurityAdmin.EDITPERMISSIONS_HELP', 'Ability to edit Permissions and IP Addresses for a group.' . ' Requires the "Access to \'Security\' section" permission.'), 'sort' => 0), 'APPLY_ROLES' => array('name' => _t('SecurityAdmin.APPLY_ROLES', 'Apply roles to groups'), 'category' => _t('Permissions.PERMISSIONS_CATEGORY', 'Roles and access permissions'), 'help' => _t('SecurityAdmin.APPLY_ROLES_HELP', 'Ability to edit the roles assigned to a group.' . ' Requires the "Access to \'Users\' section" permission.'), 'sort' => 0));
}
示例5: MainMenu
/**
* Returns the main menu of the CMS. This is also used by init()
* to work out which sections the user has access to.
*
* @return DataObjectSet
*/
public function MainMenu()
{
// Don't accidentally return a menu if you're not logged in - it's used to determine access.
if (!Member::currentUser()) {
return new DataObjectSet();
}
// Encode into DO set
$menu = new DataObjectSet();
$menuItems = CMSMenu::get_viewable_menu_items();
if ($menuItems) {
foreach ($menuItems as $code => $menuItem) {
// alternate permission checks (in addition to LeftAndMain->canView())
if (isset($menuItem->controller) && $this->hasMethod('alternateMenuDisplayCheck') && !$this->alternateMenuDisplayCheck($menuItem->controller)) {
continue;
}
$linkingmode = "";
if (strpos($this->Link(), $menuItem->url) !== false) {
if ($this->Link() == $menuItem->url) {
$linkingmode = "current";
// default menu is the one with a blank {@link url_segment}
} else {
if (singleton($menuItem->controller)->stat('url_segment') == '') {
if ($this->Link() == $this->stat('url_base') . '/') {
$linkingmode = "current";
}
} else {
$linkingmode = "current";
}
}
}
// already set in CMSMenu::populate_menu(), but from a static pre-controller
// context, so doesn't respect the current user locale in _t() calls - as a workaround,
// we simply call LeftAndMain::menu_title_for_class() again
// if we're dealing with a controller
if ($menuItem->controller) {
$defaultTitle = LeftAndMain::menu_title_for_class($menuItem->controller);
$title = _t("{$menuItem->controller}.MENUTITLE", $defaultTitle);
} else {
$title = $menuItem->title;
}
$menu->push(new ArrayData(array("MenuItem" => $menuItem, "Title" => Convert::raw2xml($title), "Code" => $code, "Link" => $menuItem->url, "LinkingMode" => $linkingmode)));
}
}
// if no current item is found, assume that first item is shown
//if(!isset($foundCurrent))
return $menu;
}
示例6: providePermissions
/**
* Provide the permission codes used by LeftAndMain.
* Can't put it on LeftAndMain since that's an abstract base class.
*/
function providePermissions()
{
$classes = ClassInfo::subclassesFor('LeftAndMain');
foreach ($classes as $i => $class) {
$title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class));
$perms["CMS_ACCESS_" . $class] = array('name' => sprintf(_t('CMSMain.ACCESS', "Access to '%s' section", PR_MEDIUM, "Item in permission selection identifying the admin section. Example: Access to 'Files & Images'"), $title, null), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'));
}
$perms["CMS_ACCESS_LeftAndMain"] = array('name' => _t('CMSMain.ACCESSALLINTERFACES', 'Access to all CMS sections'), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('CMSMain.ACCESSALLINTERFACESHELP', 'Overrules more specific access settings.'), 'sort' => -100);
$perms['CMS_ACCESS_CMSMain']['help'] = _t('CMSMain.ACCESS_HELP', 'Allow viewing of the section containing page tree and content. View and edit permissions can be handled through page specific dropdowns, as well as the separate "Content permissions".');
$perms['CMS_ACCESS_SecurityAdmin']['help'] = _t('SecurityAdmin.ACCESS_HELP', 'Allow viewing, adding and editing users, as well as assigning permissions and roles to them.');
if (isset($perms['CMS_ACCESS_ModelAdmin'])) {
unset($perms['CMS_ACCESS_ModelAdmin']);
}
return $perms;
}
示例7: provideI18nEntities
/**
* Provide menu titles to the i18n entity provider
*/
function provideI18nEntities()
{
$cmsClasses = self::get_cms_classes();
$entities = array();
foreach ($cmsClasses as $cmsClass) {
$defaultTitle = LeftAndMain::menu_title_for_class($cmsClass);
$ownerModule = i18n::get_owner_module($cmsClass);
$entities["{$cmsClass}.MENUTITLE"] = array($defaultTitle, PR_HIGH, 'Menu title', $ownerModule);
}
return $entities;
}
示例8: providePermissions
/**
* Provides custom permissions to the Security section
*
* @return array
*/
public function providePermissions()
{
$title = _t("Dashboard.MENUTITLE", LeftAndMain::menu_title_for_class('Dashboard'));
return array("CMS_ACCESS_Dashboard" => array('name' => _t('Dashboard.ACCESS', "Access to '{title}' section", array('title' => $title)), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('Dashboard.ACCESS_HELP', 'Allow use of the CMS Dashboard')), "CMS_ACCESS_DashboardAddPanels" => array('name' => _t('Dashboard.ADDPANELS', "Add dashboard panels"), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('Dashboard.ACCESS_HELP', 'Allow user to add panels to his/her dashboard')), "CMS_ACCESS_DashboardConfigurePanels" => array('name' => _t('Dashboard.CONFIGUREANELS', "Configure dashboard panels"), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('Dashboard.ACCESS_HELP', 'Allow user to configure his/her dashbaord panels')), "CMS_ACCESS_DashboardDeletePanels" => array('name' => _t('Dashboard.DELETEPANELS', "Remove dashboard panels"), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('Dashboard.ACCESS_HELP', 'Allow user to remove panels from his/her dashbaord')));
}
示例9: providePermissions
/**
* Provide the permission codes used by LeftAndMain.
* Can't put it on LeftAndMain since that's an abstract base class.
*/
function providePermissions() {
$classes = ClassInfo::subclassesFor('LeftAndMain');
foreach($classes as $class) {
$title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class));
$perms["CMS_ACCESS_" . $class] = sprintf(
_t(
'CMSMain.ACCESS',
"Access to '%s' (%s)",
PR_MEDIUM,
"Item in permission selection identifying the admin section, with title and classname. Example: Access to 'Files & Images' (AssetAdmin)"
),
$title,
$class
);
}
$perms["CMS_ACCESS_LeftAndMain"] = _t(
'CMSMain.ACCESSALLINTERFACES',
'Access to all CMS interfaces'
);
return $perms;
}
示例10: providePermissions
/**
* Provides custom permissions to the Security section
*
* @return array
*/
public function providePermissions()
{
$title = _t("SparkPostAdmin.MENUTITLE", LeftAndMain::menu_title_for_class('SparkPost'));
return ["CMS_ACCESS_SparkPost" => ['name' => _t('SparkPostAdmin.ACCESS', "Access to '{title}' section", ['title' => $title]), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('SparkPostAdmin.ACCESS_HELP', 'Allow use of SparkPost admin section')]];
}
示例11: providePermissions
public function providePermissions()
{
$title = _t("AdminHelp.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
return array("ADMINHELP_ACCESS_VIEW" => array('name' => _t('AdminHelp.VIEWACCESS', "Access to '{title}' section", array('title' => $title)), 'category' => _t('Permission.ADMINHELP_ACCESS_CATEGORY', 'Admin Help Access')));
}
示例12: providePermissions
public function providePermissions()
{
$title = _t("GlobalContentAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
return ["CMS_ACCESS_GlobalContentAdmin" => ['name' => _t('CMSMain.ACCESS', "Access to '{title}' section", ['title' => $title]), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('GlobalContentAdmin.ACCESS_HELP', "Allow viewing and editing data in the '{title}' section", ['title' => $title])]];
}
示例13: providePermissions
/**
* @return array
*/
public function providePermissions()
{
$perms = array();
// Add any custom SinglePageAdmin subclasses.
foreach (ClassInfo::subclassesFor('SinglePageAdmin') as $i => $class) {
if ($class == 'SinglePageAdmin') {
continue;
}
if (ClassInfo::classImplements($class, 'TestOnly')) {
continue;
}
$title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class));
$perms["CMS_ACCESS_" . $class] = array('name' => _t('CMSMain.ACCESS', "Access to '{title}' section", "Item in permission selection identifying the admin section. Example: Access to 'Files & Images'", array('title' => $title)), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'));
}
return $perms;
}
示例14: SilvercartMenus
/**
* Returns Silvercart specific menus.
*
* @return ArrayList
*
* @author Sascha Koehler <skoehler@pixeltricks.de>,
* Sebastian Diel <sdiel@pixeltricks.de>
* @since 28.02.2013
*/
public function SilvercartMenus()
{
$silvercartMenus = new ArrayList();
$menuItems = CMSMenu::get_viewable_menu_items();
$hiddenMenus = SilvercartConfig::getHiddenRegisteredMenus();
foreach (SilvercartConfig::getRegisteredMenus() as $menu) {
if (in_array($menu['code'], $hiddenMenus)) {
continue;
}
$modelAdmins = new ArrayList();
foreach ($menuItems as $code => $menuItem) {
if (isset($menuItem->controller) && $this->owner->hasMethod('alternateMenuDisplayCheck') && !$this->owner->alternateMenuDisplayCheck($menuItem->controller)) {
continue;
}
if (empty($menuItem->controller)) {
continue;
}
if (in_array($menuItem->controller, self::$model_admins_to_ignore)) {
continue;
}
$menuCode = Config::inst()->get($menuItem->controller, 'menuCode');
$menuSection = Config::inst()->get($menuItem->controller, 'menuSection');
$menuSortIndex = Config::inst()->get($menuItem->controller, 'menuSortIndex');
$url_segment = Config::inst()->get($menuItem->controller, 'url_segment');
if ($menuCode == $menu['code'] || is_null($menuCode) && $menu['code'] == 'default') {
$defaultTitle = LeftAndMain::menu_title_for_class($menuItem->controller);
$title = _t("{$menuItem->controller}.MENUTITLE", $defaultTitle);
$linkingmode = "";
if (strpos($this->owner->Link(), $menuItem->url) !== false) {
if ($this->owner->Link() == $menuItem->url) {
$linkingmode = "current";
// default menu is the one with a blank {@link url_segment}
} elseif ($url_segment == '') {
if ($this->owner->Link() == $this->owner->stat('url_base') . '/') {
$linkingmode = "current";
}
} else {
$linkingmode = "current";
}
}
if (empty($menuSection)) {
$menuSection = 'base';
}
if (empty($menuSortIndex)) {
$menuSortIndex = 1000;
}
$modelAdmins->push(new ArrayData(array("MenuItem" => $menuItem, "Title" => Convert::raw2xml($title), "Code" => $code, 'MenuCode' => $menu['code'], "IsSection" => false, "Section" => $menuSection, "SortIndex" => $menuSortIndex, "Link" => $menuItem->url, "LinkingMode" => $linkingmode)));
unset($menuItems[$code]);
}
}
$modelAdmins = $modelAdmins->sort('SortIndex', 'ASC');
if ($modelAdmins->exists()) {
$menu['name'] = _t('SilvercartStoreAdminMenu.' . strtoupper($menu['code']), $menu['name']);
$silvercartMenus->push(new DataObject(array('name' => $menu['name'], 'code' => $menu['code'], 'Code' => $menu['code'], 'ModelAdmins' => $modelAdmins)));
}
}
return $silvercartMenus;
}
示例15: providePermissions
public function providePermissions()
{
$title = _t("CMSPagesController.MENUTITLE", LeftAndMain::menu_title_for_class('CMSPagesController'));
return array("CMS_ACCESS_CMSMain" => array('name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'help' => _t('CMSMain.ACCESS_HELP', 'Allow viewing of the section containing page tree and content. View and edit permissions can be handled through page specific dropdowns, as well as the separate "Content permissions".'), 'sort' => -99));
}