1
// REACTIVATE
$sql = "UPDATE $tool_table SET visibility=1 WHERE c_id = $course_id AND id=".$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()) {
$content .= '
';
$content .= '
';
$content .= get_lang('PleaseStandBy');
$content .= '
';
if (api_get_setting('show_session_data') == 'true' && $session_id > 0) {
$content .= '
'.get_lang('SessionData').'
'.CourseHome::show_session_data($session_id).'
';
}
$my_list = CourseHome::get_tools_category(TOOL_AUTHORING);
$items = CourseHome::show_tools_category($my_list);
$content .= return_block(get_lang('Authoring'), $items);
$my_list = CourseHome::get_tools_category(TOOL_INTERACTION);
$list2 = CourseHome::get_tools_category(TOOL_COURSE_PLUGIN);
$my_list = array_merge($my_list,$list2);
$items = CourseHome::show_tools_category($my_list);
$content .= return_block(get_lang('Interaction'), $items);
$my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM);
$items = CourseHome::show_tools_category($my_list);
$content .= return_block(get_lang('Administration'), $items);
} elseif (api_is_coach()) {
if (api_get_setting('show_session_data') == 'true' && $session_id > 0) {
$content .= '
'.get_lang('SessionData').'
';
$content .= CourseHome::show_session_data($session_id);
$content .= '
';
}
$content .= '';
$my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
$content .= CourseHome::show_tools_category($my_list);
$content .= '
';
// TOOLS AUTHORING
} else {
$my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
if (count($my_list) > 0) {
$content .= '';
$content .= CourseHome::show_tools_category($my_list);
$content .= '
';
}
}
function return_block($title, $content) {
$html = ''.$content.'
';
return $html;
}