diff --git a/main/work/work.lib.php b/main/work/work.lib.php index d4e3d1a091..6f97429140 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.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 .= ''.Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).''; diff --git a/main/work/work.php b/main/work/work.php index 9e23b9e4e4..6d5d1749bc 100644 --- a/main/work/work.php +++ b/main/work/work.php @@ -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'] = '' . $realUrl . ''; $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') {