54 $this->buttonList = $context->getButtonList();
55 $this->toolbar = $context->getButtonToolbar();
56 parent::__construct($context,
$data);
67 if ($this->
hasData(self::PARAM_CONTROLLER)) {
68 $this->_controller = $this->
_getData(self::PARAM_CONTROLLER);
70 if ($this->
hasData(self::PARAM_HEADER_TEXT)) {
71 $this->_headerText = $this->
_getData(self::PARAM_HEADER_TEXT);
85 public function addButton($buttonId,
$data, $level = 0, $sortOrder = 0, $region =
'toolbar')
87 $this->buttonList->add($buttonId,
$data, $level, $sortOrder, $region);
99 $this->buttonList->remove($buttonId);
113 $this->buttonList->update($buttonId, $key,
$data);
124 $this->toolbar->pushButtons($this, $this->buttonList);
125 return parent::_prepareLayout();
134 public function getButtonsHtml($region =
null)
137 foreach ($this->buttonList->getItems() as $buttons) {
139 foreach ($buttons as
$item) {
140 if ($region && $region !=
$item->getRegion()) {
166 return 'head-' . strtr($this->_controller,
'_',
'-');
186 foreach ($this->buttonList->getItems() as $buttons) {
187 foreach ($buttons as
$data) {
188 if (isset(
$data[
'region']) &&
'footer' ==
$data[
'region']) {
204 return !
$item->isDeleted();
getChildHtml($alias='', $useCache=true)