Fix fullpage when creating/editing a document.

1.10.x
Julio Montoya 10 years ago
parent 5ad8a41541
commit e1845c7d3b
  1. 4
      main/inc/lib/formvalidator/FormValidator.class.php
  2. 2
      main/template/default/javascript/editor/ckeditor/config_js.tpl
  3. 60
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  4. 43
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php
  5. 69
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/DocumentsStudent.php
  6. 6
      src/Chamilo/CoreBundle/Component/Editor/Editor.php

@ -676,7 +676,7 @@ EOT;
/**
* Adds a HTML-editor to the form
* @param string $name
* @param string $label The label for the form-element
* @param string $label The label for the form-element
* @param bool $required (optional) Is the form-element required (default=true)
* @param bool $fullPage (optional) When it is true, the editor loads completed html code for a full page.
* @param array $config (optional) Configuration settings for the online editor.
@ -695,7 +695,7 @@ EOT;
$element = $this->getElement($name);
if ($fullPage) {
$config['FullPage'] = true;
$config['fullPage'] = true;
}
if ($element->editor) {

@ -1,6 +1,6 @@
/* Ckeditor global configuration file */
CKEDITOR.editorConfig = function( config ) {
CKEDITOR.editorConfig = function (config) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config

@ -17,7 +17,7 @@ class Basic extends Toolbar
* @var array
*/
public $defaultPlugins = array(
'adobeair',
'adobeair',
'ajax',
'audio',
'bidi',
@ -26,7 +26,8 @@ class Basic extends Toolbar
'dialogui',
'dialogadvtab',
'div',
'divarea',
//if you activate this plugin the html, head tags will not be saved
//'divarea',
'docprops',
'find',
'flash',
@ -34,30 +35,30 @@ class Basic extends Toolbar
'iframe',
'iframedialog',
'indentblock',
'justify',
'language',
'lineutils',
'liststyle',
'newpage',
'oembed',
'pagebreak',
'preview',
'print',
'save',
'selectall',
'sharedspace',
'showblocks',
'smiley',
'sourcedialog',
'stylesheetparser',
'tableresize',
'templates',
'uicolor',
'video',
'widget',
'wikilink',
'wordcount',
'xml'
'justify',
'language',
'lineutils',
'liststyle',
'newpage',
'oembed',
'pagebreak',
'preview',
'print',
'save',
'selectall',
'sharedspace',
'showblocks',
'smiley',
'sourcedialog',
'stylesheetparser',
'tableresize',
'templates',
'uicolor',
'video',
'widget',
'wikilink',
'wordcount',
'xml'
);
/**
@ -114,9 +115,9 @@ class Basic extends Toolbar
$plugins[] = 'mapping';
}
if (api_get_setting('block_copy_paste_for_students') == 'true') {
/*if (api_get_setting('block_copy_paste_for_students') == 'true') {
// Missing
}
}*/
if (api_get_setting('more_buttons_maximized_mode') == 'true') {
$plugins[] = 'toolbarswitch';
@ -136,6 +137,7 @@ class Basic extends Toolbar
*/
public function getConfig()
{
$config = array();
if (api_get_setting('more_buttons_maximized_mode') == 'true') {
$config['toolbar_minToolbar'] = $this->getMinimizedToolbar();
@ -156,8 +158,6 @@ class Basic extends Toolbar
//$config['oembed_maxWidth'] = '560';
//$config['oembed_maxHeight'] = '315';
//$config['allowedContent'] = true;
/*$config['wordcount'] = array(
// Whether or not you want to show the Word Count
'showWordCount' => true,

@ -6,7 +6,7 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
/**
* Documents toolbar configuration
*
* @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar *
* @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar
*/
class Documents extends Basic
{
@ -18,6 +18,7 @@ class Documents extends Basic
*/
public function getConfig()
{
$config = array();
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
$config['toolbar'] = $this->getNormalToolbar();
} else {
@ -25,8 +26,6 @@ class Documents extends Basic
}
$config['extraPlugins'] = $this->getPluginsToString();
//$config['mathJaxLib'] = $this->urlGenerator->generate('javascript').'/math_jax/MathJax.js?config=default';
//$config['mathJaxLib'] = api_get_path(WEB_LIBRARY_JS_PATH).'/math_jax/MathJax.js?config=default';
$config['fullPage'] = true;
return $config;
@ -53,9 +52,18 @@ class Documents extends Basic
protected function getNormalToolbar()
{
return [
['Save', 'Maximize', 'PasteFromWord', '-', 'Undo', 'Redo'],
['Maximize', 'PasteFromWord', '-', 'Undo', 'Redo'],
['Link', 'Unlink', 'Anchor', 'Glossary'],
['Image', 'Video', 'Flash', 'Oembed', 'Youtube', 'Audio', 'Asciimath', 'Asciisvg'],
[
'Image',
'Video',
'Flash',
'Oembed',
'Youtube',
'Audio',
'Asciimath',
'Asciisvg',
],
['Table', 'SpecialChar'],
[
'Outdent',
@ -86,12 +94,31 @@ class Documents extends Basic
return [
['Save', 'NewPage', 'Templates', '-', 'PasteFromWord'],
['Undo', 'Redo'],
['Link', 'Image', 'Video', 'Flash', 'Youtube', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
[
'Link',
'Image',
'Video',
'Flash',
'Youtube',
'Audio',
'Table',
'Asciimath',
'Asciisvg',
],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
[
'Format',
'Font',
'FontSize',
'Bold',
'Italic',
'Underline',
'TextColor',
'BGColor',
'Source',
],
['Toolbarswitch', 'ShowBlocks']
];
}
}

@ -24,6 +24,7 @@ class DocumentsStudent extends Basic
$config['toolbar_maxToolbar'] = $this->getMaximizedToolbar();
}
$config['extraPlugins'] = $this->getPluginsToString();
$config['fullPage'] = true;
return $config;
@ -36,7 +37,7 @@ class DocumentsStudent extends Basic
protected function getMaximizedToolbar()
{
return [
['Save', 'NewPage', 'Templates', '-', 'Preview', 'Print'],
['NewPage', 'Templates', '-', 'Preview', 'Print'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
['Undo', 'Redo', '-', 'SelectAll', 'Find', '-', 'RemoveFormat'],
['Link', 'Unlink', 'Anchor', 'Glossary'],
@ -56,9 +57,28 @@ class DocumentsStudent extends Basic
],
'/',
['Table', '-', 'CreateDiv'],
['BulletedList', 'NumberedList', 'HorizontalRule', '-', 'Outdent', 'Indent', 'Blockquote'],
[
'BulletedList',
'NumberedList',
'HorizontalRule',
'-',
'Outdent',
'Indent',
'Blockquote',
],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'TextColor', 'BGColor'],
[
'Bold',
'Italic',
'Underline',
'Strike',
'-',
'Subscript',
'Superscript',
'-',
'TextColor',
'BGColor',
],
[api_get_setting('allow_spellcheck') == 'true' ? 'Scayt' : ''],
['Styles', 'Format', 'Font', 'FontSize'],
['PageBreak', 'ShowBlocks'],
@ -75,9 +95,26 @@ class DocumentsStudent extends Basic
return [
['Save', 'Maximize', 'PasteFromWord', '-', 'Undo', 'Redo'],
['Link', 'Unlink', 'Anchor'],
['Image', 'Video', 'Flash', 'Oembed', 'Youtube', 'Audio', 'Asciimath'],
[
'Image',
'Video',
'Flash',
'Oembed',
'Youtube',
'Audio',
'Asciimath',
],
['Table', 'SpecialChar'],
['Outdent', 'Indent', '-', 'TextColor', 'BGColor', '-', 'OrderedList', 'UnorderedList'],
[
'Outdent',
'Indent',
'-',
'TextColor',
'BGColor',
'-',
'OrderedList',
'UnorderedList',
],
'/',
['Styles', 'Format', 'Font', 'FontSize'],
['Bold', 'Italic', 'Underline'],
@ -95,10 +132,28 @@ class DocumentsStudent extends Basic
return [
['Save', 'NewPage', 'Templates', '-', 'PasteFromWord'],
['Undo', 'Redo'],
['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
[
'Link',
'Image',
'Video',
'Flash',
'Audio',
'Table',
'Asciimath',
'Asciisvg',
],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor'],
[
'Format',
'Font',
'FontSize',
'Bold',
'Italic',
'Underline',
'TextColor',
'BGColor',
],
['Toolbarswitch']
];
}

@ -3,10 +3,9 @@
namespace Chamilo\CoreBundle\Component\Editor;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Routing\RouterInterface;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Framework\Template;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Translation\Translator;
/**
* Class Editor
@ -202,6 +201,7 @@ class Editor
$this->setConfigAttribute('height', $value);
break;
case 'FullPage':
case 'fullPage':
$this->setConfigAttribute('fullPage', $value);
break;
default:

Loading…
Cancel
Save