0 $sql = "UPDATE $tool_table SET visibility=0 WHERE c_id = $course_id AND id='".intval($_GET["id"])."'"; Database::query($sql); $show_message = Display::return_message(get_lang('ToolIsNowHidden'), 'confirmation'); } elseif (!empty($_GET['restore'])) { // visibility 0,2 -> 1 // REACTIVATE $sql = "UPDATE $tool_table SET visibility=1 WHERE c_id = $course_id AND id='".intval($_GET["id"])."'"; Database::query($sql); $show_message = Display::return_message(get_lang('ToolIsNowVisible'), 'confirmation'); } } // Work with data post askable by admin of course if (api_is_platform_admin()) { // Show message to confirm that a tool it to be hidden from available tools // visibility 0,1->2 if (!empty($_GET['askDelete'])) { $content .='
'; } elseif (isset($_GET['delete']) && $_GET['delete']) { /* * Process hiding a tools from available tools. */ //where $id is set? $id = intval($id); Database::query("DELETE FROM $tool_table WHERE c_id = $course_id AND id='$id' AND added_tool=1"); } } // COURSE ADMIN ONLY VIEW // Start of tools for CourseAdmins (teachers/tutors) if (api_is_allowed_to_edit(null, true) && !api_is_coach()) { $current_protocol = $_SERVER['SERVER_PROTOCOL']; $current_host = $_SERVER['HTTP_HOST']; $server_protocol = substr($current_protocol, 0, strrpos($current_protocol, '/')); $server_protocol = $server_protocol.'://'; if ($current_host == 'localhost') { // Get information of path $info = explode('courses', api_get_self()); $path_work = substr($info[0], 1); } else { $path_work = ''; } $content .= '