Пример #1
0
    } else {
        $redirect_url = ADMIN_ROOT . $bigtree["module"]["route"] . "/" . $redirect_append;
    }
    // If we specify a specific return URL...
} elseif ($bigtree["form"]["return_url"]) {
    $redirect_url = $bigtree["form"]["return_url"] . $redirect_append;
    // Otherwise just go back to the main module landing.
} else {
    $redirect_url = ADMIN_ROOT . $bigtree["module"]["route"] . "/" . $redirect_append;
}
// If we've specified a preview URL in our module and the user clicked Save & Preview, return to preview page.
if ($_POST["_bigtree_preview"]) {
    $admin->ungrowl();
    $redirect_url = $view["preview_url"] . $edit_id . "/?bigtree_preview_return=" . urlencode($bigtree["form_root"] . $edit_id . "/");
}
// If there's a callback function for this module, let's get'r'done.
if ($bigtree["form"]["callback"]) {
    call_user_func($bigtree["form"]["callback"], $edit_id, $item, $did_publish);
}
// Track resource allocation
$admin->allocateResources($bigtree["module"]["id"], $edit_id);
// Put together saved form information for the error or crop page in case we need it.
$edit_action = BigTreeAutoModule::getEditAction($bigtree["module"]["id"], $bigtree["form"]["id"]);
$_SESSION["bigtree_admin"]["form_data"] = array("view" => $view, "id" => $edit_id, "return_link" => $redirect_url, "edit_link" => ADMIN_ROOT . $bigtree["module"]["route"] . "/" . $edit_action["route"] . "/{$edit_id}/", "errors" => $bigtree["errors"], "crops" => $bigtree["crops"]);
if (count($bigtree["crops"])) {
    BigTree::redirect($bigtree["form_root"] . "crop/");
} elseif (count($bigtree["errors"])) {
    BigTree::redirect($bigtree["form_root"] . "error/");
} else {
    BigTree::redirect($redirect_url);
}