From 78d9d0faec7b93016712d884b46bde44afc964e3 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Tue, 14 Jul 2009 05:34:42 +0200 Subject: [PATCH] [svn r22048] FS#2867 - The exercises tool: Eliminating the global variable $fck_attribute within the file fill_blanks.class.php. --- main/exercice/fill_blanks.class.php | 11 ++--------- .../lib/fckeditor/toolbars/question_description.php | 2 +- main/inc/lib/formvalidator/Element/html_editor.php | 4 ++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/main/exercice/fill_blanks.class.php b/main/exercice/fill_blanks.class.php index 21c1b39cdc..3ef216312c 100644 --- a/main/exercice/fill_blanks.class.php +++ b/main/exercice/fill_blanks.class.php @@ -64,13 +64,6 @@ class FillBlanks extends Question function createAnswersForm ($form) { $defaults = array(); - global $fck_attribute; - $fck_attribute = array(); - //$fck_attribute['Width'] = '348px'; - $fck_attribute['Width'] = '100%'; - $fck_attribute['Height'] = '350px'; - $fck_attribute['ToolbarSet'] = 'Full'; - if(!empty($this->id)) { $objAnswer = new answer($this->id); @@ -156,8 +149,8 @@ class FillBlanks extends Question // answer $form -> addElement ('html', '

'.get_lang('TypeTextBelow').', '.get_lang('And').' '.get_lang('UseTagForBlank').'
'); - $form -> addElement ('html_editor', 'answer','','id="answer" cols="122" rows="6" onkeyup="updateBlanks(this)"'); - + $form -> addElement ('html_editor', 'answer', '','id="answer" cols="122" rows="6" onkeyup="javascript: updateBlanks(this);"', array('ToolbarSet' => 'QuestionDescription', 'Width' => '100%', 'Height' => '350')); + $form -> addRule ('answer',get_lang('GiveText'),'required'); $form -> addRule ('answer',get_lang('DefineBlanks'),'regex','/\[.*\]/'); diff --git a/main/inc/lib/fckeditor/toolbars/question_description.php b/main/inc/lib/fckeditor/toolbars/question_description.php index 7a7311eaf5..1f60ddb20f 100644 --- a/main/inc/lib/fckeditor/toolbars/question_description.php +++ b/main/inc/lib/fckeditor/toolbars/question_description.php @@ -45,4 +45,4 @@ $config['ToolbarSets']['Maximized'] = array( // Here new width and height of the editor may be set. // Possible values, examples: 300 , '250' , '100%' , ... //$config['Width'] = '100%'; -//$config['Height'] = '300'; +//$config['Height'] = '150'; diff --git a/main/inc/lib/formvalidator/Element/html_editor.php b/main/inc/lib/formvalidator/Element/html_editor.php index d5158bf693..79344b1905 100644 --- a/main/inc/lib/formvalidator/Element/html_editor.php +++ b/main/inc/lib/formvalidator/Element/html_editor.php @@ -1,5 +1,5 @@ fck_editor->Height = $config['Height']; } if (isset($config['FullPage'])) { - $this->fullPage = $config['FullPage']; + $this->fullPage = is_bool($config['FullPage']) ? $config['FullPage'] : ($config['FullPage'] === 'true'); } } }