Minor - format code.

1.9.x
Julio Montoya 12 years ago
parent 868f5b8192
commit 0ac2cdf59f
  1. 8
      main/document/edit_document.php
  2. 6
      main/inc/lib/formvalidator/FormValidator.class.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('</title></head>', '</title><link rel="stylesheet" href="../css/frames.css" type="text/css" /></head>', $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);
}
}

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
require_once api_get_path(LIBRARY_PATH) . 'pear/HTML/QuickForm.php';
@ -116,7 +115,7 @@ class FormValidator extends HTML_QuickForm
*/
function __construct($form_name, $method = 'post', $action = '', $target = '', $attributes = null, $track_submit = true)
{
//Default form class
// Default form class.
if (is_array($attributes) && !isset($attributes['class']) || empty($attributes)) {
$attributes['class'] = 'form-horizontal';
}
@ -131,12 +130,10 @@ class FormValidator extends HTML_QuickForm
$this->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;

Loading…
Cancel
Save