[svn r22051] FS#2867 - The exercises tool: Eliminating the global variable $fck_attribute within the file question.class.php.

skala
Ivan Tcholakov 16 years ago
parent bfce2b9d23
commit f404a89548
  1. 19
      main/exercice/question.class.php

@ -1,4 +1,4 @@
<?php // $Id: question.class.php 21662 2009-06-29 14:55:09Z iflorespaz $
<?php // $Id: question.class.php 22051 2009-07-14 04:50:33Z ivantcholakov $
/*
==============================================================================
@ -28,7 +28,7 @@
* File containing the Question class.
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: question.class.php 21662 2009-06-29 14:55:09Z iflorespaz $
* @version $Id: question.class.php 22051 2009-07-14 04:50:33Z ivantcholakov $
*/
@ -991,19 +991,12 @@ abstract class Question
$answerType= intval($_REQUEST['answerType']);
$form->addElement('hidden','answerType',$_REQUEST['answerType']);
// html editor
global $fck_attribute;
$fck_attribute = array();
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '150px';
$fck_attribute['ToolbarSet'] = 'QuestionDescription';
$editor_config = array('ToolbarSet' => 'QuestionDescription', 'Width' => '100%', 'Height' => '150');
if(is_array($fck_config)){
$fck_attribute = array_merge($fck_attribute,$fck_config);
$editor_config = array_merge($editor_config, $fck_config);
}
if(!api_is_allowed_to_edit()) $fck_attribute['Config']['UserStatus'] = 'student';
if(!api_is_allowed_to_edit()) $editor_config['UserStatus'] = 'student';
$form -> addElement('html','<div class="row">
<div class="label"></div>
@ -1014,7 +1007,7 @@ abstract class Question
$form -> addElement ('html','<div id="media" style="display:none;">');
$form->add_html_editor('questionDescription', get_lang('langQuestionDescription'), false);
$form->add_html_editor('questionDescription', get_lang('langQuestionDescription'), false, false, $editor_config);
$form -> addElement ('html','</div>');
$renderer->setElementTemplate('<div class="row"><div class="label">{label}</div><div class="formw">{element}</div></div>','questionDescription');

Loading…
Cancel
Save