[svn r10976] WCAG editor

skala
Patrick Vandermaesen 18 years ago
parent 0068979c58
commit 7d239274dc
  1. 25
      main/admin/system_announcements.php

@ -1,5 +1,5 @@
<?php <?php
// $Id: system_announcements.php 10667 2007-01-11 09:36:29Z bmol $ // $Id: system_announcements.php 10976 2007-01-29 21:55:28Z pvandermaesen $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -43,6 +43,7 @@ $cidReset = true;
include ('../inc/global.inc.php'); include ('../inc/global.inc.php');
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
include (api_get_path(LIBRARY_PATH).'system_announcements.lib.php'); include (api_get_path(LIBRARY_PATH).'system_announcements.lib.php');
include_once(api_get_path(LIBRARY_PATH).'WCAG/WCAG_rendering.php');
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section=SECTION_PLATFORM_ADMIN; $this_section=SECTION_PLATFORM_ADMIN;
@ -174,7 +175,11 @@ if ($action_todo)
$fck_attribute['ToolbarSet'] = 'Middle'; $fck_attribute['ToolbarSet'] = 'Middle';
$form->addElement('select', 'lang',get_lang('Language'),$language_list_with_keys); $form->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->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_teacher', get_lang('Visible'), get_lang('Teacher'));
$form->addElement('checkbox', 'visible_student', null, get_lang('Student')); $form->addElement('checkbox', 'visible_student', null, get_lang('Student'));
@ -182,6 +187,10 @@ if ($action_todo)
$form->addElement('hidden', 'action'); $form->addElement('hidden', 'action');
$form->addElement('hidden', 'id'); $form->addElement('hidden', 'id');
$form->addElement('submit', 'submit', get_lang('Ok')); $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); $form->setDefaults($values);
if($form->validate()) if($form->validate())
{ {
@ -202,6 +211,10 @@ if ($action_todo)
{ {
$values['lang'] = null; $values['lang'] = null;
} }
if (api_get_setting('wcag_anysurfer_public_pages')=='true')
{
$values['content'] = WCAG_Rendering::text_to_HTML($values['content']);
}
switch($values['action']) switch($values['action'])
{ {
case 'add': case 'add':
@ -227,7 +240,15 @@ if ($action_todo)
} }
else else
{ {
if (api_get_setting('wcag_anysurfer_public_pages')=='true')
{
echo('<div class="WCAG-form">');
}
$form->display(); $form->display();
if (api_get_setting('wcag_anysurfer_public_pages')=='true')
{
echo('</div>');
}
$show_announcement_list = false; $show_announcement_list = false;
} }
} }

Loading…
Cancel
Save