[svn r22027] FS#2867 - Course description and Documents tool: Elimination of the global variable $fck_attribute. User profile: Making the option 'ToolbarStartExpanded' configurable.

skala
Ivan Tcholakov 16 years ago
parent f2e68d1e0d
commit e25035765d
  1. 4
      main/admin/user_add.php
  2. 4
      main/admin/user_edit.php
  3. 12
      main/auth/inscription.php
  4. 10
      main/auth/profile.php
  5. 10
      main/course_description/index.php
  6. 37
      main/document/create_document.php
  7. 43
      main/document/edit_document.php
  8. 2
      main/inc/lib/fckeditor/toolbars/course_description.php
  9. 2
      main/inc/lib/fckeditor/toolbars/documents.php
  10. 2
      main/inc/lib/fckeditor/toolbars/documents_student.php
  11. 2
      main/inc/lib/fckeditor/toolbars/profil.php
  12. 5
      main/inc/lib/formvalidator/Element/html_editor.php

@ -1,4 +1,4 @@
<?php // $Id: user_add.php 22024 2009-07-13 09:21:43Z ivantcholakov $
<?php // $Id: user_add.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -209,7 +209,7 @@ foreach($extra as $id => $field_details)
$form->applyFilter('extra_'.$field_details[1], 'trim');
break;
case USER_FIELD_TYPE_TEXTAREA:
$form->add_html_editor('extra_'.$field_details[1], $field_details[3], false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('extra_'.$field_details[1], $field_details[3], false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
//$form->addElement('textarea', 'extra_'.$field_details[1], $field_details[3], array('size' => 80));
$form->applyFilter('extra_'.$field_details[1], 'stripslashes');
$form->applyFilter('extra_'.$field_details[1], 'trim');

@ -1,4 +1,4 @@
<?php // $Id: user_edit.php 22024 2009-07-13 09:21:43Z ivantcholakov $
<?php // $Id: user_edit.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -243,7 +243,7 @@ foreach($extra as $id => $field_details)
$form->applyFilter('extra_'.$field_details[1], 'trim');
break;
case USER_FIELD_TYPE_TEXTAREA:
$form->add_html_editor('extra_'.$field_details[1], $field_details[3], false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('extra_'.$field_details[1], $field_details[3], false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
//$form->addElement('textarea', 'extra_'.$field_details[1], $field_details[3], array('size' => 80));
$form->applyFilter('extra_'.$field_details[1], 'stripslashes');
$form->applyFilter('extra_'.$field_details[1], 'trim');

@ -1,5 +1,5 @@
<?php
// $Id: inscription.php 22024 2009-07-13 09:21:43Z ivantcholakov $
// $Id: inscription.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -125,19 +125,19 @@ if (get_setting('allow_registration_as_teacher') <> 'false') {
// EXTENDED FIELDS
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','mycomptetences') == 'true')
{
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','mydiplomas') == 'true')
{
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','myteach') == 'true')
{
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','mypersonalopenarea') == 'true')
{
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
}
if (api_get_setting('extended_profile') == 'true')
{
@ -173,7 +173,7 @@ foreach ($extra as $id => $field_details) {
if ($field_details[7] == 0) $form->freeze('extra_'.$field_details[1]);
break;
case USER_FIELD_TYPE_TEXTAREA:
$form->add_html_editor('extra_'.$field_details[1], $field_details[3], false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('extra_'.$field_details[1], $field_details[3], false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
//$form->addElement('textarea', 'extra_'.$field_details[1], $field_details[3], array('size' => 80));
$form->applyFilter('extra_'.$field_details[1], 'stripslashes');
$form->applyFilter('extra_'.$field_details[1], 'trim');

@ -1,4 +1,4 @@
<?php // $Id: profile.php 22024 2009-07-13 09:21:43Z ivantcholakov $
<?php // $Id: profile.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -246,11 +246,11 @@ if (api_get_setting('extended_profile') == 'true') {
//$form->addElement('html', '<a href="#" onclick="javascript:show_extend();"> show_extend_profile</a>');
$form->addElement('static', null, '<em>'.get_lang('OptionalTextFields').'</em>');
// MY COMPETENCES
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
// MY DIPLOMAS
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
// WHAT I AM ABLE TO TEACH
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
// MY PRODUCTIONS
$form->addElement('file', 'production', get_lang('MyProductions'));
@ -258,7 +258,7 @@ if (api_get_setting('extended_profile') == 'true') {
$form->addElement('static', 'productions_list', null, $production_list);
}
// MY PERSONAL OPEN AREA
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130', 'ToolbarStartExpanded' => false));
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profil', 'Width' => '100%', 'Height' => '130'));
$form->applyFilter(array('competences', 'diplomas', 'teach', 'openarea'), 'stripslashes');
$form->applyFilter(array('competences', 'diplomas', 'teach'), 'trim'); // openarea is untrimmed for maximum openness
}

@ -1,4 +1,4 @@
<?php // $Id: index.php 21933 2009-07-09 06:08:22Z ivantcholakov $
<?php // $Id: index.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -72,11 +72,6 @@ $nameTools = get_lang(TOOL_COURSE_DESCRIPTION);
Display::display_introduction_section(TOOL_COURSE_DESCRIPTION);
// These settings are for the other instances of the online editor.
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '300';
$fck_attribute['ToolbarSet'] = 'CourseDescription';
$tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
$show_description_list = true;
$show_peda_suggest = true;
@ -184,8 +179,7 @@ if (api_is_allowed_to_edit() && !is_null($description_id) || $action =='add') {
if (api_get_setting('wcag_anysurfer_public_pages')=='true') {
WCAG_rendering::prepare_admin_form($description_content, $form);
} else {
$fck_attribute['Height'] = '200';
$form->add_html_editor('contentDescription', get_lang('Content'));
$form->add_html_editor('contentDescription', get_lang('Content'), true, false, array('ToolbarSet' => 'CourseDescription', 'Width' => '100%', 'Height' => '200'));
}
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
// Set some default values

@ -1,4 +1,4 @@
<?php // $Id: create_document.php 21106 2009-05-30 16:25:16Z iflorespaz $
<?php // $Id: create_document.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/*
==============================================================================
@ -193,17 +193,6 @@ require_once api_get_path(LIBRARY_PATH).'events.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
$nameTools = get_lang('CreateDocument');
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '600';
$fck_attribute['Config']['FullPage'] = true;
if(!api_is_allowed_to_edit()) {
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Documents_Student';
} else {
$fck_attribute['ToolbarSet'] = 'Documents';
}
/*
-----------------------------------------------------------
@ -211,6 +200,7 @@ if(!api_is_allowed_to_edit()) {
-----------------------------------------------------------
*/
$dir = isset($_GET['dir']) ? Security::remove_XSS($_GET['dir']) : Security::remove_XSS($_POST['dir']); // please do not modify this dirname formatting
/*
==============================================================================
MAIN CODE
@ -261,14 +251,19 @@ for($i=0;$i<($count_dir);$i++)
if ($relative_url== '') {
$relative_url = '/';
}
$fck_attribute['Config']['InDocument'] = true;
$fck_attribute['Config']['CreateDocumentDir'] = $relative_url;
if (empty($group_properties['directory'])) {
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/';
} else {
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document'.$group_properties['directory'].'/';
}
$fck_attribute['Config']['BaseHref'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document'.$dir;
$html_editor_config = array(
'ToolbarSet' => (api_is_allowed_to_edit() ? 'Documents' :'Documents_Student'),
'Width' => '100%',
'Height' => '600',
'FullPage' => true,
'InDocument' => true,
'CreateDocumentDir' => $relative_url,
'CreateDocumentWebDir' => (empty($group_properties['directory']))
? api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/'
: api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document'.$group_properties['directory'].'/',
'BaseHref' => api_get_path('WEB_COURSE_PATH').$_course['path'].'/document'.$dir
);
$filepath = api_get_path('SYS_COURSE_PATH').$_course['path'].'/document'.$dir;
@ -398,7 +393,7 @@ if (api_get_setting('use_document_title') == 'true') {
// HTML-editor
$renderer->setElementTemplate('<div class="row"><div class="label" id="frmModel" style="overflow: visible;"></div><div class="formw">{element}</div></div>', 'content');
$form->add_html_editor('content','', false, false);
$form->add_html_editor('content','', false, false, $html_editor_config);
// Comment-field
//$form->addElement('textarea', 'comment', get_lang('Comment'), array ('rows' => 5, 'cols' => 50));

@ -1,4 +1,4 @@
<?php // $Id: edit_document.php 21106 2009-05-30 16:25:16Z iflorespaz $
<?php // $Id: edit_document.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -118,21 +118,6 @@ require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '600';
$fck_attribute['Config']['FullPage'] = true;
if(!api_is_allowed_to_edit())
{
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Documents_Student';
}
else
{
$fck_attribute['ToolbarSet'] = 'Documents';
}
/*
------------------------------------------------------------------------------
@ -172,17 +157,19 @@ for($i=0;$i<($count_dir);$i++)
{
$relative_url.='../';
}
$fck_attribute['Config']['InDocument'] = true;
$fck_attribute['Config']['CreateDocumentDir'] = $relative_url;
if (empty($group_properties['directory']))
{
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/';
}
else
{
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document'.$group_properties['directory'].'/';
}
$fck_attribute['Config']['BaseHref'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document'.$dir;
$html_editor_config = array(
'ToolbarSet' => (api_is_allowed_to_edit() ? 'Documents' :'Documents_Student'),
'Width' => '100%',
'Height' => '600',
'FullPage' => true,
'InDocument' => true,
'CreateDocumentDir' => $relative_url,
'CreateDocumentWebDir' => (empty($group_properties['directory']))
? api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/'
: api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document'.$group_properties['directory'].'/',
'BaseHref' => api_get_path('WEB_COURSE_PATH').$_course['path'].'/document'.$dir
);
$use_document_title = (get_setting('use_document_title')=='true')?true:false;
$noPHP_SELF=true;
@ -673,7 +660,7 @@ if ($owner_id == $_user['user_id'] || api_is_platform_admin() || api_is_allowed_
{
$_SESSION['showedit']=1;
$renderer->setElementTemplate('<div class="row"><div class="label" id="frmModel" style="overflow: visible;"></div><div class="formw">{element}</div></div>', 'texte');
$form->add_html_editor('texte','',false,true);
$form->add_html_editor('texte', '', false, true, $html_editor_config);
}
}

@ -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'] = '200';

@ -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'] = '600';

@ -46,4 +46,4 @@ $config['BlockCopyPaste'] = true;
// 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'] = '600';

@ -31,7 +31,7 @@ $config['ToolbarSets']['Maximized'] = array(
// Sets how the editor's toolbar should start - expanded or collapsed.
// Possible values: true , false
//$config['ToolbarStartExpanded'] = false;
$config['ToolbarStartExpanded'] = false;
//This option sets the location of the toolbar.
// Possible values: 'In' , 'None' , 'Out:[TargetId]' , 'Out:[TargetWindow]([TargetId])'

@ -1,5 +1,5 @@
<?php
// $Id: html_editor.php 21931 2009-07-09 04:38:48Z ivantcholakov $
// $Id: html_editor.php 22027 2009-07-13 11:03:41Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -72,6 +72,9 @@ class HTML_QuickForm_html_editor extends HTML_QuickForm_textarea
if (isset($config['Height'])) {
$this->fck_editor->Height = $config['Height'];
}
if (isset($config['FullPage'])) {
$this->fullPage = $config['FullPage'];
}
}
}

Loading…
Cancel
Save