Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
*
*/
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"/>