123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- require_once '../global.inc.php';
- $action = $_GET['a'];
- switch ($action) {
- case 'set_visibility':
- if(api_is_allowed_to_edit(null,true)) {
- $tool_table = Database::get_course_table(TABLE_TOOL_LIST);
- $tool_id = Security::remove_XSS($_GET["id"]);
- $tool_info = api_get_tool_information($tool_id);
- $tool_visibility = $tool_info['visibility'];
- $tool_image = $tool_info['image'];
- $new_image = str_replace('.gif','_na.gif',$tool_image);
- $requested_image = ($tool_visibility == 0 ) ? $tool_image : $new_image;
- $requested_clase = ($tool_visibility == 0 ) ? 'visible' : 'invisible';
- $requested_message = ($tool_visibility == 0 ) ? 'is_active' : 'is_inactive';
- $requested_view = ($tool_visibility == 0 ) ? 'visible.gif' : 'invisible.gif';
- $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;
-
- $requested_view = ($tool_visibility == 0 ) ? 'visible.gif' : 'invisible.gif';
- $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;
-
- if ($_GET["id"]==strval(intval($_GET["id"]))) {
-
-
-
-
- $sql="UPDATE $tool_table SET visibility=$requested_visible WHERE id='".$_GET["id"]."'";
- Database::query($sql,__FILE__,__LINE__);
- }
-
-
-
- $response_data = array(
- 'image' => $requested_image,
- 'tclass' => $requested_clase,
- 'message' => $requested_message,
- 'view' => $requested_view
- );
- print(json_encode($response_data));
- }
- break;
- default:
- echo '';
- }
- exit;
- ?>
|