. */ namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\SimpleController; use Fisharebest\Webtrees\Module\CkeditorModule; use PDO; /** * Defined in session.php * * @global Tree $WT_TREE */ global $WT_TREE; define('WT_SCRIPT_NAME', 'editnews.php'); require './includes/session.php'; $controller = new SimpleController; $controller ->setPageTitle(I18N::translate('Add/edit a journal/news entry')) ->restrictAccess(Auth::isMember($WT_TREE)) ->pageHeader(); $action = Filter::get('action', 'compose|save', 'compose'); $news_id = Filter::getInteger('news_id'); $user_id = Filter::get('user_id', WT_REGEX_INTEGER, Filter::post('user_id', WT_REGEX_INTEGER)); $gedcom_id = Filter::get('gedcom_id', WT_REGEX_INTEGER, Filter::post('gedcom_id', WT_REGEX_INTEGER)); $date = Filter::postInteger('date', 0, PHP_INT_MAX, WT_TIMESTAMP); $title = Filter::post('title'); $text = Filter::post('text'); switch ($action) { case 'compose': if (Module::getModuleByName('ckeditor')) { CkeditorModule::enableEditor($controller); } echo '