public function platformeditAction() { if ($this->tplVars['lvals']['canEdit'] && $this->_hasParam('id')) { include_once 'platforms.php'; $id = $this->_getParam('id'); $this->tplVars['lvals']['postRes'] = 2; $platforms = new Platforms(); $this->tplVars['platforms'] = $platforms->getById($id); if ($this->_request->getPost('ispost')) { $this->to_log(); $this->tplVars['platforms'] = $this->_request->getPost(); if (($this->tplVars['lvals']['postRes'] = $platforms->update($id, $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'] = false; $this->tplVars['header']['actions']['names'][] = array('name' => 'platforms', 'menu_name' => 'Platform list'); $this->tplVars['header']['actions']['names'][] = array('name' => 'platformedit', 'menu_name' => 'Platform edit'); $this->tplVars['header']['actions']['names'][] = array('name' => 'os', 'menu_name' => 'OS list'); array_push($this->viewIncludes, 'products/platformEdit.tpl'); unset($platforms); } else { $this->_redirect('/products/platforms/'); } }