function oAuthRedirect() { $this->Settings["token_secret"] = ""; $response = $this->callAPI("https://api.login.yahoo.com/oauth/v2/get_request_token", "GET", array("oauth_callback" => $this->ReturnURL)); parse_str($response); if ($oauth_callback_confirmed != "true") { global $admin; $admin->growl("Yahoo BOSS API", "Consumer Key or Secret invalid.", "error"); BigTree::redirect(ADMIN_ROOT . "developer/geocoding/yahoo-boss/"); } $this->Settings["token_secret"] = $oauth_token_secret; BigTree::redirect("https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token={$oauth_token}"); }
<?php $page = end($bigtree["path"]); $page_data = $cms->getPendingPage($page); $admin->deletePage($page); BigTree::redirect(ADMIN_ROOT . "pages/view-tree/" . $page_data["parent"] . "/");
foreach ((array) $p["field_types"] as $type) { if ($type) { if (file_exists(SERVER_ROOT . "custom/admin/form-field-types/draw/{$type}.php")) { $p["files"][] = SERVER_ROOT . "custom/admin/form-field-types/draw/{$type}.php"; } if (file_exists(SERVER_ROOT . "custom/admin/form-field-types/process/{$type}.php")) { $p["files"][] = SERVER_ROOT . "custom/admin/form-field-types/process/{$type}.php"; } if (file_exists(SERVER_ROOT . "custom/admin/ajax/developer/field-options/{$type}.php")) { $p["files"][] = SERVER_ROOT . "custom/admin/ajax/developer/field-options/{$type}.php"; } } } // Make sure we have no dupes $p["module_groups"] = array_unique($p["module_groups"]); $p["modules"] = array_unique($p["modules"]); $p["templates"] = array_unique($p["templates"]); $p["callouts"] = array_unique($p["callouts"]); $p["settings"] = array_unique($p["settings"]); $p["feeds"] = array_unique($p["feeds"]); $p["field_types"] = array_unique($p["field_types"]); $p["files"] = array_unique($p["files"]); $p["tables"] = array_unique($p["tables"]); // Sort them to make them easier to read foreach ($p as &$part) { if (is_array($part)) { asort($part); } } BigTree::redirect(DEVELOPER_ROOT . "packages/build/files/");
<?php $item = $admin->getSetting(end($bigtree["path"])); if ($item["system"]) { $admin->growl("Developer", "Access Denied", "error"); BigTree::redirect(DEVELOPER_ROOT . "settings/"); } else { $success = $admin->updateSetting(end($bigtree["path"]), $_POST); if ($success) { $admin->growl("Developer", "Updated Setting"); BigTree::redirect(DEVELOPER_ROOT . "settings/"); } else { $_SESSION["bigtree_admin"]["developer"]["setting_data"] = $_POST; $_SESSION["bigtree_admin"]["developer"]["error"] = "The ID you specified is already in use by another Setting."; BigTree::redirect(DEVELOPER_ROOT . "settings/edit/" . end($bigtree["path"]) . "/"); } }
function oAuthRedirect() { $this->Settings["token_secret"] = ""; $admin = new BigTreeAdmin(); $r = $this->callAPI("http://www.flickr.com/services/oauth/request_token", "GET", array("oauth_callback" => $this->ReturnURL)); parse_str($r); if ($oauth_callback_confirmed) { $this->Settings["token"] = $oauth_token; $this->Settings["token_secret"] = $oauth_token_secret; header("Location: http://www.flickr.com/services/oauth/authorize?perms=delete&oauth_token=" . $oauth_token); die; } else { $admin->growl($oauth_problem, "Flickr API", "error"); BigTree::redirect(ADMIN_ROOT . "developer/services/flickr/"); } }
} $use_cases = is_array($type["use_cases"]) ? sqlescape(json_encode($type["use_cases"])) : sqlescape($type["use_cases"]); $self_draw = $type["self_draw"] ? "'on'" : "NULL"; sqlquery("INSERT INTO bigtree_field_types (`id`,`name`,`use_cases`,`self_draw`) VALUES ('" . sqlescape($type["id"]) . "','" . sqlescape($type["name"]) . "','{$use_cases}',{$self_draw})"); } } // Import files foreach ($json["files"] as $file) { BigTree::copyFile(SERVER_ROOT . "cache/package/{$file}", SERVER_ROOT . $file); } // Run SQL foreach ($json["sql"] as $sql) { sqlquery($sql); } // Empty view cache sqlquery("DELETE FROM bigtree_module_view_cache"); // Remove the package directory, we do it backwards because the "deepest" files are last $contents = @array_reverse(BigTree::directoryContents(SERVER_ROOT . "cache/package/")); foreach ($contents as $file) { @unlink($file); @rmdir($file); } @rmdir(SERVER_ROOT . "cache/package/"); // Clear module class cache and field type cache. @unlink(SERVER_ROOT . "cache/bigtree-module-class-list.json"); @unlink(SERVER_ROOT . "cache/bigtree-form-field-types.json"); sqlquery("INSERT INTO bigtree_extensions (`id`,`type`,`name`,`version`,`last_updated`,`manifest`) VALUES ('" . sqlescape($json["id"]) . "','package','" . sqlescape($json["title"]) . "','" . sqlescape($json["version"]) . "',NOW(),'" . sqlescape(json_encode($json)) . "')"); sqlquery("SET foreign_key_checks = 1"); $admin->growl("Developer", "Installed Package"); BigTree::redirect(DEVELOPER_ROOT . "packages/install/complete/");
<?php BigTree::globalizePOSTVars(); $fields = array(); foreach ($_POST["type"] as $key => $val) { $field = json_decode(str_replace(array("\r", "\n"), array('\\r', '\\n'), $_POST["options"][$key]), true); $field["type"] = $val; $field["title"] = htmlspecialchars($_POST["titles"][$key]); $field["subtitle"] = htmlspecialchars($_POST["subtitles"][$key]); $fields[$key] = $field; } $admin->updateModuleForm(end($bigtree["path"]), $title, $table, $fields, $preprocess, $callback, $default_position, $return_view, $return_url, $tagging); $action = $admin->getModuleActionForForm(end($bigtree["path"])); $admin->growl("Developer", "Updated Module Form"); if ($_POST["return_page"]) { BigTree::redirect($_POST["return_page"]); } else { BigTree::redirect(DEVELOPER_ROOT . "modules/edit/" . $action["module"] . "/"); }
function makeSecure() { if (!$_SERVER["HTTPS"]) { BigTree::redirect("https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"], "301"); } $this->Secure = true; }
<a class="button blue" href="<?php echo $page_link . $page_vars; ?> ">Try Again</a> <a class="button" href="<?php echo DEVELOPER_ROOT; ?> extensions/">Return to Extensions List</a> </footer> </div> <?php } else { // If we're not using local install and the config settings only allow for HTTPS logins, redirect $secure = !empty($_SERVER["HTTPS"]) && $_SERVER['HTTPS'] !== "off" || $_SERVER["SERVER_PORT"] == 443; if ($updater->Method != "Local" && $bigtree["config"]["force_secure_login"] && !$secure) { BigTree::redirect(str_replace("http://", "https://", $page_link) . "check-file/" . $page_vars); } ?> <form method="post" action="<?php echo $page_link; ?> process/<?php echo $page_vars; ?> "> <div class="container"> <summary><h2>Upgrade Extension</h2></summary> <section> <?php if ($updater->Method == "Local") { ?>
<?php $admin->deletePageDraft(end($bigtree["path"])); BigTree::redirect(ADMIN_ROOT . "pages/edit/" . $page . "/");
} // Draw the main page. include $bigtree["routed_inc"]; // Draw the footers. $bigtree["routed_footers"] = array_reverse($bigtree["routed_footers"]); foreach ($bigtree["routed_footers"] as $footer) { include $footer; } } elseif ($bigtree["page"]["template"]) { if ($extension) { include SERVER_ROOT . "extensions/{$extension}/templates/basic/{$template}.php"; } else { include SERVER_ROOT . "templates/basic/" . $bigtree["page"]["template"] . ".php"; } } else { BigTree::redirect($bigtree["page"]["external"]); } // Check for standard sitemap } else { if ($bigtree["path"][0] == "sitemap" && !$bigtree["path"][1]) { include SERVER_ROOT . "templates/basic/_sitemap.php"; // We've got a 404, check for old routes or throw one. } else { // Let's check if it's in the old routing table. $cms->checkOldRoutes($bigtree["path"]); // It's not, it's a 404. if ($cms->handle404($_GET["bigtree_htaccess_url"])) { include SERVER_ROOT . "templates/basic/_404.php"; } } }
} 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); }
$group = $admin->createModuleGroup($group_new, "on"); } else { $group = $group_existing; } $id = $admin->createModule($name, $group, $class, $table, $gbp, $icon, $route); // Route was incorrect if we failed if (!$id) { $_POST["group_existing"] = $group; unset($_POST["group_new"]); $_SESSION["bigtree_admin"]["saved"] = $_POST; $admin->growl("Developer", "Invalid Route"); BigTree::redirect(DEVELOPER_ROOT . "modules/add/?error=route"); } if (!$table) { $admin->growl("Developer", "Created Module"); BigTree::redirect(DEVELOPER_ROOT . "modules/"); } ?> <div class="container"> <section> <h3><?php echo htmlspecialchars($name); ?> </h3> <p>If you plan on programming this module manually, you can leave now. Otherwise, click the continue button below to setup the module's landing view.</p> </section> <footer> <a href="<?php echo DEVELOPER_ROOT; ?> modules/views/add/?new_module=true&module=<?php
$package = $admin->getPackage($bigtree["commands"][0]); $j = json_decode($package["manifest"], true); $_SESSION["bigtree_admin"]["developer"]["package"] = array("id" => $j["id"], "version" => $j["version"], "compatibility" => $j["compatibility"], "title" => $j["title"], "description" => $j["description"], "keywords" => implode(", ", $j["keywords"]), "author" => $j["author"], "files" => array(), "modules" => array(), "templates" => array(), "callouts" => array(), "settings" => array(), "feeds" => array(), "field_types" => array(), "tables" => array()); foreach ($j["components"] as $k => $v) { if ($k == "tables") { $tables = array(); foreach ($v as $table) { $_SESSION["bigtree_admin"]["developer"]["package"]["tables"][] = "{$table}#structure"; } } else { foreach ($v as $item) { $_SESSION["bigtree_admin"]["developer"]["package"][$k][] = $item["id"]; } } } foreach ($j["licenses"] as $l => $d) { if (isset($available_licenses["Open Source"][$l])) { $_SESSION["bigtree_admin"]["developer"]["package"]["licenses"][] = $l; } elseif (isset($available_licenses["Closed Source"][$l])) { $_SESSION["bigtree_admin"]["developer"]["package"]["license"] = $l; } else { $_SESSION["bigtree_admin"]["developer"]["package"]["license_name"] = $l; $_SESSION["bigtree_admin"]["developer"]["package"]["license_url"] = $d; } } foreach ($j["files"] as $file) { $_SESSION["bigtree_admin"]["developer"]["package"]["files"][] = SERVER_ROOT . $file; } BigTree::redirect(DEVELOPER_ROOT . "packages/build/details/");
<?php BigTree::redirect("view-tree/0/");
$storage->Settings->Container = $_POST["container"]; // If we're using Rackspace, we need to explicitly CDN enable this container. if ($_POST["service"] == "rackspace") { BigTree::cURL($cloud->RackspaceCDNEndpoint . "/" . $_POST["container"], "", array(CURLOPT_PUT => true, CURLOPT_HTTPHEADER => array("X-Auth-Token: " . $cloud->Settings["rackspace"]["token"], "X-Cdn-Enabled: true"))); } } else { // We're only going to try to get a unique bucket 10 times to prevent an infinite loop $x = 0; $success = false; while (!$success && $x < 10) { $container = $cms->urlify(uniqid("bigtree-container-", true)); $success = $cloud->createContainer($container, true); $x++; } if ($success) { $storage->Settings->Container = $container; } else { $admin->growl("Developer", "Failed to create container.", "error"); BigTree::redirect(DEVELOPER_ROOT . "cloud-storage/"); } } $container = $cloud->getContainer($storage->Settings->Container); if ($container === false) { $admin->growl("Developer", "Failed to read container.", "error"); BigTree::redirect(DEVELOPER_ROOT . "cloud-storage/"); } // Remove all existing cloud file caches and import new data $cloud->resetCache($container["flat"]); $admin->growl("Developer", "Changed Default Storage"); BigTree::redirect(DEVELOPER_ROOT . "cloud-storage/");
<?php $admin->requireLevel(1); $analytics->Settings["profile"] = $_POST["profile"]; $admin->growl("Analytics", "Profile Set"); BigTree::redirect(MODULE_ROOT . "cache/");
<?php if ($_POST["group_new"]) { $group = $admin->createCalloutGroup($_POST["group_new"]); } else { $group = $_POST["group_existing"]; } $admin->updateCallout($_POST["id"], $_POST["name"], $_POST["description"], $_POST["level"], $_POST["resources"], $_POST["display_field"], $_POST["display_default"], $group); $admin->growl("Developer", "Updated Callout"); BigTree::redirect(DEVELOPER_ROOT . "callouts/");
<?php $admin->deleteExtension($bigtree["commands"][0]); $admin->growl("Developer", "Uninstalled Extension"); BigTree::redirect(DEVELOPER_ROOT . "extensions/");
<?php $updates = @json_decode(BigTree::cURL("http://www.bigtreecms.org/ajax/version-check/?current_version=" . BIGTREE_VERSION), true); $update = $updates[$_GET["type"]]; if (!$update) { $admin->growl("Developer", "Couldn't Get Download Information", "error"); BigTree::redirect(DEVELOPER_ROOT); } ?> <div class="container"> <summary><h2>Upgrade BigTree</h2></summary> <section> <p>Please wait while we download the update...</p> </section> </div> <script> $.ajax("<?php echo ADMIN_ROOT; ?> ajax/developer/upgrade/download/", { type: "POST", data: { file: "<?php echo $update["file"]; ?> " }, complete: function() { window.location.href = "<?php echo DEVELOPER_ROOT; ?> upgrade/check-file/?type=<?php echo htmlspecialchars($_GET["type"]); ?> "; } });
<?php $_POST["id"] = $_GET["draft"]; include BigTree::path("admin/ajax/dashboard/approve-change.php"); $admin->growl("Pages", "Published Draft"); BigTree::redirect(ADMIN_ROOT . "pages/revisions/" . end($bigtree["commands"]) . "/");
<?php if (!count($_POST["send_to"]) || !$_POST["subject"] || !$_POST["message"]) { $_SESSION["saved_message"] = $_POST; BigTree::redirect(ADMIN_ROOT . "dashboard/messages/new/"); } $admin->createMessage($_POST["subject"], $_POST["message"], $_POST["send_to"]); $admin->growl("Message Center", "Sent Message"); BigTree::redirect(ADMIN_ROOT . "dashboard/messages/");
<?php // Check whether our database is running the latest revision of BigTree or not. $current_revision = $cms->getSetting("bigtree-internal-revision"); if ($current_revision < BIGTREE_REVISION && $admin->Level > 1) { BigTree::redirect(DEVELOPER_ROOT . "upgrade/database/"); } // Check for newer versions of BigTree $ignored_all = true; if (!$_COOKIE["bigtree_admin"]["deferred_update"]) { $updates = array_filter((array) @json_decode(BigTree::cURL("http://www.bigtreecms.org/ajax/version-check/?current_version=" . BIGTREE_VERSION, false, array(CURLOPT_CONNECTTIMEOUT => 1, CURLOPT_TIMEOUT => 5)), true)); // See if we've ignored these updates $ignorable = array(); foreach ($updates as $update) { if (!$_COOKIE["bigtree_admin"]["ignored_update"][$update["version"]]) { $ignored_all = false; } $ignorable[] = $update["version"]; } } // If we're ignoring updates through config, still ignore them if (!empty($bigtree["config"]["ignore_admin_updates"])) { $ignored_all = true; } // Updates are available and we didn't ignore them if (!$ignored_all && count($updates)) { ?> <div class="container"> <summary><h2>Update Available</h2></summary> <section> <p>You are currently running BigTree <?php
static function logout() { setcookie("bigtree_admin[email]", "", time() - 3600, str_replace(DOMAIN, "", WWW_ROOT)); setcookie("bigtree_admin[login]", "", time() - 3600, str_replace(DOMAIN, "", WWW_ROOT)); unset($_COOKIE["bigtree_admin"]); unset($_SESSION["bigtree_admin"]); BigTree::redirect(ADMIN_ROOT); }
<?php $admin->processCrops(json_decode($_POST["crop_info"], true)); // For embedded forms we let them process crops first since we're not saving the data to the database and we'll lose their uploads otherwise if (count($_SESSION["bigtree_admin"]["form_data"]["errors"])) { BigTree::redirect($bigtree["form_root"] . "error/?id=" . $bigtree["form"]["id"] . "&hash=" . $bigtree["form"]["hash"]); } else { unset($_SESSION["bigtree_admin"]["form_data"]); BigTree::redirect($bigtree["form_root"] . "complete/?id=" . $bigtree["form"]["id"] . "&hash=" . $bigtree["form"]["hash"]); }
BigTree::redirect($_SERVER["HTTP_REFERER"]); } $admin->requireLevel(1); $item = $admin->getSetting($_POST["id"]); if ($item["system"] || $item["locked"] && $admin->Level < 2) { $admin->growl("Settings", "Access Denied", "error"); } else { $bigtree["crops"] = array(); $bigtree["errors"] = array(); $bigtree["post_data"] = $_POST; $bigtree["file_data"] = BigTree::parsedFilesArray(); // Pretend like we're a normal field $field = array("type" => $item["type"], "title" => $item["title"], "key" => "value", "options" => json_decode($item["options"], true), "ignore" => false, "input" => $bigtree["post_data"]["value"], "file_input" => $bigtree["file_data"]["value"]); // Process the input $output = BigTreeAdmin::processField($field); if (!is_null($output)) { $admin->updateSettingValue($_POST["id"], $output); } $admin->growl("Settings", "Updated Setting"); } $_SESSION["bigtree_admin"]["form_data"] = array("page" => true, "return_link" => ADMIN_ROOT . "settings/", "edit_link" => ADMIN_ROOT . "settings/edit/" . $_POST["id"] . "/", "errors" => $bigtree["errors"]); // Track resource allocation $admin->allocateResources("settings", $_POST["id"]); if (count($bigtree["crops"])) { $_SESSION["bigtree_admin"]["form_data"]["crop_key"] = $cms->cacheUnique("org.bigtreecms.crops", $bigtree["crops"]); BigTree::redirect(ADMIN_ROOT . "settings/crop/"); } elseif (count($bigtree["errors"])) { BigTree::redirect(ADMIN_ROOT . "settings/error/"); } BigTree::redirect(ADMIN_ROOT . "settings/");
<?php BTXSocialFeed::sync(); $admin->growl("Social Feed", "Synced Stream"); BigTree::redirect(MODULE_ROOT);
function paypalExpressCheckoutRedirect($amount, $success_url, $cancel_url) { // Clean up the amount. $amount = round(floatval(str_replace(array('$', ','), "", $amount)), 2); $params = array(); $params["PAYMENTREQUEST_0_AMT"] = $amount; $params["AMT"] = $amount; $params["RETURNURL"] = $success_url; $params["CANCELURL"] = $cancel_url; // Payflow if ($this->Service == "payflow") { $params["TRXTYPE"] = "S"; $params["ACTION"] = "S"; $params["TENDER"] = "P"; $response = $this->sendPayflow($params); $this->Message = $response["RESPMSG"]; if ($response["RESULT"] == "0") { BigTree::redirect("https://www" . ($this->Environment == "test" ? ".sandbox" : "") . ".paypal.com/webscr?cmd=_express-checkout&token=" . urldecode($response["TOKEN"]) . "&AMT={$total_cost}&CURRENCYCODE=USD&RETURNURL={$return_urly}&CANCELURL={$cancel_url}"); } else { return false; } // PayPal Payments Pro } elseif ($this->Service == "paypal") { $params["METHOD"] = "SetExpressCheckout"; $params["PAYMENTACTION"] = "Sale"; $response = $this->sendPayPal($params); $this->Message = urldecode($response["L_LONGMESSAGE0"]); if ($response["ACK"] == "Success" || $response["ACK"] == "SuccessWithWarning") { BigTree::redirect("https://www" . ($this->Environment == "test" ? ".sandbox" : "") . ".paypal.com/webscr?cmd=_express-checkout&token=" . urldecode($response["TOKEN"]) . "&AMT={$total_cost}&CURRENCYCODE=USD&RETURNURL={$return_urly}&CANCELURL={$cancel_url}"); } else { return false; } // PayPal REST API } elseif ($this->Service == "paypal-rest") { $data = json_encode(array("intent" => "sale", "redirect_urls" => array("return_url" => $success_url, "cancel_url" => $cancel_url), "payer" => array("payment_method" => "paypal"), "transactions" => array(array("amount" => array("total" => $amount, "currency" => "USD"))))); $response = $this->sendPayPalREST("payments/payment", $data); if ($response->state == "created") { $_SESSION["bigtree"]["paypal-rest-payment-id"] = $response->id; foreach ($response->links as $link) { if ($link->rel == "approval_url") { BigTree::redirect($link->href); } } } else { $this->Errors = $response->details; $this->Message = $response->message; return false; } } else { return false; } }
$bigtree["subnav_extras"] = array(); // If we're not logged in and we're not trying to login or access an embedded form, redirect to the login page. if (!isset($admin->ID) && $bigtree["path"][1] != "login") { if (implode(array_slice($bigtree["path"], 1), "/") != "ajax/auto-modules/embeddable-form") { $_SESSION["bigtree_login_redirect"] = DOMAIN . $_SERVER["REQUEST_URI"]; BigTree::redirect(ADMIN_ROOT . "login/"); } } // Developer Mode On? if (isset($admin->ID) && !empty($bigtree["config"]["developer_mode"]) && $admin->Level < 2) { include BigTree::path("admin/pages/developer-mode.php"); $admin->stop(); } // Redirect to dashboard by default if we're not requesting anything. if (!$bigtree["path"][1]) { BigTree::redirect(ADMIN_ROOT . "dashboard/"); } // See if we're requesting something in /ajax/ if ($bigtree["path"][1] == "ajax") { $module = false; if ($bigtree["path"][2] != "auto-modules") { // If the current user isn't allowed in the module for the ajax, stop them. $module = $admin->getModuleByRoute($bigtree["path"][2]); if ($module && !$admin->checkAccess($module["id"])) { die("Permission denied to module: " . $module["name"]); } elseif (!$admin->ID) { die("Please login."); } if ($module) { $bigtree["current_module"] = $bigtree["module"] = $module; }
<?php $id = $_POST["id"]; if ($admin->getFieldType($id) || file_exists("../core/admin/form-field-types/draw/{$id}.php") || file_exists("../core/admin/form-field-types/process/{$id}.php")) { $_SESSION["bigtree_admin"]["error"] = "ID Used"; $_SESSION["bigtree_admin"]["saved"] = $_POST; BigTree::redirect(DEVELOPER_ROOT . "field-types/add/"); } elseif (!$admin->createFieldType($_POST["id"], $_POST["name"], $_POST["use_cases"], $_POST["self_draw"])) { $_SESSION["bigtree_admin"]["error"] = "ID Invalid"; $_SESSION["bigtree_admin"]["saved"] = $_POST; BigTree::redirect(DEVELOPER_ROOT . "field-types/add/"); } $admin->growl("Developer", "Created Field Type"); BigTree::redirect(DEVELOPER_ROOT . "field-types/new/{$id}/");