0
$sql = "UPDATE $tool_table SET visibility=0 WHERE c_id = $course_id AND id='".$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='".$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 .= '
';
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);
$blocks[] = [
'title' => get_lang('Authoring'),
'content' => CourseHome::show_tools_category($my_list),
];
$my_list = CourseHome::get_tools_category(TOOL_INTERACTION);
$blocks[] = [
'title' => get_lang('Interaction'),
'content' => CourseHome::show_tools_category($my_list),
];
$my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM);
$blocks[] = [
'title' => get_lang('Administration'),
'content' => CourseHome::show_tools_category($my_list),
];
} 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 .= '
';
}
$my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
$blocks[] = [
'class' => 'Authoringview',
'content' => CourseHome::show_tools_category($my_list),
];
// TOOLS AUTHORING
} else {
$my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
if (count($my_list) > 0) {
//ordering by get_lang name
$order_tool_list = [];
foreach ($my_list as $key => $new_tool) {
$tool_name = CourseHome::translate_tool_name($new_tool);
$order_tool_list[$key] = $tool_name;
}
natsort($order_tool_list);
$my_temp_tool_array = [];
foreach ($order_tool_list as $key => $new_tool) {
$my_temp_tool_array[] = $my_list[$key];
}
$blocks[] = [
'class' => 'course-student-view-activity-3col',
'content' => CourseHome::show_tools_category($my_temp_tool_array),
];
}
}
$activityView = new Template('', false, false, false, false, false, false);
$activityView->assign('blocks', $blocks);
$content .= $activityView->fetch(
$activityView->get_template('course_home/vertical_activity.tpl')
);