rendered paste bodyfunction aSaveNewEntry()
{
//$GLOBALS['session']->CheckPermission('Blog', 'AddEntries');
$model =& $GLOBALS['app']->LoadGadget('Blog', 'AdminModel');
$timestamp = null;
if (isset($_POST['edit_timestamp']) && $_POST['edit_timestamp'][0] == 'yes') {
$timestamp = $_POST['timestamp'];
}
$id = $model->NewEntry($GLOBALS['session']->GetAttribute(2) , $_POST['categories'],
$_POST['title'], $_POST['text'],
$_POST['fasturl'],
isset($_POST['allow_comments'][0]), $_POST['published'], $timestamp);
if (!JawsError::IsError($id)) {
if ($GLOBALS['app']->Registry->Get('/gadgets/Blog/trackback') == 'true') {
$to = explode('\n',$_POST['trackback_to']);
$link = $GLOBALS['app']->Registry->Get('/config/url');
$link .= '?/'.$id;
$title = $_POST['title'];
$text = $_POST['text'];
if (strlen($text) > 250) {
$text = substr($text, 0, 250) . '...';
}
$model->SendTrackback($title, $text, $link, $to);
}
}
//require_once JAWS_PATH . 'include/JawsTypes/JawsHeader.php';
// JawsHeader::Location('admin.php?gadget=Blog&action=ListEntries');
}