/** * Execute the view of the template "tpl.addnode.php" * * @return bool true on success else false */ function perform() { if (isset($_POST['addnode'])) { if (!isset($_REQUEST['node'])) { $node = 0; } else { $node = (int) $_REQUEST['node']; } if (TRUE == M(MOD_NAVIGATION, 'add_node', array('title' => commonUtil::addSlashes($_POST['title']), 'body' => commonUtil::stripSlashes($_POST['body']), 'status' => (int) $_POST['status'], 'parent_id' => $node, 'error' => 'tpl_error'))) { // on success switch to the main navigation page @header('Location: ' . SF_BASE_LOCATION . '/' . SF_CONTROLLER . '?' . SF_ADMIN_CODE . '=1&m=navigation&node=' . (int) @$_REQUEST['node']); exit; } else { // if it fails reset form fields $this->_reset_old_fields_data(); return TRUE; } } return TRUE; }