Example #1
0
 protected function __construct($controller)
 {
     parent::__construct($controller);
     if (Router::getDefaultModule() == 'Page') {
         if (Page_Handler::getPageID()) {
             $this->show->merge(Page_Handler::getPage(), true);
             $this->show->breadcrumbs = Page_Handler::getPage()->getParents();
         }
         $oPage = new Page();
         list($full, $current) = $oPage->getMenuList();
         if (is_array($full) && count($full)) {
             foreach ($full as $menu) {
                 if (isset($menu["Children0"])) {
                     $this->show->{'MENU_' . $menu["StaticPath"]} = $menu["Children0"];
                 }
             }
         }
     }
     // i.kiz   для интернет магазина
     //     $trash                  = NULL;
     //    $this->show->basketList = NULL;
     if ($this->show->itemID) {
         $this->show->staticPath = $this->show->itemID;
     } else {
         if (!empty($this->data[0])) {
             $this->show->staticPath = $this->data[0];
         } else {
             $this->show->staticPath = 0;
         }
     }
     $this->oCatalogCategory = new Catalog_Category();
     $this->oCatalogBrand = new Catalog_Brand();
     $this->show->catalogBrand = $this->oCatalogBrand->getList();
     // menu
     $i = 0;
     $this->show->catalogMenu = array();
     foreach ($this->show->catalogBrand as $br) {
         $this->show->catalogMenu['Brand'][$i] = $br['Title'];
         $cats = $this->oCatalogCategory->getList($br['BrandID']);
         $j = 0;
         foreach ($cats as $cat) {
             $this->show->catalogMenu['Category'][$i][$j] = $cat['Title'];
             $this->show->catalogMenu['CategoryID'][$i][$j] = $cat['CategoryID'];
             $j++;
         }
         $i++;
     }
     //        корзина
     $this->session = MySession::getInstance();
     $trash = $this->session->get('trash');
     if (isset($trash)) {
         $this->show->trash = $trash;
     } else {
         $this->show->trash = array();
     }
 }