Пример #1
0
 public function featureditAction()
 {
     if ($this->tplVars['lvals']['canEdit']) {
         array_push($this->tplVars['header']['actions']['names'], array('name' => 'featuredit', 'menu_name' => 'Edit Product\'s Features'));
         //array_push($this->tplVars['page_js'], 'features.js');
         array_push($this->viewIncludes, 'products/featuresAdd.tpl');
         array_push($this->viewIncludes, 'products/featuresList.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['features'] = $products->getFeatures($lang, $pId);
         }
     } else {
         $this->_redirect('/products/list/');
     }
 }