From 496adcef6fad24a3927befb065d819c3f79e8383 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 18 Apr 2016 21:20:59 +0200 Subject: [PATCH] Minor - format code. --- main/course_info/infocours.php | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/main/course_info/infocours.php b/main/course_info/infocours.php index e23c406787..4080fcf7c7 100755 --- a/main/course_info/infocours.php +++ b/main/course_info/infocours.php @@ -176,8 +176,8 @@ $form->addElement( $categories, ['style'=>'width:350px', 'id'=>'category_code'] ); -$form->addElement('select_language', 'course_language', array(get_lang('Ln'), get_lang('TipLang'))); +$form->addElement('select_language', 'course_language', array(get_lang('Ln'), get_lang('TipLang'))); $form->addText('department_name', get_lang('Department'), false); $form->applyFilter('department_name', 'html_filter'); $form->applyFilter('department_name', 'trim'); @@ -187,23 +187,29 @@ $form->applyFilter('department_url', 'html_filter'); // Picture $form->addElement('file', 'picture', get_lang('AddPicture'), array('id' => 'picture', 'class' => 'picture-form')); -$form->addHtml('' - . '
' - . '' - . '
' - . '
' - . '' - . '
' - . '
' - . '' - . '
' - . '
' - . '
' -. ''); +$form->addHtml('
+ +
+
+ +
+
+ +
+
+
+'); $form->addHidden('cropResult', ''); $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif'); -$form->addRule('picture', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types); -//$form->addElement('html', '
'.get_lang('UniqueAnswerImagePreferredSize200x150').'
'); +$form->addRule( + 'picture', + get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', + 'filetype', + $allowed_picture_types +); $form->addElement('checkbox', 'delete_picture', null, get_lang('DeletePicture')); if (api_get_setting('pdf_export_watermark_by_course') == 'true') { @@ -279,8 +285,6 @@ if (api_get_setting('documents_default_visibility_defined_in_course') == 'true') ); $form->addGroup($group, '', array(get_lang("DocumentsDefaultVisibility")), ''); $form->addButtonSave(get_lang('SaveSettings'),'submit_save'); - - $form->addElement('html', ''); } @@ -480,7 +484,7 @@ $form->setDefaults($values); // Validate form if ($form->validate() && is_settings_editable()) { $updateValues = $form->exportValues(); - + // update course picture $picture = $_FILES['picture']; if (!empty($picture['name'])) { @@ -491,7 +495,7 @@ if ($form->validate() && is_settings_editable()) { $updateValues['cropResult'] ); } - + $visibility = $updateValues['visibility']; $deletePicture = isset($updateValues['delete_picture']) ? $updateValues['delete_picture'] : '';