From d2c5cb2d05f0aed5b865fbee6c3f56c9c4acdde6 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 21 May 2012 12:44:31 +0200 Subject: [PATCH] Adding "hide bar" when adding/editing documents see BT#4114 --- main/document/create_document.php | 73 ++++++++++--------- main/document/edit_document.php | 54 ++++++++++---- .../fckeditor/editor/dialog/fck_template.html | 6 +- main/newscorm/lp_add_item.php | 15 ++-- 4 files changed, 93 insertions(+), 55 deletions(-) diff --git a/main/document/create_document.php b/main/document/create_document.php index 0915c05022..7d94e9568d 100644 --- a/main/document/create_document.php +++ b/main/document/create_document.php @@ -19,15 +19,32 @@ $_SESSION['whereami'] = 'document/create'; $this_section = SECTION_COURSES; $htmlHeadXtra[] = ' - -'; require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php'; -require_once api_get_path(LIBRARY_PATH).'document.lib.php'; require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php'; -require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php'; //I'm in the certification module? $is_certificate_mode = false; @@ -290,7 +305,7 @@ if (isset ($group_properties)) { } // Create a new form -$form = new FormValidator('create_document','post',api_get_self().'?dir='.Security::remove_XSS(urlencode($dir)).'&selectcat='.Security::remove_XSS($_GET['selectcat'])); +$form = new FormValidator('create_document','post',api_get_self().'?dir='.Security::remove_XSS(urlencode($dir)).'&selectcat='.Security::remove_XSS($_GET['selectcat']), null, array('class' =>'form-vertical' )); // form title $form->addElement('header', '', $nameTools); @@ -301,14 +316,12 @@ if ($is_certificate_mode) {//added condition for certicate in gradebook $form->addElement('hidden','selectcat', intval($_GET['selectcat'])); } -$renderer = & $form->defaultRenderer(); - // Hidden element with current directory $form->addElement('hidden', 'id'); $defaults = array(); $defaults['id'] = $folder_id; -// Filename +// Filename $form->addElement('hidden', 'title_edited', 'false', 'id="title_edited"'); /** @@ -334,16 +347,10 @@ if ($is_certificate_mode) { if (!empty($_SESSION['_gid'])) { $group[]= $form->createElement('checkbox', 'readonly', '', get_lang('ReadOnly')); } - - $form->addRule('title', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('title', get_lang('FileExists'), 'callback', 'document_exists'); $current_session_id = api_get_session_id(); - -// HTML-editor -$renderer->setElementTemplate('
{element}
', 'content'); - $form->add_html_editor('content','', false, false, $html_editor_config); // Comment-field @@ -554,18 +561,6 @@ if ($form->validate()) { $dir_array = explode('/', $dir); $array_len = count($dir_array); - /* - TODO:check and delete this code - if (!$is_certificate_mode) { - if ($array_len > 1) { - if (empty($_SESSION['_gid'])) { - $url_dir = 'document.php?&curdirpath=/'; - $interbreadcrumb[] = array('url' => $url_dir, 'name' => get_lang('HomeDirectory')); - } - } - } - */ - // Interbreadcrumb for the current directory root path if (empty($document_data['parents'])) { $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); @@ -596,8 +591,16 @@ if ($form->validate()) { } $create_certificate = get_lang('CreateCertificateWithTags'); Display::display_normal_message($create_certificate.':

'.$str_info,false); - } - - $form->display(); + } + // HTML-editor + echo '
+
+
+
+
+
+ '.$form->return_form().' +
+
'; Display :: display_footer(); } diff --git a/main/document/edit_document.php b/main/document/edit_document.php index dfe1b8d787..90d8e4024e 100644 --- a/main/document/edit_document.php +++ b/main/document/edit_document.php @@ -37,7 +37,30 @@ require_once '../inc/global.inc.php'; // Template's javascript $htmlHeadXtra[] = ' -