Beispiel #1
0
        list($id_dir, $id_rule, $id_father) = explode("-", $rule);
        $old_rule = $tab_rules[$id_rule];
        $new_rule = $old_rule->rule->cloneNode(true);
        // deep = true
        $new_rule->setAttribute("name", "Copy of " . $new_rule->getAttribute("name"));
        // Can not copy the root rule at same level => copy as a child (Button disabled for the moment)
        $parent = $old_rule->rule->parentNode;
        $parent->appendChild($new_rule);
        $directive_editor->save_xml($filepath, $dom, "DOMXML");
    } elseif (GET('mode') == "move") {
        $dom = $directive_editor->get_xml($filepath, "DOMXML");
        $direct = $directive_editor->getDirectiveFromXML($dom, $directive_id);
        $tab_rules = $direct->rules;
        switch (GET('direction')) {
            case 'left':
                $directive_editor->left($dom, $rule, &$tab_rules, $direct);
                break;
            case 'right':
                $directive_editor->right($dom, $rule, &$tab_rules, $direct);
                break;
            case 'up':
                $directive_editor->up($dom, $rule, &$tab_rules, $direct);
                break;
            case 'down':
                $directive_editor->down($dom, $rule, &$tab_rules, $direct);
                break;
        }
        $directive_editor->save_xml($filepath, $dom, "DOMXML");
    }
}
// Get columns