本文整理汇总了PHP中CMSMenu::remove_menu_item方法的典型用法代码示例。如果您正苦于以下问题:PHP CMSMenu::remove_menu_item方法的具体用法?PHP CMSMenu::remove_menu_item怎么用?PHP CMSMenu::remove_menu_item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMSMenu
的用法示例。
在下文中一共展示了CMSMenu::remove_menu_item方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
Requirements::css($this->ModuleBase() . '/css/cms-tweaks.css');
Requirements::javascript($this->ModuleBase() . '/javascript/cms-tweaks.js');
/* Remove help link */
CMSMenu::remove_menu_item('Help');
/* Hide "Add new" page, page Settings tab */
if (!Permission::check('SITETREE_REORGANISE')) {
Requirements::javascript($this->ModuleBase() . '/javascript/sitetree-noedit.js');
}
/* Hide all error pages in SiteTree and Files (modeladmin) */
if (!Permission::check('ADMIN')) {
Requirements::javascript($this->ModuleBase() . '/javascript/hide-error-pages.js');
}
/* Add file timestamps for TinyMCE's content_css */
$css = HtmlEditorConfig::get('cms')->getOption('content_css');
if ($css) {
$base_folder = Director::baseFolder();
$timestamped_css = array();
$regular_css = preg_split('/,/', $css, -1, PREG_SPLIT_NO_EMPTY);
foreach ($regular_css as $file) {
if (is_file($base_folder . '/' . $file)) {
array_push($timestamped_css, $file . '?m=' . filemtime($base_folder . '/' . $file));
}
}
if (count($timestamped_css > 0)) {
HtmlEditorConfig::get('cms')->setOption('content_css', implode(',', $timestamped_css));
}
}
}
示例2: init
public function init()
{
/**
* If the config is set, display the menu item in the LeftAndMain
*/
if (!$this->owner->config()->enable_menu_item) {
CMSMenu::remove_menu_item('CMSSiteDesignController');
}
}
开发者ID:helpfulrobot,项目名称:toastnz-silverstripe-site-designer,代码行数:9,代码来源:SiteDesignLeftAndMainExtension.php
示例3: 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
示例4: 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());
}
示例5: init
public function init()
{
/** =========================================
* @var SiteConfig $config
===========================================*/
$config = SiteConfig::current_site_config();
/**
* Remove the Reports menu item in the CMS
*/
if (!$config->ShowAssetAdmin) {
CMSMenu::remove_menu_item('AssetAdmin');
}
/**
* Remove the Blog menu item in the CMS
*/
if (!$config->ShowBlogAdmin) {
CMSMenu::remove_menu_item('BlogPageModelAdmin');
}
/**
* Remove the Help Link in the CMS
*/
if (!$config->ShowHelpLink) {
CMSMenu::remove_menu_item('Help');
}
/**
* Remove the Messages menu item in the CMS
*/
if (!$config->ShowMessagesAdmin) {
CMSMenu::remove_menu_item('ContactMessageModelAdmin');
}
/**
* Remove the Portfolio menu item in the CMS
*/
if (!$config->ShowPortfolioAdmin) {
CMSMenu::remove_menu_item('PortfolioPageModelAdmin');
}
/**
* Remove the Reports menu item in the CMS
*/
if (!$config->ShowReportAdmin) {
CMSMenu::remove_menu_item('ReportAdmin');
}
/**
* Remove the Security menu item in the CMS
*/
if (!$config->ShowSecurityAdmin) {
CMSMenu::remove_menu_item('SecurityAdmin');
}
/** Set the background colour of the cms sidebar menu. */
Requirements::customCSS('.cms-menu {background: ' . $this->owner->stat('cms_menu_background') . ';}');
}
示例6: init
public function init()
{
$config = SiteConfig::current_site_config();
if ($config->CustomApplicationLink) {
Config::inst()->update('LeftAndMain', 'application_link', $config->CustomApplicationLink);
}
if ($config->CustomApplicationName) {
Config::inst()->update('LeftAndMain', 'application_name', $config->CustomApplicationName);
}
if (!$config->ShowReportAdmin) {
CMSMenu::remove_menu_item('ReportAdmin');
}
if (!$config->ShowHelpLink) {
CMSMenu::remove_menu_item('Help');
}
}
示例7: init
public function init()
{
/** @var SiteConfig $config */
$config = SiteConfig::current_site_config();
/**
* Remove the Reports menu item in the CMS
*/
if (!$config->ShowAssetAdmin) {
CMSMenu::remove_menu_item('AssetAdmin');
}
/**
* Remove the Blog menu item in the CMS
*/
if (!$config->ShowBlogAdmin) {
CMSMenu::remove_menu_item('BlogPageModelAdmin');
}
/**
* Remove the Help Link in the CMS
*/
if (!$config->ShowHelpLink) {
CMSMenu::remove_menu_item('Help');
}
/**
* Remove the Messages menu item in the CMS
*/
if (!$config->ShowMessagesAdmin) {
CMSMenu::remove_menu_item('ContactMessageModelAdmin');
}
/**
* Remove the Portfolio menu item in the CMS
*/
if (!$config->ShowPortfolioAdmin) {
CMSMenu::remove_menu_item('PortfolioPageModelAdmin');
}
/**
* Remove the Reports menu item in the CMS
*/
if (!$config->ShowReportAdmin) {
CMSMenu::remove_menu_item('ReportAdmin');
}
/**
* Remove the Security menu item in the CMS
*/
if (!$config->ShowSecurityAdmin) {
CMSMenu::remove_menu_item('SecurityAdmin');
}
}
开发者ID:helpfulrobot,项目名称:toastnz-silverstripe-boilerplate-installer,代码行数:47,代码来源:ProjectLeftAndMainExtension.php
示例8: customise_data_objects
/**
* Set JSON/XML data object exclusions/inclusions.
* NOTE: ALL data objects are included by default (excluding some core), unless disabled or inclusions have explicitly been defined.
*
* @parameter <{FILTER_TYPE}> string
* @parameter <{DATA_OBJECT_NAMES}> array(string)
*/
public static function customise_data_objects($type, $objects = null)
{
// Merge the exclusions/inclusions in case of multiple definitions.
if (is_array($objects) && strtolower($type) === 'exclude') {
self::$custom_exclusions = array_unique(array_merge(self::$custom_exclusions, $objects));
} else {
if (is_array($objects) && strtolower($type) === 'include') {
self::$custom_inclusions = array_unique(array_merge(self::$custom_inclusions, $objects));
} else {
if (strtolower($type) === 'disabled') {
self::$disabled = true;
// The CMS interface will no longer be required.
CMSMenu::remove_menu_item('APIwesomeAdmin');
}
}
}
}
开发者ID:helpfulrobot,项目名称:nglasl-silverstripe-apiwesome,代码行数:24,代码来源:DataObjectOutputConfiguration.php
示例9: SS_LogFileWriter
<?php
global $project;
$project = 'mysite';
global $database;
$database = 'eamon';
require_once 'conf/ConfigureFromEnv.php';
// Log notices
if (defined('MY_SS_ERROR_LOG')) {
SS_Log::add_writer(new SS_LogFileWriter(MY_SS_ERROR_LOG), SS_Log::NOTICE, '<=');
}
// Set the site locale
i18n::set_locale('en_GB');
CMSMenu::remove_menu_item('ReportAdmin');
// Set cache life
$devCacheLife = -1;
$liveCacheLife = 60 * 5;
// 5 min
$cacheLife = Director::isDev() ? $devCacheLife : $liveCacheLife;
SS_Cache::set_cache_lifetime(Cached_PageDataUtil::CACHE_NAME, $cacheLife, 100);
示例10: init
public function init()
{
parent::init();
CMSMenu::remove_menu_item('Help');
}
示例11: isset
<?php
// Default CMS HTMLEditorConfig
HtmlEditorConfig::get('cms')->setOptions(array('friendly_name' => 'Default CMS', 'priority' => '50', 'body_class' => 'typography', 'document_base_url' => isset($_SERVER['HTTP_HOST']) ? Director::absoluteBaseURL() : null, 'cleanup_callback' => "sapphiremce_cleanup", 'use_native_selects' => false, 'valid_elements' => "@[id|class|style|title],a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title" . "|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class]," . "-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align|data*]," . "-sub[class],-sup[class],-blockquote[dir|class],-cite[dir|class|id|title]," . "-table[cellspacing|cellpadding|width|height|class|align|summary|dir|id|style]," . "-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style]," . "tbody[id|class|style],thead[id|class|style],tfoot[id|class|style]," . "#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style]," . "-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class]," . "-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align]," . "-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style]," . "-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class]," . "dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class]", 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name" . "|usemap|data*],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling]," . "object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]"));
HtmlEditorConfig::get('cms')->disablePlugins('contextmenu');
HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen', 'inlinepopups');
HtmlEditorConfig::get('cms')->enablePlugins(array('ssbuttons' => sprintf('../../../%s/tinymce_ssbuttons/editor_plugin_src.js', THIRDPARTY_DIR)));
HtmlEditorConfig::get('cms')->enablePlugins('advimagescale');
HtmlEditorConfig::get('cms')->insertButtonsBefore('formatselect', 'styleselect');
HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'ssmedia', 'ssflash', 'sslink', 'unlink', 'anchor', 'separator', 'code', 'fullscreen', 'separator');
HtmlEditorConfig::get('cms')->removeButtons('tablecontrols');
HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols');
CMSMenu::remove_menu_item('CMSProfileController');
示例12: array
'admin/bulkload//$Action/$ID/$OtherID' => 'BulkLoaderAdmin',
'admin/cms//$Action/$ID/$OtherID' => 'CMSMain',
'admin/asset//$Action/$ID/$OtherID' => 'AssetAdmin',
'dev/buildcache/$Action' => 'RebuildStaticCacheTask',
));
// Default to "pages" view unless a URLSegment within /admin is specified
Director::addRules(20, array(
'admin//$action/$ID/$OtherID' => '->admin/pages'
));
Director::addRules(1, array(
'$URLSegment//$Action/$ID/$OtherID' => 'ModelAsController',
));
/**
* Register the default internal shortcodes.
*/
ShortcodeParser::get('default')->register('sitetree_link', array('SiteTree', 'link_shortcode_handler'));
Object::add_extension('File', 'SiteTreeFileExtension');
// TODO Remove once we can configure CMSMenu through static, nested configuration files
CMSMenu::remove_menu_item('CMSMain');
CMSMenu::remove_menu_item('CMSPageEditController');
CMSMenu::remove_menu_item('CMSPageSettingsController');
CMSMenu::remove_menu_item('CMSPageHistoryController');
CMSMenu::remove_menu_item('CMSPageReportsController');
CMSMenu::remove_menu_item('CMSPageAddController');
CMSMenu::remove_menu_item('CMSFileAddController');
示例13: define
<?php
define('DMS_DIR', 'dms');
Object::add_extension('SiteTree', 'DMSSiteTreeExtension');
Object::add_extension('HtmlEditorField_Toolbar', 'DocumentHtmlEditorFieldToolbar');
CMSMenu::remove_menu_item('DMSDocumentAddController');
ShortcodeParser::get('default')->register('dms_document_link', array('DMSDocument_Controller', 'dms_link_shortcode_handler'));
if (!file_exists(BASE_PATH . DIRECTORY_SEPARATOR . DMS_DIR)) {
user_error("DMS directory named incorrectly. Please install the DMS module into a folder named: " . DMS_DIR);
}
示例14: define
<?php
define('INPAGE_MODULES_DIR', basename(__DIR__));
CMSMenu::remove_menu_item('ContentModuleMain');
CMSMenu::remove_menu_item('ContentModuleEditController');
CMSMenu::remove_menu_item('ContentModuleSettingsController');
CMSMenu::remove_menu_item('ContentModuleHistoryController');
//CMSMenu::remove_menu_item('CMSPageReportsController');
CMSMenu::remove_menu_item('ContentModuleAddController');
//CMSMenu::remove_menu_item('CMSFileAddController');
LeftAndMain::require_css(INPAGE_MODULES_DIR . '/css/ContentModuleField.css');
if (class_exists('Translatable') && SiteTree::has_extension('Translatable')) {
Config::inst()->update('ContentModule', 'extensions', array('ContentModuleLanguageExtension'));
Config::inst()->update('ContentModuleField', 'extensions', array('ContentModuleFieldTranslatableExtension'));
Config::inst()->update('SiteTree', 'extensions', array('ContentModuleSiteTreeTranslatableExtension'));
Config::inst()->update('ContentModuleMain', 'extensions', array('ContentModuleMainTranslatableExtension'));
}
示例15: define
<?php
define('ADMINHELP_DIR', basename(__DIR__));
CMSMenu::remove_menu_item('AdminHelpShowController');
CMSMenu::remove_menu_item('AdminHelpModelAdmin');