当前位置: 首页>>代码示例>>PHP>>正文


PHP move_item_up函数代码示例

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


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

示例1: item_moveup

function item_moveup() {
	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("graph_template_id"));
	/* ==================================================== */

	global $graph_item_types;

	$arr = get_graph_group($_GET["id"]);
	$next_id = get_graph_parent($_GET["id"], "previous");

	if ((!empty($next_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group($_GET["id"], $arr, $next_id, "previous");
	}elseif (ereg("(GPRINT|VRULE|HRULE|COMMENT)", $graph_item_types{db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"])})) {
		/* this is so we know the "other" graph item to propagate the changes to */
		$last_item = get_item("graph_templates_item", "sequence", $_GET["id"], "graph_template_id=" . $_GET["graph_template_id"] . " and local_graph_id=0", "previous");

		move_item_up("graph_templates_item", $_GET["id"], "graph_template_id=" . $_GET["graph_template_id"] . " and local_graph_id=0");

		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . $_GET["id"]) . " where local_graph_template_item_id=" . $_GET["id"]);
		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . $last_item). " where local_graph_template_item_id=" . $last_item);
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:23,代码来源:graph_templates_items.php

示例2: data_query_item_moveup_dssv

function data_query_item_moveup_dssv() {
	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("data_template_id"));
	input_validate_input_number(get_request_var("snmp_query_graph_id"));
	/* ==================================================== */

	move_item_up("snmp_query_graph_rrd_sv", $_GET["id"], "data_template_id=" . $_GET["data_template_id"] . " and snmp_query_graph_id=" . $_GET["snmp_query_graph_id"] . " and field_name='" . $_GET["field_name"] . "'");
}
开发者ID:songchin,项目名称:Cacti,代码行数:9,代码来源:data_queries.php

示例3: mactrack_snmp_item_moveup

function mactrack_snmp_item_moveup()
{
    /* ================= input validation ================= */
    get_filter_request_var('item_id');
    get_filter_request_var('id');
    /* ==================================================== */
    move_item_up('mac_track_snmp_items', get_request_var('item_id'), 'snmp_id=' . get_request_var('id'));
}
开发者ID:Cacti,项目名称:plugin_mactrack,代码行数:8,代码来源:mactrack_snmp.php

示例4: item_moveup

function item_moveup() {
	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("cdef_id"));
	/* ==================================================== */

	move_item_up("cdef_items", $_GET["id"], "cdef_id=" . $_GET["cdef_id"]);
}
开发者ID:songchin,项目名称:Cacti,代码行数:8,代码来源:cdef.php

示例5: reports_item_moveup

function reports_item_moveup()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('item_id'));
    input_validate_input_number(get_request_var_request('id'));
    /* ==================================================== */
    move_item_up('reports_items', get_request_var_request('item_id'), 'report_id=' . get_request_var_request('id'));
}
开发者ID:MrWnn,项目名称:cacti,代码行数:8,代码来源:html_reports.php

示例6: item_moveup

function item_moveup()
{
    global $graph_item_types;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('local_graph_id'));
    /* ==================================================== */
    $arr = get_graph_group($_REQUEST['id']);
    $previous_id = get_graph_parent($_REQUEST['id'], 'previous');
    if (!empty($previous_id) && isset($arr[$_REQUEST['id']])) {
        move_graph_group($_REQUEST['id'], $arr, $previous_id, 'previous');
    } elseif (preg_match('/(GPRINT|VRULE|HRULE|COMMENT)/', $graph_item_types[db_fetch_cell_prepared('SELECT graph_type_id FROM graph_templates_item WHERE id = ?', array(get_request_var_request('id')))])) {
        move_item_up('graph_templates_item', $_REQUEST['id'], 'local_graph_id=' . $_REQUEST['local_graph_id']);
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:15,代码来源:graphs_items.php

示例7: move_graph_group

function move_graph_group($graph_template_item_id, $graph_group_array, $target_id, $direction)
{
    $graph_item = db_fetch_row_prepared('SELECT local_graph_id, graph_template_id FROM graph_templates_item WHERE id = ?', array($graph_template_item_id));
    if (empty($graph_item['local_graph_id'])) {
        $sql_where = 'graph_template_id = ' . $graph_item['graph_template_id'] . ' AND local_graph_id = 0';
    } else {
        $sql_where = 'local_graph_id = ' . $graph_item['local_graph_id'];
    }
    $graph_items = db_fetch_assoc_prepared("SELECT id, sequence FROM graph_templates_item WHERE {$sql_where} ORDER BY sequence");
    /* get a list of parent+children of our target group */
    $target_graph_group_array = get_graph_group($target_id);
    /* if this "parent" item has no children, then treat it like a regular gprint */
    if (sizeof($target_graph_group_array) == 0) {
        if ($direction == 'next') {
            move_item_down('graph_templates_item', $graph_template_item_id, $sql_where);
        } elseif ($direction == 'previous') {
            move_item_up('graph_templates_item', $graph_template_item_id, $sql_where);
        }
        return;
    }
    /* start the sequence at '1' */
    $sequence_counter = 1;
    if (sizeof($graph_items) > 0) {
        foreach ($graph_items as $item) {
            /* check to see if we are at the "target" spot in the loop; if we are, update the sequences and move on */
            if ($target_id == $item['id']) {
                if ($direction == 'next') {
                    $group_array1 = $target_graph_group_array;
                    $group_array2 = $graph_group_array;
                } elseif ($direction == 'previous') {
                    $group_array1 = $graph_group_array;
                    $group_array2 = $target_graph_group_array;
                }
                while (list($sequence, $graph_template_item_id) = each($group_array1)) {
                    db_execute_prepared('UPDATE graph_templates_item SET sequence = ? WHERE id = ?', array($sequence_counter, $graph_template_item_id));
                    /* propagate to ALL graphs using this template */
                    if (empty($graph_item['local_graph_id'])) {
                        db_execute_prepared('UPDATE graph_templates_item SET sequence = ? WHERE local_graph_template_item_id = ?', array($sequence_counter, $graph_template_item_id));
                    }
                    $sequence_counter++;
                }
                while (list($sequence, $graph_template_item_id) = each($group_array2)) {
                    db_execute_prepared('UPDATE graph_templates_item SET sequence = ? WHERE id = ?', array($sequence_counter, $graph_template_item_id));
                    /* propagate to ALL graphs using this template */
                    if (empty($graph_item['local_graph_id'])) {
                        db_execute_prepared('UPDATE graph_templates_item SET sequence = ? WHERE local_graph_template_item_id = ?', array($sequence_counter, $graph_template_item_id));
                    }
                    $sequence_counter++;
                }
            }
            /* make sure to "ignore" the items that we handled above */
            if (!isset($graph_group_array[$item['id']]) && !isset($target_graph_group_array[$item['id']])) {
                db_execute_prepared('UPDATE graph_templates_item SET sequence = ? WHERE id = ?', array($sequence_counter, $item['id']));
                $sequence_counter++;
            }
        }
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:58,代码来源:functions.php

示例8: data_query_item_moveup_dssv

function data_query_item_moveup_dssv()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('data_template_id'));
    input_validate_input_number(get_request_var_request('snmp_query_graph_id'));
    /* ==================================================== */
    move_item_up('snmp_query_graph_rrd_sv', $_REQUEST['id'], 'data_template_id=' . $_REQUEST['data_template_id'] . ' AND snmp_query_graph_id=' . $_REQUEST['snmp_query_graph_id'] . " AND field_name='" . $_REQUEST['field_name'] . "'");
}
开发者ID:MrWnn,项目名称:cacti,代码行数:9,代码来源:data_queries.php

示例9: item_moveup

function item_moveup() {
	require(CACTI_BASE_PATH . "/include/graph/graph_arrays.php");

	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("local_graph_id"));
	/* ==================================================== */

	$arr = get_graph_group($_GET["id"]);
	$previous_id = get_graph_parent($_GET["id"], "previous");

	$graph_type_id = db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"]);
	if ((!empty($previous_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group(get_request_var("id"), $arr, $previous_id, "previous");
	}elseif ($graph_type_id == GRAPH_ITEM_TYPE_GPRINT_AVERAGE ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_LAST ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MAX ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MIN ||
			$graph_type_id == GRAPH_ITEM_TYPE_HRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_VRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_COMMENT) {
		move_item_up("graph_templates_item", $_GET["id"], "local_graph_id=" . $_GET["local_graph_id"]);
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:24,代码来源:graphs_items.php

示例10: mactrack_snmp_item_moveup

function mactrack_snmp_item_moveup() {
	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("item_id"));
	input_validate_input_number(get_request_var("id"));
	/* ==================================================== */
	move_item_up("mac_track_snmp_items", get_request_var("item_id"), "snmp_id=" . get_request_var("id"));
}
开发者ID:avillaverdec,项目名称:cacti,代码行数:7,代码来源:mactrack_snmp.php

示例11: item_moveup

function item_moveup() {
	require(CACTI_BASE_PATH . "/include/graph/graph_arrays.php");

	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("graph_template_id"));
	/* ==================================================== */

	$arr = get_graph_group(get_request_var("id"));
	$next_id = get_graph_parent(get_request_var("id"), "previous");

	$graph_type_id = db_fetch_cell("select graph_type_id from graph_templates_item where id=" . get_request_var("id"));
	if ((!empty($next_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group(get_request_var("id"), $arr, $next_id, "previous");
	}elseif ($graph_type_id == GRAPH_ITEM_TYPE_GPRINT_AVERAGE ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_LAST ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MAX ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MIN ||
			$graph_type_id == GRAPH_ITEM_TYPE_HRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_VRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_COMMENT) {
		/* this is so we know the "other" graph item to propagate the changes to */
		$last_item = get_item("graph_templates_item", "sequence", get_request_var("id"), "graph_template_id=" . get_request_var("graph_template_id") . " and local_graph_id=0", "previous");

		move_item_up("graph_templates_item", get_request_var("id"), "graph_template_id=" . get_request_var("graph_template_id") . " and local_graph_id=0");

		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . get_request_var("id")) . " where local_graph_template_item_id=" . get_request_var("id"));
		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . $last_item). " where local_graph_template_item_id=" . $last_item);
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:30,代码来源:graph_templates_items.php

示例12: item_moveup

function item_moveup()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('cdef_id'));
    /* ==================================================== */
    move_item_up('cdef_items', $_REQUEST['id'], 'cdef_id=' . $_REQUEST['cdef_id']);
}
开发者ID:MrWnn,项目名称:cacti,代码行数:8,代码来源:cdef.php

示例13: item_moveup

function item_moveup() {
	global $graph_item_types;

	$arr = get_graph_group($_GET["id"]);
	$previous_id = get_graph_parent($_GET["id"], "previous");

	if ((!empty($previous_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group($_GET["id"], $arr, $previous_id, "previous");
	}elseif (ereg("(GPRINT|VRULE|HRULE|COMMENT)", $graph_item_types{db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"])})) {
		move_item_up("graph_templates_item", $_GET["id"], "local_graph_id=" . $_GET["local_graph_id"]);
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:12,代码来源:graphs_items.php

示例14: item_moveup

function item_moveup()
{
    global $graph_item_types;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    input_validate_input_number(get_request_var("local_graph_id"));
    /* ==================================================== */
    $arr = get_graph_group($_GET["id"]);
    $previous_id = get_graph_parent($_GET["id"], "previous");
    if (!empty($previous_id) && isset($arr[$_GET["id"]])) {
        move_graph_group($_GET["id"], $arr, $previous_id, "previous");
    } elseif (preg_match("/(GPRINT|VRULE|HRULE|COMMENT)/", $graph_item_types[db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"])])) {
        move_item_up("graph_templates_item", $_GET["id"], "local_graph_id=" . $_GET["local_graph_id"]);
    }
}
开发者ID:teddywen,项目名称:cacti,代码行数:15,代码来源:graphs_items.php

示例15: move_graph_group

function move_graph_group($graph_template_item_id, $graph_group_array, $target_id, $direction) {
	$graph_item = db_fetch_row("select local_graph_id,graph_template_id from graph_templates_item where id=$graph_template_item_id");

	if (empty($graph_item["local_graph_id"])) {
		$sql_where = "graph_template_id = " . $graph_item["graph_template_id"] . " and local_graph_id=0";
	}else{
		$sql_where = "local_graph_id = " . $graph_item["local_graph_id"];
	}

	$graph_items = db_fetch_assoc("select id,sequence from graph_templates_item where $sql_where order by sequence");

	/* get a list of parent+children of our target group */
	$target_graph_group_array = get_graph_group($target_id);

	/* if this "parent" item has no children, then treat it like a regular gprint */
	if (sizeof($target_graph_group_array) == 0) {
		if ($direction == "next") {
			move_item_down("graph_templates_item", $graph_template_item_id, $sql_where);
		}elseif ($direction == "previous") {
			move_item_up("graph_templates_item", $graph_template_item_id, $sql_where);
		}

		return;
	}

	/* start the sequence at '1' */
	$sequence_counter = 1;

	if (sizeof($graph_items) > 0) {
	foreach ($graph_items as $item) {
		/* check to see if we are at the "target" spot in the loop; if we are, update the sequences and move on */
		if ($target_id == $item["id"]) {
			if ($direction == "next") {
				$group_array1 = $target_graph_group_array;
				$group_array2 = $graph_group_array;
			}elseif ($direction == "previous") {
				$group_array1 = $graph_group_array;
				$group_array2 = $target_graph_group_array;
			}

			while (list($sequence,$graph_template_item_id) = each($group_array1)) {
				db_execute("update graph_templates_item set sequence=$sequence_counter where id=$graph_template_item_id");

				/* propagate to ALL graphs using this template */
				if (empty($graph_item["local_graph_id"])) {
					db_execute("update graph_templates_item set sequence=$sequence_counter where local_graph_template_item_id=$graph_template_item_id");
				}

				$sequence_counter++;
			}

			while (list($sequence,$graph_template_item_id) = each($group_array2)) {
				db_execute("update graph_templates_item set sequence=$sequence_counter where id=$graph_template_item_id");

				/* propagate to ALL graphs using this template */
				if (empty($graph_item["local_graph_id"])) {
					db_execute("update graph_templates_item set sequence=$sequence_counter where local_graph_template_item_id=$graph_template_item_id");
				}

				$sequence_counter++;
			}
		}

		/* make sure to "ignore" the items that we handled above */
		if ((!isset($graph_group_array{$item["id"]})) && (!isset($target_graph_group_array{$item["id"]}))) {
			db_execute("update graph_templates_item set sequence=$sequence_counter where id=" . $item["id"]);
			$sequence_counter++;
		}
	}
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:71,代码来源:functions.php


注:本文中的move_item_up函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。