Access Denied
You do not have access to this resource.'); print_simple_footer(); exit; } $action =safe_GET('action', array('compose', 'save', 'delete'), 'compose'); $news_id =safe_GET('news_id'); $username=safe_REQUEST($_REQUEST, 'username'); $date =safe_POST('date', WT_REGEX_UNSAFE); $title =safe_POST('title', WT_REGEX_UNSAFE); $text =safe_POST('text', WT_REGEX_UNSAFE); if (empty($username)) $username=$GEDCOM; if ($action=="compose") { echo ''.i18n::translate('Add/edit journal/news entry').''; ?>
"; if ($news_id) { $news = getNewsItem($news_id); } else { $news = array(); $news["username"] = $username; $news["date"] = client_time(); $news["title"] = ""; $news["text"] = ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".i18n::translate('Title:')."
".i18n::translate('Entry Text:')."
"; if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { require_once WT_ROOT.'modules/ckeditor/ckeditor.php'; $oCKeditor = new CKEditor(); $oCKeditor->basePath = './modules/ckeditor/'; $oCKeditor->config['width'] = 700; $oCKeditor->config['height'] = 250; $oCKeditor->config['AutoDetectLanguage'] = false ; $oCKeditor->config['DefaultLanguage'] = 'en'; $oCKeditor->editor('text', $news["text"]); } else { //use standard textarea echo ""; } echo "
"; echo "
"; } else if ($action=="save") { $date=time()-$_SESSION["timediff"]; if (empty($title)) $title="No Title"; if (empty($text)) $text="No Text"; $message = array(); if ($news_id) { $message["id"]=$news_id; } $message["username"] = $username; $message["date"]=$date; $message["title"] = $title; $message["text"] = $text; if (addNews($message)) { echo i18n::translate('News/Journal entry successfully saved.'); } } else if ($action=="delete") { if (deleteNews($news_id)) echo i18n::translate('The news/journal entry has been deleted.'); } echo "


".i18n::translate('Close Window')."
"; print_simple_footer();