Example #1
0
    }
}
$directive_editor = new Directive_editor($engine_id);
// Default toggle User Contributed
if ($toggled == "") {
    $toggled = "user.xml";
}
if (POST('delete_directive_id') != "") {
    $toggled = POST('file');
    ossim_valid(POST('delete_directive_id'), OSS_DIGIT, 'illegal:' . _("Directive ID"));
    ossim_valid(POST('file'), OSS_ALPHA, OSS_PUNC, 'illegal:' . _("File"));
    if (ossim_error()) {
        die(ossim_error());
    }
    // Check if the directive belongs to a DS Group
    list($can_delete, $can_delete_msg) = $directive_editor->can_delete_directive(POST('delete_directive_id'));
    if (!$can_delete) {
        $msg_error = $can_delete_msg;
    } elseif ($directive_editor->delete_directive(POST('delete_directive_id'), POST('file'))) {
        $msg_success = _("The directive was successfully deleted");
    } else {
        $msg_error = _("Unable to delete this directive");
    }
}
if (POST('clone_directive_id') != "") {
    $toggled = POST('file');
    ossim_valid(POST('clone_directive_id'), OSS_DIGIT, 'illegal:' . _("Directive ID"));
    ossim_valid(POST('file'), OSS_ALPHA, OSS_PUNC, 'illegal:' . _("File"));
    if (ossim_error()) {
        die(ossim_error());
    }