addElement('hidden', 'submitAndManage', array('value' => '0')); $this->addElement('text', 'title', array('label' => 'Title', 'required' => true)); $this->addSeoGroup('Gallery'); $config = $this->getConfig('image')->toArray(); $resize = $config['width'] . 'x' . $config['height'] . \Qs_ImageFs::getResizeMethodAlias($config['method']); $this->addElement('extendedImage', 'image', array('label' => 'Image', 'resize' => $resize)); $this->addElement('textarea', 'description', array('label' => 'Description', 'hasMsWordNote' => true)); $this->addElement('checkbox', 'enabled', array('label' => 'Show on user end', 'decoration' => 'simple')); return $this; } protected function _initButtons() { if (!$this->_hasButtons) { return $this; } $buttons = array('btnSubmit'); $this->addElement( 'submit', 'btnSubmit', array( 'label' => 'Save', 'attribs' => array('class' => 'btn btn-primary'), ) ); if ($this->_submitAndManageButtonTitle) { $buttons[] = 'btnSubmitManage'; $this->addElement( 'submit', 'btnSubmitManage', array( 'label' => $this->_submitAndManageButtonTitle, 'attribs' => array('class' => 'btn btn-primary'), 'onclick' => '$("#submitAndManage").val("1");' ) ); } $buttons[] = 'btnCancel'; $this->addElement( 'submit', 'btnCancel', array( 'label' => 'Cancel', 'attribs' => array( 'class' => 'btn', 'onclick' => "window.location.href = '" . htmlspecialchars($this->getCancelUrl()) . "';", 'helper' => 'formInputButton', ), ) ); $this->addDisplayGroup($buttons, 'submitGroup'); return $this; } }