function change_disable_option($data) { $panel = $data['panel']; $user = $data['user']; ossim_valid($panel, OSS_DIGIT, 'illegal:' . _("Tab")); ossim_valid($user, OSS_USER, 'illegal:' . _("User")); if (ossim_error()) { $info_error = "Error: " . ossim_get_error(); ossim_clean_error(); $return['error'] = TRUE; $return['msg'] = $info_error; return $return; } if (!get_user_valid($user)) { $return['error'] = TRUE; $return['msg'] = _('You do not have permission to modify this tab'); return $return; } try { $tab = new Dashboard_tab($panel, $user); $tab->set_visible(1 - intval($tab->is_visible())); $tab->save_db(); } catch (Exception $e) { $return['error'] = TRUE; $return['msg'] = $e->getMessage(); return $return; } $return['error'] = FALSE; $return['msg'] = _("Visibility Option Changed Successfully"); return $return; }
function change_visibility($data) { $panel = $data['panel']; ossim_valid($panel, OSS_DIGIT, 'illegal:' . _("Tab")); if (ossim_error()) { $info_error = "Error: " . ossim_get_error(); ossim_clean_error(); $return['error'] = TRUE; $return['msg'] = $info_error; return $return; } list($user, $edit) = get_tabs_data_aux(); if (!$edit) { $return['error'] = TRUE; $return['msg'] = _("You have to be in edit mode to achieve this action"); return $return; } try { $tab = new Dashboard_tab($panel); if ($tab->is_visible() && $tab->is_default()) { $return['error'] = TRUE; $return['msg'] = _("Default tab cannot be disabled"); return $return; } $tab->set_visible(1 - intval($tab->is_visible())); $tab->save_db(); } catch (Exception $e) { $return['error'] = TRUE; $return['msg'] = $e->getMessage(); return $return; } $return['error'] = FALSE; $return['msg'] = _("Visibility Option Changed Successfully"); return $return; }
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt * */ require_once 'av_init.php'; Session::logcheck("dashboard-menu", "ControlPanelExecutive"); $id = GET("id"); ossim_valid($id, OSS_DIGIT, 'illegal:' . _("Tab ID")); if (ossim_error()) { die(ossim_error()); } try { $tab = new Dashboard_tab($id); } catch (Exception $e) { die($e->getMessage()); } $enable = $tab->is_visible() ? _("Hide Tab") : _("Show Tab"); if ($tab->is_default()) { $default = "<div class='div_list ui-icon ui-icon-circle-check'></div><span>" . _("Default Tab") . "</span>"; } else { $default = "<a class='default_tab' href='javascript:;'><div class='div_list ui-icon ui-icon-check'></div><span>" . _("Set Default") . "</span></a>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title> <?php echo gettext("OSSIM Framework"); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Pragma" content="no-cache"/>