Remove use of "gradebook" in URLs already added by api_get_cidreq()

pull/2487/head
jmontoyaa 8 years ago
parent bb63c0f019
commit 100a1dfede
  1. 6
      main/exercise/exercise_report.php
  2. 3
      main/exercise/overview.php
  3. 4
      main/exercise/stats.php
  4. 39
      main/forum/forumfunction.inc.php
  5. 28
      main/forum/forumqualify.php
  6. 18
      main/forum/reply.php
  7. 3
      main/forum/viewforum.php
  8. 3
      main/forum/viewpost.php
  9. 2
      main/forum/viewthread.php
  10. 6
      main/forum/viewthread_flat.inc.php
  11. 17
      main/forum/viewthread_threaded.inc.php
  12. 1
      main/gradebook/exercise_jump.php
  13. 14
      main/lp/learnpath.class.php
  14. 6
      main/lp/lp_build.php
  15. 1
      main/lp/lp_edit.php
  16. 37
      main/work/work.lib.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();

@ -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));

@ -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(

@ -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').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'">'.
get_lang('Forum').'</a><br />';
$message .= get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&gradebook='.$gradebook.'&thread='.$lastThread->getIid().'">'.
$message .= get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&thread='.$lastThread->getIid().'">'.
get_lang('Message').'</a>';
}
$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').'<br />';
$message .= get_lang('ReturnTo').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&">'.get_lang('Forum').'</a><br />';
$message .= get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&gradebook='.$gradebook.'&thread='.$values['thread_id'].'&post='.Security::remove_XSS($_GET['post']).'">'.get_lang('Message').'</a>';
$message .= get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.$values['thread_id'].'&post='.Security::remove_XSS($_GET['post']).'">'.get_lang('Message').'</a>';
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).'</a> &gt; ';
$search_results_item .= '<a href="viewforum.php?'.api_get_cidreq().'&forum='.$forumId.'&search='.urlencode($search_term).'">'.
prepare4display($forum_list[$row['forum_id']]['forum_title']).'</a> &gt; ';
$search_results_item .= '<a href="viewthread.php?'.api_get_cidreq().'&forum='.$forumId.'&gradebook='.$gradebook.'&thread='.$row['thread_id'].'&search='.urlencode($search_term).'">'.
$search_results_item .= '<a href="viewthread.php?'.api_get_cidreq().'&forum='.$forumId.'&thread='.$row['thread_id'].'&search='.urlencode($search_term).'">'.
prepare4display($row['post_title']).'</a>';
$search_results_item .= '<br />';
if (api_strlen($row['post_title']) > 200) {

@ -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 '<h4>'.get_lang('QualificationChangesHistory').'</h4>';
if (isset($_GET['type']) && $_GET['type'] === 'false') {
$buttons = '<a class="btn btn-default" href="forumqualify.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&origin='.$origin.'&thread='.$threadId.'&user='.intval($_GET['user']).'&user_id='.intval($_GET['user_id']).'&type=true&idtextqualify='.$score.$view_gradebook.'#history">'.
$buttons = '<a class="btn btn-default" href="forumqualify.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&origin='.$origin.'&thread='.$threadId.'&user='.intval($_GET['user']).'&user_id='.intval($_GET['user_id']).'&type=true&idtextqualify='.$score.'#history">'.
get_lang('MoreRecent').'</a> <a class="btn btn-default disabled" >'.get_lang('Older').'</a>';
} else {
$buttons = '<a class="btn btn-default">'.get_lang('MoreRecent').'</a>
<a class="btn btn-default" href="forumqualify.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&origin='.$origin.'&thread='.$threadId.'&user='.intval($_GET['user']).'&user_id='.intval($_GET['user_id']).'&type=false&idtextqualify='.$score.$view_gradebook.'#history">'.
<a class="btn btn-default" href="forumqualify.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&origin='.$origin.'&thread='.$threadId.'&user='.intval($_GET['user']).'&user_id='.intval($_GET['user_id']).'&type=false&idtextqualify='.$score.'#history">'.
get_lang('Older').'</a>';
}

@ -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 '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
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>';
echo '<a href="viewthread.php?'.api_get_cidreq().'&forum='.$forumId.'&thread='.$threadId.'">';
echo Display::return_icon(
'back.png',
get_lang('BackToThread'),
'',
ICON_SIZE_MEDIUM
).'</a>';
echo '</div>';
}
/*New display forum div*/

@ -338,8 +338,7 @@ echo '<div class="actions">';
if ($origin != 'learnpath') {
if (!empty($groupId)) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'group/group_space.php?'
. api_get_cidreq().'&gradebook='.$gradebook.'">'
echo '<a href="'.api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq().'">'
. Display::return_icon('back.png', get_lang('BackTo')
. ' '.get_lang('Groups'), '', ICON_SIZE_MEDIUM).'</a>';
} else {

@ -108,9 +108,8 @@ if ($message != 'PostDeletedSpecial') {
increase_thread_view($_GET['thread']);
/* Action Links */
echo '<div style="float:right;">';
$my_url = '<a href="viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread']).'&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']).'&search='.Security::remove_XSS(urlencode($_GET['search']));
echo $my_url.'&view=flat">'.get_lang('FlatView').'</a> | ';
echo $my_url.'&view=threaded">'.get_lang('ThreadedView').'</a> | ';
echo $my_url.'&view=nested">'.get_lang('NestedView').'</a>';

@ -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.

@ -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']) {

@ -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 '<center style="margin-top: 10px; margin-bottom: 10px;">';
// Go to: first and previous

@ -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'])) {

@ -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 .= '<div id="actions_lp" class="actions_lp"><hr>';
$html .= '<div class="btn-group">';
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=".$this->lp_id."&isStudentView=false' target='_parent'>".
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&action=build&lp_id=".$this->lp_id."&isStudentView=false' target='_parent'>".
Display::returnFontAwesomeIcon('street-view').get_lang('Overview')."</a>";
$html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&action=add_item&type=step&lp_id=".$this->lp_id."&isStudentView=false' target='_parent'>".
Display::returnFontAwesomeIcon('pencil').get_lang('Edit')."</a>";
$html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=".$this->lp_id.'&isStudentView=false">'.
$html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&action=edit&lp_id=".$this->lp_id.'&isStudentView=false">'.
Display::returnFontAwesomeIcon('cog').get_lang('Settings').'</a>';
$html .= '</div>';
$html .= '</div>';
@ -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,

@ -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 '<ul id="lp_overview" class="thumbnails">';
echo show_block(
'lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=add_item&type=step&lp_id='.$_SESSION['oLP']->lp_id,
'lp_controller.php?'.api_get_cidreq().'&action=add_item&type=step&lp_id='.$_SESSION['oLP']->lp_id,
get_lang("NewStep"),
get_lang('NewStepComment'),
'tools.png'
);
echo show_block(
'lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=view&lp_id='.$_SESSION['oLP']->lp_id,
'lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$_SESSION['oLP']->lp_id,
get_lang("Display"),
get_lang('DisplayComment'),
'view.png'

@ -49,7 +49,6 @@ function activate_end_date() {
</script>';
$gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
$defaults = array();
$form = new FormValidator(
'form1',

@ -24,8 +24,6 @@ use Chamilo\CourseBundle\Entity\CStudentPublication;
*/
function display_action_links($id, $cur_dir_path, $action)
{
global $gradebook;
$id = $my_back_id = intval($id);
if ($action == 'list') {
$my_back_id = 0;
@ -35,26 +33,47 @@ function display_action_links($id, $cur_dir_path, $action)
$origin = api_get_origin();
if (!empty($id)) {
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&gradebook='.$gradebook.'&id='.$my_back_id.'">'.
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$my_back_id.'">'.
Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
}
if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') {
// Create dir
if (empty($id)) {
$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 .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir">';
$display_output .= Display::return_icon(
'new_work.png',
get_lang('CreateAssignment'),
'',
ICON_SIZE_MEDIUM
).
'</a>';
}
if (empty($id)) {
// Options
$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 .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=settings">';
$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>';
}
if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath' && api_is_allowed_to_session_edit(false, true)) {
if (api_is_allowed_to_edit(null, true) &&
$origin != 'learnpath' &&
api_is_allowed_to_session_edit(false, true)
) {
// Delete all files
if (api_get_setting('permanently_remove_deleted_files') == 'true') {
$message = get_lang('ConfirmYourChoiceDeleteAllfiles');

Loading…
Cancel
Save