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


PHP CMSMenu::add_menu_item方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     Requirements::css('silverstripe-upgrade-notification/css/custom.css');
     CMSMenu::remove_menu_item('UpgradeNotificationPage');
     $upgrade_notification_page = new UpgradeNotificationPage();
     if (!$upgrade_notification_page->isCurrentVersion() || $upgrade_notification_page->isCurrentVersion() && $upgrade_notification_page->config()->ShowMenuItemWhenCurrent) {
         CMSMenu::add_menu_item($upgrade_notification_page->getCode(), $upgrade_notification_page->getUpgradeMessage(), 'admin/upgrade/', null, 1000);
     }
 }
开发者ID:bluehousegroup,项目名称:silverstripe-upgrade-notification,代码行数:10,代码来源:UpgradeNotificationLeftAndMainExtension.php

示例2: testRemove

 public function testRemove()
 {
     CMSMenu::clear_menu();
     CMSMenu::add_menu_item('custom', 'Custom Title', 'custom');
     CMSMenu::add_menu_item('other', 'Other Section', 'other', 'CMSMenuTest_LeftAndMainController');
     $this->assertNotEmpty(CMSMenu::get_menu_items());
     CMSMenu::remove_menu_class('CMSMenuTest_LeftAndMainController');
     CMSMenu::remove_menu_item('custom');
     $this->assertEmpty(CMSMenu::get_menu_items());
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:10,代码来源:CMSMenuTest.php

示例3: UpgradeNotificationPage

<?php

LeftAndMain::require_css(basename(__DIR__) . '/css/custom.css');
CMSMenu::remove_menu_item('UpgradeNotificationPage');
$upgrade_notification_page = new UpgradeNotificationPage();
if (!$upgrade_notification_page->isCurrentVersion() || $upgrade_notification_page->isCurrentVersion() && $upgrade_notification_page->config()->ShowMenuItemWhenCurrent) {
    CMSMenu::add_menu_item($upgrade_notification_page->getCode(), $upgrade_notification_page->getUpgradeMessage(), 'admin/upgrade/', null, 1000);
}
开发者ID:helpfulrobot,项目名称:bluehousegroup-silverstripe-upgrade-notification,代码行数:8,代码来源:_config.php

示例4: add_menu_item

	/**
	 * @deprecated Use CMSMenu::add_menu_item();
	 */
	static function add_menu_item($code, $menuTitle, $url, $controllerClass = null, $priority = -1) {
		user_error("LeftAndMain::add_menu_item is deprecated; use CMSMenu::add_menu_item", E_USER_NOTICE);
		return CMSMenu::add_menu_item($code, $menuTitle, $url, $controllerClass, $priority);
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:7,代码来源:LeftAndMain.php

示例5: array

<?php

/**
 *
 * @author: Nicolaas - modules [at] sunnysideup.co.nz
 **/
// optional settings that may be useful
//setlocale (LC_TIME, 'en_NZ@dollar', 'en_NZ.UTF-8', 'en_NZ', 'nz', 'nz');
//date_default_timezone_set("NZ");
// CACHING RECOMMENDATION - you can overrule that in the mysite _config.php file...
//one week = 604800 (60 * 60 * 24 * 7)
//last param is priority
SS_Cache::set_cache_lifetime('any', 604800);
CMSMenu::add_menu_item('refresh', 'Refresh Website', 'shoppingcart/clear/?flush=all', $controllerClass = null, $priority = 2.9, array("target" => "_blank"));
CMSMenu::remove_menu_item('CMSPageAddController_Products');
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce,代码行数:15,代码来源:_config.php

示例6: array

<?php

/* 
Requires XSLT-Processor, i.e.
>> sudo apt-get install php5-xsl
*/
// Change this field to anything except 'setup' do set the configuration fields
// to read-only.
CataloguePage::set_site_status('setup');
Director::addRules(100, array('admin/metadata' => "MetadataAdmin"));
// Add model admin for the metadata entries.
CMSMenu::add_menu_item("metadata", 'Metadata', 'admin/metadata', "MetadataAdmin");
开发者ID:helpfulrobot,项目名称:silverstripe-geocatalogue,代码行数:12,代码来源:_config.php


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