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


PHP LeftAndMain::menu_title_for_class方法代码示例

本文整理汇总了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;
 }
开发者ID:helpfulrobot,项目名称:undefinedoffset-silverstripe-codebank,代码行数:23,代码来源:CodeBankIPAgreement.php

示例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')));
 }
开发者ID:lekoala,项目名称:silverstripe-mandrill,代码行数:10,代码来源:MandrillAdmin.php

示例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;
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:17,代码来源:LeftAndMain.php

示例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));
 }
开发者ID:ivoba,项目名称:silverstripe-framework,代码行数:5,代码来源:SecurityAdmin.php

示例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;
 }
开发者ID:rodneyway,项目名称:silverstripe-cms,代码行数:53,代码来源:LeftAndMain.php

示例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;
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:19,代码来源:CMSMain.php

示例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;
 }
开发者ID:rixrix,项目名称:sapphire,代码行数:14,代码来源:CMSMenu.php

示例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')));
 }
开发者ID:nathancox,项目名称:silverstripe-dashboard,代码行数:10,代码来源:Dashboard.php

示例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;
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:26,代码来源:CMSMain.php

示例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')]];
 }
开发者ID:lekoala,项目名称:silverstripe-sparkpost,代码行数:10,代码来源:SparkPostAdmin.php

示例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')));
 }
开发者ID:nyeholt,项目名称:silverstripe-adminhelp,代码行数:5,代码来源:AdminHelpController.php

示例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])]];
 }
开发者ID:webfox,项目名称:silverstripe-global-content,代码行数:5,代码来源:GlobalContentAdmin.php

示例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;
 }
开发者ID:littlegiant,项目名称:silverstripe-singlepageadmin,代码行数:19,代码来源:SinglePageAdmin.php

示例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;
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:67,代码来源:SilvercartLeftAndMainExtension.php

示例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));
 }
开发者ID:helpfulrobot,项目名称:webtorque7-inpage-modules,代码行数:5,代码来源:ContentModuleMain.php


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