if (isset($_POST["_bigtree_return_view_data"])) { $return_view_data = unserialize(base64_decode($_POST["_bigtree_return_view_data"])); if (!$bigtree["form"]["return_view"] || $bigtree["form"]["return_view"] == $return_view_data["view"]) { $redirect_append = array(); unset($return_view_data["view"]); // We don't need the view passed back. foreach ($return_view_data as $key => $val) { $redirect_append[] = "{$key}=" . urlencode($val); } $redirect_append = "?" . implode("&", $redirect_append); } } else { $redirect_append = ""; } // Get the redirect location. $view = BigTreeAutoModule::getRelatedViewForForm($bigtree["form"]); // If we specify a specific return view, get that information if ($bigtree["form"]["return_view"]) { $view = BigTreeAutoModule::getView($bigtree["form"]["return_view"]); $action = $admin->getModuleActionForView($bigtree["form"]["return_view"]); if ($action["route"]) { $redirect_url = ADMIN_ROOT . $bigtree["module"]["route"] . "/" . $action["route"] . "/" . $redirect_append; } 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;