From 0ac2cdf59f5c7ef79226effe1828c2d049e64bfc Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 6 Mar 2014 11:15:49 +0100 Subject: [PATCH] Minor - format code. --- main/document/edit_document.php | 8 ++------ main/inc/lib/formvalidator/FormValidator.class.php | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/main/document/edit_document.php b/main/document/edit_document.php index bfcd8cb737..beec3806ac 100644 --- a/main/document/edit_document.php +++ b/main/document/edit_document.php @@ -243,13 +243,13 @@ if ($is_allowed_to_edit) { $filename = stripslashes($_POST['filename']); $extension = $_POST['extension']; - $content = trim(str_replace(array("\r", "\n"), '', stripslashes($_POST['content']))); $content = Security::remove_XSS($content, COURSEMANAGERLOWSECURITY); if (!strstr($content, '/css/frames.css')) { $content = str_replace('', '', $content); } + if ($dir == '/') { $dir = ''; } @@ -339,9 +339,6 @@ if (file_exists($document_data['absolute_path'])) { if (in_array($extension, array('html', 'htm'))) { $content = file($document_data['absolute_path']); $content = implode('', $content); - //$path_to_append = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir; - // $content = str_replace('="./', '="'.$path_to_append, $content); - //$content = str_replace('mp3player.swf?son=.%2F', 'mp3player.swf?son='.urlencode($path_to_append), $content); } } @@ -381,7 +378,6 @@ if ($owner_id == api_get_user_id() || api_is_platform_admin() || $is_allowed_to_ $form->addElement('hidden', 'showedit'); $form->addElement('hidden', 'origin'); $form->addElement('hidden', 'origin_opt'); - $form->add_textfield('title', get_lang('Title')); $defaults['title'] = $document_data['title']; @@ -406,7 +402,7 @@ if ($owner_id == api_get_user_id() || api_is_platform_admin() || $is_allowed_to_ if (($extension == 'htm' || $extension == 'html') && $condition) { if (empty($readonly) && $readonly == 0) { $_SESSION['showedit'] = 1; - $form->add_html_editor('content','', false, false, $html_editor_config); + $form->add_html_editor('content', '', false, false, $html_editor_config); } } diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php index 4981962e02..a85525a549 100644 --- a/main/inc/lib/formvalidator/FormValidator.class.php +++ b/main/inc/lib/formvalidator/FormValidator.class.php @@ -1,5 +1,4 @@ registerElementType('receivers', $dir . 'Element/receivers.php', 'HTML_QuickForm_receivers'); $this->registerElementType('select_language', $dir . 'Element/select_language.php', 'HTML_QuickForm_Select_Language'); $this->registerElementType('select_ajax', $dir . 'Element/select_ajax.php', 'HTML_QuickForm_Select_Ajax'); - $this->registerElementType('select_theme', $dir . 'Element/select_theme.php', 'HTML_QuickForm_Select_Theme'); $this->registerElementType('style_submit_button', $dir . 'Element/style_submit_button.php', 'HTML_QuickForm_stylesubmitbutton'); $this->registerElementType('style_reset_button', $dir . 'Element/style_reset_button.php', 'HTML_QuickForm_styleresetbutton'); $this->registerElementType('button', $dir . 'Element/style_submit_button.php', 'HTML_QuickForm_stylesubmitbutton'); - $this->registerElementType('captcha', 'HTML/QuickForm/CAPTCHA.php', 'HTML_QuickForm_CAPTCHA'); $this->registerElementType('CAPTCHA_Image', 'HTML/QuickForm/CAPTCHA/Image.php', 'HTML_QuickForm_CAPTCHA_Image'); @@ -320,7 +317,6 @@ EOT; */ function add_html_editor($name, $label, $required = true, $full_page = false, $config = null) { - $this->addElement('html_editor', $name, $label, 'rows="15" cols="80"', $config); $this->applyFilter($name, 'trim'); $html_type = STUDENT_HTML;