From 55a1ca29625a4ba581080d84fb13986947a330f5 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 20 Mar 2019 10:19:45 +0100 Subject: [PATCH] Minor - flint fixes fixes --- main/forum/download.php | 2 +- main/forum/forumfunction.inc.php | 4 ++-- main/forum/viewthread.php | 10 +++++----- main/inc/lib/glossary.lib.php | 31 +++++++++++++++---------------- main/inc/lib/link.lib.php | 6 +----- 5 files changed, 24 insertions(+), 29 deletions(-) diff --git a/main/forum/download.php b/main/forum/download.php index 59da5bd80c..f6804465a9 100755 --- a/main/forum/download.php +++ b/main/forum/download.php @@ -81,8 +81,8 @@ if ($forum_thread_visibility == 1 && $forum_forum_visibility == 1) { if ($result === false) { api_not_allowed(true); + } } } -} api_not_allowed(); diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 1d735c4f3d..e47a650394 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -5377,8 +5377,8 @@ function getAllAttachment($postId) /** * Delete the all the attachments from the DB and the file according to the post's id or attach id(optional). * - * @param int $post_id - * @param int $id_attach + * @param int $post_id + * @param int $id_attach * * @return int * diff --git a/main/forum/viewthread.php b/main/forum/viewthread.php index 54ccd7459b..8c55e5e626 100755 --- a/main/forum/viewthread.php +++ b/main/forum/viewthread.php @@ -197,7 +197,7 @@ if (!api_is_allowed_to_edit(false, true) && $template = new Template('', false, false, true, true, false); } else { $template = new Template(); -} + } $actions = ''.search_link().''; if ($origin != 'learnpath') { @@ -288,7 +288,7 @@ if (isset($_GET['action']) && isset($_GET['id_attach']) ) { delete_attachment(0, $_GET['id_attach']); - } +} $origin = api_get_origin(); $sessionId = api_get_session_id(); @@ -320,7 +320,7 @@ foreach ($posts as $post) { $username = ''; if (isset($post['username'])) { $username = sprintf(get_lang('LoginX'), $post['username']); -} + } $name = $post['complete_name']; if (empty($posterId)) { @@ -328,11 +328,11 @@ foreach ($posts as $post) { } $post['user_data'] = ''; -if ($origin != 'learnpath') { + if ($origin != 'learnpath') { if ($allowUserImageForum) { $post['user_data'] = '
'. display_user_image($posterId, $name, $origin).'
'; -} + } $post['user_data'] .= Display::tag( 'h4', diff --git a/main/inc/lib/glossary.lib.php b/main/inc/lib/glossary.lib.php index 2a07f47550..823606e0b1 100755 --- a/main/inc/lib/glossary.lib.php +++ b/main/inc/lib/glossary.lib.php @@ -397,51 +397,50 @@ class GlossaryManager // action links $actionsLeft = ''; if (api_is_allowed_to_edit(null, true)) { - $actionsLeft .= '' . - Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM) . ''; + $actionsLeft .= ''. + Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM).''; } if (api_is_allowed_to_edit(null, true)) { - $actionsLeft .= '' . - Display::return_icon('import.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . ''; + $actionsLeft .= ''. + Display::return_icon('import.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM).''; } if (!api_is_anonymous()) { - $actionsLeft .= '' . - Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM) . ''; + $actionsLeft .= ''. + Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).''; } if (!api_is_anonymous()) { $actionsLeft .= Display::url( Display::return_icon('export_to_documents.png', get_lang('ExportToDocArea'), [], ICON_SIZE_MEDIUM), - api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['action' => 'export_documents']) + api_get_self().'?'.api_get_cidreq().'&'.http_build_query(['action' => 'export_documents']) ); } $orderList = isset($_GET['order']) ? Database::escape_string($_GET['order']) : ''; - if(empty($orderList)){ + if (empty($orderList)) { $orderList = 'ASC'; } if (!api_is_anonymous()) { - if($orderList ==='ASC'){ + if ($orderList === 'ASC') { $actionsLeft .= Display::url( Display::return_icon('falling.png', get_lang('Sort Descending'), [], ICON_SIZE_MEDIUM), - api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['order' => 'DESC']) + api_get_self().'?'.api_get_cidreq().'&'.http_build_query(['order' => 'DESC']) ); } else { $actionsLeft .= Display::url( Display::return_icon('upward.png', get_lang('Sort Ascending'), [], ICON_SIZE_MEDIUM), - api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query(['order' => 'ASC']) + api_get_self().'?'.api_get_cidreq().'&'.http_build_query(['order' => 'ASC']) ); } } - /* BUILD SEARCH FORM */ $form = new FormValidator( 'search', 'get', - api_get_self() . '?' . api_get_cidreq(), + api_get_self().'?'.api_get_cidreq(), '', [], FormValidator::LAYOUT_INLINE @@ -459,7 +458,7 @@ class GlossaryManager $content = $toolbar; - $list = self::getListGlossary(1000,0,$orderList); + $list = self::getListGlossary(1000, 0, $orderList); $tpl = new Template(null); $tpl->assign('data', $list); @@ -523,7 +522,8 @@ class GlossaryManager return $obj->total; } - public static function getListGlossary($numberOfItems, $column, $direction){ + public static function getListGlossary($numberOfItems, $column, $direction) + { $_user = api_get_user_info(); // Database table definition @@ -592,7 +592,6 @@ class GlossaryManager } return $list; - } /** diff --git a/main/inc/lib/link.lib.php b/main/inc/lib/link.lib.php index 0e63e537fa..e86f50f821 100755 --- a/main/inc/lib/link.lib.php +++ b/main/inc/lib/link.lib.php @@ -974,7 +974,6 @@ class Link extends Model * @param int $session_id * * @return array - * */ public static function showLinksPerCategory($catid, $courseId, $session_id) { @@ -987,11 +986,9 @@ class Link extends Model $listLink = []; if (!empty($links)) { - $i = 1; $linksAdded = []; foreach ($links as $myrow) { - $linkId = $myrow['id']; $linksAdded['id'] = $linkId; $categoryId = $myrow['category_id']; @@ -1667,12 +1664,11 @@ class Link extends Model } echo ''; - $counter = 0; $category = []; $listCategory = []; - $list['not_category'] = self::showLinksPerCategory(0, $course_id, $session_id);; + $list['not_category'] = self::showLinksPerCategory(0, $course_id, $session_id); foreach ($categories as $myrow) { // Student don't see invisible categories.