From 7d239274dc45d6d17660ccc13a8a2376dbd8a854 Mon Sep 17 00:00:00 2001 From: Patrick Vandermaesen Date: Mon, 29 Jan 2007 22:55:28 +0100 Subject: [PATCH] [svn r10976] WCAG editor --- main/admin/system_announcements.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/main/admin/system_announcements.php b/main/admin/system_announcements.php index 08464a8456..594ca035c0 100644 --- a/main/admin/system_announcements.php +++ b/main/admin/system_announcements.php @@ -1,5 +1,5 @@ addElement('select', 'lang',get_lang('Language'),$language_list_with_keys); - $form->add_html_editor('content', get_lang('Content')); + if (api_get_setting('wcag_anysurfer_public_pages')=='true') { + $form->addElement('textarea', 'content', get_lang('Content')); + } else { + $form->add_html_editor('content', get_lang('Content')); + } $form->add_timewindow('start','end',get_lang('StartTimeWindow'),get_lang('EndTimeWindow')); $form->addElement('checkbox', 'visible_teacher', get_lang('Visible'), get_lang('Teacher')); $form->addElement('checkbox', 'visible_student', null, get_lang('Student')); @@ -182,6 +187,10 @@ if ($action_todo) $form->addElement('hidden', 'action'); $form->addElement('hidden', 'id'); $form->addElement('submit', 'submit', get_lang('Ok')); + if (api_get_setting('wcag_anysurfer_public_pages')=='true') + { + $values['content'] = WCAG_Rendering::HTML_to_text($values['content']); + } $form->setDefaults($values); if($form->validate()) { @@ -202,6 +211,10 @@ if ($action_todo) { $values['lang'] = null; } + if (api_get_setting('wcag_anysurfer_public_pages')=='true') + { + $values['content'] = WCAG_Rendering::text_to_HTML($values['content']); + } switch($values['action']) { case 'add': @@ -227,7 +240,15 @@ if ($action_todo) } else { + if (api_get_setting('wcag_anysurfer_public_pages')=='true') + { + echo('
'); + } $form->display(); + if (api_get_setting('wcag_anysurfer_public_pages')=='true') + { + echo('
'); + } $show_announcement_list = false; } }