From b25425d5ae670abf0053d57c58253a1ea9cfe6ce Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 11 Oct 2017 12:17:42 +0200 Subject: [PATCH] Minor - format code --- main/extrafield/translate.php | 12 ++++++++--- main/forum/editthread.php | 33 ++++++++++++++++++++++-------- main/forum/forumfunction.inc.php | 1 - main/forum/forumsearch.php | 29 +++++++++++++++++++------- main/forum/iframe_thread.php | 1 - main/forum/newthread.php | 32 ++++++++++++++++++++++------- main/forum/viewthread_flat.inc.php | 1 - main/gamification/my_progress.php | 2 +- 8 files changed, 82 insertions(+), 29 deletions(-) diff --git a/main/extrafield/translate.php b/main/extrafield/translate.php index cc2f8d2124..b7fbc46f8c 100644 --- a/main/extrafield/translate.php +++ b/main/extrafield/translate.php @@ -49,12 +49,18 @@ $form = new FormValidator('new_lang_variable', 'POST', $translateUrl); $form->addHeader(get_lang('AddWordForTheSubLanguage')); $form->addText('variable_language', get_lang('LanguageVariable'), false); $form->addText('original_name', get_lang('OriginalName'), false); -$form->addSelect('sub_language', [get_lang('SubLanguage'), get_lang('OnlyActiveSubLanguagesAreListed')], $languagesOptions); +$form->addSelect( + 'sub_language', + [get_lang('SubLanguage'), get_lang('OnlyActiveSubLanguagesAreListed')], + $languagesOptions +); if ($languageId) { $languageInfo = api_get_language_info($languageId); - - $form->addText('new_language', [get_lang('Translation'), get_lang('IfThisTranslationExistsThisWillReplaceTheTerm')]); + $form->addText( + 'new_language', + [get_lang('Translation'), get_lang('IfThisTranslationExistsThisWillReplaceTheTerm')] + ); $form->addHidden('file_id', 0); $form->addHidden('id', $languageInfo['parent_id']); $form->addHidden('sub', $languageInfo['id']); diff --git a/main/forum/editthread.php b/main/forum/editthread.php index bf4dfa775b..78c49e3b58 100644 --- a/main/forum/editthread.php +++ b/main/forum/editthread.php @@ -94,22 +94,39 @@ if (api_is_invitee()) { $groupId = api_get_group_id(); if (!empty($groupId)) { - $groupProperties = GroupManager :: get_group_properties($groupId); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups')); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, 'name' => $currentForum['forum_title']); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.$forumId, 'name' => get_lang('EditThread')); + $groupProperties = GroupManager:: get_group_properties($groupId); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, + 'name' => get_lang('Groups'), + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, + 'name' => get_lang('GroupSpace').' '.$groupProperties['name'], + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, + 'name' => $currentForum['forum_title'], + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.$forumId, + 'name' => get_lang('EditThread'), + ); } else { $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], 'name' => $currentForumCategory['cat_title']); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, 'name' => $currentForum['forum_title']); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], + 'name' => $currentForumCategory['cat_title'], + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, + 'name' => $currentForum['forum_title'], + ); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditThread')); } $tableLink = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); /* Header */ - $htmlHeadXtra[] = << $(document).on('ready', function() { diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 793d39a8cb..e272fc13eb 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -4241,7 +4241,6 @@ function move_thread_form() /** * This function displays the form for moving a post message to a different (already existing) or a new thread. - * @return void HTML * * @author Patrick Cool , Ghent University * @version february 2006, dokeos 1.8 diff --git a/main/forum/forumsearch.php b/main/forum/forumsearch.php index 87ce68d350..c6da4ec3ea 100755 --- a/main/forum/forumsearch.php +++ b/main/forum/forumsearch.php @@ -49,13 +49,28 @@ if (api_is_in_gradebook()) { $groupId = api_get_group_id(); if ($origin == 'group') { - $group_properties = GroupManager :: get_group_properties($groupId); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')'); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title'])); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch')); + $group_properties = GroupManager:: get_group_properties($groupId); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), + 'name' => get_lang('Groups'), + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), + 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')', + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), + 'name' => prepare4display($current_forum['forum_title']), + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), + 'name' => get_lang('ForumSearch'), + ); } else { - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), + 'name' => $nameTools, + ); $nameTools = get_lang('ForumSearch'); } @@ -63,7 +78,7 @@ if ($origin == 'group') { if ($origin == 'learnpath') { Display::display_reduced_header(); } else { - Display :: display_header($nameTools); + Display::display_header($nameTools); } // Tool introduction diff --git a/main/forum/iframe_thread.php b/main/forum/iframe_thread.php index f0b34a9d9b..4dcac5b539 100755 --- a/main/forum/iframe_thread.php +++ b/main/forum/iframe_thread.php @@ -64,7 +64,6 @@ $course_id = api_get_course_int_id(); // We are getting all the information about the current forum and forum category. // Note pcool: I tried to use only one sql statement (and function) for this, // but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table. - $sql = "SELECT * FROM $table_posts posts INNER JOIN $table_users users ON (posts.poster_id = users.user_id) diff --git a/main/forum/newthread.php b/main/forum/newthread.php index de5cf35461..9cae19a6fd 100755 --- a/main/forum/newthread.php +++ b/main/forum/newthread.php @@ -100,15 +100,33 @@ if (api_is_invitee()) { $groupId = api_get_group_id(); if (!empty($groupId)) { - $groupProperties = GroupManager :: get_group_properties($groupId); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups')); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic')); + $groupProperties = GroupManager::get_group_properties($groupId); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, + 'name' => get_lang('Groups'), + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, + 'name' => get_lang('GroupSpace').' '.$groupProperties['name'], + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), + 'name' => $current_forum['forum_title'], + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), + 'name' => get_lang('NewTopic'), + ); } else { $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']); - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], + 'name' => $current_forum_category['cat_title'], + ); + $interbreadcrumb[] = array( + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), + 'name' => $current_forum['forum_title'], + ); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewTopic')); } diff --git a/main/forum/viewthread_flat.inc.php b/main/forum/viewthread_flat.inc.php index 59c70b5aa7..450511a651 100755 --- a/main/forum/viewthread_flat.inc.php +++ b/main/forum/viewthread_flat.inc.php @@ -240,7 +240,6 @@ if (isset($current_thread['thread_id'])) { $my_forum_id = $clean_forum_id; $info_thread = get_thread_information($clean_forum_id, $clean_thread_id); $my_forum_id = $info_thread['forum_id']; - $userCanEdit = $current_thread['thread_peer_qualify'] == 1 && $row['poster_id'] != $userId; /*if ($row['poster_id'] != $userId && $current_forum['moderated'] == 1 && $row['status']) { }*/ diff --git a/main/gamification/my_progress.php b/main/gamification/my_progress.php index 32874fc0ce..82432294f0 100644 --- a/main/gamification/my_progress.php +++ b/main/gamification/my_progress.php @@ -1,6 +1,6 @@