0 /* -- session condition for visibility if (!empty($session_id)) { $sql = "select session_id FROM $tool_table WHERE id='".intval($_GET["id"])."' AND session_id = '".intval($session_id)."'"; $rs = Database::query($sql); if (Database::num_rows($rs) > 0) { $sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."' AND session_id = '".intval($session_id)."'"; } else { $sql_select = "select * FROM $tool_table WHERE id='".$_GET["id"]."'"; $res_select = Database::query($sql_select); $row_select = Database::fetch_array($res_select); $sql = "INSERT INTO $tool_table(name,link,image,visibility,admin,address,added_tool,target,category,session_id) VALUES('{$row_select['name']}','{$row_select['link']}','{$row_select['image']}','0','{$row_select['admin']}','{$row_select['address']}','{$row_select['added_tool']}','{$row_select['target']}','{$row_select['category']}','$session_id')"; } } else { $sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."'"; }*/ $sql = "UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."'"; Database::query($sql); Display::display_confirmation_message(get_lang('ToolIsNowHidden')); } elseif (!empty($_GET['restore'])) { // visibility 0,2 -> 1 // REACTIVATE $sql = "UPDATE $tool_table SET visibility=1 WHERE id='".intval($_GET["id"])."'"; Database::query($sql); Display::display_confirmation_message(get_lang('ToolIsNowVisible')); } } // 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'])) { ?>

     | 
0) { ?>
0) { ?>
0) { echo '
'; //ordering by get_lang name $order_tool_list = array(); 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 = array(); foreach($order_tool_list as $key=>$new_tool) { $my_temp_tool_array[] = $my_list[$key]; } $my_list = $my_temp_tool_array; $i = 0; foreach($my_list as $new_tool) { if ($i >= 10) { $my_list2[] = $new_tool; } else { $my_list1[] = $new_tool; } $i++; } CourseHome::show_tools_category($my_list1); CourseHome::show_tools_category($my_list2); echo '
'; } } ?>