From c4f34cb83df1f4b376e9efe42236640e25688b23 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Tue, 14 Jul 2009 04:32:55 +0200 Subject: [PATCH] [svn r22047] FS#2867 - The exercises tool: Eliminating the global variable $fck_attribute within the file feedback.php. --- main/exercice/feedback.php | 28 +++++++++---------- .../lib/formvalidator/FormValidator.class.php | 15 ++++++++++ 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/main/exercice/feedback.php b/main/exercice/feedback.php index b4ff7efe46..7df71b21e3 100644 --- a/main/exercice/feedback.php +++ b/main/exercice/feedback.php @@ -17,6 +17,7 @@ Tel. +32 (2) 211 34 56 */ +// Note by Ivan Tcholakov, 14-JUL-2009: I can't see where this file is used. Is it obsolete? /** * Feedback @@ -73,24 +74,21 @@ Display::display_header($nameTools,"Exercise"); { echo " "; $ans = $objAnswerTmp->answer[$i]; - $fck_attribute['Width'] = '600'; - $fck_attribute['Height'] = '200'; - $fck_attribute['ToolbarSet'] = 'Small'; //TODO: check where run? for customize buttons bar $form = new FormValidator('feedbackform','post',api_get_self()."?modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion); $obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST'); -$renderer =& $obj_registration_form->defaultRenderer(); -$renderer->setElementTemplate( - ' - {label} - * - - {element} -
{error} - - ' -); - $form->add_html_editor('Feedback',$i.'.'.$ans,false); + $renderer =& $obj_registration_form->defaultRenderer(); + $renderer->setElementTemplate( +' + {label} + * + + {element} +
{error} + +'); + //TODO: Maybe another toolbar set would be better. + $form->add_html_editor('Feedback', $i.'.'.$ans, false, false, array('ToolbarSet' => 'Small', 'Width' => '600', 'Height' => '200')); $form->display(); echo ""; }?> diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php index 2f546a8aac..27a1d6c758 100644 --- a/main/inc/lib/formvalidator/FormValidator.class.php +++ b/main/inc/lib/formvalidator/FormValidator.class.php @@ -151,6 +151,21 @@ EOT; { $html_type = $_SESSION['status'] == COURSEMANAGER ? TEACHER_HTML : STUDENT_HTML; } + if (is_array($config)) + { + if (isset($config['FullPage'])) + { + $full_page = is_bool($config['FullPage']) ? $config['FullPage'] : ($config['FullPage'] === 'true'); + } + else + { + $config['FullPage'] = $full_page; + } + } + else + { + $config = array('FullPage' => (bool) $full_page); + } if($full_page) { $html_type = $_SESSION['status'] == COURSEMANAGER ? TEACHER_HTML_FULLPAGE : STUDENT_HTML_FULLPAGE;