Ejemplo n.º 1
0
    include "../../../inc/includes.php";
}
$plugin = new Plugin();
if ($plugin->isActivated("archires")) {
    Session::checkRight("config", "w");
    $PluginArchiresImageItem = new PluginArchiresImageItem();
    $PluginArchiresNetworkInterfaceColor = new PluginArchiresNetworkInterfaceColor();
    $PluginArchiresVlanColor = new PluginArchiresVlanColor();
    $PluginArchiresStateColor = new PluginArchiresStateColor();
    if (isset($_POST["add"]) && isset($_POST['type'])) {
        $test = explode(";", $_POST['type']);
        if (isset($test[0])) {
            $_POST['type'] = $test[1];
            $_POST['itemtype'] = $test[0];
            if ($PluginArchiresImageItem->canCreate()) {
                $PluginArchiresImageItem->addItemImage($_POST['type'], $_POST['itemtype'], $_POST['img']);
            }
        }
        Html::back();
    } else {
        if (isset($_POST["delete"])) {
            Session::checkRight("config", "w");
            $PluginArchiresImageItem->getFromDB($_POST["id"], -1);
            foreach ($_POST["item"] as $key => $val) {
                if ($val == 1) {
                    $PluginArchiresImageItem->delete(array('id' => $key));
                }
            }
            Html::back();
        } else {
            if (isset($_POST["add_color_networkinterface"]) && isset($_POST['networkinterfaces_id'])) {