public function __construct($params) { parent::__construct($params); $this->show->Title = 'Категории'; $this->show->breadcrumbs[] = array('url' => BASE_PATH . 'admin/catalog', 'title' => 'Каталог'); $this->show->breadcrumbs[] = array('url' => BASE_PATH . 'admin/catalog/category', 'title' => $this->show->Title); $oBrand = new Catalog_Brand(); $this->show->brandList = $oBrand->getList(); }
public function delete() { if ($this->show->itemID) { $Br = new Catalog_Category(); if ($Br->isEmptyBrand($this->show->itemID)) { $oBrand = new Catalog_Brand(); $oBrand->delete($this->show->itemID); } } redirect(BASE_PATH . 'admin/catalog/brand'); }
public function index() { if ($this->show->indexPage) { $oNewsPage = new Page(); $oNewsPage->loadByID($this->show->Page); $this->show->Content = $oNewsPage->Content; $brand = new Catalog_Brand(); $sub = new Catalog_Category(); $this->show->subbrand = new object(); $this->show->categorylist = $sub->getList(-1); $this->show->brand = $brand->getList(); foreach ($this->show->brand as $item) { $this->show->subbrand[$item['Title']] = $sub->getList($item['BrandID']); } $this->show->sliders = Slider::getSlides(); } }
public function edit() { $oCatalog = new Catalog(); $prop = new Catalog_Property(); if ($this->show->itemID) { $row = $oCatalog->getById($this->show->itemID); $this->show->categoryID = $row['CategoryID']; $this->show->propertyID = $row['PropertyID']; } else { $this->show->brandID = $this->post['BrandID']; $this->show->categoryID = $this->post['CategoryID']; } $this->show->propertyList = $prop->getList($this->show->categoryID); setcookie("brandID", $this->show->brandID, null, '/'); $this->show->status = $oCatalog->getStatusList(); if (!empty($this->post['Save'])) { if ($this->show->itemID) { $oCatalogID = $oCatalog->update($this->post, $this->show->itemID); } else { $oCatalogID = $oCatalog->insert($this->post); } if ($oCatalogID) { redirect(BASE_PATH . 'admin/catalog/'); } } if ($this->show->itemID) { $this->show->item = $oCatalog->getByID($this->show->itemID); $this->show->breadcrumbs[] = array('url' => BASE_PATH . 'admin/catalog/' . $this->show->itemID, 'title' => $this->show->item['Title']); } else { $this->show->item = $oCatalog->get(); $this->show->breadcrumbs[] = array('url' => BASE_PATH . 'admin/catalog/' . $this->show->itemID, 'title' => 'Создание'); $oCategory = new Catalog_Category(); $this->show->categoryList = $oCategory->getList($this->show->brandID); $oBrand = new Catalog_Brand(); $this->show->brandList = $oBrand->getList(); } if (!empty($this->post['Save'])) { $this->show->item->merge($this->post); } }