Fixing the work add link

skala
Julio Montoya 14 years ago
parent 08e25812e6
commit abff56c1c2
  1. 4
      main/work/work.lib.php
  2. 12
      main/work/work.php

@ -17,7 +17,6 @@ require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'fileDisplay.lib.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
/**
* Displays action links (for admins, authorized groups members and authorized students)
* @param string Current dir
@ -34,8 +33,7 @@ function display_action_links($id, $cur_dir_path, $show_tool_options, $display_u
}
$display_output = '';
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
if (!empty($cur_dir_path)) {
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'&id='.$my_back_id.'">'.Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';

@ -264,7 +264,7 @@ if (!in_array($action, array('send_mail','add', 'upload'))) {
$token = Security::get_token();
}
$show_tool_options = $action == 'list' ? true : false;
$show_tool_options = (in_array($action, array('list', 'add'))) ? true : false;
$display_upload_link = $action == 'upload_form' ? false : true;
if ($is_special) {
@ -386,9 +386,7 @@ switch ($action) {
$defaults['document'] = '<a href="' . format_url($submitGroupWorkUrl) . '">' . $realUrl . '</a>';
$text_document->freeze();
} elseif ($item_id && ($is_allowed_to_edit or $is_author)) {
$workUrl = $currentCourseRepositoryWeb . $workUrl;
$form->addElement('html', $html);
$workUrl = $currentCourseRepositoryWeb . $workUrl;
} else {
// else standard upload option
$form->addElement('file', 'file', get_lang('UploadADocument'), 'size="40" onchange="updateDocumentTitle(this.value)"');
@ -598,9 +596,9 @@ switch ($action) {
}
break;
case 'add':
/*
$fexpire = get_date_from_select('expires');
$fend = get_date_from_select('ends');
$fend = get_date_from_select('ends');*/
$directory = Security::remove_XSS($_POST['new_dir']);
$directory = replace_dangerous_char($directory);
@ -956,7 +954,7 @@ switch ($action) {
case 'move':
case 'move_to':
case 'list':
if ($action == 'mark_work') {
if ($action == 'mark_work') {
}
/* Move file command */
if ($is_allowed_to_edit && $action == 'move_to') {

Loading…
Cancel
Save