[svn r18253] FS#2867 - FCKEditor, Learnig paths tool: Adding a calculation mechanism for the settings of the online editor. The editor has to work properly with lp-items that are documents stored in Documents tool (on the root or in subfolders).

skala
Ivan Tcholakov 16 years ago
parent aa3b5e0666
commit 0d376876f0
  1. 33
      main/newscorm/learnpath.class.php
  2. 12
      main/newscorm/lp_controller.php

@ -6558,6 +6558,39 @@ class learnpath {
if(!$no_display_edit_textarea)
{
// We need to claculate here some specific settings for the online editor.
// The calculated settings work for documents in the Documents tool
// (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'] = '950';
$fck_attribute['ToolbarSet'] = 'Full';
$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.
$relative_path = '';
$relative_prefix = '';
}
else
{
// The document already exists. Whe have to determine its relative path towards the repository root.
$relative_path = explode('/', $relative_path);
$relative_prefix = str_repeat('../', count($relative_path) - 2);
$relative_path = array_slice($relative_path, 1, count($relative_path) - 2);
$relative_path = implode('/', $relative_path);
if (strlen($relative_path) > 0)
{
$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;
$form->addElement('style_submit_button', 'submit_button', get_lang('Ok'));
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{label}<br />{element}','content_lp');

@ -157,15 +157,11 @@ 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
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '950';
// 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
$fck_attribute['ToolbarSet'] = 'Full';
$fck_attribute['Config']['FullPage'] = true;
$fck_attribute['Config']['InDocument'] = false;
$fck_attribute['Config']['CreateDocumentDir'] = '/'; // this means that fck editor will add the mp3, video files like this audio/fil.mp3 and not the absolute path
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/';
$fck_attribute['Config']['BaseHref'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/';
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
if(isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true')
{

Loading…
Cancel
Save