• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_browser_query_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_browser_query_string函数的典型用法代码示例。如果您正苦于以下问题:PHP get_browser_query_string函数的具体用法?PHP get_browser_query_string怎么用?PHP get_browser_query_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_browser_query_string函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: finalize_timespan

function finalize_timespan(&$timespan)
{
    if (!isset($timespan["current_value_date1"])) {
        /* Default end date is now default time span */
        $timespan["current_value_date1"] = date("Y-m-d H:i", $timespan["begin_now"]);
    }
    if (!isset($timespan["current_value_date2"])) {
        /* Default end date is now */
        $timespan["current_value_date2"] = date("Y-m-d H:i", $timespan["end_now"]);
    }
    /* correct bad dates on calendar */
    if ($timespan["end_now"] < $timespan["begin_now"]) {
        set_preset_timespan($timespan);
        $_SESSION["sess_current_timespan"] = read_graph_config_option("default_timespan");
        $timespan["current_value_date1"] = date("Y-m-d H:i", $timespan["begin_now"]);
        $timespan["current_value_date2"] = date("Y-m-d H:i", $timespan["end_now"]);
    }
    /* if moved to future although not allow by settings, stop at current time */
    if ($timespan["end_now"] > time() && read_graph_config_option("allow_graph_dates_in_future") == "") {
        $timespan["end_now"] = time();
        # convert end time to human readable format
        $timespan["current_value_date2"] = date("Y-m-d H:i", $timespan["end_now"]);
    }
    $_SESSION["sess_current_timespan_end_now"] = $timespan["end_now"];
    $_SESSION["sess_current_timespan_begin_now"] = $timespan["begin_now"];
    $_SESSION["sess_current_date1"] = $timespan["current_value_date1"];
    $_SESSION["sess_current_date2"] = $timespan["current_value_date2"];
    $timespan_sel_pos = strpos(get_browser_query_string(), "&predefined_timespan");
    if ($timespan_sel_pos) {
        $_SESSION["urlval"] = substr(get_browser_query_string(), 0, $timespan_sel_pos);
    } else {
        $_SESSION["urlval"] = get_browser_query_string();
    }
}
开发者ID:songchin,项目名称:Cacti,代码行数:34,代码来源:timespan_settings.php


示例2: syslog_messages

/** function syslog_messages()
 *  This is the main page display function in Syslog.  Displays all the
 *  syslog messages that are relevant to Syslog.
*/
function syslog_messages($tab = "syslog")
{
    global $colors, $sql_where, $hostfilter, $severities;
    global $config, $syslog_incoming_config, $reset_multi, $syslog_levels;
    include "./include/global_arrays.php";
    /* force the initial timespan to be 30 minutes for performance reasons */
    if (!isset($_SESSION["sess_syslog_init"])) {
        $_SESSION["sess_current_timespan"] = 1;
        $_SESSION["sess_syslog_init"] = 1;
    }
    if (file_exists("./lib/timespan_settings.php")) {
        include "./lib/timespan_settings.php";
    } else {
        include "./include/html/inc_timespan_settings.php";
    }
    include dirname(__FILE__) . "/config.php";
    /* create the custom css and javascript for the page */
    generate_syslog_cssjs();
    $url_curr_page = get_browser_query_string();
    $sql_where = "";
    if ($_REQUEST["rows"] == -1) {
        $row_limit = read_config_option("num_rows_syslog");
    } elseif ($_REQUEST["rows"] == -2) {
        $row_limit = 999999;
    } else {
        $row_limit = $_REQUEST["rows"];
    }
    $syslog_messages = get_syslog_messages($sql_where, $row_limit, $tab);
    $total_rows = syslog_filter($sql_where, $tab);
    /* generate page list */
    $url_page_select = get_page_list($_REQUEST["page"], MAX_DISPLAY_PAGES, $row_limit, $total_rows, "syslog.php?tab={$tab}");
    if ($total_rows > 0) {
        $nav = "<tr bgcolor='#" . $colors["header"] . "'>\n\t\t\t\t\t<td colspan='13'>\n\t\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align='left' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\t<strong>&lt;&lt; ";
        if ($_REQUEST["page"] > 1) {
            $nav .= "<a class='linkOverDark' href='syslog.php?tab={$tab}&page=" . ($_REQUEST["page"] - 1) . "'>";
        }
        $nav .= "Previous";
        if ($_REQUEST["page"] > 1) {
            $nav .= "</a>";
        }
        $nav .= "</strong>\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\tShowing Rows " . ($total_rows == 0 ? "None" : $row_limit * ($_REQUEST["page"] - 1) + 1 . " to " . ($total_rows < $row_limit || $total_rows < $row_limit * $_REQUEST["page"] ? $total_rows : $row_limit * $_REQUEST["page"]) . " of {$total_rows} [{$url_page_select}]") . "\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t\t<td align='right' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\t<strong>";
        if ($_REQUEST["page"] * $row_limit < $total_rows) {
            $nav .= "<a class='linkOverDark' href='syslog.php?tab={$tab}&page=" . ($_REQUEST["page"] + 1) . "'>";
        }
        $nav .= "Next";
        if ($_REQUEST["page"] * $row_limit < $total_rows) {
            $nav .= "</a>";
        }
        $nav .= " &gt;&gt;</strong>\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
    } else {
        $nav = "<tr bgcolor='#" . $colors["header"] . "' class='noprint'>\n\t\t\t\t\t<td colspan='22'>\n\t\t\t\t\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align='center' class='textHeaderDark'>\n\t\t\t\t\t\t\t\t\tNo Rows Found\n\t\t\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n";
    }
    print $nav;
    if ($tab == "syslog") {
        if (api_plugin_user_realm_auth('syslog_alerts.php')) {
            $display_text = array("nosortt" => array("Actions", "ASC"), "host_id" => array("Host", "ASC"), "logtime" => array("Date", "ASC"), "message" => array("Message", "ASC"), "facility_id" => array("Facility", "ASC"), "priority_id" => array("Priority", "ASC"));
        } else {
            $display_text = array("host_id" => array("Host", "ASC"), "logtime" => array("Date", "ASC"), "message" => array("Message", "ASC"), "facility_id" => array("Facility", "ASC"), "priority_id" => array("Priority", "ASC"));
        }
        html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
        $hosts = array_rekey(syslog_db_fetch_assoc("SELECT host_id, host FROM `" . $syslogdb_default . "`.`syslog_hosts`"), "host_id", "host");
        $facilities = array_rekey(syslog_db_fetch_assoc("SELECT facility_id, facility FROM `" . $syslogdb_default . "`.`syslog_facilities`"), "facility_id", "facility");
        $priorities = array_rekey(syslog_db_fetch_assoc("SELECT priority_id, priority FROM `" . $syslogdb_default . "`.`syslog_priorities`"), "priority_id", "priority");
        $i = 0;
        if (sizeof($syslog_messages) > 0) {
            foreach ($syslog_messages as $syslog_message) {
                $title = "'" . str_replace("\"", "", str_replace("'", "", $syslog_message["message"])) . "'";
                $tip_options = "CLICKCLOSE, 'true', WIDTH, '40', DELAY, '500', FOLLOWMOUSE, 'true', FADEIN, 450, FADEOUT, 450, BGCOLOR, '#F9FDAF', STICKY, 'true', SHADOWCOLOR, '#797C6E', TITLE, 'Message'";
                syslog_row_color($colors["alternate"], $colors["light"], $i, $priorities[$syslog_message["priority_id"]], $title);
                $i++;
                if (api_plugin_user_realm_auth('syslog_alerts.php')) {
                    print "<td style='whitspace-nowrap;width:1%;'>";
                    if ($syslog_message['mtype'] == 'main') {
                        print "<a href='syslog_alerts.php?id=" . $syslog_message[$syslog_incoming_config["id"]] . "&date=" . $syslog_message["logtime"] . "&action=newedit&type=0'><img src='images/green.gif' align='absmiddle' border=0></a>\n\t\t\t\t\t\t<a href='syslog_removal.php?id=" . $syslog_message[$syslog_incoming_config["id"]] . "&date=" . $syslog_message["logtime"] . "&action=newedit&type=new&type=0'><img src='images/red.gif' align='absmiddle' border=0></a>\n";
                    }
                    print "</td>\n";
                }
                print "<td>" . $hosts[$syslog_message["host_id"]] . "</td>\n";
                print "<td>" . $syslog_message["logtime"] . "</td>\n";
                print "<td>" . (strlen($_REQUEST["filter"]) ? eregi_replace("(" . preg_quote($_REQUEST["filter"]) . ")", "<span style='background-color: #F8D93D;'>\\1</span>", title_trim($syslog_message[$syslog_incoming_config["textField"]], get_request_var_request("trimval"))) : title_trim($syslog_message[$syslog_incoming_config["textField"]], get_request_var_request("trimval"))) . "</td>\n";
                print "<td>" . ucfirst($facilities[$syslog_message["facility_id"]]) . "</td>\n";
                print "<td>" . ucfirst($priorities[$syslog_message["priority_id"]]) . "</td>\n";
            }
        } else {
            print "<tr><td><em>No Messages</em></td></tr>";
        }
        print $nav;
        html_end_box(false);
        syslog_syslog_legend();
    } else {
        $display_text = array("name" => array("Alert Name", "ASC"), "severity" => array("Severity", "ASC"), "count" => array("Count", "ASC"), "logtime" => array("Date", "ASC"), "logmsg" => array("Message", "ASC"), "slhost" => array("Host", "ASC"), "facility" => array("Facility", "ASC"), "priority" => array("Priority", "ASC"));
        html_header_sort($display_text, $_REQUEST["sort_column"], $_REQUEST["sort_direction"]);
        $i = 0;
        if (sizeof($syslog_messages) > 0) {
            foreach ($syslog_messages as $log) {
                $title = "'" . str_replace("\"", "", str_replace("'", "", $log["logmsg"])) . "'";
//.........这里部分代码省略.........
开发者ID:khoimt,项目名称:cacti-sample,代码行数:101,代码来源:syslog.php


示例3: finalize_timespan

function finalize_timespan(&$timespan) {
	if (!isset($timespan["current_value_date1"])) {
		/* Default end date is now default time span */
		$timespan["current_value_date1"] = date("Y", $timespan["begin_now"]) . "-" . date("m", $timespan["begin_now"]) . "-" . date("d", $timespan["begin_now"]) . " " . date("H", $timespan["begin_now"]) . ":".date("i", $timespan["begin_now"]);
	}

	if (!isset($timespan["current_value_date2"])) {
		/* Default end date is now */
		$timespan["current_value_date2"] = date("Y", $timespan["end_now"]) . "-" . date("m", $timespan["end_now"]) . "-" . date("d", $timespan["end_now"]) . " " . date("H", $timespan["end_now"]) . ":" . date("i", $timespan["end_now"]);
	}

	/* correct bad dates on calendar */
	if ($timespan["end_now"] < $timespan["begin_now"]) {
		set_preset_timespan($timespan);
		$_SESSION["sess_current_timespan"] = read_graph_config_option("default_timespan");

		$timespan["current_value_date1"] = date("Y", $timespan["begin_now"]) . "-" . date("m", $timespan["begin_now"]) . "-" . date("d", $timespan["begin_now"]) . " " . date("H", $timespan["begin_now"]) . ":".date("i", $timespan["begin_now"]);
		$timespan["current_value_date2"] = date("Y", $timespan["end_now"]) . "-" . date("m", $timespan["end_now"]) . "-" . date("d", $timespan["end_now"]) . " " . date("H", $timespan["end_now"]) . ":" . date("i", $timespan["end_now"]);
	}

	$_SESSION["sess_current_timespan_end_now"] = $timespan["end_now"];
	$_SESSION["sess_current_timespan_begin_now"] = $timespan["begin_now"];
	$_SESSION["sess_current_date1"] = $timespan["current_value_date1"];
	$_SESSION["sess_current_date2"] = $timespan["current_value_date2"];

	$timespan_sel_pos = strpos(get_browser_query_string(),"&predefined_timespan");
	if ($timespan_sel_pos) {
		$_SESSION["urlval"] = substr(get_browser_query_string(),0,$timespan_sel_pos);
	}else {
		$_SESSION["urlval"] = get_browser_query_string();
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:32,代码来源:inc_timespan_settings.php


示例4: array_to_sql_or

                 $sql_or = "AND " . array_to_sql_or($graph_array, "graph_templates_graph.local_graph_id");
                 /* clear the filter vars so they don't affect our results */
                 $_REQUEST["filter"] = "";
                 $_REQUEST["host_id"] = "0";
                 $set_rra_id = empty($rra_id) ? read_graph_config_option("default_rra_id") : get_request_var("rra_id");
             }
         }
     }
     $sql_base = "FROM (graph_templates_graph,graph_local)\r\n\t\t{$sql_join}\r\n\t\t{$sql_where}\r\n\t\t" . (empty($sql_where) ? "WHERE" : "AND") . "   graph_templates_graph.local_graph_id > 0\r\n\t\tAND graph_templates_graph.local_graph_id=graph_local.id\r\n\t\tAND graph_templates_graph.title_cache like '%%" . get_request_var_request("filter") . "%%'\r\n\t\t" . (empty($_REQUEST["host_id"]) ? "" : " and graph_local.host_id=" . get_request_var_request("host_id")) . "\r\n\t\t" . (empty($_REQUEST["graph_template_id"]) ? "" : " and graph_local.graph_template_id=" . get_request_var_request("graph_template_id")) . "\r\n\t\t{$sql_or}";
     $total_rows = count(db_fetch_assoc("SELECT " . "graph_templates_graph.local_graph_id " . $sql_base));
     $graphs = db_fetch_assoc("SELECT " . "graph_templates_graph.local_graph_id, " . "graph_templates_graph.height, " . "graph_templates_graph.title_cache " . $sql_base . " " . "GROUP BY graph_templates_graph.local_graph_id " . "ORDER BY graph_templates_graph.title_cache " . "limit " . $_REQUEST["rows"] * ($_REQUEST["page"] - 1) . "," . $_REQUEST["rows"]);
     /* do some fancy navigation url construction so we don't have to try and rebuild the url string */
     if (ereg("page=[0-9]+", basename($_SERVER["QUERY_STRING"]))) {
         $nav_url = str_replace("page=" . get_request_var_request("page"), "page=<PAGE>", get_browser_query_string());
     } else {
         $nav_url = get_browser_query_string() . (substr_count(get_browser_query_string(), "?") ? "&" : "?") . "page=<PAGE>&host_id=" . get_request_var_request("host_id");
     }
     $nav_url = preg_replace("/((\\?|&)host_id=[0-9]+|(\\?|&)filter=[a-zA-Z0-9]*)/", "", $nav_url);
     html_start_box("", "100%", $colors["header"], "1", "center", "");
     html_nav_bar($colors["header"], read_graph_config_option("num_columns"), get_request_var_request("page"), $_REQUEST["rows"], $total_rows, $nav_url);
     if (read_graph_config_option("thumbnail_section_preview") == "on") {
         html_graph_thumbnail_area($graphs, "", "graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
     } else {
         html_graph_area($graphs, "", "graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
     }
     html_nav_bar($colors["header"], read_graph_config_option("num_columns"), get_request_var_request("page"), $_REQUEST["rows"], $total_rows, $nav_url);
     html_end_box();
     break;
 case 'list':
     if (read_config_option("auth_method") != 0 && empty($current_user["show_list"])) {
         print "<strong><font size='+1' color='FF0000'>YOU DO NOT HAVE RIGHTS FOR LIST VIEW</font></strong>";
开发者ID:resmon,项目名称:resmon-cacti,代码行数:31,代码来源:graph_view.php


示例5: draw_navigation_text


//.........这里部分代码省略.........
    $current_mappings = explode(',', $current_array['mapping']);
    $current_nav = "<ul id='breadcrumbs'>";
    $title = '';
    $nav_count = 0;
    /* resolve all mappings to build the navigation string */
    for ($i = 0; $i < count($current_mappings); $i++) {
        if (empty($current_mappings[$i])) {
            continue;
        }
        if ($i == 0) {
            /* always use the default for level == 0 */
            $url = $nav[$current_mappings[$i]]['url'];
            if (basename($url) == 'graph_view.php') {
                continue;
            }
        } elseif (isset($nav_level_cache[$i]) && !empty($nav_level_cache[$i]['url'])) {
            /* found a match in the url cache for this level */
            $url = $nav_level_cache[$i]['url'];
        } elseif (!empty($current_array['url'])) {
            /* found a default url in the above array */
            $url = $current_array['url'];
        } else {
            /* default to no url */
            $url = '';
        }
        if ($current_mappings[$i] == '?') {
            /* '?' tells us to pull title from the cache at this level */
            if (isset($nav_level_cache[$i])) {
                $current_nav .= (empty($url) ? '' : "<li><a id='nav_{$i}' href='" . htmlspecialchars($url) . "'>") . htmlspecialchars(resolve_navigation_variables($nav[$nav_level_cache[$i]['id']]['title'])) . (empty($url) ? '' : '</a>' . (read_config_option('selected_theme') == 'classic' ? ' -> ' : '') . '</li>');
                $title .= htmlspecialchars(resolve_navigation_variables($nav[$nav_level_cache[$i]['id']]['title'])) . ' -> ';
            }
        } else {
            /* there is no '?' - pull from the above array */
            $current_nav .= (empty($url) ? '' : "<li><a id='nav_{$i}' href='" . htmlspecialchars($url) . "'>") . htmlspecialchars(resolve_navigation_variables($nav[$current_mappings[$i]]['title'])) . (empty($url) ? '' : '</a>' . (read_config_option('selected_theme') == 'classic' ? ' -> ' : '') . '</li>');
            $title .= htmlspecialchars(resolve_navigation_variables($nav[$current_mappings[$i]]['title'])) . ' -> ';
        }
        $nav_count++;
    }
    if ($nav_count) {
        $current_nav .= "<li><a id='nav_{$i}' href=#>" . htmlspecialchars(resolve_navigation_variables($current_array['title'])) . '</a></li>';
    } else {
        $current_array = $nav[$current_page . ':' . $current_action];
        $url = isset($current_array['url']) ? $current_array['url'] : '';
        $current_nav .= "<li><a id='nav_{$i}' href='{$url}'>" . htmlspecialchars(resolve_navigation_variables($current_array['title'])) . '</a></li>';
    }
    if (isset($_REQUEST['tree_id']) || isset($_REQUEST['leaf_id'])) {
        $leaf_sub = '';
        $leaf_name = '';
        $tree_name = '';
        if (isset($_REQUEST['leaf_id']) && $_REQUEST['leaf_id'] != '') {
            $leaf = db_fetch_row_prepared('SELECT * FROM graph_tree_items WHERE id = ?', array($_REQUEST['leaf_id']));
            if (sizeof($leaf)) {
                if ($leaf['host_id'] > 0) {
                    $leaf_name = db_fetch_cell_prepared('SELECT description FROM host WHERE id = ?', array($leaf['host_id']));
                } else {
                    $leaf_name = $leaf['title'];
                }
                $tree_name = db_fetch_cell_prepared('SELECT name FROM graph_tree WHERE id = ?', array($leaf['graph_tree_id']));
            } else {
                $leaf_name = 'Leaf';
            }
            if (isset($_REQUEST['host_group_data']) && $_REQUEST['host_group_data'] != '') {
                $parts = explode(':', $_REQUEST['host_group_data']);
                input_validate_input_number($parts[1]);
                if ($parts[0] == 'graph_template') {
                    $leaf_sub = db_fetch_cell_prepared('SELECT name FROM graph_templates WHERE id = ?', array($parts[1]));
                } else {
                    if ($parts[1] > 0) {
                        $leaf_sub = db_fetch_cell_prepared('SELECT name FROM snmp_query WHERE id = ?', array($parts[1]));
                    } else {
                        $leaf_sub = 'Non Query Based';
                    }
                }
            } else {
                $leaf_sub = '';
            }
        } else {
            $leaf_name = '';
            if (isset($_REQUEST['tree_id'])) {
                $tree_name = db_fetch_cell_prepared('SELECT name FROM graph_tree WHERE id = ?', array($_REQUEST['tree_id']));
            } else {
                $tree_name = '';
            }
        }
        $tree_title = $tree_name . ($leaf_name != '' ? ' (' . $leaf_name : '') . ($leaf_sub != '' ? ':' . $leaf_sub . ')' : ($leaf_name != '' ? ')' : ''));
        $current_nav .= "<li><a id='nav_title' href=#>" . htmlspecialchars($tree_title) . '</a></li></ul>';
    } else {
        $current_nav .= '</ul>';
        $tree_title = '';
    }
    $title .= htmlspecialchars(resolve_navigation_variables($current_array['title']) . ' ' . $tree_title);
    /* keep a cache for each level we encounter */
    $nav_level_cache[$current_array['level']] = array('id' => $current_page . ':' . $current_action, 'url' => get_browser_query_string());
    $_SESSION['sess_nav_level_cache'] = $nav_level_cache;
    if ($type == 'url') {
        return $current_nav;
    } else {
        return $title;
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:101,代码来源:functions.php


示例6: array_to_sql_or

         }
         if (isset($graph_array) && sizeof($graph_array) > 0) {
             /* build sql string including each graph the user checked */
             $sql_or = 'AND ' . array_to_sql_or($graph_array, 'graph_templates_graph.local_graph_id');
             $set_rra_id = empty($rra_id) ? read_graph_config_option('default_rra_id') : get_request_var_request('rra_id');
         }
     }
 }
 $sql_base = "FROM (graph_templates_graph,graph_local)\n\t\t{$sql_join}\n\t\t{$sql_where}\n\t\t" . (empty($sql_where) ? 'WHERE' : 'AND') . "   graph_templates_graph.local_graph_id > 0\n\t\tAND graph_templates_graph.local_graph_id=graph_local.id\n\t\tAND graph_templates_graph.title_cache like '%%" . get_request_var_request('filter') . "%%'\n\t\t" . (empty($_REQUEST['host_id']) ? '' : ' and graph_local.host_id=' . get_request_var_request('host_id')) . "\n\t\t" . (empty($_REQUEST['graph_template_id']) ? '' : ' and graph_local.graph_template_id=' . get_request_var_request('graph_template_id')) . "\n\t\t{$sql_or}";
 $total_rows = count(db_fetch_assoc('SELECT ' . 'graph_templates_graph.local_graph_id ' . $sql_base));
 $graphs = db_fetch_assoc('SELECT ' . 'graph_templates_graph.local_graph_id, ' . 'graph_templates_graph.height, ' . 'graph_templates_graph.width, ' . 'graph_templates_graph.title_cache ' . $sql_base . ' ' . 'GROUP BY graph_templates_graph.local_graph_id ' . 'ORDER BY graph_templates_graph.title_cache ' . 'limit ' . $_REQUEST['rows'] * ($_REQUEST['page'] - 1) . ',' . $_REQUEST['rows']);
 /* do some fancy navigation url construction so we don't have to try and rebuild the url string */
 if (preg_match('/page=[0-9]+/', basename($_SERVER['QUERY_STRING']))) {
     $nav_url = str_replace('&page=' . get_request_var_request('page'), '', get_browser_query_string());
 } else {
     $nav_url = get_browser_query_string() . '&host_id=' . get_request_var_request('host_id');
 }
 $nav_url = preg_replace('/((\\?|&)host_id=[0-9]+|(\\?|&)filter=[a-zA-Z0-9]*)/', '', $nav_url);
 html_start_box('', '100%', "", '3', 'center', '');
 $nav = html_nav_bar($nav_url, MAX_DISPLAY_PAGES, get_request_var_request("page"), get_request_var_request("rows"), $total_rows, get_request_var_request('columns'), "Graphs", 'page', 'main');
 print $nav;
 if (get_request_var_request('thumbnails') == 'true') {
     html_graph_thumbnail_area($graphs, '', 'graph_start=' . get_current_graph_start() . '&graph_end=' . get_current_graph_end(), '', get_request_var_request('columns'));
 } else {
     html_graph_area($graphs, '', 'graph_start=' . get_current_graph_start() . '&graph_end=' . get_current_graph_end(), '', get_request_var_request('columns'));
 }
 print $nav;
 html_end_box();
 if (!isset($_REQUEST['header']) || $_REQUEST['header'] == false) {
     include_once './include/bottom_footer.php';
 }
开发者ID:teddywen,项目名称:cacti,代码行数:31,代码来源:graph_view.php


示例7: draw_navigation_text


//.........这里部分代码省略.........
		"presets_cdef.php:remove" => array(
			"title" => _("(Remove)"),
			"mapping" => "index.php:,presets.php:,presets.php:view_cdef",
			"level" => "3"
			),
		"presets_cdef.php:item_edit" => array(
			"title" => _("CDEF Items"),
			"mapping" => "index.php:,presets.php:,presets.php:view_cdef,presets_cdef.php:edit",
			"level" => "4"
			),
		"presets_color.php:edit" => array(
			"title" => _("(Edit)"),
			"mapping" => "index.php:,presets.php:,presets.php:view_color",
			"level" => "3"
			),
		"presets_gprint.php:edit" => array(
			"title" => _("(Edit)"),
			"mapping" => "index.php:,presets.php:,presets.php:view_gprint",
			"level" => "3"
			),
		"presets_gprint.php:remove" => array(
			"title" => _("(Remove)"),
			"mapping" => "index.php:,presets.php:,presets.php:view_gprint",
			"level" => "3"
			),
		"logs.php:" => array(
			"title" => _("Log Management"),
			"mapping" => "index.php:",
			"level" => "1"
			),
		"logs.php:view" => array(
			"title" => _("View"),
			"mapping" => "index.php:,logs.php:",
			"level" => "2"
			),
		"logs.php:save" => array(
			"title" => _("View"),
			"mapping" => "index.php:,logs.php:",
			"level" => "2"
			),
		"plugins.php:" => array(
			"title" => _("Plugins"),
			"mapping" => "index.php:",
			"level" => "1"
			),
		"auth_user.php:" => array(
			"title" => _("Users"),
			"mapping" => "index.php:",
			"level" => "1"
			),
		"auth_group.php:" => array(
			"title" => _("Users"),
			"mapping" => "index.php:",
			"level" => "1"
			)
		);

	$current_page = basename($_SERVER["PHP_SELF"]);
	$current_action = (isset($_REQUEST["action"]) ? $_REQUEST["action"] : "");

	/* find the current page in the big array */
	$current_array = $nav{$current_page . ":" . $current_action};
	$current_mappings = explode(",", $current_array["mapping"]);
	$current_nav = "";

	/* resolve all mappings to build the navigation string */
	for ($i=0; ($i<count($current_mappings)); $i++) {
		if (empty($current_mappings[$i])) { continue; }

		if  (isset($nav{$current_mappings[$i]}["url"])) {
			/* always use the default for level == 0 */
			$url = $nav{$current_mappings[$i]}["url"];
		}elseif (!empty($nav_level_cache{$i}["url"])) {
			/* found a match in the url cache for this level */
			$url = $nav_level_cache{$i}["url"];

		}else{
			/* default to no url */
			$url = "";
		}

		if ($current_mappings[$i] == "?") {
			/* '?' tells us to pull title from the cache at this level */
			if (isset($nav_level_cache{$i})) {
				$current_nav .= (empty($url) ? "" : "<a href='$url'>") . resolve_navigation_variables($nav{$nav_level_cache{$i}["id"]}["title"]) . (empty($url) ? "" : "</a>") . " -> ";
			}
		}else{
			/* there is no '?' - pull from the above array */
			$current_nav .= (empty($url) ? "" : "<a href='$url'>") . resolve_navigation_variables($nav{$current_mappings[$i]}["title"]) . (empty($url) ? "" : "</a>") . " -> ";
		}
	}

	$current_nav .= resolve_navigation_variables($current_array["title"]);

	/* keep a cache for each level we encounter */
	$nav_level_cache{$current_array["level"]} = array("id" => $current_page . ":" . $current_action, "url" => get_browser_query_string());
	$_SESSION["sess_nav_level_cache"] = $nav_level_cache;

	print $current_nav;
}
开发者ID:songchin,项目名称:Cacti,代码行数:101,代码来源:html.php


示例8: draw_navigation_text

function draw_navigation_text($type = "url")
{
    global $config;
    $nav_level_cache = isset($_SESSION["sess_nav_level_cache"]) ? $_SESSION["sess_nav_level_cache"] : array();
    $nav = array("graph_view.php:" => array("title" => "Graphs", "mapping" => "", "url" => "graph_view.php", "level" => "0"), "graph_view.php:tree" => array("title" => "Tree Mode", "mapping" => "graph_view.php:", "url" => "graph_view.php?action=tree", "level" => "1"), "graph_view.php:list" => array("title" => "List Mode", "mapping" => "graph_view.php:", "url" => "graph_view.php?action=list", "level" => "1"), "graph_view.php:preview" => array("title" => "Preview Mode", "mapping" => "graph_view.php:", "url" => "graph_view.php?action=preview", "level" => "1"), "graph.php:" => array("title" => "|current_graph_title|", "mapping" => "graph_view.php:,?", "level" => "2"), "graph.php:view" => array("title" => "|current_graph_title|", "mapping" => "graph_view.php:,?", "level" => "2"), "graph.php:zoom" => array("title" => "Zoom", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"), "graph.php:properties" => array("title" => "Properties", "mapping" => "graph_view.php:,?,graph.php:view", "level" => "3"), "graph_settings.php:" => array("title" => "Settings", "mapping" => "graph_view.php:", "url" => "graph_settings.php", "level" => "1"), "index.php:" => array("title" => "Console", "mapping" => "", "url" => $config['url_path'] . "index.php", "level" => "0"), "index.php:login" => array("title" => "Console", "mapping" => "", "url" => $config['url_path'] . "index.php", "level" => "0"), "graphs.php:" => array("title" => "Graph Management", "mapping" => "index.php:", "url" => "graphs.php", "level" => "1"), "graphs.php:graph_edit" => array("title" => "(Edit)", "mapping" => "index.php:,graphs.php:", "url" => "", "level" => "2"), "graphs.php:graph_diff" => array("title" => "Change Graph Template", "mapping" => "index.php:,graphs.php:,graphs.php:graph_edit", "url" => "", "level" => "3"), "graphs.php:actions" => array("title" => "Actions", "mapping" => "index.php:,graphs.php:", "url" => "", "level" => "2"), "graphs_items.php:item_edit" => array("title" => "Graph Items", "mapping" => "index.php:,graphs.php:,graphs.php:graph_edit", "url" => "", "level" => "3"), "graphs_new.php:" => array("title" => "Create New Graphs", "mapping" => "index.php:", "url" => "graphs_new.php", "level" => "1"), "graphs_new.php:save" => array("title" => "Create Graphs from Data Query", "mapping" => "index.php:,graphs_new.php:", "url" => "", "level" => "2"), "gprint_presets.php:" => array("title" => "GPRINT Presets", "mapping" => "index.php:", "url" => "gprint_presets.php", "level" => "1"), "gprint_presets.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,gprint_presets.php:", "url" => "", "level" => "2"), "gprint_presets.php:remove" => array("title" => "(Remove)", "mapping" => "index.php:,gprint_presets.php:", "url" => "", "level" => "2"), "cdef.php:" => array("title" => "CDEF's", "mapping" => "index.php:", "url" => "cdef.php", "level" => "1"), "cdef.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,cdef.php:", "url" => "", "level" => "2"), "cdef.php:remove" => array("title" => "(Remove)", "mapping" => "index.php:,cdef.php:", "url" => "", "level" => "2"), "cdef.php:item_edit" => array("title" => "CDEF Items", "mapping" => "index.php:,cdef.php:,cdef.php:edit", "url" => "", "level" => "3"), "cdef.php:actions" => array("title" => "Actions", "mapping" => "index.php:,cdef.php:", "url" => "", "level" => "2"), "tree.php:" => array("title" => "Graph Trees", "mapping" => "index.php:", "url" => "tree.php", "level" => "1"), "tree.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,tree.php:", "url" => "", "level" => "2"), "tree.php:remove" => array("title" => "(Remove)", "mapping" => "index.php:,tree.php:", "url" => "", "level" => "2"), "tree.php:item_edit" => array("title" => "Graph Tree Items", "mapping" => "index.php:,tree.php:,tree.php:edit", "url" => "", "level" => "3"), "tree.php:item_remove" => array("title" => "(Remove Item)", "mapping" => "index.php:,tree.php:,tree.php:edit", "url" => "", "level" => "3"), "color.php:" => array("title" => "Colors", "mapping" => "index.php:", "url" => "color.php", "level" => "1"), "color.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,color.php:", "url" => "", "level" => "2"), "graph_templates.php:" => array("title" => "Graph Templates", "mapping" => "index.php:", "url" => "graph_templates.php", "level" => "1"), "graph_templates.php:template_edit" => array("title" => "(Edit)", "mapping" => "index.php:,graph_templates.php:", "url" => "", "level" => "2"), "graph_templates.php:actions" => array("title" => "Actions", "mapping" => "index.php:,graph_templates.php:", "url" => "", "level" => "2"), "graph_templates_items.php:item_edit" => array("title" => "Graph Template Items", "mapping" => "index.php:,graph_templates.php:,graph_templates.php:template_edit", "url" => "", "level" => "3"), "graph_templates_inputs.php:input_edit" => array("title" => "Graph Item Inputs", "mapping" => "index.php:,graph_templates.php:,graph_templates.php:template_edit", "url" => "", "level" => "3"), "graph_templates_inputs.php:input_remove" => array("title" => "(Remove)", "mapping" => "index.php:,graph_templates.php:,graph_templates.php:template_edit", "url" => "", "level" => "3"), "host_templates.php:" => array("title" => "Host Templates", "mapping" => "index.php:", "url" => "host_templates.php", "level" => "1"), "host_templates.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,host_templates.php:", "url" => "", "level" => "2"), "host_templates.php:actions" => array("title" => "Actions", "mapping" => "index.php:,host_templates.php:", "url" => "", "level" => "2"), "graph_templates.php:actions" => array("title" => "Actions", "mapping" => "index.php:,graph_templates.php:", "url" => "", "level" => "2"), "data_templates.php:" => array("title" => "Data Templates", "mapping" => "index.php:", "url" => "data_templates.php", "level" => "1"), "data_templates.php:template_edit" => array("title" => "(Edit)", "mapping" => "index.php:,data_templates.php:", "url" => "", "level" => "2"), "data_templates.php:actions" => array("title" => "Actions", "mapping" => "index.php:,data_templates.php:", "url" => "", "level" => "2"), "data_sources.php:" => array("title" => "Data Sources", "mapping" => "index.php:", "url" => "data_sources.php", "level" => "1"), "data_sources.php:ds_edit" => array("title" => "(Edit)", "mapping" => "index.php:,data_sources.php:", "url" => "", "level" => "2"), "data_sources.php:actions" => array("title" => "Actions", "mapping" => "index.php:,data_sources.php:", "url" => "", "level" => "2"), "host.php:" => array("title" => "Devices", "mapping" => "index.php:", "url" => "host.php", "level" => "1"), "host.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,host.php:", "url" => "", "level" => "2"), "host.php:actions" => array("title" => "Actions", "mapping" => "index.php:,host.php:", "url" => "", "level" => "2"), "rra.php:" => array("title" => "Round Robin Archives", "mapping" => "index.php:", "url" => "rra.php", "level" => "1"), "rra.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,rra.php:", "url" => "", "level" => "2"), "rra.php:remove" => array("title" => "(Remove)", "mapping" => "index.php:,rra.php:", "url" => "", "level" => "2"), "data_input.php:" => array("title" => "Data Input Methods", "mapping" => "index.php:", "url" => "data_input.php", "level" => "1"), "data_input.php:actions" => array("title" => "Actions", "mapping" => "index.php:,data_input.php:", "url" => "", "level" => "2"), "data_input.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,data_input.php:", "url" => "", "level" => "2"), "data_input.php:remove" => array("title" => "(Remove)", "mapping" => "index.php:,data_input.php:", "url" => "", "level" => "2"), "data_input.php:field_edit" => array("title" => "Data Input Fields", "mapping" => "index.php:,data_input.php:,data_input.php:edit", "url" => "", "level" => "3"), "data_input.php:field_remove" => array("title" => "(Remove Item)", "mapping" => "index.php:,data_input.php:,data_input.php:edit", "url" => "", "level" => "3"), "data_queries.php:" => array("title" => "Data Queries", "mapping" => "index.php:", "url" => "data_queries.php", "level" => "1"), "data_queries.php:actions" => array("title" => "Actions", "mapping" => "index.php:,data_queries.php:", "url" => "", "level" => "2"), "data_queries.php:edit" => array("title" => "(Edit)", "mapping" => "index.php:,data_queries.php:", "url" => "", "level" => "2"), "data_queries.php:item_edit" => array("title" => "Associated Graph Templates", "mapping" => "index.php:,data_queries.php:,data_queries.php:edit", "url" => "", "level" => "3"), "data_queries.php:item_remove" => array("title" => "(Remove Item)", "mapping" => "index.php:,data_queries.php:,data_queries.php:edit", "url" => "", "level" => "3"), "utilities.php:" => array("title" => "Utilities", "mapping" => "index.php:", "url" => "utilities.php", "level" => "1"), "utilities.php:view_poller_cache" => array("title" => "View Poller Cache", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "utilities.php:view_snmp_cache" => array("title" => "View SNMP Cache", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "utilities.php:clear_poller_cache" => array("title" => "Clear Poller Cache", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "utilities.php:view_logfile" => array("title" => "View Cacti Log File", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "utilities.php:clear_logfile" => array("title" => "Clear Cacti Log File", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "utilities.php:view_user_log" => array("title" => "View User Log File", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "utilities.php:clear_user_log" => array("title" => "Clear User Log File", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "utilities.php:view_tech" => array("title" => "Technical Support", "mapping" => "index.php:,utilities.php:", "url" => "utilities.php", "level" => "2"), "settings.php:" => array("title" => "Cacti Settings", "mapping" => "index.php:", "url" => "settings.php", "level" => "1"), "user_admin.php:" => array("title" => "User Management", "mapping" => "index.php:", "url" => "user_admin.php", "level" => "1"), "user_admin.php:user_edit" => array("title" => "(Edit)", "mapping" => "index.php:,user_admin.php:", "url" => "", "level" => "2"), "user_admin.php:actions" => array("title" => "(Action)", "mapping" => "index.php:,user_admin.php:", "url" => "", "level" => "2"), "user_admin.php:graph_perms_edit" => array("title" => "Edit (Graph Permissions)", "mapping" => "index.php:,user_admin.php:", "url" => "", "level" => "2"), "user_admin.php:user_realms_edit" => array("title" => "Edit (Realm Permissions)", "mapping" => "index.php:,user_admin.php:", "url" => "", "level" => "2"), "user_admin.php:graph_settings_edit" => array("title" => "Edit (Graph Settings)", "mapping" => "index.php:,user_admin.php:", "url" => "", "level" => "2"), "about.php:" => array("title" => "About Cacti", "mapping" => "index.php:", "url" => "about.php", "level" => "1"), "templates_export.php:" => array("title" => "Export Templates", "mapping" => "index.php:", "url" => "templates_export.php", "level" => "1"), "templates_export.php:save" => array("title" => "Export Results", "mapping" => "index.php:,templates_export.php:", "url" => "templates_export.php", "level" => "2"), "templates_import.php:" => array("title" => "Import Templates", "mapping" => "index.php:", "url" => "templates_import.php", "level" => "1"));
    $nav = api_plugin_hook_function('draw_navigation_text', $nav);
    $current_page = basename($_SE 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_browser_version_classes函数代码示例发布时间:2022-05-15
下一篇:
PHP get_browser_language函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap