Beispiel #1
0
<?php

$ItemObj = Item::GetByField("Item", "ID", intval($_GET["item"]));
$ActionArr = Action::GetAction($_GET["addaction"]);
if (isset($_POST["doAddAction"])) {
    $ActionData = "";
    $ServerData = "";
    foreach ($ActionArr["Arguments"] as $ArgObject) {
        $ActionData .= $_POST["input_" . $ArgObject->SysName] . ItemAction::$SerialKey;
    }
    foreach (Servers::GetCachedResults("Servers") as $ServerObj) {
        if (isset($_POST["action_server_" . $ServerObj->GetValue("ID")])) {
            $ServerData .= $ServerObj->GetValue("ID") . ";";
        }
    }
    ItemAction::AddItemAction($ItemObj->GetValue("ID"), $ActionArr["SysName"], $ActionData, $ServerData);
    KERNEL::HardNavigate("admin", "&area=items&edit=1&item=" . $ItemObj->GetValue("ID"));
}
?>

<h4>Add Action</h4>

<form method="POST" action="?page=admin&area=items&addaction=<?php 
echo $ActionArr["SysName"];
?>
&item=<?php 
echo $ItemObj->GetValue("ID");
?>
">
	<input type="hidden" name="doAddAction" value="yes" />