function check_step() { global $lang; $validate = validate(); if ($validate) { $vl =& $lang['samplecontent']; entry_save(array('subject' => $vl['entry']['subject'], 'content' => $vl['entry']['content'])); if (!static_exists('menu')) { static_save(array('subject' => $vl['menu']['subject'], 'content' => $vl['menu']['content']), 'menu'); } if (!static_exists('about')) { static_save(array('subject' => $vl['about']['subject'], 'content' => $vl['about']['content']), 'about'); } } return $validate; }
function onsave($do_preview = false) { $id = $this->id; $data = $this->_getposteddata(); if ($this->draft) { $success = draft_save($data, $id, true); $this->smarty->assign('success', $success ? 1 : -1); } else { $success = entry_save($data, $id); $this->smarty->assign('success', is_numeric($success) ? $success : 1); } // if ($success) sess_remove('entry'); if ($do_preview) { $this->_makePreview($data); } if ($success < 0) { $this->main(); return PANEL_NOREDIRECT; } return 1; }