Example #1
0
// display form
$form = new FormValidator('course_description', 'POST', 'index.php?action=edit&id=' . $original_id . '&description_type=' . $description_type . '&' . api_get_cidreq());
$form->addElement('header', '', $header);
$form->addElement('hidden', 'id', $original_id);
$form->addElement('hidden', 'description_type', $description_type);
$form->addElement('hidden', 'sec_token', $token);
$form->add_textfield('title', get_lang('Title'), true, array('size' => '50'));
$form->applyFilter('title', 'html_filter');
if (api_get_setting('wcag_anysurfer_public_pages') == 'true') {
    WCAG_rendering::prepare_admin_form($description_content, $form);
} else {
    $form->add_html_editor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));
}
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
// Set some default values
$default['title'] = Security::remove_XSS($description_title);
$default['contentDescription'] = Security::remove_XSS($description_content, COURSEMANAGERLOWSECURITY);
$default['description_type'] = $description_type;
$form->setDefaults($default);
if (isset($question[$description_type])) {
    $message = '<strong>' . get_lang('QuestionPlan') . '</strong><br />';
    $message .= $question[$description_type];
    Display::display_normal_message($message, false);
}
if (api_get_setting('wcag_anysurfer_public_pages') == 'true') {
    echo WCAG_Rendering::editor_header();
}
$form->display();
if (api_get_setting('wcag_anysurfer_public_pages') == 'true') {
    echo WCAG_Rendering::editor_footer();
}
 function &create_xhtml($xhtml)
 {
     $values = WCAG_Rendering::extract_data($xhtml);
     $xhtml = WCAG_Rendering::editor_header();
     $xhtml .= get_lang('WCAGContent') . '<br />';
     $xhtml .= '<textarea name="text">' . $values['text'] . '</textarea>';
     $xhtml .= get_lang('WCAGImage') . '<br />';
     $xhtml .= '<input type="text" name="imagefile" value="' . $values['imagefile'] . '"/>';
     $xhtml .= '<br />';
     $xhtml .= '<a href="#" onclick="OpenFileBrowser (\'' . api_get_path(WEB_PATH) . 'main/inc/lib/fckeditor/' . 'editor/plugins/ImageManagerStandalone/genericManager.php?uploadPath=/\');">' . get_lang('SelectPicture') . '</a>';
     $xhtml .= '<br />';
     $xhtml .= get_lang('WCAGLabel') . '<br />';
     $xhtml .= '<input type="text" name="imageLabel" value="' . $values['imageLabel'] . '"/>';
     $xhtml .= get_lang('WCAGLink') . '<br />';
     $xhtml .= '<input type="text" name="link" value="' . $values['link'] . '"/>';
     $xhtml .= get_lang('WCAGLinkLabel') . '<br />';
     $xhtml .= '<input type="text" name="linkLabel" value="' . $values['linkLabel'] . '"/>';
     $xhtml .= WCAG_Rendering::editor_footer();
     return $xhtml;
 }