fix document width htmleditor and templates refs - CT#7539

1.10.x
aragonc 9 years ago
parent 72804afee7
commit 0e2960de2e
  1. 4
      app/Resources/public/css/base.css
  2. 55
      main/document/create_document.php
  3. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php

@ -2794,6 +2794,10 @@ form .formw .freeze {
height:550px; height:550px;
position:relative; position:relative;
} }
.items-templates{
display:block;
height:750px;
}
.editor-lp{ .editor-lp{
margin-bottom: 20px; margin-bottom: 20px;
} }

@ -21,15 +21,30 @@ var hide_bar = function() {
$("#hide_bar_template").css({"background-image" : \'url("../img/hide2.png")\'}) $("#hide_bar_template").css({"background-image" : \'url("../img/hide2.png")\'})
} }
jQuery(document).ready(function(){
jQuery(".scrollbar-macosx").scrollbar();
});
$(document).ready(function() { $(document).ready(function() {
if ($(window).width() <= 785 ) { if ($(window).width() <= 785 ) {
hide_bar(); hide_bar();
} }
$("#doc_form").removeClass( "col-md-8" ).addClass( "col-md-7" );
$("#hide_bar_template").click(function() { $("#hide_bar_template").click(function() {
$("#template_col").toggleClass("hide"); $("#template_col").toggleClass("hide");
if ($("#doc_form").is(".col-md-8")) {
$("#doc_form").removeClass("col-md-8");
$("#doc_form").addClass("col-md-11");
} else {
$("#doc_form").removeClass("col-md-11");
$("#doc_form").addClass("col-md-8");
}
$("#hide_bar_template").toggleClass("hide_bar_template_not_hide"); $("#hide_bar_template").toggleClass("hide_bar_template_not_hide");
}); });
CKEDITOR.on("instanceReady", function (e) { CKEDITOR.on("instanceReady", function (e) {
@ -157,7 +172,8 @@ $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$editorConfig = array( $editorConfig = array(
'ToolbarSet' => ($is_allowed_to_edit ? 'Documents' : 'DocumentsStudent'), 'ToolbarSet' => ($is_allowed_to_edit ? 'Documents' : 'DocumentsStudent'),
'Width' => '100%', 'Width' => '100%',
'Height' => '500', 'Height' => '400',
'cols-size' => [2, 10, 0],
'FullPage' => true, 'FullPage' => true,
'InDocument' => true, 'InDocument' => true,
'CreateDocumentDir' => $relative_url, 'CreateDocumentDir' => $relative_url,
@ -226,8 +242,7 @@ $form = new FormValidator(
'create_document', 'create_document',
'post', 'post',
api_get_self().'?'.api_get_cidreq().'&dir='.Security::remove_XSS(urlencode($dir)).'&selectcat='.$select_cat, api_get_self().'?'.api_get_cidreq().'&dir='.Security::remove_XSS(urlencode($dir)).'&selectcat='.$select_cat,
null, null
array('class' =>'form-vertical')
); );
// form title // form title
@ -271,7 +286,7 @@ function document_exists($filename)
if ($is_certificate_mode) { if ($is_certificate_mode) {
$form->addText('title', get_lang('CertificateName'), true, array('autofocus')); $form->addText('title', get_lang('CertificateName'), true, array('autofocus'));
} else { } else {
$form->addText('title', get_lang('Title'), true, array('autofocus')); $form->addText('title', get_lang('Title'), true, array('cols-size' => [2, 10, 0], 'autofocus'));
} }
// Show read-only box only in groups // Show read-only box only in groups
@ -282,7 +297,7 @@ $form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('title', get_lang('FileExists'), 'callback', 'document_exists'); $form->addRule('title', get_lang('FileExists'), 'callback', 'document_exists');
$current_session_id = api_get_session_id(); $current_session_id = api_get_session_id();
$form->addHtmlEditor('content','', true, true, $editorConfig); $form->addHtmlEditor('content','', true, true, $editorConfig, true);
// Comment-field // Comment-field
$folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit); $folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit);
@ -295,8 +310,8 @@ if (!$is_certificate_mode &&
) { ) {
$folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit); $folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit);
$parent_select = $form->addElement('select', 'curdirpath', array(null, get_lang('DestinationDirectory'))); //$parent_select = $form->addElement('select', 'curdirpath', array(null, get_lang('DestinationDirectory')));
$parent_select = $form->addSelect('curdirpath', get_lang('DestinationDirectory'),null, array('cols-size' => [2, 10, 0]) );
// Following two conditions copied from document.inc.php::build_directory_selector() // Following two conditions copied from document.inc.php::build_directory_selector()
$folder_titles = array(); $folder_titles = array();
@ -575,16 +590,18 @@ if ($form->validate()) {
Display :: display_header($nameTools, "Doc"); Display :: display_header($nameTools, "Doc");
// actions // actions
echo '<div class="actions">';
// link back to the documents overview // link back to the documents overview
if ($is_certificate_mode) if ($is_certificate_mode) {
echo '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'. $actionsLeft = '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
else } else {
echo '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'. $actionsLeft = '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>'; }
echo $toolbar = Display::toolbarAction('actions-documents', array(0 => $actionsLeft, 1 => ''));
if ($is_certificate_mode) { if ($is_certificate_mode) {
$all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id()); $all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id());
@ -598,13 +615,17 @@ if ($form->validate()) {
} }
// HTML-editor // HTML-editor
echo '<div class="row" style="overflow:hidden"> echo '<div class="row" style="overflow:hidden">
<div id="template_col" class="col-md-2"> <div id="template_col" class="col-md-3">
<div id="frmModel" ></div> <div class="panel panel-default">
<div class="panel-body">
<div id="frmModel" class="items-templates scrollbar-macosx"></div>
</div>
</div>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<div id="hide_bar_template"></div> <div id="hide_bar_template"></div>
</div> </div>
<div id="doc_form" class="col-md-9"> <div id="doc_form" class="col-md-8">
'.$form->returnForm().' '.$form->returnForm().'
</div> </div>
</div>'; </div>';

@ -118,7 +118,7 @@ class Documents extends Basic
'BGColor', 'BGColor',
'Source', 'Source',
], ],
['Toolbarswitch', 'ShowBlocks'] ['Toolbarswitch']
]; ];
} }
} }

Loading…
Cancel
Save