public function getBodyContent($data) { $button = new Button(); $button->setPresenter($this->grid->presenter)->setType('btn-info btn-xs')->setClassName('mesour-ajax')->addAttribute('href', $this->grid['subitem']->link('toggleItem!', array($this->option[self::KEY], $this->option[self::NAME]))); if ($this->option[self::OPENED]) { $button->setIcon('glyphicon-minus')->setTitle('Disable sub item'); } else { $button->setIcon('glyphicon-plus')->setTitle('Enable sub item'); } return $button; }
/** * Create button * * @param Array $data * @return String * @throws Grid_Exception */ public function create($data = NULL) { if (empty($data) === FALSE) { $this->data = $data; } if (is_null($this->presenter)) { throw new Grid_Exception('Presenter is not set for ' . __CLASS__ . '.'); } if (!isset($this->option[self::STATUS]) && !isset($this->option[self::CALLBACK])) { throw new Grid_Exception('Option ' . __CLASS__ . '::STATUS is required.'); } return parent::create($data); }