diff --git a/main/exercise/exercise_report.php b/main/exercise/exercise_report.php index dc43ec48c0..46aa439724 100755 --- a/main/exercise/exercise_report.php +++ b/main/exercise/exercise_report.php @@ -39,7 +39,6 @@ $_course = api_get_course_info(); // document path $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path']."/document"; $origin = isset($origin) ? $origin : null; -$gradebook = isset($gradebook) ? $gradebook : null; $path = isset($_GET['path']) ? Security::remove_XSS($_GET['path']) : null; /* Constants and variables */ @@ -330,10 +329,9 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) && } } - if ($is_allowedToEdit || $is_tutor) { $interbreadcrumb[] = array( - "url" => "exercise.php?gradebook=$gradebook", + "url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises') ); $objExerciseTmp = new Exercise(); @@ -346,7 +344,7 @@ if ($is_allowedToEdit || $is_tutor) { } } else { $interbreadcrumb[] = array( - "url" => "exercise.php?gradebook=$gradebook", + "url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises') ); $objExerciseTmp = new Exercise(); diff --git a/main/exercise/overview.php b/main/exercise/overview.php index 959e3f3d45..2a535f09b1 100755 --- a/main/exercise/overview.php +++ b/main/exercise/overview.php @@ -30,14 +30,13 @@ if (!$result) { api_not_allowed(true); } -$gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null; $learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpath_id']) : null; $learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : null; $learnpathItemViewId = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : null; $origin = api_get_origin(); $interbreadcrumb[] = array( - "url" => "exercise.php?".api_get_path(), + "url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises') ); $interbreadcrumb[] = array("url" => "#", "name" => $objExercise->selectTitle(true)); diff --git a/main/exercise/stats.php b/main/exercise/stats.php index be44ba7f6a..b721e1e6a5 100755 --- a/main/exercise/stats.php +++ b/main/exercise/stats.php @@ -6,8 +6,6 @@ require_once __DIR__.'/../inc/global.inc.php'; $this_section = SECTION_COURSES; $exercise_id = isset($_GET['exerciseId']) && !empty($_GET['exerciseId']) ? intval($_GET['exerciseId']) : 0; -$gradebook = isset($gradebook) ? $gradebook : null; - $objExercise = new Exercise(); $result = $objExercise->read($exercise_id); @@ -291,7 +289,7 @@ foreach ($data as $row_table) { $content .= $table->toHtml(); $interbreadcrumb[] = array( - "url" => "exercise.php?gradebook=$gradebook&".api_get_cidreq(), + "url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises'), ); $interbreadcrumb[] = array( diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 5743021aa3..08e0bfc9e4 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -1088,7 +1088,12 @@ function return_lock_unlock_icon($content, $id, $current_lock_status, $additiona //check if the forum is blocked due if ($content == 'thread') { if (api_resource_is_locked_by_gradebook($id, LINK_FORUM_THREAD)) { - $html .= Display::return_icon('lock_na.png', get_lang('ResourceLockedByGradebook'), array(), ICON_SIZE_SMALL); + $html .= Display::return_icon( + 'lock_na.png', + get_lang('ResourceLockedByGradebook'), + array(), + ICON_SIZE_SMALL + ); return $html; } @@ -2588,8 +2593,6 @@ function store_thread( $em = Database::getManager(); $table_threads = Database::get_course_table(TABLE_FORUM_THREAD); - - $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : ''; $upload_ok = 1; $has_attachment = false; @@ -2651,19 +2654,15 @@ function store_thread( 1 == $values['thread_qualify_gradebook'] ) { // Add function gradebook. - $resourcetype = 5; - $resourceid = $lastThread->getIid(); $resourcename = stripslashes($values['calification_notebook_title']); - $maxqualify = $values['numeric_calification']; - $weigthqualify = $values['weight_calification']; GradebookUtils::add_resource_to_course_gradebook( $values['category_id'], $courseCode, - $resourcetype, - $resourceid, + 5, + $lastThread->getIid(), $resourcename, - $weigthqualify, - $maxqualify, + $values['weight_calification'], + $values['numeric_calification'], '', 0, $sessionId @@ -2819,7 +2818,7 @@ function store_thread( } else { $message .= get_lang('ReturnTo').' '. get_lang('Forum').'
'; - $message .= get_lang('ReturnTo').' '. + $message .= get_lang('ReturnTo').' '. get_lang('Message').''; } $reply_info['new_post_id'] = $lastPostId; @@ -2868,12 +2867,10 @@ function show_add_post_form($current_forum, $forum_setting, $action, $id = '', $ $myThread = isset($_GET['thread']) ? (int) $_GET['thread'] : ''; $forumId = isset($_GET['forum']) ? (int) $_GET['forum'] : ''; $my_post = isset($_GET['post']) ? (int) $_GET['post'] : ''; - $my_gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : ''; $url = api_get_self().'?'.http_build_query([ 'action' => $action, 'forum' => $forumId, - 'gradebook' => $my_gradebook, 'thread' => $myThread, 'post' => $my_post ]).'&'.api_get_cidreq(); @@ -2889,7 +2886,6 @@ function show_add_post_form($current_forum, $forum_setting, $action, $id = '', $ // Setting the form elements. $form->addElement('hidden', 'forum_id', $forumId); $form->addElement('hidden', 'thread_id', $myThread); - $form->addElement('hidden', 'gradebook', $my_gradebook); $form->addElement('hidden', 'action', $action); // If anonymous posts are allowed we also display a form to allow the user to put his name or username in. @@ -3698,7 +3694,6 @@ function store_edit_post($forumInfo, $values) { $threadTable = Database::get_course_table(TABLE_FORUM_THREAD); $table_posts = Database::get_course_table(TABLE_FORUM_POST); - $gradebook = Security::remove_XSS($_GET['gradebook']); $course_id = api_get_course_int_id(); //check if this post is the first of the thread @@ -3779,7 +3774,7 @@ function store_edit_post($forumInfo, $values) $message = get_lang('EditPostStored').'
'; $message .= get_lang('ReturnTo').' '.get_lang('Forum').'
'; - $message .= get_lang('ReturnTo').' '.get_lang('Message').''; + $message .= get_lang('ReturnTo').' '.get_lang('Message').''; Session::erase('formelements'); Session::erase('origin'); @@ -4183,11 +4178,10 @@ function send_mail($user_info = array(), $thread_information = array()) */ function move_thread_form() { - $gradebook = Security::remove_XSS($_GET['gradebook']); $form = new FormValidator( 'movepost', 'post', - api_get_self().'?forum='.intval($_GET['forum']).'&gradebook='.$gradebook.'&thread='.intval($_GET['thread']).'&action='.Security::remove_XSS($_GET['action']).'&'.api_get_cidreq() + api_get_self().'?forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']).'&action='.Security::remove_XSS($_GET['action']).'&'.api_get_cidreq() ); // The header for the form $form->addElement('header', get_lang('MoveThread')); @@ -4243,12 +4237,10 @@ function move_thread_form() */ function move_post_form() { - $gradebook = Security::remove_XSS($_GET['gradebook']); - // initiate the object $form = new FormValidator( 'movepost', 'post', - api_get_self().'?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']).'&gradebook='.$gradebook.'&post='.Security::remove_XSS($_GET['post']).'&action='.Security::remove_XSS($_GET['action']).'&post='.Security::remove_XSS($_GET['post']) + api_get_self().'?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']).'&post='.Security::remove_XSS($_GET['post']).'&action='.Security::remove_XSS($_GET['action']).'&post='.Security::remove_XSS($_GET['post']) ); // The header for the form $form->addElement('header', '', get_lang('MovePost')); @@ -4566,7 +4558,6 @@ function display_forum_search_results($search_term) $table_posts = Database::get_course_table(TABLE_FORUM_POST); $table_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY); $session_id = api_get_session_id(); - $gradebook = Security::remove_XSS($_GET['gradebook']); $course_id = api_get_course_int_id(); // Defining the search strings as an array. @@ -4648,7 +4639,7 @@ function display_forum_search_results($search_term) prepare4display($categoryName).' > '; $search_results_item .= ''. prepare4display($forum_list[$row['forum_id']]['forum_title']).' > '; - $search_results_item .= ''. + $search_results_item .= ''. prepare4display($row['post_title']).''; $search_results_item .= '
'; if (api_strlen($row['post_title']) > 200) { diff --git a/main/forum/forumqualify.php b/main/forum/forumqualify.php index a0abaa4a06..19b1236850 100755 --- a/main/forum/forumqualify.php +++ b/main/forum/forumqualify.php @@ -147,21 +147,16 @@ if ($origin == 'learnpath') { ); if ($message <> 'PostDeletedSpecial') { - if (isset($_GET['gradebook']) && $_GET['gradebook'] == 'view') { - $info_thread = get_thread_information($currentForum['forum_id'], $_GET['thread']); - $interbreadcrumb[] = array( - "url" => "viewthread.php?".api_get_cidreq()."&forum=".$info_thread['forum_id']."&thread=".intval($_GET['thread']), - "name" => prepare4display($currentThread['thread_title']) - ); - } else { - $interbreadcrumb[] = array( - "url" => "viewthread.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&thread=".intval($_GET['thread']), - "name" => prepare4display($currentThread['thread_title']) - ); - } + $interbreadcrumb[] = array( + "url" => "viewthread.php?".api_get_cidreq()."&forum=".$info_thread['forum_id']."&thread=".intval($_GET['thread']), + "name" => prepare4display($currentThread['thread_title']) + ); } // the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string - $interbreadcrumb[] = array("url" => "#", "name" => get_lang('QualifyThread')); + $interbreadcrumb[] = array( + "url" => "#", + "name" => get_lang('QualifyThread') + ); Display::display_header(''); } } @@ -311,16 +306,13 @@ $form->display(); // Show past data if (api_is_allowed_to_edit() && $counter > 0) { - if (isset($_GET['gradebook'])) { - $view_gradebook = '&gradebook=view'; - } echo '

'.get_lang('QualificationChangesHistory').'

'; if (isset($_GET['type']) && $_GET['type'] === 'false') { - $buttons = ''. + $buttons = ''. get_lang('MoreRecent').' '.get_lang('Older').''; } else { $buttons = ''.get_lang('MoreRecent').' - '. + '. get_lang('Older').''; } diff --git a/main/forum/reply.php b/main/forum/reply.php index f723f33c56..65c85b3ec0 100755 --- a/main/forum/reply.php +++ b/main/forum/reply.php @@ -85,8 +85,7 @@ if (api_is_in_gradebook()) { } $groupId = api_get_group_id(); if (!empty($groupId)) { - $_clean['toolgroup'] = $groupId; - $group_properties = GroupManager::get_group_properties($_clean['toolgroup']); + $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'), @@ -102,7 +101,7 @@ if (!empty($groupId)) { 'name' => $current_forum['forum_title'] ); $interbreadcrumb[] = array( - 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?gradebook='.$gradebook.'&forum='.$forumId.'&thread='.$threadId.'&'.api_get_cidreq(), + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum='.$forumId.'&thread='.$threadId.'&'.api_get_cidreq(), 'name' => $current_thread['thread_title'] ); @@ -112,7 +111,7 @@ if (!empty($groupId)) { ); } else { $interbreadcrumb[] = array( - 'url' => 'index.php?gradebook='.$gradebook, + 'url' => 'index.php?'.api_get_cidreq(), 'name' => $nameTools ); $interbreadcrumb[] = array( @@ -124,7 +123,7 @@ if (!empty($groupId)) { 'name' => $current_forum['forum_title'] ); $interbreadcrumb[] = array( - 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?gradebook='.$gradebook.'&forum='.$forumId.'&thread='.$threadId.'&'.api_get_cidreq(), + 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?forum='.$forumId.'&thread='.$threadId.'&'.api_get_cidreq(), 'name' => $current_thread['thread_title'] ); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Reply')); @@ -173,8 +172,13 @@ if ($origin == 'learnpath') { if ($origin != 'learnpath') { echo '
'; echo ''.search_link().''; - echo ''. - Display::return_icon('back.png', get_lang('BackToThread'), '', ICON_SIZE_MEDIUM).''; + echo ''; + echo Display::return_icon( + 'back.png', + get_lang('BackToThread'), + '', + ICON_SIZE_MEDIUM + ).''; echo '
'; } /*New display forum div*/ diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php index 2a5170b3ff..2ca0339248 100755 --- a/main/forum/viewforum.php +++ b/main/forum/viewforum.php @@ -338,8 +338,7 @@ echo '
'; if ($origin != 'learnpath') { if (!empty($groupId)) { - echo '' + echo '' . Display::return_icon('back.png', get_lang('BackTo') . ' '.get_lang('Groups'), '', ICON_SIZE_MEDIUM).''; } else { diff --git a/main/forum/viewpost.php b/main/forum/viewpost.php index 9cf846324f..c1b598fb3d 100755 --- a/main/forum/viewpost.php +++ b/main/forum/viewpost.php @@ -108,9 +108,8 @@ if ($message != 'PostDeletedSpecial') { increase_thread_view($_GET['thread']); /* Action Links */ - echo '
'; - $my_url = ''.get_lang('FlatView').' | '; echo $my_url.'&view=threaded">'.get_lang('ThreadedView').' | '; echo $my_url.'&view=nested">'.get_lang('NestedView').''; diff --git a/main/forum/viewthread.php b/main/forum/viewthread.php index a39726d672..e6ecea409f 100755 --- a/main/forum/viewthread.php +++ b/main/forum/viewthread.php @@ -23,10 +23,8 @@ $forumUrl = api_get_path(WEB_CODE_PATH).'forum/'; // Are we in a lp ? $origin = api_get_origin(); $my_search = null; -$gradebook = null; /* MAIN DISPLAY SECTION */ - /* Retrieving forum and forum category information */ // We are getting all the information about the current forum and forum category. diff --git a/main/forum/viewthread_flat.inc.php b/main/forum/viewthread_flat.inc.php index 7145ffddaf..59c70b5aa7 100755 --- a/main/forum/viewthread_flat.inc.php +++ b/main/forum/viewthread_flat.inc.php @@ -238,10 +238,8 @@ if (isset($current_thread['thread_id'])) { $current_thread['thread_qualify_max'] > 0 && $origin != 'learnpath' ) { $my_forum_id = $clean_forum_id; - if (isset($_GET['gradebook'])) { - $info_thread = get_thread_information($clean_forum_id, $clean_thread_id); - $my_forum_id = $info_thread['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/forum/viewthread_threaded.inc.php b/main/forum/viewthread_threaded.inc.php index c00d7d0ed7..8df0f4047c 100755 --- a/main/forum/viewthread_threaded.inc.php +++ b/main/forum/viewthread_threaded.inc.php @@ -139,19 +139,12 @@ $next_img = Display::return_icon( $class_prev = ''; $class_next = ''; +$threadLink = $forumUrl.'viewthread.php?'.api_get_cidreq().'&forum='.$forumId.'&thread='.$threadId; // Links -$first_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). - '&forum='.$forumId.'&thread='.$threadId. - '&gradebook='.$gradebook.'&id=1&post='.$prev_next_array[0]; -$last_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). - '&forum='.$forumId.'&thread='.$threadId. - '&gradebook='.$gradebook.'&post='.$prev_next_array[$max - 1]; -$prev_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). - '&forum='.$forumId.'&thread='.$threadId. - '&gradebook='.$gradebook.'&post='.$prev_next_array[$prev_id]; -$next_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). - '&forum='.$forumId.'&thread='.$threadId. - '&post='.$prev_next_array[$next_id]; +$first_href = $threadLink.'&id=1&post='.$prev_next_array[0]; +$last_href = $threadLink.'&post='.$prev_next_array[$max - 1]; +$prev_href = $threadLink.'&post='.$prev_next_array[$prev_id]; +$next_href = $threadLink.'&post='.$prev_next_array[$next_id]; echo '
'; // Go to: first and previous diff --git a/main/gradebook/exercise_jump.php b/main/gradebook/exercise_jump.php index 6a0feaeebf..ac252db6d9 100755 --- a/main/gradebook/exercise_jump.php +++ b/main/gradebook/exercise_jump.php @@ -19,7 +19,6 @@ $gradebook = Security::remove_XSS($_GET['gradebook']); $session_id = api_get_session_id(); $cidReq = Security::remove_XSS($_GET['cidReq']); $type = Security::remove_XSS($_GET['type']); - $doExerciseUrl = ''; if (isset($_GET['doexercise'])) { diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index 0a66ef4fce..7d93a7313c 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -3268,18 +3268,14 @@ class learnpath $hide_teacher_icons_lp = api_get_configuration_value('hide_teacher_icons_lp'); $html = ''; if ($is_allowed_to_edit && $hide_teacher_icons_lp == false) { - $gradebook = ''; - if (!empty($_GET['gradebook'])) { - $gradebook = Security::remove_XSS($_GET['gradebook']); - } if ($this->get_lp_session_id() == api_get_session_id()) { $html .= ''; @@ -6320,7 +6316,6 @@ class learnpath $isConfigPage = false, $allowExpand = true ) { - $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null; $actionsLeft = ''; $actionsRight = ''; @@ -6332,7 +6327,6 @@ class learnpath ICON_SIZE_MEDIUM ), 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ - 'gradebook' => $gradebook, 'action' => 'view', 'lp_id' => $this->lp_id, 'isStudentView' => 'true' @@ -8041,11 +8035,9 @@ class learnpath $arrLP = isset($this->arrMenu) ? $this->arrMenu : null; unset($this->arrMenu); - $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null; - $url = api_get_self().'?'.api_get_cidreq().'&gradeboook='.$gradebook.'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; + $url = api_get_self().'?'.api_get_cidreq().'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; $form = new FormValidator('form', 'POST', $url); - $defaults['title'] = api_html_entity_decode( $item_title, ENT_QUOTES, diff --git a/main/lp/lp_build.php b/main/lp/lp_build.php index 30051dd57d..8ceb1a6922 100755 --- a/main/lp/lp_build.php +++ b/main/lp/lp_build.php @@ -105,18 +105,16 @@ if (isset($is_success) && $is_success === true) { if ($is_new) { echo Display::return_message(get_lang('LearnpathAdded'), 'normal', false); } - // Display::addFlash(Display::return_message(get_lang('LPCreatedAddChapterStep'), 'normal', false)); - $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null; echo Display::page_subheader(get_lang('LearnPathAddedTitle')); echo '