Example #1
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('editCategory');
     $this->frm->addImage('image');
     $this->frm->addCheckbox('delete_image');
     $this->frm->addDropdown('ballcolor', BackendCatalogModel::$ballColorArray, $this->record['ballcolor']);
     //hidden values
     $categories = BackendCatalogModel::getCategories(true);
     $this->frm->addDropdown('parent_id', $categories, $this->record['parent_id']);
     foreach ((array) BackendModel::get('fork.settings')->get('Core', 'languages') as $key => $language) {
         $catalogLanguage = BackendCatalogModel::getCategoryLanguage($this->id, $language);
         $fieldTitle = $this->frm->addText("title_" . strtolower($language), empty($catalogLanguage) ? "" : $catalogLanguage['title']);
         $fieldDescription = $this->frm->addEditor("description_" . strtolower($language), empty($catalogLanguage) ? "" : $catalogLanguage['description']);
         $fieldSummary = $this->frm->addEditor("summary_" . strtolower($language), empty($catalogLanguage) ? "" : $catalogLanguage['summary']);
         $fieldBalltext = $this->frm->addText("balltext_" . strtolower($language), empty($catalogLanguage) ? "" : $catalogLanguage['balltext']);
         $this->fieldLanguages[$key]["key"] = $key;
         $this->fieldLanguages[$key]["language"] = $language;
         $this->fieldLanguages[$key]["title"] = $fieldTitle->parse();
         $this->fieldLanguages[$key]["description"] = $fieldDescription->parse();
         $this->fieldLanguages[$key]["summary"] = $fieldSummary->parse();
         $this->fieldLanguages[$key]["balltext"] = $fieldBalltext->parse();
     }
     $this->meta = new BackendMeta($this->frm, $this->record['meta_id'], 'title_nl', true);
     $this->meta->setUrlCallback('Backend\\Modules\\Catalog\\Engine\\Model', 'getURLForCategory', array($this->record['id']));
     //--Media
     $this->media = new BackendMediaHelper($this->frm, (string) $this->getModule(), (int) $this->id, (string) $this->getAction(), 'category');
 }