mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: Fixed bug with // placement in CMSMenu Director rule generation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65502 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6f33a5fcf6
commit
3546ec275b
@ -33,9 +33,18 @@ class CMSMenu extends Object implements Iterator
|
||||
*/
|
||||
public static function add_controller($controllerClass) {
|
||||
$controller = singleton($controllerClass);
|
||||
Director::addRules($controller->stat('url_priority', true),
|
||||
array(Controller::join_links($controller->Link(), $controller->stat('url_rule', true)) => $controllerClass)
|
||||
);
|
||||
|
||||
$link = $controller->Link();
|
||||
if(substr($link,-1) == '/') $link = substr($link,0,-1);
|
||||
$subRule = $controller->stat('url_rule', true);
|
||||
if($subRule[0] == '/') $subRule = substr($subRule,1);
|
||||
$rule = $link . '//' . $subRule;
|
||||
|
||||
Director::addRules($controller->stat('url_priority', true), array(
|
||||
$rule => $controllerClass
|
||||
|
||||
));
|
||||
|
||||
return self::add_menu_item(
|
||||
$controllerClass,
|
||||
$controller->getMenuTitle(),
|
||||
|
Loading…
Reference in New Issue
Block a user