Removing input_files CSS class and cleaning the document creation see #3781

skala
Julio Montoya 13 years ago
parent 3f7c75f67a
commit c7d58f57a5
  1. 15
      main/css/base_chamilo.css
  2. 8
      main/css/blue_lagoon/default.css
  3. 8
      main/css/cool_blue/default.css
  4. 8
      main/css/delicious_bordeaux/default.css
  5. 8
      main/css/dokeos_blue/default.css
  6. 8
      main/css/dokeos_classic/default.css
  7. 8
      main/css/dokeos_classic_2D/default.css
  8. 8
      main/css/empire_green/default.css
  9. 8
      main/css/fruity_orange/default.css
  10. 8
      main/css/medical/default.css
  11. 8
      main/css/public_admin/default.css
  12. 8
      main/css/royal_purple/default.css
  13. 8
      main/css/sober_brown/default.css
  14. 8
      main/css/steel_grey/default.css
  15. 14
      main/css/tasty_olive/default.css
  16. 96
      main/document/create_document.php

@ -1100,20 +1100,7 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0p
.skip {
display: none;
}
/*
Document title
*/
.input_titles {
width: 400px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
border:1px solid #E1E1E0;
}
/*
Survey
*/
/* Survey */
#survey_title {
background-color:#dcdcdc;
color:#000;

@ -1802,14 +1802,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1750,14 +1750,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1764,14 +1764,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1772,14 +1772,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1663,14 +1663,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1782,14 +1782,6 @@ input.forms {
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1760,14 +1760,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1768,14 +1768,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1749,14 +1749,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1518,14 +1518,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1721,14 +1721,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1407,14 +1407,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1752,14 +1752,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1696,19 +1696,7 @@ div.comments {
width: 100%;
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
*/
/* Survey */
#survey_title {
background-color:#264269;
color:#FFF;

@ -61,12 +61,6 @@ function InnerDialogLoaded() {
var temp2=false;
var load_default_template = '. ((isset($_POST['submit']) || empty($_SERVER['QUERY_STRING'])) ? 'false' : 'true' ) .';
function launch_templates() {
//document.getElementById(\'frmModel\').style.display="block";
//document.getElementById(\'content___Frame\').width=\'70%\';
//window.frames[0].FCKToolbarItems.GetItem("Template").Click;
}
function FCKeditor_OnComplete( editorInstance ) {
editorInstance.Events.AttachEvent( \'OnSelectionChange\', check_for_title ) ;
document.getElementById(\'frmModel\').innerHTML = "<iframe style=\'height: 525px; width: 180px;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
@ -120,13 +114,6 @@ function InnerDialogLoaded() {
bestandsnaamNieuw += contentTextArray[x];
}
}
// comment see FS#3335
// if(document.getElementById(\'title_edited\').value == "false")
// {
// document.getElementById(\'filename\').value = bestandsnaamNieuw;
// }
}
temp=true;
}
@ -140,13 +127,6 @@ function InnerDialogLoaded() {
}
return s;
}
function check_if_still_empty() {
if(trim(document.getElementById(\'filename\').value) != "") {
document.getElementById(\'title_edited\').value = "true";
}
}
function setFocus() {
$("#document_title").focus();
}
@ -161,7 +141,6 @@ 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;
@ -326,7 +305,8 @@ $renderer = & $form->defaultRenderer();
// Hidden element with current directory
$form->addElement('hidden', 'id');
$default['id'] = $folder_id;
$defaults = array();
$defaults['id'] = $folder_id;
// Filename
$form->addElement('hidden', 'title_edited', 'false', 'id="title_edited"');
@ -343,51 +323,21 @@ function document_exists($filename) {
return !file_exists($filepath.$filename.'.html');
}
$filename_template = str_replace('{element}', '{element}', $renderer->_elementTemplate); // TODO: What is the point of this statement?
$renderer->setElementTemplate($filename_template, 'filename');
// Initialize group array
$group = array();
$group[] = $form->createElement('text','title',get_lang('Title'),'class="input_titles" id="document_title"');
// Added by Ivan Tcholakov, 10-OCT-2009.
$form->addElement('hidden', 'filename', '', array('id' => 'filename'));
/*
// If allowed, add element for document title
if (api_get_setting('use_document_title') == 'true') {
$group[]=$form->createElement('text','title',get_lang('Title'),'class="input_titles" id="document_title"');
// Added by Ivan Tcholakov, 10-OCT-2009.
$form->addElement('hidden', 'filename', '', array('id' => 'filename'));
//
// Add group to the form
if ($is_certificate_mode) {
$form->addElement('text', 'title', get_lang('CertificateName'), 'class="span4" id="document_title"');
} else {
// replace the add_textfield with this
$group[]=$form->createElement('text', 'filename', get_lang('FileName'), 'class="input_titles" id="document_title" onblur="javascript: check_if_still_empty();"');
// Added by Ivan Tcholakov, 10-OCT-2009.
$form->addElement('hidden', 'title', '', array('id' => 'title'));
$form->addElement('text', 'title', get_lang('Title'), 'class="span4" id="document_title"');
}
*/
// Show read-only box only in groups
if (!empty($_SESSION['_gid'])) {
$group[]= $form->createElement('checkbox', 'readonly', '', get_lang('ReadOnly'));
}
// Add group to the form
if ($is_certificate_mode)
$form->addGroup($group, 'filename_group', get_lang('CertificateName') ,'&nbsp;&nbsp;&nbsp;', false);
else
$form->addGroup($group, 'filename_group', get_lang('Title'), false);
$form->addRule('filename_group', get_lang('ThisFieldIsRequired'), 'required');
$form->addGroupRule('filename_group', array(
'title' => array(
array(get_lang('ThisFieldIsRequired'), 'required'),
array(get_lang('FileExists'),'callback', 'document_exists')
)
));
$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('title', get_lang('FileExists'), 'callback', 'document_exists');
$current_session_id = api_get_session_id();
@ -410,7 +360,7 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $dir, $curr
// Following two conditions copied from document.inc.php::build_directory_selector()
$folder_titles = array();
if (is_array($folders)) {
if (is_array($folders)) {
$escaped_folders = array();
foreach ($folders as $key => & $val) {
//Hide some folders
@ -440,8 +390,7 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $dir, $curr
while ($obj = Database::fetch_object($res)) {
$folder_titles[$obj->path] = $obj->title;
}
}
}
if (empty($group_dir)) {
$parent_select -> addOption(get_lang('HomeDirectory'), '/');
@ -492,19 +441,17 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $dir, $curr
}
}
}
//$form->addElement('textarea', 'comment', get_lang('Comment'), array ('rows' => 5, 'cols' => 50));
if ($is_certificate_mode)
$form->addElement('style_submit_button', 'submit', get_lang('CreateCertificate'), 'class="save"');
else
$form->addElement('style_submit_button', 'submit', get_lang('langCreateDoc'), 'class="save"');
$form->setDefaults($default);
$form->setDefaults($defaults);
// If form validates -> save the new document
if ($form->validate()) {
$values = $form->exportValues();
$values = $form->exportValues();
$readonly = isset($values['readonly']) ? 1 : 0;
$values['title'] = trim($values['title']);
@ -512,17 +459,22 @@ if ($form->validate()) {
if (!empty($values['curdirpath'])) {
$dir = $values['curdirpath'];
}
if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/';
}
$values['title'] = $values['filename'];
$values['filename'] = addslashes(trim($values['filename']));
$values['filename'] = Security::remove_XSS($values['filename']);
$values['filename'] = replace_dangerous_char($values['filename']);
$values['filename'] = disable_dangerous_file($values['filename']);
$filename = $values['filename'];
//Setting the filename
$filename = $values['title'];
$filename = addslashes(trim($filename));
$filename = Security::remove_XSS($filename);
$filename = replace_dangerous_char($filename);
$filename = disable_dangerous_file($filename);
//Setting the title
$title = $values['title'];
//Setting the extension
$extension = 'html';
$content = Security::remove_XSS($values['content'], COURSEMANAGERLOWSECURITY);

Loading…
Cancel
Save