[svn r22095] FS#2867 - The learning path tool: Eliminating the global variable $fck_attribute, part 2.

skala
Ivan Tcholakov 16 years ago
parent bbc2ff3079
commit 8c97c2e803
  1. 2
      main/inc/lib/fckeditor/toolbars/learn_path.php
  2. 18
      main/newscorm/learnpath.class.php
  3. 7
      main/newscorm/lp_controller.php

@ -43,4 +43,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'] = '700';

@ -6364,8 +6364,7 @@ class learnpath {
}
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{label}<br />{element}', 'content_lp');
$form->addElement('html_editor', 'content_lp', '');
//$form->addElement('html_editor','content_lp','');
$form->addElement('html_editor', 'content_lp', '', null, array('ToolbarSet' => 'LearnPath', 'Width' => '100%', 'Height' => '400', 'FullPage' => true));
$defaults["content_lp"] = file_get_contents($item_path);
}
@ -6666,11 +6665,6 @@ class learnpath {
// (on the root or in subfolders).
// For documents in native scorm packages it is unclear whether the
// online editor should be activated or not.
global $fck_attribute;
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '700';
$fck_attribute['ToolbarSet'] = 'LearnPath';
$fck_attribute['Config']['FullPage'] = true;
$relative_path = $extra_info['dir'];
if ($relative_path == 'n/') {
// A new document, it is in the root of the repository.
@ -6690,9 +6684,11 @@ class learnpath {
$relative_path = $relative_path . '/';
}
}
$fck_attribute['Config']['CreateDocumentDir'] = $relative_prefix;
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH') . api_get_course_path() . '/document/';
$fck_attribute['Config']['BaseHref'] = api_get_path('WEB_COURSE_PATH') . api_get_course_path() . '/document/' . $relative_path;
$editor_config = array('ToolbarSet' => 'LearnPath', 'Width' => '100%', 'Height' => '700', 'FullPage' => true,
'CreateDocumentDir' => $relative_prefix,
'CreateDocumentWebDir' => api_get_path('WEB_COURSE_PATH') . api_get_course_path() . '/document/',
'BaseHref' => api_get_path('WEB_COURSE_PATH') . api_get_course_path() . '/document/' . $relative_path
);
if ($_GET['action'] == 'add_item') {
$class = 'add';
@ -6708,7 +6704,7 @@ class learnpath {
$renderer->setElementTemplate('<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{label}<br />{element}', 'content_lp');
$form->addElement('html', '<div style="margin:3px 12px">');
$form->addElement('html_editor', 'content_lp', '');
$form->addElement('html_editor', 'content_lp', '', null, $editor_config);
$form->addElement('html', '</div>');
$defaults["content_lp"] = $content;
}

@ -160,13 +160,6 @@ if($debug>0) error_log('New LP - Passed oLP creation check',0);
$_SESSION['oLP']->update_queue = array(); //reinitialises array used by javascript to update items in the TOC
$_SESSION['oLP']->message = ''; //should use ->clear_message() method but doesn't work
// Some common default settings for the online editor. Other settings are calculated in formvalidator module.
// For editing document type lp-items specific settings are set/calculated, see learnpath.class.php
//TODO: check, see if we need, it seems not working here
$fck_attribute['ToolbarSet'] = 'LearnPath';
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
if(isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true')
{
if($_REQUEST['action'] != 'list' AND $_REQUEST['action'] != 'view')

Loading…
Cancel
Save