function ondelete() { $id = $_REQUEST['entry']; $ok = draft_delete($id) || entry_delete($id); $success = $ok ? 2 : -2; $this->smarty->assign('success', $success); return 1; }
function draft_to_entry($draftid) { $dir = draft_dir($draftid); $dir2 = entry_dir($draftid); @rename($dir, $dir2); draft_delete($draftid); }