Minor- fix urls / remove origin already added by api_get_cidreq

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent c190325966
commit 3a3316ed09
  1. 9
      main/announcements/announcements.php
  2. 1
      main/calendar/agenda.php
  3. 14
      main/forum/editpost.php
  4. 19
      main/forum/forumqualify.php
  5. 4
      main/forum/reply.php
  6. 16
      main/forum/viewforum.php
  7. 7
      main/forum/viewforumcategory.php
  8. 12
      main/forum/viewpost.php
  9. 5
      main/forum/viewthread_flat.inc.php
  10. 9
      main/forum/viewthread_nested.inc.php
  11. 13
      main/forum/viewthread_threaded.inc.php
  12. 4
      main/group/group_space.php
  13. 2
      main/inc/lib/AnnouncementManager.php
  14. 3
      main/inc/lib/glossary.lib.php
  15. 4
      main/inc/lib/grade_model.lib.php
  16. 29
      main/inc/lib/groupmanager.lib.php
  17. 2
      main/inc/lib/import.lib.php
  18. 3
      main/survey/survey.lib.php
  19. 6
      main/work/work.lib.php

@ -59,7 +59,6 @@ api_protect_course_group(GroupManager::GROUP_TOOL_ANNOUNCEMENT);
Event::event_access_tool(TOOL_ANNOUNCEMENT); Event::event_access_tool(TOOL_ANNOUNCEMENT);
$announcement_id = isset($_GET['id']) ? intval($_GET['id']) : null; $announcement_id = isset($_GET['id']) ? intval($_GET['id']) : null;
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'list'; $action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'list';
$announcement_number = AnnouncementManager::getNumberAnnouncements(); $announcement_number = AnnouncementManager::getNumberAnnouncements();
@ -604,16 +603,16 @@ if ((api_is_allowed_to_edit(false, true) ||
(empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')
) { ) {
if (in_array($action, array('add', 'modify', 'view'))) { if (in_array($action, array('add', 'modify', 'view'))) {
$actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>". $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."'>".
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>"; Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
} else { } else {
$actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&action=add&origin=".$origin."'>". $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&action=add'>".
Display::return_icon('new_announce.png', get_lang('AddAnnouncement'), '', ICON_SIZE_MEDIUM)."</a>"; Display::return_icon('new_announce.png', get_lang('AddAnnouncement'), '', ICON_SIZE_MEDIUM)."</a>";
} }
$show_actions = true; $show_actions = true;
} else { } else {
if (in_array($action, array('view'))) { if (in_array($action, array('view'))) {
$actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>". $actionsLeft .= "<a href='".api_get_self()."?".api_get_cidreq()."'>".
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>"; Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
} }
} }
@ -638,7 +637,7 @@ if ($show_actions) {
echo $content; echo $content;
if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') { if (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath') {
//we are not in learnpath tool //we are not in learnpath tool
Display::display_footer(); Display::display_footer();
} }

@ -16,7 +16,6 @@ if (!empty($course_info)) {
} }
$action = isset($_GET['action']) ? $_GET['action'] : null; $action = isset($_GET['action']) ? $_GET['action'] : null;
$origin = isset($_GET['origin']) ? $_GET['origin'] : null;
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
$url = null; $url = null;

@ -84,7 +84,7 @@ if ($origin == 'group') {
'name' => get_lang('GroupSpace').' '.$group_properties['name'], 'name' => get_lang('GroupSpace').' '.$group_properties['name'],
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&origin='.$origin.'&forum='.Security::remove_XSS($_GET['forum']), 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']),
'name' => prepare4display($current_forum['forum_title']), 'name' => prepare4display($current_forum['forum_title']),
); );
$interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost')); $interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost'));
@ -92,15 +92,15 @@ if ($origin == 'group') {
$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);
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&'.api_get_cidreq(), 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&'.api_get_cidreq(),
'name' => prepare4display($current_forum_category['cat_title']), 'name' => prepare4display($current_forum_category['cat_title'])
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq(),
'name' => prepare4display($current_forum['forum_title']), 'name' => prepare4display($current_forum['forum_title'])
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.api_get_cidreq().'&origin='.$origin.'&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']), 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']),
'name' => prepare4display($current_thread['thread_title']), 'name' => prepare4display($current_thread['thread_title'])
); );
$interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost')); $interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost'));
} }
@ -192,7 +192,7 @@ if ($origin != 'learnpath') {
echo '<a href="index.php?'.api_get_cidreq().'">'. echo '<a href="index.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('BackToForumOverview'), '', ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png', get_lang('BackToForumOverview'), '', ICON_SIZE_MEDIUM).'</a>';
} }
echo '<a href="viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq().'&origin='.$origin.'">'. echo '<a href="viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq().'">'.
Display::return_icon('forum.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('forum.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>'; echo '</div>';
} }

@ -76,50 +76,49 @@ if ($origin == 'learnpath') {
if (!empty($groupId)) { if (!empty($groupId)) {
$group_properties = GroupManager::get_group_properties($groupId); $group_properties = GroupManager::get_group_properties($groupId);
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "../group/group.php", "url" => "../group/group.php?".api_get_cidreq(),
"name" => get_lang('Groups'), "name" => get_lang('Groups')
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "../group/group_space.php?".api_get_cidreq(), "url" => "../group/group_space.php?".api_get_cidreq(),
"name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')' "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')'
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "viewforum.php?forum=".intval($_GET['forum'])."&origin=".$origin."&search=".Security::remove_XSS(urlencode($_GET['search'])), "url" => "viewforum.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&search=".Security::remove_XSS(urlencode($_GET['search'])),
"name" => prepare4display($currentForum['forum_title']) "name" => prepare4display($currentForum['forum_title'])
); );
if ($message <> 'PostDeletedSpecial') { if ($message <> 'PostDeletedSpecial') {
$interbreadcrumb[]= array( $interbreadcrumb[]= array(
"url" => "viewthread.php?forum=".intval($_GET['forum'])."&gradebook=".$gradebook."&thread=".intval($_GET['thread']), "url" => "viewthread.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&gradebook=".$gradebook."&thread=".intval($_GET['thread']),
"name" => prepare4display($currentThread['thread_title']) "name" => prepare4display($currentThread['thread_title'])
); );
} }
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "#", "url" => "#",
"name" => get_lang('QualifyThread'), "name" => get_lang('QualifyThread')
); );
// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string // the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
Display :: display_header(''); Display :: display_header('');
api_display_tool_title($nameTools); api_display_tool_title($nameTools);
} else { } else {
$search = isset($_GET['search']) ? Security::remove_XSS(urlencode($_GET['search'])) : ''; $search = isset($_GET['search']) ? Security::remove_XSS(urlencode($_GET['search'])) : '';
$info_thread = get_thread_information($_GET['thread']); $info_thread = get_thread_information($_GET['thread']);
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "index.php?".api_get_cidreq()."&search=".$search, "url" => "index.php?".api_get_cidreq()."&search=".$search,
"name" => $nameTools); "name" => $nameTools);
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "viewforumcategory.php?forumcategory=".$currentForumCategory['cat_id']."&search=".$search, "url" => "viewforumcategory.php?".api_get_cidreq()."&forumcategory=".$currentForumCategory['cat_id']."&search=".$search,
"name" => prepare4display($currentForumCategory['cat_title']) "name" => prepare4display($currentForumCategory['cat_title'])
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&origin=".$origin."&search=".$search, "url" => "viewforum.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&search=".$search,
"name" => prepare4display($currentForum['forum_title']) "name" => prepare4display($currentForum['forum_title'])
); );
if ($message <> 'PostDeletedSpecial') { if ($message <> 'PostDeletedSpecial') {
if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') { if (isset($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
$info_thread=get_thread_information($_GET['thread']); $info_thread=get_thread_information($_GET['thread']);
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "viewthread.php?".api_get_cidreq()."&forum=".$info_thread['forum_id']."&thread=".intval($_GET['thread']), "url" => "viewthread.php?".api_get_cidreq()."&forum=".$info_thread['forum_id']."&thread=".intval($_GET['thread']),
@ -133,7 +132,7 @@ if ($origin == 'learnpath') {
} }
} }
// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string // 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(''); Display :: display_header('');
} }
} }

@ -185,13 +185,13 @@ if ($origin == 'learnpath') {
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
echo '<div class="actions">'; echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>'; echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="viewthread.php?'.api_get_cidreq().'&forum='.$forumId.'&gradebook='.$gradebook.'&thread='.$threadId.'&origin='.$origin.'">'. echo '<a href="viewthread.php?'.api_get_cidreq().'&forum='.$forumId.'&gradebook='.$gradebook.'&thread='.$threadId.'">'.
Display::return_icon('back.png', get_lang('BackToThread'), '', ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png', get_lang('BackToThread'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>'; echo '</div>';
} }
/*New display forum div*/ /*New display forum div*/
echo '<div class="forum_title">'; echo '<div class="forum_title">';
echo '<h1><a href="viewforum.php?&origin='.$origin.'&forum='.$current_forum['forum_id'].'" '. echo '<h1><a href="viewforum.php?'.api_get_cidreq().'&forum='.$current_forum['forum_id'].'" '.
class_visible_invisible($current_forum['visibility']).'>'. class_visible_invisible($current_forum['visibility']).'>'.
prepare4display($current_forum['forum_title']).'</a></h1>'; prepare4display($current_forum['forum_title']).'</a></h1>';
echo '<p class="forum_description">'.prepare4display($current_forum['forum_comment']).'</p>'; echo '<p class="forum_description">'.prepare4display($current_forum['forum_comment']).'</p>';

@ -314,15 +314,15 @@ if (
$table_list .= '<td> $table_list .= '<td>
<a href="' . $forumUrl . 'forumqualify.php?' . api_get_cidreq() <a href="' . $forumUrl . 'forumqualify.php?' . api_get_cidreq()
. '&forum=' . Security::remove_XSS($my_forum) . '&thread=' . '&forum=' . Security::remove_XSS($my_forum) . '&thread='
. Security::remove_XSS($_GET['id']) . '&user=' . $row_student_list['id'] . intval($_GET['id']) . '&user=' . $row_student_list['id']
. '&user_id=' . $row_student_list['id'] . '&idtextqualify=' . '&user_id=' . $row_student_list['id'] . '&idtextqualify='
. $current_qualify_thread . '&origin=' . $origin . '">' . $current_qualify_thread.'">'
. Display::return_icon($icon_qualify, get_lang('Qualify')) . '</a></td></tr>'; . Display::return_icon($icon_qualify, get_lang('Qualify')) . '</a></td></tr>';
} }
$counter_stdlist++; $counter_stdlist++;
} }
} else { } else {
if ($listType == 'qualify') { if ($listType === 'qualify') {
$table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotQualifiedLearners') . '</td></tr>'; $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotQualifiedLearners') . '</td></tr>';
} else { } else {
$table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotUnqualifiedLearners') . '</td></tr>'; $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotUnqualifiedLearners') . '</td></tr>';
@ -461,7 +461,7 @@ if (is_array($threads)) {
$name = api_get_person_name($row['firstname'], $row['lastname']); $name = api_get_person_name($row['firstname'], $row['lastname']);
$linkPostForum = '<a href="viewthread.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) $linkPostForum = '<a href="viewthread.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum)
. "&origin=$origin&thread={$row['thread_id']}$origin_string&search=" . "&origin=$origin&thread={$row['thread_id']}&search="
. Security::remove_XSS(urlencode($my_search)) . '">' . Security::remove_XSS(urlencode($my_search)) . '">'
. $row['thread_title'] . '</a>'; . $row['thread_title'] . '</a>';
$html = ''; $html = '';
@ -624,15 +624,15 @@ if (is_array($threads)) {
$icon_liststd = 'user.png'; $icon_liststd = 'user.png';
if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
$iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' $iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum='
. Security::remove_XSS($my_forum) . intval($my_forum)
. "&origin=$origin&action=notify&content=thread&id={$row['thread_id']}" . "&action=notify&content=thread&id={$row['thread_id']}"
. '">' . Display::return_icon($iconnotify, get_lang('NotifyMe')) . '</a>'; . '">' . Display::return_icon($iconnotify, get_lang('NotifyMe')) . '</a>';
} }
if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') { if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') {
$iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' $iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum='
. Security::remove_XSS($my_forum) . intval($my_forum)
. "&origin=$origin&action=liststd&content=thread&id={$row['thread_id']}" . "&action=liststd&content=thread&id={$row['thread_id']}"
. '">' . Display::return_icon($icon_liststd, get_lang('StudentList'), array(), ICON_SIZE_SMALL) . '">' . Display::return_icon($icon_liststd, get_lang('StudentList'), array(), ICON_SIZE_SMALL)
. '</a>'; . '</a>';
} }

@ -80,8 +80,7 @@ $interbreadcrumb[] = array(
if (!empty($_GET['action']) && !empty($_GET['content'])) { if (!empty($_GET['action']) && !empty($_GET['content'])) {
if ($_GET['action']=='add' && $_GET['content']=='forum' ) { if ($_GET['action']=='add' && $_GET['content']=='forum' ) {
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => 'viewforumcategory.php?forumcategory=' 'url' => 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='. $current_forum_category['cat_id'],
. $current_forum_category['cat_id'] . '&origin=' . $origin,
'name' => $current_forum_category['cat_title'] 'name' => $current_forum_category['cat_title']
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
@ -96,7 +95,7 @@ if (!empty($_GET['action']) && !empty($_GET['content'])) {
); );
} }
if ($origin=='learnpath') { if ($origin == 'learnpath') {
Display::display_reduced_header(); Display::display_reduced_header();
} else { } else {
Display::display_header(null); Display::display_header(null);
@ -387,7 +386,7 @@ if ($action_forums != 'add') {
$forum['forum_title'].$session_displayed, $forum['forum_title'].$session_displayed,
array( array(
'href' => 'viewforum.php?' . api_get_cidreq() 'href' => 'viewforum.php?' . api_get_cidreq()
. "&gidReq={$forum['forum_of_group']}&forum={$forum['forum_id']}&origin=$origin&search=" . "&gidReq={$forum['forum_of_group']}&forum={$forum['forum_id']}&search="
. Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')), . Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')),
'class' => return_visible_invisible($forum['visibility']) 'class' => return_visible_invisible($forum['visibility'])
) )

@ -65,11 +65,11 @@ if ($origin == 'learnpath') {
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.$current_forum_category['cat_id'].'&search='.Security::remove_XSS(urlencode($_GET['search'])), 'url' => 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.$current_forum_category['cat_id'].'&search='.Security::remove_XSS(urlencode($_GET['search'])),
'name' => prepare4display($current_forum_category['cat_title']), 'name' => prepare4display($current_forum_category['cat_title'])
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => 'viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&origin='.$origin.'&search='.Security::remove_XSS(urlencode($_GET['search'])), 'url' => 'viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&search='.Security::remove_XSS(urlencode($_GET['search'])),
'name' => prepare4display($current_forum['forum_title']), 'name' => prepare4display($current_forum['forum_title'])
); );
// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string // the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
@ -122,9 +122,9 @@ if ($message != 'PostDeletedSpecial') {
echo '<div style="float:right;">'; echo '<div style="float:right;">';
$my_url = '<a href="viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']).'&origin='.$origin.'&gradebook='.$gradebook.'&search='.Security::remove_XSS(urlencode($_GET['search'])); $my_url = '<a href="viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']).'&origin='.$origin.'&gradebook='.$gradebook.'&search='.Security::remove_XSS(urlencode($_GET['search']));
echo $my_url.'&view=flat&origin='.$origin.'">'.get_lang('FlatView').'</a> | '; echo $my_url.'&view=flat">'.get_lang('FlatView').'</a> | ';
echo $my_url.'&view=threaded&origin='.$origin.'">'.get_lang('ThreadedView').'</a> | '; echo $my_url.'&view=threaded">'.get_lang('ThreadedView').'</a> | ';
echo $my_url.'&view=nested&origin='.$origin.'">'.get_lang('NestedView').'</a>'; echo $my_url.'&view=nested">'.get_lang('NestedView').'</a>';
$my_url = null; $my_url = null;
echo '</div>'; echo '</div>';
// The reply to thread link should only appear when the forum_category is // The reply to thread link should only appear when the forum_category is

@ -44,7 +44,7 @@ if (isset($current_thread['thread_id'])) {
if (!empty($rows)) { if (!empty($rows)) {
$postCount = count($rows); $postCount = count($rows);
foreach ($rows as $row) { foreach ($rows as $row) {
if ($row['user_id'] == '0') { if ($row['user_id'] == '0') {
$name = prepare4display($row['poster_name']); $name = prepare4display($row['poster_name']);
@ -322,8 +322,7 @@ if (isset($current_thread['thread_id'])) {
if (($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) || if (($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) ||
(api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
) { ) {
$html .= '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&origin=' $html .= '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete_attach&id_attach='
. Security::remove_XSS($origin) . '&action=delete_attach&id_attach='
. $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id . $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id
. '" onclick="javascript:if(!confirm(\'' . '" onclick="javascript:if(!confirm(\''
. addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))

@ -85,7 +85,7 @@ foreach ($rows as $post) {
if (api_get_course_setting('allow_user_image_forum')) { if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>'; $html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>';
} }
$html .= Display::tag( $html .= Display::tag(
'p', 'p',
$name, $name,
@ -177,7 +177,7 @@ foreach ($rows as $post) {
if ($count > 0) { if ($count > 0) {
$iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq() $iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq()
. "&forum=$clean_forum_id&thread=$clean_thread_id&action=move&origin=$origin&post={$post['post_id']}" . "&forum=$clean_forum_id&thread=$clean_thread_id&action=move&post={$post['post_id']}"
. "\">" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . "</a>"; . "\">" . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) . "</a>";
} }
} }
@ -199,7 +199,7 @@ foreach ($rows as $post) {
if ($locked == false) { if ($locked == false) {
$iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq() $iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq()
. "&forum=$clean_forum_id&thread=$clean_thread_id&action=list&post={$post['post_id']}" . "&forum=$clean_forum_id&thread=$clean_thread_id&action=list&post={$post['post_id']}"
. "&user={$post['user_id']}&user_id={$post['user_id']}&origin=$origin" . "&user={$post['user_id']}&user_id={$post['user_id']}"
. "&idtextqualify=$current_qualify_thread" . "&idtextqualify=$current_qualify_thread"
. "\" >" . Display::return_icon('quiz.gif', get_lang('Qualify')) . "</a>"; . "\" >" . Display::return_icon('quiz.gif', get_lang('Qualify')) . "</a>";
} }
@ -319,8 +319,7 @@ foreach ($rows as $post) {
if (($current_forum['allow_edit'] == 1 && $post['user_id'] == $userId) || if (($current_forum['allow_edit'] == 1 && $post['user_id'] == $userId) ||
(api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
) { ) {
$html .= '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&origin=' $html .= '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete_attach&id_attach='
. Security::remove_XSS($_GET['origin']) . '&action=delete_attach&id_attach='
. $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id . $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id
. '" onclick="javascript:if(!confirm(\'' . '" onclick="javascript:if(!confirm(\''
. addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . '\')) return false;">' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) . '\')) return false;">'

@ -100,7 +100,7 @@ foreach ($rows as $post) {
$count_loop = ($count == 0) ? '&id=1' : ''; $count_loop = ($count == 0) ? '&id=1' : '';
$thread_structure .= "<a href=\"viewthread.php?" . api_get_cidreq() . $thread_structure .= "<a href=\"viewthread.php?" . api_get_cidreq() .
"&forum=" . $forumId . "&thread=" . $threadId . "&forum=" . $forumId . "&thread=" . $threadId .
"&post=" . $post['post_id'] . "&origin=$origin$count_loop\"" . "&post=" . $post['post_id'] . "$count_loop\"" .
"$class>" . prepare4display($post['post_title']) . "</a></div>"; "$class>" . prepare4display($post['post_title']) . "</a></div>";
$prev_next_array[] = $post['post_id']; $prev_next_array[] = $post['post_id'];
} }
@ -309,7 +309,7 @@ if (
if (!isset($_GET['id']) && $post_id > $post_minor) { if (!isset($_GET['id']) && $post_id > $post_minor) {
echo "<a href=\"viewthread.php?" . api_get_cidreq() . echo "<a href=\"viewthread.php?" . api_get_cidreq() .
"&forum=" . $forumId . "&thread=" . $threadId . "&forum=" . $forumId . "&thread=" . $threadId .
"&origin=" . $origin . "&action=move&post=" . "&action=move&post=" .
$rows[$display_post_id]['post_id'] . "\">" . $rows[$display_post_id]['post_id'] . "\">" .
Display::return_icon( Display::return_icon(
'move.png', 'move.png',
@ -363,7 +363,7 @@ if (($current_forum_category && $current_forum_category['locked'] == 0) &&
echo '<a href="reply.php?' . api_get_cidreq() . echo '<a href="reply.php?' . api_get_cidreq() .
'&forum=' . $forumId . '&thread=' . $threadId . '&forum=' . $forumId . '&thread=' . $threadId .
'&post=' . $rows[$display_post_id]['post_id'] . '&post=' . $rows[$display_post_id]['post_id'] .
'&action=replymessage&origin=' . $origin . '">' . '&action=replymessage">' .
Display::return_icon( Display::return_icon(
'message_reply_forum.png', 'message_reply_forum.png',
get_lang('ReplyToMessage') get_lang('ReplyToMessage')
@ -371,7 +371,7 @@ if (($current_forum_category && $current_forum_category['locked'] == 0) &&
echo '<a href="reply.php?' . api_get_cidreq() . echo '<a href="reply.php?' . api_get_cidreq() .
'&forum=' . $forumId . '&thread=' . $threadId . '&forum=' . $forumId . '&thread=' . $threadId .
'&post=' . $rows[$display_post_id]['post_id'] . '&post=' . $rows[$display_post_id]['post_id'] .
'&action=quote&origin=' . $origin . '">' . '&action=quote">' .
Display::return_icon( Display::return_icon(
'quote.gif', 'quote.gif',
get_lang('QuoteMessage') get_lang('QuoteMessage')
@ -437,10 +437,7 @@ if (!empty($attachment_list) && is_array($attachment_list)) {
(api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId))
) { ) {
echo '&nbsp;&nbsp;<a href="' . api_get_self() . '?' . echo '&nbsp;&nbsp;<a href="' . api_get_self() . '?' .
api_get_cidreq() . '&origin=' . api_get_cidreq() . '&action=delete_attach&id_attach=' .$attachment['id'] . '&forum=' . $forumId .
Security::remove_XSS($_GET['origin']) .
'&action=delete_attach&id_attach=' .
$attachment['id'] . '&forum=' . $forumId .
'&thread=' . $threadId . '&thread=' . $threadId .
'" onclick="javascript:if(!confirm(\'' . '" onclick="javascript:if(!confirm(\'' .
addslashes(api_htmlentities( addslashes(api_htmlentities(

@ -96,8 +96,7 @@ $edit_url = '';
if (api_is_allowed_to_edit(false, true) || if (api_is_allowed_to_edit(false, true) ||
GroupManager::is_tutor_of_group(api_get_user_id(), api_get_group_id()) GroupManager::is_tutor_of_group(api_get_user_id(), api_get_group_id())
) { ) {
$my_origin = isset($origin) ? $origin : ''; $edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'">'.
$edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'&origin='.$my_origin.'">'.
Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>'; Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>';
} }
@ -308,7 +307,6 @@ $tutor_info = '';
if (count($tutors) == 0) { if (count($tutors) == 0) {
$tutor_info = get_lang('GroupNoneMasc'); $tutor_info = get_lang('GroupNoneMasc');
} else { } else {
isset($origin) ? $my_origin = $origin:$my_origin='';
$tutor_info .= '<ul class="thumbnails">'; $tutor_info .= '<ul class="thumbnails">';
foreach ($tutors as $index => $tutor) { foreach ($tutors as $index => $tutor) {
$userInfo = api_get_user_info($tutor['user_id']); $userInfo = api_get_user_info($tutor['user_id']);

@ -1685,7 +1685,7 @@ class AnnouncementManager
$image_visibility="invisible"; $image_visibility="invisible";
$alt_visibility=get_lang('Visible'); $alt_visibility=get_lang('Visible');
} }
$modify_icons .= "<a href=\"".$actionUrl."&origin=".$origin."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">". $modify_icons .= "<a href=\"".$actionUrl."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">".
Display::return_icon($image_visibility.'.png', $alt_visibility,'',ICON_SIZE_SMALL)."</a>"; Display::return_icon($image_visibility.'.png', $alt_visibility,'',ICON_SIZE_SMALL)."</a>";
// DISPLAY MOVE UP COMMAND only if it is not the top announcement // DISPLAY MOVE UP COMMAND only if it is not the top announcement

@ -123,7 +123,6 @@ class GlossaryManager
} }
return false; return false;
} else { } else {
$params = [ $params = [
'glossary_id' => 0, 'glossary_id' => 0,
'c_id' => api_get_course_int_id(), 'c_id' => api_get_course_int_id(),
@ -189,7 +188,6 @@ class GlossaryManager
glossary_id = ".intval($values['glossary_id']); glossary_id = ".intval($values['glossary_id']);
$result = Database::query($sql); $result = Database::query($sql);
if ($result === false) { if ($result === false) {
return false; return false;
} }
@ -321,7 +319,6 @@ class GlossaryManager
$glossaryInfo = self::get_glossary_information($glossary_id); $glossaryInfo = self::get_glossary_information($glossary_id);
if (empty($glossaryInfo)) { if (empty($glossaryInfo)) {
return false; return false;
} }

@ -266,11 +266,11 @@ class GradeModel extends Model
*/ */
public function fill_grade_model_select_in_form(&$form, $name = 'gradebook_model_id', $default_value = null) public function fill_grade_model_select_in_form(&$form, $name = 'gradebook_model_id', $default_value = null)
{ {
if (api_get_setting('gradebook_enable_grade_model') == 'false') { if (api_get_setting('gradebook_enable_grade_model') === 'false') {
return false; return false;
} }
if (api_get_setting('teachers_can_change_grade_model_settings') == 'true' || api_is_platform_admin()) { if (api_get_setting('teachers_can_change_grade_model_settings') === 'true' || api_is_platform_admin()) {
$grade_models = $this->get_all(); $grade_models = $this->get_all();
$grade_model_options = array('-1' => get_lang('None')); $grade_model_options = array('-1' => get_lang('None'));
if (!empty($grade_models)) { if (!empty($grade_models)) {

@ -229,7 +229,7 @@ class GroupManager
$unique_name = $newFolderData['path']; $unique_name = $newFolderData['path'];
/* Stores the directory path into the group table */ /* Stores the directory path into the group table */
$sql = "UPDATE ".$table_group." SET $sql = "UPDATE $table_group SET
name = '".Database::escape_string($name)."', name = '".Database::escape_string($name)."',
secret_directory = '".$unique_name."' secret_directory = '".$unique_name."'
WHERE c_id = $course_id AND id ='".$lastId."'"; WHERE c_id = $course_id AND id ='".$lastId."'";
@ -287,6 +287,7 @@ class GroupManager
return $lastId; return $lastId;
} }
/** /**
* Create subgroups. * Create subgroups.
* This function creates new groups based on an existing group. It will * This function creates new groups based on an existing group. It will
@ -344,7 +345,7 @@ class GroupManager
*/ */
public static function create_class_groups($category_id) public static function create_class_groups($category_id)
{ {
$options['where'] = array(" usergroup.course_id = ? " => api_get_course_int_id()); $options['where'] = array(" usergroup.course_id = ? " => api_get_course_int_id());
$obj = new UserGroup(); $obj = new UserGroup();
$classes = $obj->getUserGroupInCourse($options); $classes = $obj->getUserGroupInCourse($options);
$group_ids = array(); $group_ids = array();
@ -356,7 +357,7 @@ class GroupManager
0, 0,
count($users_ids) count($users_ids)
); );
self::subscribe_users($users_ids,$group_id); self::subscribe_users($users_ids, $group_id);
$group_ids[] = $group_id; $group_ids[] = $group_id;
} }
return $group_ids; return $group_ids;
@ -382,13 +383,13 @@ class GroupManager
$forum_table = Database:: get_course_table(TABLE_FORUM); $forum_table = Database:: get_course_table(TABLE_FORUM);
$group_ids = is_array($group_ids) ? $group_ids : array ($group_ids); $group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
$group_ids = array_map('intval',$group_ids); $group_ids = array_map('intval', $group_ids);
if (api_is_course_coach()) { if (api_is_course_coach()) {
//a coach can only delete courses from his session //a coach can only delete courses from his session
for ($i = 0; $i < count($group_ids); $i++) { for ($i = 0; $i < count($group_ids); $i++) {
if (!api_is_element_in_the_session(TOOL_GROUP,$group_ids[$i])) { if (!api_is_element_in_the_session(TOOL_GROUP, $group_ids[$i])) {
array_splice($group_ids,$i,1); array_splice($group_ids, $i, 1);
$i--; $i--;
} }
} }
@ -772,7 +773,7 @@ class GroupManager
WHERE c_id = $course_id AND category_id='".$cat_id."'"; WHERE c_id = $course_id AND category_id='".$cat_id."'";
$res = Database::query($sql); $res = Database::query($sql);
if (Database::num_rows($res) > 0) { if (Database::num_rows($res) > 0) {
$groups_to_delete = array (); $groups_to_delete = array();
while ($group = Database::fetch_object($res)) { while ($group = Database::fetch_object($res)) {
$groups_to_delete[] = $group->id; $groups_to_delete[] = $group->id;
} }
@ -1152,7 +1153,7 @@ class GroupManager
while ($row = Database::fetch_array($rs)) { while ($row = Database::fetch_array($rs)) {
$result[] = $row['user_id']; $result[] = $row['user_id'];
} }
return $result; return $result;
} }
@ -1295,8 +1296,9 @@ class GroupManager
$sql = "SELECT COUNT(*) AS number_of_students $sql = "SELECT COUNT(*) AS number_of_students
FROM $table_group_user FROM $table_group_user
WHERE c_id = $course_id AND group_id = $group_id"; WHERE c_id = $course_id AND group_id = $group_id";
$db_result = Database::query($sql); $result = Database::query($sql);
$db_object = Database::fetch_object($db_result); $db_object = Database::fetch_object($result);
return $db_object->number_of_students; return $db_object->number_of_students;
} }
@ -1343,8 +1345,8 @@ class GroupManager
g.c_id = $course_id AND g.c_id = $course_id AND
gu.user_id = $user_id AND gu.user_id = $user_id AND
g.id = gu.group_id $cat_condition"; g.id = gu.group_id $cat_condition";
$db_result = Database::query($sql); $result = Database::query($sql);
$db_object = Database::fetch_object($db_result); $db_object = Database::fetch_object($result);
return $db_object->number_of_groups; return $db_object->number_of_groups;
} }
@ -1408,7 +1410,7 @@ class GroupManager
*/ */
public static function is_subscribed($user_id, $group_id) public static function is_subscribed($user_id, $group_id)
{ {
if (empty($user_id) or empty($group_id)) { if (empty($user_id) || empty($group_id)) {
return false; return false;
} }
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER); $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
@ -1674,6 +1676,7 @@ class GroupManager
$sql = 'DELETE FROM '.$table_group_user.' $sql = 'DELETE FROM '.$table_group_user.'
WHERE group_id IN ('.implode(',', $group_ids).') AND c_id = '.$course_id; WHERE group_id IN ('.implode(',', $group_ids).') AND c_id = '.$course_id;
$result = Database::query($sql); $result = Database::query($sql);
return $result; return $result;
} }
return true; return true;

@ -50,7 +50,7 @@ class Import
* $result [1]['FirstName'] = 'Adam'; * $result [1]['FirstName'] = 'Adam';
* ... * ...
* @param string $filename The path to the CSV-file which should be imported. * @param string $filename The path to the CSV-file which should be imported.
* @return array Returns an array (in the system encoding) that contains all data from the CSV-file. * @return array Returns an array (in the system encoding) that contains all data from the CSV-file.
* *
* *
* @deprecated use cvs_reader instead * @deprecated use cvs_reader instead

@ -4613,10 +4613,9 @@ class SurveyUtil
echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY); echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY);
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/fillsurvey.php?course='.$_course['sysCode'].'&invitationcode='.$row['invitation_code'].'&cidReq='.$_course['sysCode'].'">'.$row['title'].'</a></td>'; echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/fillsurvey.php?course='.$_course['sysCode'].'&invitationcode='.$row['invitation_code'].'&cidReq='.$_course['sysCode'].'">'.$row['title'].'</a></td>';
} else { } else {
//echo '<td>'.$row['title'].'</td>';
echo '<td>'; echo '<td>';
echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY); echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY);
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&cidReq='.$_course['sysCode'].'&id_session='.$row['session_id'].'&gidReq='.'0'.'&origin='.''.'&survey_id='.$row['survey_id'].'">'.$row['title'].'</a></td>'; echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&cidReq='.$_course['sysCode'].'&id_session='.$row['session_id'].'&gidReq=0&origin=&survey_id='.$row['survey_id'].'">'.$row['title'].'</a></td>';
} }
echo '<td class="center">'; echo '<td class="center">';
echo ($row['anonymous'] == 1) ? get_lang('Yes') : get_lang('No'); echo ($row['anonymous'] == 1) ? get_lang('Yes') : get_lang('No');

@ -34,19 +34,19 @@ function display_action_links($id, $cur_dir_path, $action)
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : ''; $origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
if (!empty($id)) { if (!empty($id)) {
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'&id='.$my_back_id.'">'. $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&gradebook='.$gradebook.'&id='.$my_back_id.'">'.
Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
} }
if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') { if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') {
// Create dir // Create dir
if (empty($id)) { if (empty($id)) {
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir&origin='.$origin.'&gradebook='.$gradebook.'">'; $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir&gradebook='.$gradebook.'">';
$display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'),'',ICON_SIZE_MEDIUM).'</a>'; $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'),'',ICON_SIZE_MEDIUM).'</a>';
} }
if (empty($id)) { if (empty($id)) {
// Options // Options
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=settings&origin='.$origin.'&gradebook='.$gradebook.'">'; $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=settings&gradebook='.$gradebook.'">';
$display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).'</a>'; $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).'</a>';
} }
$display_output .= '<a id="open-view-list" href="#">' . Display::return_icon('listwork.png', get_lang('ViewStudents'),'',ICON_SIZE_MEDIUM) . '</a>'; $display_output .= '<a id="open-view-list" href="#">' . Display::return_icon('listwork.png', get_lang('ViewStudents'),'',ICON_SIZE_MEDIUM) . '</a>';

Loading…
Cancel
Save