Пример #1
0
 public function demoeditAction()
 {
     if ($this->tplVars['lvals']['canEdit']) {
         array_push($this->tplVars['header']['actions']['names'], array('name' => 'demoedit', 'menu_name' => 'Edit Product\'s Demolimits'));
         array_push($this->viewIncludes, 'products/demoAdd.tpl');
         array_push($this->viewIncludes, 'products/demoList.tpl');
         if ($this->_hasParam('id') && $this->_hasParam('lang')) {
             $pId = $this->_getParam('id');
             $lang = $this->_getParam('lang');
             $saved = $this->_hasParam('saved') ? $this->_getParam('saved') : '0';
             $products = new AdminProducts();
             $this->tplVars['lvals']['language'] = $lang;
             $this->tplVars['lvals']['product'] = $pId;
             $this->tplVars['lvals']['title'] = $products->getProduct($pId);
             $this->tplVars['lvals']['saved'] = $saved;
             $this->tplVars['demolimits'] = $products->getDemo($lang, $pId);
         }
     } else {
         $this->_redirect('/products/list/');
     }
 }