public function exportAction() { if ($this->_hasParam('id')) { $products = new AdminProducts(); $this->tplVars['header']['actions']['names'][] = array('name' => 'export', 'menu_name' => 'Export new data', 'params' => array('id' => $this->_getParam('id'))); array_push($this->viewIncludes, 'products/export.tpl'); $this->tplVars['export']['message'] = ''; if ($products->exportNewDataToOldDB($this->_getParam('id'), $this->tplVars['export']['message'])) { $this->tplVars['export']['message'] .= '<br/><strong>New data has been exported succesfully!</strong>'; } else { $this->tplVars['export']['message'] .= '<strong style="color:red;">New data has\'t exported!</strong>'; } } }