Minor - format code

pull/2539/head
jmontoyaa 8 years ago
parent fe581f3404
commit 74a53d2d37
  1. 4
      main/course_home/course_home.php
  2. 3
      main/course_info/delete_course.php
  3. 6
      main/course_info/infocours.php
  4. 41
      main/course_info/maintenance.php
  5. 9
      main/course_info/tools.php
  6. 4
      main/course_progress/thematic_controller.php
  7. 2
      main/coursecopy/copy_course_session.php
  8. 5
      main/document/create_audio.php
  9. 1
      main/document/create_document.php
  10. 8
      main/inc/lib/formvalidator/FormValidator.class.php

@ -324,7 +324,9 @@ if (!empty($autoLaunchWarning)) {
);
}
if (api_get_setting('homepage_view') === 'activity' || api_get_setting('homepage_view') === 'activity_big') {
if (api_get_setting('homepage_view') === 'activity' ||
api_get_setting('homepage_view') === 'activity_big'
) {
require 'activity.php';
} elseif (api_get_setting('homepage_view') === '2column') {
require '2column.php';

@ -40,7 +40,8 @@ if (isset($_GET['delete']) && $_GET['delete'] === 'yes') {
} else {
$message = '<h3>'.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.') </h3>';
$message .= '<p>'.get_lang('ByDel').'</p>';
$message .= '<p><a class="btn btn-primary" href="'.api_get_path(WEB_CODE_PATH).'course_info/maintenance.php?'.api_get_cidreq().'">'.
$message .= '<p><a class="btn btn-primary"
href="'.api_get_path(WEB_CODE_PATH).'course_info/maintenance.php?'.api_get_cidreq().'">'.
get_lang('No').'</a>&nbsp;<a class="btn btn-danger" href="'.api_get_self().'?delete=yes&'.api_get_cidreq().'">'.
get_lang('Yes').'</a></p>';
$interbreadcrumb[] = [

@ -174,10 +174,10 @@ if (api_get_setting('allow_course_theme') == 'true') {
$form->addElement('label', get_lang('DocumentQuota'), format_file_size(DocumentManager::get_course_quota()));
if (!empty(ExerciseLib::getScoreModels())) {
$models = ExerciseLib::getScoreModels();
$scoreModels = ExerciseLib::getScoreModels();
if (!empty($scoreModels)) {
$options = ['' => get_lang('None')];
foreach ($models['models'] as $item) {
foreach ($scoreModels['models'] as $item) {
$options[$item['id']] = get_lang($item['name']);
}
$form->addSelect('score_model_id', get_lang('ScoreModel'), $options);

@ -29,25 +29,48 @@ echo Display::page_header($nameTools);
</div>
<div class="sectioncomment">
<ul>
<li><a href="../coursecopy/create_backup.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('CreateBackup'); ?></a><br/>
<?php echo get_lang('CreateBackupInfo'); ?>
<li>
<a href="../coursecopy/create_backup.php?<?php echo api_get_cidreq(); ?>">
<?php echo get_lang('CreateBackup'); ?>
</a><br/>
<?php echo get_lang('CreateBackupInfo'); ?>
</li>
<li><a href="../coursecopy/import_backup.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('ImportBackup'); ?></a><br/>
<?php echo get_lang('ImportBackupInfo'); ?>
<li>
<a href="../coursecopy/import_backup.php?<?php echo api_get_cidreq(); ?>">
<?php echo get_lang('ImportBackup'); ?>
</a><br/>
<?php echo get_lang('ImportBackupInfo'); ?>
</li>
<li><a href="../coursecopy/import_moodle.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('ImportFromMoodle'); ?></a><br/>
<li>
<a href="../coursecopy/import_moodle.php?<?php echo api_get_cidreq(); ?>">
<?php echo get_lang('ImportFromMoodle'); ?>
</a><br/>
<?php echo get_lang('ImportFromMoodleInfo'); ?>
</li>
</ul>
</div>
<div class="sectiontitle"><?php Display::display_icon('copy.gif', get_lang('CopyCourse')); ?>&nbsp;&nbsp;<a href="../coursecopy/copy_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('CopyCourse'); ?></a></div>
<div class="sectioncomment"><?php echo get_lang('DescriptionCopyCourse'); ?></div>
<div class="sectiontitle">
<?php Display::display_icon('copy.gif', get_lang('CopyCourse')); ?>&nbsp;&nbsp;
<a href="../coursecopy/copy_course.php?<?php echo api_get_cidreq(); ?>">
<?php echo get_lang('CopyCourse'); ?></a>
</div>
<div class="sectioncomment"><?php echo get_lang('DescriptionCopyCourse'); ?>
</div>
<div class="sectiontitle"><?php Display::display_icon('tool_delete.gif', get_lang('recycle_course')); ?>&nbsp;&nbsp;<a href="../coursecopy/recycle_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('recycle_course'); ?></a></div>
<div class="sectiontitle">
<?php Display::display_icon('tool_delete.gif', get_lang('recycle_course')); ?>&nbsp;&nbsp;
<a href="../coursecopy/recycle_course.php?<?php echo api_get_cidreq(); ?>">
<?php echo get_lang('recycle_course'); ?>
</a>
</div>
<div class="sectioncomment"><?php echo get_lang('DescriptionRecycleCourse'); ?></div>
<div class="sectiontitle"><?php Display::display_icon('delete.gif', get_lang('DelCourse')); ?>&nbsp;&nbsp;<a href="../course_info/delete_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('DelCourse'); ?></a></div>
<div class="sectiontitle">
<?php Display::display_icon('delete.gif', get_lang('DelCourse')); ?>&nbsp;&nbsp;
<a href="../course_info/delete_course.php?<?php echo api_get_cidreq(); ?>"><?php echo get_lang('DelCourse'); ?>
</a>
</div>
<div class="sectioncomment"><?php echo get_lang('DescriptionDeleteCourse'); ?></div>
<?php

@ -56,9 +56,14 @@ switch ($action) {
$form->addHtml('<div class="col-md-7">');
$form->addText('name', get_lang('Name'));
$form->addText('link', get_lang('Links'));
$allowed_picture_types = ['jpg', 'jpeg', 'png'];
$allowedPictureTypes = ['jpg', 'jpeg', 'png'];
$form->addFile('icon', get_lang('CustomIcon'));
$form->addRule('icon', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types);
$form->addRule(
'icon',
get_lang('OnlyImagesAllowed').' ('.implode(',', $allowedPictureTypes).')',
'filetype',
$allowedPictureTypes
);
$form->addSelect(
'target',
get_lang('LinkTarget'),

@ -85,13 +85,13 @@ class ThematicController
}
break;
case 'thematic_copy':
//Copy a thematic to a session
// Copy a thematic to a session
$thematic->copy($thematic_id);
$thematic_id = null;
$action = 'thematic_details';
break;
case 'thematic_delete_select':
//Delete many thematics
// Delete many thematics
if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
if (api_is_allowed_to_edit(null, true)) {
$thematic_ids = $_POST['id'];

@ -161,7 +161,7 @@ function display_form()
*/
function search_courses($id_session, $type)
{
global $tbl_course, $tbl_session_rel_course, $course_list;
global $tbl_course, $tbl_session_rel_course;
$xajax_response = new xajaxResponse();
$select_destination = '';
$return = null;

@ -223,7 +223,6 @@ while ($row = Database::fetch_array($result_select)) {
if ($service == 'google') {
$selected_language = api_get_language_isocode(); //lang default is the course language
$form = new FormValidator('form1', 'post', api_get_self().'?'.api_get_cidreq(), '', ['id' => 'form1']);
$form->addHeader(get_lang('HelpText2Audio'));
$form->addElement('hidden', 'text2voice_mode', 'google');
@ -255,7 +254,9 @@ function downloadAudioGoogle($filepath, $dir)
$location = 'create_audio.php?'.api_get_cidreq().'&id='.intval($_POST['id']).'&service=google';
//security
if (!isset($_POST['lang']) && !isset($_POST['text']) && !isset($_POST['title']) && !isset($filepath) && !isset($dir)) {
if (!isset($_POST['lang']) && !isset($_POST['text']) &&
!isset($_POST['title']) && !isset($filepath) && !isset($dir)
) {
echo '<script>window.location.href="'.$location.'"</script>';
return;

@ -633,7 +633,6 @@ if ($form->validate()) {
Display :: display_header($nameTools, "Doc");
// actions
// link back to the documents overview
if ($is_certificate_mode) {
$actionsLeft = '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat='.Security::remove_XSS($_GET['selectcat']).'">'.

@ -178,10 +178,10 @@ EOT;
* Adds a text field to the form.
* A trim-filter is attached to the field.
*
* @param string $label The label for the form-element
* @param string $name The element name
* @param bool $required (optional) Is the form-element required (default=true)
* @param array $attributes (optional) List of attributes for the form-element
* @param string|array $label The label for the form-element
* @param string $name The element name
* @param bool $required (optional) Is the form-element required (default=true)
* @param array $attributes (optional) List of attributes for the form-element
*
* @return HTML_QuickForm_text
*/

Loading…
Cancel
Save