true, 'text' => '' . html_print_image("images/list.png", true, array("title" => __('GIS Maps list'))) .''); ui_print_page_header(__('GIS Maps'), "images/op_gis.png", false, "configure_gis_map", false, $buttons); $own_info = get_user_info($config['id_user']); if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "MM")) $display_default_column = true; else $display_default_column = false; $edit_gis_maps = false; if (check_acl ($config['id_user'], 0, "MW") || check_acl ($config['id_user'], 0, "MM")) { $edit_gis_maps = true; } if (is_ajax ()) { $action = get_parameter('action'); $id_map = get_parameter('id_map'); // Set to not default the actual default map $returnOperationDB = db_process_sql_update('tgis_map', array('default_map' => 0), array('default_map' => 1)); // Set default the new default map $returnOperationDB = db_process_sql_update('tgis_map', array('default_map' => 1), array('id_tgis_map' => $id_map)); if ($returnOperationDB === false) $data['correct'] = false; else $data['correct'] = true; echo json_encode($data); return; } $action = get_parameter('action'); switch ($action) { case 'delete_map': $idMap = get_parameter('map_id'); $result = gis_delete_map($idMap); ui_print_result_message($result, __('Successfully deleted'), __('Could not be deleted')); break; } $maps = gis_get_maps(); $table = new stdClass(); $table->width = "100%"; $table->class = "databox data"; $table->head = array (); $table->head['name'] = __('Name'); $table->head['group'] = __('Group'); if ($edit_gis_maps) { if ($display_default_column) $table->head['default'] = __('Default'); $table->head['op'] = '' . __('Op.') . ''; } $table->headstyle = array(); $table->headstyle['name'] = 'text-align: left;'; $table->headstyle['group'] = 'text-align: center;'; if ($edit_gis_maps) { if ($display_default_column) $table->headstyle['default'] = 'text-align: center;'; $table->headstyle['op'] = 'text-align: center;'; } $table->size = array(); $table->size['name'] = "80%"; $table->size['group'] = "30"; if ($edit_gis_maps) { if ($display_default_column) $table->size['default'] = "30"; $table->size['op'] = "60"; } $table->align = array (); $table->align['name'] = 'left'; $table->align['group'] = 'center'; if ($edit_gis_maps) { if ($display_default_column) $table->align['default'] = 'center'; $table->align['op'] = 'center'; } $table->data = array (); $rowPair = true; $iterator = 0; if ($maps !== false) { foreach ($maps as $map) { if (!check_acl ($config["id_user"], $map["group_id"], "MR") && !check_acl ($config["id_user"], $map["group_id"], "MW") && !check_acl ($config["id_user"], $map["group_id"], "MM")) { continue; } if ($rowPair) $table->rowclass[$iterator] = 'rowPair'; else $table->rowclass[$iterator] = 'rowOdd'; $rowPair = !$rowPair; $iterator++; $data = array (); $data['name'] = '' . $map['map_name'].' '; $data['group'] = ui_print_group_icon ($map["group_id"], true); if ($edit_gis_maps) { if ($display_default_column) { $checked = false; if ($map['default_map']) { $checked = true; $defaultMapId = $map['id_tgis_map']; } $data['default'] = html_print_radio_button_extended('default_map', $map['id_tgis_map'], '', $checked, false, "setDefault(" . $map['id_tgis_map'] . ");", '', true); } $data['op'] = '' . html_print_image ("images/config.png", true, array('title' => __('Edit'))).' ' . '' . html_print_image ("images/cross.png", true, array('title' => __('Delete'))).''; } array_push ($table->data, $data); } } if (!empty ($table->data)) { html_print_table ($table); } else { echo '