addElement('hidden', 'submitAndManage', ['value' => '0']); $this->addElement('text', 'title', ['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', ['label' => 'Image', 'resize' => $resize]); $this->addElement('textarea', 'description', ['label' => 'Description', 'hasMsWordNote' => true]); $this->addElement('checkbox', 'enabled', ['label' => 'Show on user end', 'decoration' => 'simple']); return $this; } protected function _initButtons() { if (!$this->_hasButtons) { return $this; } $buttons = ['btnSubmit']; $this->addElement( 'submit', 'btnSubmit', [ 'label' => 'Save', 'attribs' => ['class' => 'btn btn-primary'], ] ); if ($this->_submitAndManageButtonTitle) { $buttons[] = 'btnSubmitManage'; $this->addElement( 'submit', 'btnSubmitManage', [ 'label' => $this->_submitAndManageButtonTitle, 'attribs' => ['class' => 'btn btn-primary'], 'onclick' => '$("#submitAndManage").val("1");', ] ); } $buttons[] = 'btnCancel'; $this->addElement( 'submit', 'btnCancel', [ 'label' => 'Cancel', 'attribs' => [ 'class' => 'btn', 'onclick' => "window.location.href = '" . htmlspecialchars($this->getCancelUrl()) . "';", 'helper' => 'formInputButton', ], ] ); $this->addDisplayGroup($buttons, 'submitGroup'); return $this; } }