Пример #1
0
 public function platformaddAction()
 {
     if ($this->tplVars['lvals']['canEdit']) {
         include_once 'platforms.php';
         if ($this->_request->getPost('ispost')) {
             $this->to_log();
             $platforms = new Platforms();
             $this->tplVars['platforms'] = $this->_request->getPost();
             if (($this->tplVars['lvals']['postRes'] = $platforms->add($this->_request->getPost())) > 0) {
                 $this->_redirect('/products/platforms/');
             }
         }
         array_push($this->tplVars['page_css'], 'product_edit.css');
         array_push($this->tplVars['page_css'], 'livevalidation.css');
         array_push($this->tplVars['page_js'], 'livevalidation.js');
         $this->tplVars['lvals']['isNewRecord'] = true;
         $this->tplVars['header']['actions']['names'][] = array('name' => 'platforms', 'menu_name' => 'Platform list');
         $this->tplVars['header']['actions']['names'][] = array('name' => 'platformadd', 'menu_name' => 'Platform add');
         $this->tplVars['header']['actions']['names'][] = array('name' => 'os', 'menu_name' => 'OS list');
         array_push($this->viewIncludes, 'products/platformEdit.tpl');
         $this->tplVars['lvals']['postRes'] = 2;
         unset($platforms);
     } else {
         $this->_redirect('/products/platforms/');
     }
 }