Skip to content

Commit

Permalink
Add the ability to configure disabling the sidebar
Browse files Browse the repository at this point in the history
Useful for crud admins that have a single controller and do not need a sidebar
  • Loading branch information
josegonzalez committed Dec 26, 2015
1 parent c78152d commit 7cdecf4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function beforeRender(Event $event)
$controller->set('viewblocks', $this->_getViewBlocks());
$controller->set('formUrl', $this->_getFormUrl());
$controller->set('disableExtraButtons', $this->_getDisableExtraButtons());
$controller->set('disableSidebar', $this->_getDisableSidebar());
$controller->set('extraButtonsBlacklist', $this->_getExtraButtonsBlacklist());
$controller->set('enableDirtyCheck', $this->_getEnableDirtyCheck());
$controller->set('actionGroups', $this->_getActionGroups());
Expand Down Expand Up @@ -575,6 +576,17 @@ protected function _getDisableExtraButtons()
return $action->config('scaffold.disable_extra_buttons') ?: false;
}

/**
* Disable sidebar.
*
* @return bool
*/
protected function _getDisableSidebar()
{
$action = $this->_action();
return $action->config('scaffold.disable_sidebar') ?: false;
}

/**
* Get extra buttons blacklist
*
Expand Down

0 comments on commit 7cdecf4

Please sign in to comment.