mirror of
https://github.com/jonom/silverstripe-betternavigator.git
synced 2024-10-22 14:05:51 +02:00
FIX: don't customise the current controller to prevent variables conflicting with page controller / record variables/functions.
fixes: #8
This commit is contained in:
parent
3b53e7b36a
commit
d3c4f381b4
@ -45,18 +45,17 @@ class BetterNavigator extends DataExtension {
|
||||
$isDeveloper = $member && is_array($devs) ? in_array($member->Email, $devs) : false;
|
||||
|
||||
//Add other data for template
|
||||
$nav = array_merge($nav, array(
|
||||
$nav = new ArrayData(array_merge($nav, array(
|
||||
'Member' => $member,
|
||||
'Stage' => Versioned::current_stage(),
|
||||
'LoginLink' => Config::inst()->get('Security', 'login_url'),
|
||||
'Mode' => Director::get_environment_type(),
|
||||
'IsDeveloper' => $isDeveloper
|
||||
));
|
||||
'IsDeveloper' => $isDeveloper,
|
||||
'ID' => $this->owner->ID,
|
||||
'Link' => $this->owner->Link()
|
||||
)));
|
||||
|
||||
//Merge with page data, send to template and render
|
||||
$nav = new ArrayData($nav);
|
||||
$page = $this->owner->customise($nav);
|
||||
return $page->renderWith('BetterNavigator');
|
||||
return $nav->renderWith('BetterNavigator');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user