當前位置: 首頁>>代碼示例>>PHP>>正文


PHP read_graph_config_option函數代碼示例

本文整理匯總了PHP中read_graph_config_option函數的典型用法代碼示例。如果您正苦於以下問題:PHP read_graph_config_option函數的具體用法?PHP read_graph_config_option怎麽用?PHP read_graph_config_option使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了read_graph_config_option函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: rrdtool_function_graph


//.........這裏部分代碼省略.........
    /* override: graph height (in pixels) */
    if (isset($graph_data_array["graph_height"])) {
        $graph_height = $graph_data_array["graph_height"];
    }else{
        $graph_height = $graph["height"];
    }

    /* override: graph width (in pixels) */
    if (isset($graph_data_array["graph_width"])) {
        $graph_width = $graph_data_array["graph_width"];
    }else{
        $graph_width = $graph["width"];
    }

    /* override: skip drawing the legend? */
    if (isset($graph_data_array["graph_nolegend"])) {
        $graph_legend = "--no-legend" . RRD_NL;
    }else{
        $graph_legend = "";
    }

    /* export options */
    if (isset($graph_data_array["export"])) {
        $graph_opts = read_config_option("path_html_export") . "/" . $graph_data_array["export_filename"] . RRD_NL;
    }else{
        if (empty($graph_data_array["output_filename"])) {
                $graph_opts = "-" . RRD_NL;
        }else{
            $graph_opts = $graph_data_array["output_filename"] . RRD_NL;
        }
    }

    /* setup date format */
    $date_fmt = read_graph_config_option("default_date_format");
    $datechar = read_graph_config_option("default_datechar");

    if ($datechar == GDC_HYPHEN) {
        $datechar = "-";
    }else {
        $datechar = "/";
    }

    switch ($date_fmt) {
        case GD_MO_D_Y:
            $graph_date = "m" . $datechar . "d" . $datechar . "Y H:i:s";
            break;
        case GD_MN_D_Y:
            $graph_date = "M" . $datechar . "d" . $datechar . "Y H:i:s";
            break;
        case GD_D_MO_Y:
            $graph_date = "d" . $datechar . "m" . $datechar . "Y H:i:s";
            break;
        case GD_D_MN_Y:
            $graph_date = "d" . $datechar . "M" . $datechar . "Y H:i:s";
            break;
        case GD_Y_MO_D:
            $graph_date = "Y" . $datechar . "m" . $datechar . "d H:i:s";
            break;
        case GD_Y_MN_D:
            $graph_date = "Y" . $datechar . "M" . $datechar . "d H:i:s";
            break;
    }

    /* display the timespan for zoomed graphs */
    if ((isset($graph_data_array["graph_start"])) && (isset($graph_data_array["graph_end"]))) {
        if (($graph_data_array["graph_start"] < 0) && ($graph_data_array["graph_end"] < 0)) {
開發者ID:songchin,項目名稱:Cacti,代碼行數:67,代碼來源:rrd.php

示例2: get_graph_tree_array

function get_graph_tree_array($return_sql = false, $force_refresh = false) {

    /* set the tree update time if not already set */
    if (!isset($_SESSION["tree_update_time"])) {
        $_SESSION["tree_update_time"] = time();
    }

    /* build tree array */
    if (!isset($_SESSION["tree_array"]) || ($force_refresh) ||
        (($_SESSION["tree_update_time"] + read_graph_config_option("page_refresh")) < time())) {

        if (read_config_option("auth_method") != "0") {
            $current_user = db_fetch_row("select policy_trees from user_auth where id=" . $_SESSION["sess_user_id"]);

            if ($current_user["policy_trees"] == "1") {
                $sql_where = "where user_auth_perms.user_id is null";
            }elseif ($current_user["policy_trees"] == "2") {
                $sql_where = "where user_auth_perms.user_id is not null";
            }

            $sql = "select
                graph_tree.id,
                graph_tree.name,
                user_auth_perms.user_id
                from graph_tree
                left join user_auth_perms on (graph_tree.id=user_auth_perms.item_id and user_auth_perms.type=2 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ")
                $sql_where
                order by graph_tree.name";
        }else{
            $sql = "select * from graph_tree order by name";
        }

        $_SESSION["tree_array"] = $sql;
        $_SESSION["tree_update_time"] = time();
    } else {
        $sql = $_SESSION["tree_array"];
    }

    if ($return_sql == true) {
        return $sql;
    }else{
        return db_fetch_assoc($sql);
    }
}
開發者ID:songchin,項目名稱:Cacti,代碼行數:44,代碼來源:functions.php

示例3: errorimage_check_graphs

function errorimage_check_graphs()
{
    global $config;
    $local_graph_id = $_GET['local_graph_id'];
    $graph_items = db_fetch_assoc("select\r\n\t\tdata_template_rrd.local_data_id\r\n\t\tfrom graph_templates_item\r\n\t\tleft join data_template_rrd on (graph_templates_item.task_item_id=data_template_rrd.id)\r\n\t\twhere graph_templates_item.local_graph_id={$local_graph_id}\r\n\t\torder by graph_templates_item.sequence");
    $ids = array();
    foreach ($graph_items as $graph) {
        if ($graph['local_data_id'] != '') {
            $ids[] = $graph['local_data_id'];
        }
    }
    $ids = array_unique($ids);
    if (!empty($_GET["graph_nolegend"])) {
        $height = read_graph_config_option("default_height") + 62;
        $width = read_graph_config_option("default_width") + 95;
    } else {
        $hw = db_fetch_row("SELECT width, height \r\n\t\t\tFROM graph_templates_graph \r\n\t\t\tWHERE local_graph_id=" . $_GET['local_graph_id']);
        $hr = db_fetch_cell("SELECT count(*) FROM graph_templates_item WHERE local_graph_id=" . $_GET['local_graph_id'] . " AND hard_return='on'");
        $height = $hw['height'] + 16 * $hr + 90;
        // # hard rules, plus room for date
        $width = $hw['width'] + 95;
    }
    foreach ($ids as $id => $local_data_id) {
        $data_source_path = get_data_source_path($local_data_id, true);
        if (!file_exists($data_source_path)) {
            $filename = $config['base_path'] . '/plugins/errorimage/images/no-datasource.png';
            if (function_exists("imagecreatefrompng")) {
                echo errorimage_resize_png($filename, $width, $height);
            } else {
                $file = fopen($filename, 'rb');
                echo fread($file, filesize($filename));
                fclose($file);
            }
            exit;
        }
    }
}
開發者ID:resmon,項目名稱:resmon-cacti,代碼行數:37,代碼來源:setup.php

示例4: html_graph_thumbnail_area

function html_graph_thumbnail_area(&$graph_array, $no_graphs_message = "", $extra_url_args = "", $header = "") {
    $i = 0; $k = 0;
    if (sizeof($graph_array) > 0) {
        if ($header != "") {
            print $header;
        }

        print "<tr>";

        foreach ($graph_array as $graph) {
            ?>
            <td align='center' width='<?php print (98 / read_graph_config_option("num_columns"));?>%'>
                <table width='1' cellpadding='0'>
                    <tr>
                        <td>
                            <a href='graph.php?rra_id=all&local_graph_id=<?php print $graph["local_graph_id"];?>'><img src='graph_image.php?local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&graph_height=<?php print read_graph_config_option("default_height");?>&graph_width=<?php print read_graph_config_option("default_width");?>&graph_nolegend=true<?php print (($extra_url_args == "") ? "" : "&$extra_url_args");?>' border='0' alt='<?php print $graph["title_cache"];?>'></a>
                        </td>
                        <td valign='top' style='padding: 3px;'>
                            <a href='graph.php?action=zoom&local_graph_id=<?php print $graph["local_graph_id"];?>&rra_id=0&<?php print $extra_url_args;?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>
                        </td>
                    </tr>
                </table>
            </td>
            <?php

            $i++;
            $k++;

            if (($i == read_graph_config_option("num_columns")) && ($k < count($graph_array))) {
                $i = 0;
                print "</tr><tr>";
            }
        }

        print "</tr>";
    }else{
        if ($no_graphs_message != "") {
            print "<td><em>$no_graphs_message</em></td>";
        }
    }
}
開發者ID:songchin,項目名稱:Cacti,代碼行數:41,代碼來源:html.php

示例5: trim

            }

            /* override: graph end time (unix time) */
            if (!empty($_GET["graph_end"])) {
                $graph_data_array["graph_end"] = $_GET["graph_end"];
            }

            print trim(rrdtool_function_graph($_GET["local_graph_id"], $_GET["rra_id"], $graph_data_array));
            ?>
        </td>
    </tr>
    <?php }?>

    <tr>
        <?php if ((read_graph_config_option("default_tree_view_mode") == "2") && (($_REQUEST["action"] == "tree") || ((isset($_REQUEST["view_type"]) ? $_REQUEST["view_type"] : "") == "tree"))) { ?>
        <td valign="top" style="padding: 5px; border-right: #aaaaaa 1px solid;" bgcolor='#efefef' width='<?php print read_graph_config_option("default_dual_pane_width");?>' class='noprint'>
            <table border=0 cellpadding=0 cellspacing=0><tr><td><font size=-2><a style="font-size:7pt;text-decoration:none;color:silver" href="http://www.treemenu.net/" target=_blank></a></font></td></tr></table>
            <?php grow_dhtml_trees(); ?>
            <script type="text/javascript">initializeDocument();</script>

            <?php if (isset($_GET["select_first"])) { ?>
            <script type="text/javascript">
            var obj;
            obj = findObj(1);

            if (!obj.isOpen) {
                clickOnNode(1);
            }

            clickOnLink(2,'','main');
            </script>
開發者ID:songchin,項目名稱:Cacti,代碼行數:31,代碼來源:top_graph_header.php

示例6: date_time_format

/** date_time_format		create a format string for date/time
 * @param string returns	date time format
 */
function date_time_format() {
    require_once(CACTI_BASE_PATH . "/include/graph/graph_constants.php");
    global $config;

    $graph_date = "";

    /* setup date format */
    $date_fmt = read_graph_config_option("default_date_format");
    $datechar = read_graph_config_option("default_datechar");

    switch ($datechar) {
        case GDC_HYPHEN: 	$datechar = "-"; break;
        case GDC_SLASH: 	$datechar = "/"; break;
        case GDC_DOT:	 	$datechar = "."; break;
    }

    switch ($date_fmt) {
        case GD_MO_D_Y:
            $graph_date = "m" . $datechar . "d" . $datechar . "Y H:i:s";
            break;
        case GD_MN_D_Y:
            $graph_date = "M" . $datechar . "d" . $datechar . "Y H:i:s";
            break;
        case GD_D_MO_Y:
            $graph_date = "d" . $datechar . "m" . $datechar . "Y H:i:s";
            break;
        case GD_D_MN_Y:
            $graph_date = "d" . $datechar . "M" . $datechar . "Y H:i:s";
            break;
        case GD_Y_MO_D:
            $graph_date = "Y" . $datechar . "m" . $datechar . "d H:i:s";
            break;
        case GD_Y_MN_D:
            $graph_date = "Y" . $datechar . "M" . $datechar . "d H:i:s";
            break;
    }
    return $graph_date;
}
開發者ID:songchin,項目名稱:Cacti,代碼行數:41,代碼來源:time.php

示例7: html_graph_thumbnail_area

function html_graph_thumbnail_area(&$graph_array, $no_graphs_message = "", $extra_url_args = "", $header = "")
{
    $i = 0;
    $k = 0;
    $j = 0;
    $num_graphs = sizeof($graph_array);
    if ($num_graphs > 0) {
        if ($header != "") {
            print $header;
        }
        $start = true;
        foreach ($graph_array as $graph) {
            if (isset($graph["graph_template_name"])) {
                if (isset($prev_graph_template_name)) {
                    if ($prev_graph_template_name != $graph["graph_template_name"]) {
                        $print = true;
                        $prev_graph_template_name = $graph["graph_template_name"];
                    } else {
                        $print = false;
                    }
                } else {
                    $print = true;
                    $prev_graph_template_name = $graph["graph_template_name"];
                }
                if ($print) {
                    if (!$start) {
                        while ($i % read_graph_config_option("num_columns") != 0) {
                            print "<td align='center' width='" . ceil(100 / read_graph_config_option("num_columns")) . "%'></td>";
                            $i++;
                        }
                        print "</tr>";
                    }
                    print "<tr style='background-color:#a9b7cb;'>\n\t\t\t\t\t\t<td style='background-color:#a9b7cb;' colspan='" . read_graph_config_option("num_columns") . "' class='textHeaderDark'>\n\t\t\t\t\t\t\t<strong>Graph Template:</strong> " . $graph["graph_template_name"] . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
                    $i = 0;
                }
            } elseif (isset($graph["data_query_name"])) {
                if (isset($prev_data_query_name)) {
                    if ($prev_data_query_name != $graph["data_query_name"]) {
                        $print = true;
                        $prev_data_query_name = $graph["data_query_name"];
                    } else {
                        $print = false;
                    }
                } else {
                    $print = true;
                    $prev_data_query_name = $graph["data_query_name"];
                }
                if ($print) {
                    if (!$start) {
                        while ($i % read_graph_config_option("num_columns") != 0) {
                            print "<td align='center' width='" . ceil(100 / read_graph_config_option("num_columns")) . "%'></td>";
                            $i++;
                        }
                        print "</tr>";
                    }
                    print "<tr style='background-color:#a9b7cb;'>\n\t\t\t\t\t\t\t<td style='background-color:#a9b7cb;' colspan='" . read_graph_config_option("num_columns") . "' class='textHeaderDark'><strong>Data Query:</strong> " . $graph["data_query_name"] . "</td>\n\t\t\t\t\t\t</tr>";
                    $i = 0;
                }
                if (!isset($prev_sort_field_value) || $prev_sort_field_value != $graph["sort_field_value"]) {
                    $prev_sort_field_value = $graph["sort_field_value"];
                    print "<tr style='background-color:#a9b7cb;'>\n\t\t\t\t\t\t<td style='background-color:#a9b7cb;' colspan='" . read_graph_config_option("num_columns") . "' class='textHeaderDark'>\n\t\t\t\t\t\t\t" . $graph["sort_field_value"] . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
                    $i = 0;
                    $j = 0;
                }
            }
            if ($i == 0) {
                print "<tr style='background-color: #" . ($j % 2 == 0 ? "F2F2F2" : "FFFFFF") . ";'>";
                $start = false;
            }
            ?>
            <td align='center' width='<?php 
            print ceil(100 / read_graph_config_option("num_columns"));
            ?>
%'>
                <table align='center' cellpadding='0'>
                    <tr>
                        <td align='center'>
                            <div style="min-height: <?php 
            echo 1.6 * read_graph_config_option("default_height") . "px";
            ?>
;"><a href='<?php 
            print $config['url_path'];
            ?>
graph.php?action=view&rra_id=all&local_graph_id=<?php 
            print $graph["local_graph_id"];
            ?>
'><img class='graphimage' id='graph_<?php 
            print $graph["local_graph_id"];
            ?>
' src='<?php 
            print $config['url_path'];
            ?>
graph_image.php?local_graph_id=<?php 
            print $graph["local_graph_id"];
            ?>
&rra_id=0&graph_height=<?php 
            print read_graph_config_option("default_height");
            ?>
&graph_width=<?php 
            print read_graph_config_option("default_width");
//.........這裏部分代碼省略.........
開發者ID:songchin,項目名稱:Cacti,代碼行數:101,代碼來源:html.php

示例8: get_current_graph_start

    }else{
        html_graph_area($graphs, "", "graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end());
    }

    html_nav_bar($colors["header_panel"], read_graph_config_option("num_columns"), $_REQUEST["page"], ROWS_PER_PAGE, $total_rows, $nav_url);

    html_graph_end_box();

    print "<br><br>";

    break;



case 'list':
    define("ROWS_PER_PAGE", read_graph_config_option("list_graphs_per_page"));

    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>"; exit;
    }

    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request("host_id"));
    input_validate_input_number(get_request_var_request("graph_template_id"));
    /* ==================================================== */

    /* clean up search string */
    if (isset($_REQUEST["filter"])) {
        $_REQUEST["filter"] = sanitize_search_string(get_request_var_request("filter"));
    }
開發者ID:songchin,項目名稱:Cacti,代碼行數:30,代碼來源:graph_view.php

示例9: url

        ?>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="noprint">
        <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(<?php 
        echo $config['url_path'];
        ?>
images/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;">
            <img src="<?php 
        echo $config['url_path'];
        ?>
images/transparent_line.gif" width="<?php 
        print read_graph_config_option("default_dual_pane_width");
        ?>
" height="2" border="0"><br>
        </td>
        <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(<?php 
        echo $config['url_path'];
        ?>
images/shadow.gif); background-repeat: repeat-x;">

        </td>
    </tr>
<?php 
    }
    ?>
    <tr>
        <td valign="top" style="padding: 5px; border-right: #aaaaaa 1px solid;"><div style='position:relative;' id='main'>
開發者ID:teddywen,項目名稱:cacti,代碼行數:31,代碼來源:general_header.php

示例10: html_end_box

                </tr>
            </table>
            <input type='hidden' name='graph_add' value=''>
            <input type='hidden' name='graph_remove' value=''>
            <input type='hidden' name='graph_list' value='<?php 
        print $_REQUEST['graph_list'];
        ?>
'>
        </form>
        </td>
    </tr>
    <?php 
        html_end_box();
        /* if the number of rows is -1, set it to the default */
        if ($_REQUEST['rows'] == -1) {
            $_REQUEST['rows'] = read_graph_config_option('list_graphs_per_page');
        }
        /* create filter for sql */
        $sql_filter = '';
        $sql_filter .= empty($_REQUEST['filter']) ? '' : " graph_templates_graph.title_cache like '%" . get_request_var_request('filter') . "%'";
        $sql_filter .= empty($_REQUEST['host_id']) ? '' : (empty($sql_filter) ? '' : ' and') . ' graph_local.host_id=' . get_request_var_request('host_id');
        $sql_filter .= empty($_REQUEST['graph_template_id']) ? '' : (empty($sql_filter) ? '' : ' and') . ' graph_local.graph_template_id=' . get_request_var_request('graph_template_id');
        /* graph permissions */
        if (read_config_option('auth_method') != 0) {
            /* get policy information for the sql where clause */
            $sql_where = 'where ' . get_graph_permissions_sql($current_user['policy_graphs'], $current_user['policy_hosts'], $current_user['policy_graph_templates']);
            $sql_join = 'left join host on (host.id=graph_local.host_id)
            left join graph_templates on (graph_templates.id=graph_local.graph_template_id)
            left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=' . $_SESSION['sess_user_id'] . ') OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=' . $_SESSION['sess_user_id'] . ') OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=' . $_SESSION['sess_user_id'] . '))';
        } else {
            $sql_where = '';
開發者ID:teddywen,項目名稱:cacti,代碼行數:31,代碼來源:graph_view.php

示例11: set_timeshift

function set_timeshift()
{
    global $config, $graph_timeshifts;
    # no current timeshift: get default timeshift
    if (!isset($_SESSION["sess_current_timeshift"]) || read_graph_config_option("timespan_sel") == "" || isset($_POST["button_clear_x"])) {
        $_SESSION["sess_current_timeshift"] = read_graph_config_option("default_timeshift");
        $_REQUEST["predefined_timeshift"] = read_graph_config_option("default_timeshift");
        $_SESSION["custom"] = 0;
    }
    return $timeshift = $graph_timeshifts[$_SESSION["sess_current_timeshift"]];
}
開發者ID:songchin,項目名稱:Cacti,代碼行數:11,代碼來源:timespan_settings.php

示例12: rrdtool_function_set_font

function rrdtool_function_set_font($type, $no_legend, $themefonts)
{
    global $config;
    if (read_config_option('font_method') == 0) {
        if (read_graph_config_option("custom_fonts") == "on") {
            $font = read_graph_config_option($type . "_font");
            $size = read_graph_config_option($type . "_size");
        } else {
            $font = read_config_option($type . "_font");
            $size = read_config_option($type . "_size");
        }
    } elseif (isset($themefonts[$type]['font']) && isset($themefonts[$type]['size'])) {
        $font = $themefonts[$type]['font'];
        $size = $themefonts[$type]['size'];
    } else {
        return;
    }
    if (strlen($font)) {
        /* do some simple checks */
        if (read_config_option("rrdtool_version") == "rrd-1.2.x") {
            # rrdtool 1.2 uses font files
            if (!is_file($font)) {
                $font = "";
            }
        } else {
            # rrdtool 1.3+ use fontconfig
            /* verifying all possible pango font params is too complex to be tested here
             * so we only escape the font
             */
            $font = cacti_escapeshellarg($font);
        }
    }
    if ($type == "title") {
        if (!empty($no_legend)) {
            $size = $size * 0.7;
        } elseif ($size <= 4 || !is_numeric($size)) {
            $size = 12;
        }
    } else {
        if ($size <= 4 || !is_numeric($size)) {
            $size = 8;
        }
    }
    return "--font " . strtoupper($type) . ":" . floatval($size) . ":" . $font . RRD_NL;
}
開發者ID:MrWnn,項目名稱:cacti,代碼行數:45,代碼來源:rrd.php

示例13: form_actions

function form_actions() {
    global $colors, $graph_actions;
    /* if we are to save this form, instead of display it */
    if (isset($_POST["selected_items"])) {
        $selected_items = unserialize(stripslashes($_POST["selected_items"]));

        if ($_POST["drp_action"] == "1") { /* delete */
            for ($i=0;($i<count($selected_items));$i++) {
                if (!isset($_POST["delete_type"])) { $_POST["delete_type"] = 1; }

                switch ($_POST["delete_type"]) {
                    case '2': /* delete all data sources referenced by this graph */
                        $data_sources = db_fetch_assoc("select
                            data_template_data.local_data_id
                            from data_template_rrd,data_template_data,graph_templates_item
                            where graph_templates_item.task_item_id=data_template_rrd.id
                            and data_template_rrd.local_data_id=data_template_data.local_data_id
                            and " . array_to_sql_or($selected_items, "graph_templates_item.local_graph_id") . "
                            and data_template_data.local_data_id > 0
                            group by data_template_data.local_data_id");

                        if (sizeof($data_sources) > 0) {
                            foreach ($data_sources as $data_source) {
                                api_data_source_remove($data_source["local_data_id"]);
                            }
                        }

                        break;
                }

                api_graph_remove($selected_items[$i]);
            }
        }elseif ($_POST["drp_action"] == "2") { /* change graph template */
            for ($i=0;($i<count($selected_items));$i++) {
                change_graph_template($selected_items[$i], $_POST["graph_template_id"], true);
            }
        }elseif ($_POST["drp_action"] == "3") { /* duplicate */
            for ($i=0;($i<count($selected_items));$i++) {
                duplicate_graph($selected_items[$i], 0, $_POST["title_format"]);
            }
        }elseif ($_POST["drp_action"] == "4") { /* graph -> graph template */
            for ($i=0;($i<count($selected_items));$i++) {
                graph_to_graph_template($selected_items[$i], $_POST["title_format"]);
            }
        }elseif (ereg("^tr_([0-9]+)$", $_POST["drp_action"], $matches)) { /* place on tree */
            for ($i=0;($i<count($selected_items));$i++) {
                api_tree_item_save(0, $_POST["tree_id"], TREE_ITEM_TYPE_GRAPH, $_POST["tree_item_id"], "", $selected_items[$i], read_graph_config_option("default_rra_id"), 0, 0, 0, false);
            }
        }elseif ($_POST["drp_action"] == "5") { /* change host */
            for ($i=0;($i<count($selected_items));$i++) {
                db_execute("update graph_local set host_id=" . $_POST["host_id"] . " where id=" . $selected_items[$i]);
                update_graph_title_cache($selected_items[$i]);
            }
        }elseif ($_POST["drp_action"] == "6") { /* reapply suggested naming */
            for ($i=0;($i<count($selected_items));$i++) {
                api_reapply_suggested_graph_title($selected_items[$i]);
                update_graph_title_cache($selected_items[$i]);
            }
        }

        header("Location: graphs.php");
        exit;
    }

    /* setup some variables */
    $graph_list = ""; $i = 0;

    /* loop through each of the graphs selected on the previous page and get more info about them */
    while (list($var,$val) = each($_POST)) {
        if (ereg("^chk_([0-9]+)$", $var, $matches)) {
            $graph_list .= "<li>" . get_graph_title($matches[1]) . "<br>";
            $graph_array[$i] = $matches[1];
        }

        $i++;
    }

    include_once("./include/top_header.php");

    /* add a list of tree names to the actions dropdown */
    add_tree_names_to_actions_array();

    html_start_box("<strong>" . $graph_actions{$_POST["drp_action"]} . "</strong>", "60%", $colors["header_panel"], "3", "center", "");

    print "<form action='graphs.php' method='post'>\n";

    if ($_POST["drp_action"] == "1") { /* delete */
        $graphs = array();

        /* find out which (if any) data sources are being used by this graph, so we can tell the user */
        if (isset($graph_array)) {
            $data_sources = db_fetch_assoc("select
                data_template_data.local_data_id,
                data_template_data.name_cache
                from data_template_rrd,data_template_data,graph_templates_item
                where graph_templates_item.task_item_id=data_template_rrd.id
                and data_template_rrd.local_data_id=data_template_data.local_data_id
                and " . array_to_sql_or($graph_array, "graph_templates_item.local_graph_id") . "
                and data_template_data.local_data_id > 0
                group by data_template_data.local_data_id
//.........這裏部分代碼省略.........
開發者ID:songchin,項目名稱:Cacti,代碼行數:101,代碼來源:graphs.php

示例14: basename

 | This code is designed, written, and maintained by the Cacti Group. See  |
 | about.php and/or the AUTHORS file for specific developer information.   |
 +-------------------------------------------------------------------------+
 | http://www.cacti.net/                                                   |
 +-------------------------------------------------------------------------+
*/
global $config, $refresh;
$script = basename($_SERVER['SCRIPT_NAME']);
if ($script == 'graph_view.php' || $script == 'graph.php') {
    if (isset($_SESSION['custom']) && $_SESSION['custom'] == true) {
        $refreshIsLogout = 'true';
    } else {
        if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'zoom') {
            $refreshIsLogout = 'true';
        } else {
            $refresh = api_plugin_hook_function('top_graph_refresh', read_graph_config_option('page_refresh'));
            $refreshIsLogout = 'false';
        }
    }
} elseif (strstr($_SERVER['SCRIPT_NAME'], 'plugins')) {
    $refresh = api_plugin_hook_function('top_graph_refresh', $refresh);
    if (empty($refresh)) {
        $refreshIsLogout = 'true';
    } else {
        $refreshIsLogout = 'false';
    }
}
if (!empty($refresh)) {
    $refreshIsLogout = 'false';
    if (!is_array($refresh)) {
        $myrefresh['seconds'] = $refresh;
開發者ID:MrWnn,項目名稱:cacti,代碼行數:31,代碼來源:global_session.php

示例15: read_graph_config_option

    <tr bgcolor="<?php print $colors["panel"];?>">
        <form name="form_graph_id" method="post">
        <td colspan='<?php print read_graph_config_option("num_columns");?>'>
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="120" class="textHeader">
                        Filter by host:&nbsp;
                    </td>
                    <td width="1">
                        <select name="cbo_graph_id" onChange="window.location=document.form_graph_id.cbo_graph_id.options[document.form_graph_id.cbo_graph_id.selectedIndex].value">
                            <option value="graph_view.php?action=preview&host_id=0&filter=<?php print $_REQUEST["filter"];?>"<?php if ($_REQUEST["host_id"] == "0") {?> selected<?php }?>>None</option>

                            <?php
                            $hosts = get_host_array();

                            if (sizeof($hosts) > 0) {
                            foreach ($hosts as $host) {
                                print "<option value='graph_view.php?action=preview&host_id=" . $host["id"] . "&filter=" . $_REQUEST["filter"] . "'"; if ($_REQUEST["host_id"] == $host["id"]) { print " selected"; } print ">" . $host["name"] . "</option>\n";
                            }
                            }
                            ?>
                        </select>
                    </td>
                    <td width="5"></td>
                    <td width="1">
                        <input type="text" name="filter" size="20" value="<?php print $_REQUEST["filter"];?>">
                    </td>
                    <td>
                        &nbsp;<input type="image" src="images/button_go.gif" alt="Go" border="0" align="absmiddle">
                    </td>
                </tr>
開發者ID:songchin,項目名稱:Cacti,代碼行數:31,代碼來源:inc_graph_view_filter_table.php


注:本文中的read_graph_config_option函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。