21307 Posts in 5737 Topics by 2603 members
| Go to End | Next > | |
| Author | Topic: | 5634 Views |
-
Remove Menu Item from Admin

16 May 2009 at 8:14am
I am trying to remove the "help" button from the admin by using:
Object::addStaticVars('LeftAndMain', array(
'removed_menu_items' => array(
'help',
)
));in mysite/_config.php file but it does not have any effect of error. I am sure I am missing something.
I am using SS v2.3.1
-
Re: Remove Menu Item from Admin

16 May 2009 at 10:44am
I think the correct method now for 2.3 is using
CMSMenu::remove_menu_item('help'); // or try 'Help'
-
Re: Remove Menu Item from Admin

16 May 2009 at 10:47am
I tried both of those versions and got the same result. No error and the help button is still there. I did run the flush between tests as well.
-
Re: Remove Menu Item from Admin

16 May 2009 at 10:53am
For reference here is my mysite/_config.php file
<?php
global $project;
$project = 'mysite';global $databaseConfig;
$databaseConfig = array(
"type" => "MySQLDatabase",
"server" => "localhost",
"username" => "root",
"password" => "******",
"database" => "******",
);// Remove the 'Help' button in the CMS
CMSMenu::remove_menu_item('Help');// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// for a description of what dev mode does.
Director::set_dev_servers(array(
'localhost',
'127.0.0.1',
));// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.com/themes/
SSViewer::set_theme('default');// The next three lines customizes the admin graphics
LeftAndMain::setApplicationName("Website CMS");
LeftAndMain::setLogo(".../themes/cms/logo.gif", "position: relative; left: 5px; margin-top: -3px; padding-left: 50px;");
LeftAndMain::set_loading_image("../themes/cms/loading.gif");?>
-
Re: Remove Menu Item from Admin

16 May 2009 at 11:06am
Ok this is a bug - I just noticed it on my localhost as well. It looks like the help link is added right at the end of the operations. This should be a ticket in open.silverstripe.com.
-
Re: Remove Menu Item from Admin

16 May 2009 at 11:10am
Sorry for nubbie-ness. IS that something I need to do?
-
Re: Remove Menu Item from Admin

22 May 2009 at 4:49am
I was having this trouble aswell with the latest stable build found the temp fix for now in /cms/code/LeftAndMain.php just comment out lines 111-115 which stops the help link being added to the menu
CMSMenu::add_link(
'Help',
_t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'),
'http://userhelp.silverstripe.com'
); -
Re: Remove Menu Item from Admin

27 June 2009 at 6:41am Last edited: 27 June 2009 7:06am
A nice, clean way to remove the Help Menu is to decorate LeftAndMain so you don't have to mod your core files:
In your _config.php file, add:
Object::add_extension('LeftAndMain', 'MyLeftAndMainDecorator');
In your /code folder, create MyLeftAndMainDecorator.php and enter the following:
<?php
class MyLeftAndMainDecorator extends LeftAndMainDecorator {
function init() {
CMSMenu::remove_menu_item('Help');
}
}
| 5634 Views | ||
| Go to Top | Next > |




