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');
 }
Example #2
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     $this->frm = new BackendForm('addCategory');
     $this->frm->addImage('image');
     $this->frm->addDropdown('ballcolor', BackendCatalogModel::$ballColorArray);
     // get the categories
     $categories = BackendCatalogModel::getCategories(true);
     $this->frm->addDropdown('parent_id', $categories);
     foreach ((array) BackendModel::get('fork.settings')->get('Core', 'languages') as $key => $language) {
         $fieldTitle = $this->frm->addText("title_" . strtolower($language));
         $fieldDescription = $this->frm->addEditor("description_" . strtolower($language));
         $fieldSummary = $this->frm->addEditor("summary_" . strtolower($language));
         $fieldBalltext = $this->frm->addText("balltext_" . strtolower($language));
         $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[$language]['meta'] = new BackendMeta($this->frm, null, 'title_' . $language, true, $language);
            $this->meta[$language]['meta']->setURLCallback('Backend\Modules\Catalog\Engine\Model', 'getURLForCategory');
            $this->meta[$language]['language'] = $language;
            $this->meta[$language]['fields'] = $this->meta[$language]['meta']->returnFields();*/
     }
     $this->meta = new BackendMeta($this->frm, null, 'title_nl', true);
     $this->meta->setURLCallback('Backend\\Modules\\Catalog\\Engine\\Model', 'getURLForCategory');
 }
Example #3
0
 /**
  * Load the item data
  */
 protected function loadData()
 {
     $this->id = $this->getParameter('product_id', 'int', null);
     if ($this->id != null) {
         $this->record = BackendCatalogModel::get($this->id);
     }
     // get categories
     $this->categories = BackendCatalogModel::getCategories(true);
     // Get all products grouped by categories
     $this->allProductsGroupedByCategories = BackendCatalogModel::getAllProductsGroupedByCategories();
     // get specifications
     $this->specifications = BackendCatalogModel::getSpecifications();
     // get brands
     $this->brands = BackendCatalogModel::getBrandsForDropdown();
 }
Example #4
0
 /**
  * Load the item data
  */
 protected function loadData()
 {
     $this->id = $this->getParameter('id', 'int', null);
     if ($this->id == null || !BackendCatalogModel::exists($this->id)) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
     $this->record = BackendCatalogModel::get($this->id);
     $this->categories = (array) BackendCatalogModel::getCategories(true);
     $this->products = (array) BackendCatalogModel::getAll();
     $this->allProductsGroupedByCategories = (array) BackendCatalogModel::getAllProductsGroupedByCategories();
     $this->relatedProducts = (array) BackendCatalogModel::getRelatedProducts($this->id);
     $this->specifications = (array) BackendCatalogModel::getSpecifications();
     // get brands
     $this->brands = BackendCatalogModel::getBrandsForDropdown();
 }
Example #5
0
 private function loadFilterForm()
 {
     // get categories
     $categories = BackendCatalogModel::getCategories(true);
     // multiple categories?
     if (count($categories) > 1) {
         // create form
         $frm = new BackendForm('filter', null, 'get', false);
         // create element
         $frm->addDropdown('category', $categories, $this->categoryId);
         //			$frm->getField('category')->setDefaultElement('');
         // parse the form
         $frm->parse($this->tpl);
     }
     // parse category
     if (!empty($this->category)) {
         $this->tpl->assign('filterCategory', $this->category);
     }
 }
Example #6
0
 /**
  * Parse the page
  */
 protected function parse()
 {
     // parse the datagrid for all products
     $this->tpl->assign('dgProducts', $this->dgProducts->getNumResults() != 0 ? $this->dgProducts->getContent() : false);
     // get categories
     $categories = BackendCatalogModel::getCategories(true);
     // multiple categories?
     if (count($categories) > 1) {
         // create form
         $frm = new BackendForm('filter', null, 'get', true);
         // create element
         $frm->addDropdown('category', $categories, $this->categoryId);
         $frm->getField('category')->setDefaultElement('');
         // parse the form
         $frm->parse($this->tpl);
     }
     // parse category
     if (!empty($this->category)) {
         $this->tpl->assign('filterCategory', $this->category);
     }
 }