From cd3772310ddecccd7017fd344063e36ecbb058ce Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 14 Mar 2017 13:47:44 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- .../admin/access_url_add_usergroup_to_url.php | 2 +- main/blog/download.php | 14 ++++---- main/cron/document/index_all_docs.php | 32 +++++++++---------- main/document/exit_pixlr.php | 14 ++++---- main/document/slideshowoptions.php | 24 +++++++------- main/dropbox/dropbox_download.php | 2 +- main/dropbox/dropbox_functions.inc.php | 8 ++--- main/gradebook/lib/fe/displaygradebook.php | 2 +- main/group/settings.php | 2 +- main/template/default/auth/courses_list.php | 16 +++++----- 10 files changed, 58 insertions(+), 58 deletions(-) diff --git a/main/admin/access_url_add_usergroup_to_url.php b/main/admin/access_url_add_usergroup_to_url.php index c0158d9412..1b7ba022ce 100755 --- a/main/admin/access_url_add_usergroup_to_url.php +++ b/main/admin/access_url_add_usergroup_to_url.php @@ -87,7 +87,7 @@ $db_urls = Database::store_result($result); + ?>   diff --git a/main/blog/download.php b/main/blog/download.php index 74519e1fe5..b9a3e130fa 100755 --- a/main/blog/download.php +++ b/main/blog/download.php @@ -30,18 +30,18 @@ $doc_url = str_replace(' ', '+', $doc_url); $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url; if (! isset($_course)) { - api_not_allowed(true); + api_not_allowed(true); } $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url; //if the rewrite rule asks for a directory, we redirect to the course view if (is_dir($full_file_name)) { - //remove last slash if present - while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); - //create the path - $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path - //redirect - header('Location: '.$document_explorer); + //remove last slash if present + while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); + //create the path + $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path + //redirect + header('Location: '.$document_explorer); exit; } diff --git a/main/cron/document/index_all_docs.php b/main/cron/document/index_all_docs.php index 416589f2be..d185fb02c0 100755 --- a/main/cron/document/index_all_docs.php +++ b/main/cron/document/index_all_docs.php @@ -8,9 +8,9 @@ die(); require '../../inc/global.inc.php'; if (empty($_GET['doc'])) { - echo "To add a document name to search, add ?doc=abc to the URL\n"; + echo "To add a document name to search, add ?doc=abc to the URL\n"; } else { - echo "Received param ".$_GET['doc']."
\n"; + echo "Received param ".$_GET['doc']."
\n"; } $allowed_mime_types = DocumentManager::file_get_mime_type(true); $allowed_extensions = array( @@ -40,30 +40,30 @@ require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; $specific_fields = get_specific_field_list(); $specific_fields_values = array(); foreach ($specific_fields as $sf) { - $specific_fields_values[$sf['code']] = ''; + $specific_fields_values[$sf['code']] = ''; } $td = Database::get_course_table(TABLE_DOCUMENT); foreach ($courses_list as $course) { - $course_dir = $course['directory'].'/document'; - $title = Database::escape_string($_GET['doc']); - $sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'"; - $res = Database::query($sql); - if (Database::num_rows($res)>0) { + $course_dir = $course['directory'].'/document'; + $title = Database::escape_string($_GET['doc']); + $sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'"; + $res = Database::query($sql); + if (Database::num_rows($res)>0) { while ($row = Database::fetch_array($res)) { - $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path']; - $extensions = preg_split("/[\/\\.]/", $doc_path); - $doc_ext = strtolower($extensions[count($extensions) - 1]); - if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) { + $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path']; + $extensions = preg_split("/[\/\\.]/", $doc_path); + $doc_ext = strtolower($extensions[count($extensions) - 1]); + if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) { $doc_mime = mime_content_type($doc_path); echo "Indexing doc ".$row['id']." (".$row['path'].") in course ".$course['code']."\n"; $residx = DocumentManager::index_document($row['id'], $course['code'], $row['session_id'], $course['course_language'], $specific_fields_values); if ($residx) { - echo "Success\n"; + echo "Success\n"; } else { - echo "Failure\n"; + echo "Failure\n"; } - } + } + } } - } } diff --git a/main/document/exit_pixlr.php b/main/document/exit_pixlr.php index c9d5bf5c8e..45d0e19c0a 100755 --- a/main/document/exit_pixlr.php +++ b/main/document/exit_pixlr.php @@ -24,12 +24,12 @@ unset($_SESSION['whereami']); unset($_SESSION['temp_realpath_image']); if (!isset($_SESSION['exit_pixlr'])){ - $location=api_get_path(WEB_CODE_PATH).'document/document.php'; - echo ''; - api_not_allowed(true); + $location=api_get_path(WEB_CODE_PATH).'document/document.php'; + echo ''; + api_not_allowed(true); } else { - echo '
'.get_lang('PleaseStandBy').'
'; - $location=api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']); - echo ''; - unset($_SESSION['exit_pixlr']); + echo '
'.get_lang('PleaseStandBy').'
'; + $location=api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']); + echo ''; + unset($_SESSION['exit_pixlr']); } diff --git a/main/document/slideshowoptions.php b/main/document/slideshowoptions.php index 742edf340c..04bce7ea71 100755 --- a/main/document/slideshowoptions.php +++ b/main/document/slideshowoptions.php @@ -77,7 +77,7 @@ Display::toolbarAction('toolbar-slideshow', $content) if ($image_resizing == 'noresizing' || $image_resizing == '') { echo ' checked'; } - ?>> + ?>> '. get_lang('NoResizing') . ', ' . get_lang('NoResizingComment') ;?> @@ -87,7 +87,7 @@ Display::toolbarAction('toolbar-slideshow', $content) if ($image_resizing == 'resizing_auto' || $image_resizing == '') { echo ' checked'; } - ?>> + ?>> '. get_lang('ResizingAuto') . ', ' . get_lang('ResizingAutoComment');?> @@ -99,7 +99,7 @@ Display::toolbarAction('toolbar-slideshow', $content) $width = $_SESSION['image_resizing_width']; $height = $_SESSION['image_resizing_height']; } - ?>> + ?>> '. get_lang('Resizing') . ', ' . get_lang('ResizingComment'); ?> @@ -107,13 +107,13 @@ Display::toolbarAction('toolbar-slideshow', $content)
> + ?> >
@@ -121,13 +121,13 @@ Display::toolbarAction('toolbar-slideshow', $content)
> + ?> >
diff --git a/main/dropbox/dropbox_download.php b/main/dropbox/dropbox_download.php index 6f2cd875b3..10db057bdb 100755 --- a/main/dropbox/dropbox_download.php +++ b/main/dropbox/dropbox_download.php @@ -86,7 +86,7 @@ if (!$allowed_to_download) { 'error' ) ); - exit; + exit; } else { /* DOWNLOAD THE FILE */ // the user is allowed to download the file diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index 0cfd08a2e8..5e9e77f17e 100755 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -84,11 +84,11 @@ function handle_multiple_actions() if (strstr($_POST['action'], 'move_')) { // check move_received_n or move_sent_n command if (strstr($_POST['action'], 'received')) { - $part = 'received'; - $to_cat_id = str_replace('move_received_', '', $_POST['action']); + $part = 'received'; + $to_cat_id = str_replace('move_received_', '', $_POST['action']); } else { - $part = 'sent'; - $to_cat_id = str_replace('move_sent_', '', $_POST['action']); + $part = 'sent'; + $to_cat_id = str_replace('move_sent_', '', $_POST['action']); } foreach ($checked_file_ids as $value) { diff --git a/main/gradebook/lib/fe/displaygradebook.php b/main/gradebook/lib/fe/displaygradebook.php index d5f834ec1c..924f9681cf 100755 --- a/main/gradebook/lib/fe/displaygradebook.php +++ b/main/gradebook/lib/fe/displaygradebook.php @@ -364,7 +364,7 @@ class DisplayGradebook $my_api_cidreq = 'cidReq=' . $my_category['course_code']; } if ($show_add_link && !$message_resource) { - $actionsLeft .= '' . + $actionsLeft .= '' . Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . ''; $cats = Category :: load($selectcat); diff --git a/main/group/settings.php b/main/group/settings.php index 126c08ec26..06978b78ce 100755 --- a/main/group/settings.php +++ b/main/group/settings.php @@ -3,7 +3,7 @@ /** * This script displays an area where teachers can edit the group properties and member list. - * + * * @author various contributors * @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support * @package chamilo.group diff --git a/main/template/default/auth/courses_list.php b/main/template/default/auth/courses_list.php index bad00b6ef2..c6b9e5f0e0 100755 --- a/main/template/default/auth/courses_list.php +++ b/main/template/default/auth/courses_list.php @@ -29,11 +29,11 @@ if (!empty($message)) { // COURSES WITH CATEGORIES if (!empty($user_course_categories)) { - foreach ($user_course_categories as $row) { - echo Display::page_subheader($row['title']); - echo ''; + foreach ($user_course_categories as $row) { + echo Display::page_subheader($row['title']); + echo ''; - if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?> + if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?>
@@ -241,15 +241,15 @@ if (!empty($courses_without_category)) { + if ($key < $number_of_courses - 1) { ?> + }?>
@@ -267,7 +267,7 @@ if (!empty($courses_without_category)) {
+ ?>