/** * Load the form * * @return void */ private function loadForm() { // create form $this->frm = new BackendForm('edit_album'); $this->frmAddImage = new BackendForm('add_image'); $this->frmDeleteImage = new BackendForm('delete_image'); // get values for the form $rbtHiddenValues[] = array('label' => BL::lbl('Hidden'), 'value' => 'Y'); $rbtHiddenValues[] = array('label' => BL::lbl('Published'), 'value' => 'N'); // set show-in-overview values $rbtShowOverviewValues[] = array('label' => BL::lbl('Yes'), 'value' => 'Y'); $rbtShowOverviewValues[] = array('label' => BL::lbl('No'), 'value' => 'N'); // create elements $this->frm->addText('title', $this->record['title']); $this->frm->getField('title')->setAttribute('class', 'title ' . $this->frm->getField('title')->getAttribute('class')); $this->frm->addEditor('description', $this->record['description']); $this->frm->addText('tags', BackendTagsModel::getTags($this->URL->getModule(), $this->id), null, 'inputText tagBox', 'inputTextError tagBox'); $this->frm->addRadiobutton('hidden', $rbtHiddenValues, $this->record['hidden']); $this->frm->addRadiobutton('show_in_overview', $rbtShowOverviewValues, $this->record['show_in_overview']); $this->frm->addDropdown('category', BackendGalleryModel::getCategoriesForDropdown(), $this->record['category_id']); $this->frm->addCheckbox('gallery', $this->record['extra_id_gallery'] != 0); $this->frm->addCheckbox('slideshow', $this->record['extra_id_slideshow'] != 0); // meta object $this->meta = new BackendMeta($this->frm, $this->record['meta_id'], 'title', true); }
/** * Get the data for an album * * @return void */ private function getData() { // check for a category's id $this->id = $this->getParameter('id', 'int'); // get categories $this->categories = BackendGalleryModel::getCategoriesForDropdown(); /*if(empty($this->categories)) { $this->redirect(BackendModel::createURLForAction('add_category')); }*/ }