function draw_users_list($conn, $user) { $columns = "<div class='column'>"; $columns .= draw_user_header($conn, $user); $columns .= "<div id='col_" . $user->login . "' class='column_body tab_list'>"; $tabs = Dashboard_tab::get_tabs_by_user($user->login, true); foreach ($tabs as $t) { $display = $t->is_visible() ? '' : 'tab_hidden'; if ($t->is_locked()) { $class_tab = 'tab_protected tab' . $user->login; $classmenu = 'menuPermsProtected'; } else { $class_tab = 'tab_unprotected'; $classmenu = 'menuPerms'; } $title = strlen($t->get_title()) > 20 ? substr($t->get_title(), 0, 17) . "..." : $t->get_title(); $columns .= "<div id='" . $user->login . "#" . $t->get_id() . "' tab_id='" . $t->get_id() . "' class='tab {$class_tab} {$display}'>"; $columns .= "<div class='db_perm_tab_title' title=\"" . $t->get_title() . "\">" . $title . "</div>"; $columns .= "<div title='" . _("Click to see Tab Options") . "' id='" . ($user->login . ";" . $t->get_id()) . "' class='db_perm_tab_icon ui-icon ui-icon-wrench {$classmenu}'></div>"; $columns .= "</div>"; } $columns .= "</div>"; return $columns; }
* MA 02110-1301 USA * * * On Debian GNU/Linux systems, the complete text of the GNU General * Public License can be found in `/usr/share/common-licenses/GPL-2'. * * 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"); $user = Session::get_session_user(); $pro = Session::is_pro(); $db = new ossim_db(); $conn = $db->connect(); $tabs = Dashboard_tab::get_tabs_by_user($user, true); $db->close(); ?> <!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"/> <?php //CSS Files
} $fullscreen = GET('fullscreen'); ossim_valid($panel_id, OSS_DIGIT, 'illegal:' . _("Tab ID")); ossim_valid($edit, '0', '1', OSS_NULLABLE, 'illegal:' . _("Edit Tab Option")); ossim_valid($fullscreen, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("Fullscreen Option")); if (ossim_error()) { die(ossim_error()); } /* Getting the mode we want to see the tabs */ if ($edit == '1') { $_SESSION['_db_show_edit'] = "1"; } else { $_SESSION['_db_show_edit'] = "0"; } /* Getting the tab list */ $tab_list = Dashboard_tab::get_tabs_by_user($login, $edit); if (empty($tab_list)) { $config_nt = array('content' => _('No tabs have been found') . ".", 'options' => array('type' => 'nf_warning', 'cancel_button' => ''), 'style' => ' margin:25px auto 0 auto;text-align:center;padding:3px 30px;'); $nt = new Notification('nt_panel', $config_nt); $nt->show(); die; } if (empty($tab_list[$panel_id])) { $_panel_keys = array_keys($tab_list); $panel_id = $_panel_keys[0]; } $_SESSION['_db_panel_selected'] = $panel_id; if (Session::menu_perms("dashboard-menu", "ControlPanelExecutiveEdit")) { $show_edit = $edit; $can_edit = 1; } else {
function save_widgets_order($conn, $data) { $panel = $data['panel']; $widgets = $data['widgets']; ossim_valid($panel, OSS_DIGIT, 'illegal:' . _("Panel")); 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); } catch (Exception $e) { $return['error'] = TRUE; $return['msg'] = $e->getMessage(); return $return; } if ($tab->is_locked()) { $return['error'] = TRUE; $return['msg'] = _("You cannot modify this tab"); return $return; } if (is_array($widgets) && !empty($widgets)) { foreach ($widgets as $widget) { ossim_valid($widget['col'], OSS_DIGIT, 'illegal:' . _("Widget Column")); ossim_valid($widget['fil'], OSS_DIGIT, 'illegal:' . _("Widget Row")); ossim_valid($widget['id'], OSS_DIGIT, 'illegal:' . _("Widget ID")); if (ossim_error()) { $info_error = "Error: " . ossim_get_error(); ossim_clean_error(); $return['error'] = TRUE; $return['msg'] = $info_error; return $return; } $sql = "UPDATE dashboard_widget_config SET col = ?, fil = ? WHERE id = ? and panel_id=? and user=?"; $params = array($widget['col'], $widget['fil'], $widget['id'], $panel, $user); if ($conn->Execute($sql, $params) === FALSE) { $return['error'] = TRUE; $return['msg'] = $conn->ErrorMsg() . '.'; return $return; } } } $return['error'] = FALSE; $return['msg'] = _("Dashboard Configuration Saved"); return $return; }
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; }
* * On Debian GNU/Linux systems, the complete text of the GNU General * Public License can be found in `/usr/share/common-licenses/GPL-2'. * * 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");