Format code

ofaj
jmontoyaa 9 years ago
parent 8bbc048933
commit 1278002b91
  1. 12
      main/course_description/edit.php
  2. 5
      main/inc/lib/formvalidator/FormValidator.class.php
  3. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php
  4. 13
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php

@ -73,12 +73,12 @@ $form = new FormValidator(
'index.php?action=edit&id='.$original_id.'&description_type='.$description_type.'&'.api_get_cidreq()
);
$form->addElement('header','',$header);
$form->addElement('header', $header);
$form->addElement('hidden', 'id', $original_id);
$form->addElement('hidden', 'description_type',$description_type);
$form->addElement('hidden', 'sec_token',$token);
$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
$form->applyFilter('title','html_filter');
$form->addElement('hidden', 'description_type', $description_type);
$form->addElement('hidden', 'sec_token', $token);
$form->addText('title', get_lang('Title'), true, array('size' => '50'));
$form->applyFilter('title', 'html_filter');
$form->addHtmlEditor(
'contentDescription',
get_lang('Content'),
@ -97,7 +97,7 @@ if (!empty($description_title)) {
$default['title'] = Security::remove_XSS($description_title);
}
if (!empty($description_content)) {
$default['contentDescription'] = Security::remove_XSS($description_content,COURSEMANAGERLOWSECURITY);
$default['contentDescription'] = Security::remove_XSS($description_content, COURSEMANAGERLOWSECURITY);
}
$default['description_type'] = $description_type;

@ -840,6 +840,7 @@ EOT;
/** @var HtmlEditor $element */
$element = $this->getElement($name);
if ($style) {
$config['style'] = true;
}
@ -953,8 +954,8 @@ EOT;
/**
* This function has been created for avoiding changes directly within QuickForm class.
* When we use it, the element is threated as 'required' to be dealt during validation.
* @param array $element The array of elements
* @param string $message The message displayed
* @param array $element The array of elements
* @param string $message The message displayed
*/
public function add_multiple_required_rule($elements, $message)
{

@ -64,7 +64,7 @@ class CkEditor extends Editor
}
$style = '<link href="'.$cssFile.'" rel="stylesheet" media="screen" type="text/css" />';
}
$html = '<textarea id="'.$this->getName().'" name="'.$this->getName().'" class="ckeditor">
'.$style.$this->value.'
</textarea>';

@ -10,7 +10,7 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class Documents extends Basic
{
public $plugins = array();
public $plugins = [];
/**
* Get the toolbar config
@ -19,7 +19,8 @@ class Documents extends Basic
public function getConfig()
{
$config = array();
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
if (api_get_setting('more_buttons_maximized_mode') !== 'true') {
$config['toolbar'] = $this->getNormalToolbar();
} else {
$config['toolbar_minToolbar'] = $this->getMinimizedToolbar();
@ -38,7 +39,7 @@ class Documents extends Basic
{
$plugins = array();
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
if (api_get_setting('show_glossary_in_documents') === 'ismanual') {
$plugins[] = 'glossary';
}
@ -75,14 +76,14 @@ class Documents extends Basic
'NumberedList',
'BulletedList',
'-',
api_get_setting('allow_spellcheck') == 'true' ? 'Scayt' : '',
api_get_setting('allow_spellcheck') === 'true' ? 'Scayt' : '',
'Source'
],
'/',
['Styles', 'Format', 'Font', 'FontSize'],
['Bold', 'Italic', 'Underline'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : ['']
api_get_setting('enabled_wiris') === 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : ['']
];
}
@ -119,7 +120,7 @@ class Documents extends Basic
'BGColor',
'Source',
],
api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
api_get_setting('enabled_wiris') === 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
['Toolbarswitch']
];
}

Loading…
Cancel
Save