Merge pull request #66 from tractorcow/inherit-sidebar-fix

BUG Fixed issue with nested InheritSideBar not inheriting beyond the first level
This commit is contained in:
Michael Parkhill 2013-08-19 20:14:12 -07:00
commit b28a6b27d6
1 changed files with 4 additions and 4 deletions

View File

@ -38,11 +38,11 @@ class WidgetPageExtension extends DataExtension {
*/
public function SideBarView() {
if(
$this->owner->InheritSideBar
&& $this->owner->getParent()
&& $this->owner->getParent()->hasMethod('SideBar')
$this->owner->InheritSideBar
&& ($parent = $this->owner->getParent())
&& $parent->hasMethod('SideBarView')
) {
return $this->owner->getParent()->SideBar();
return $parent->SideBarView();
} elseif($this->owner->SideBar()->exists()){
return $this->owner->SideBar();
}