Ejemplo n.º 1
0
<?php

BigTree::globalizePOSTVars();
$p =& $_SESSION["bigtree_admin"]["developer"]["package"];
$p["module_groups"] = array();
$p["modules"] = $modules;
$p["templates"] = $templates;
$p["callouts"] = $callouts;
$p["settings"] = $settings;
$p["feeds"] = $feeds;
$p["field_types"] = $field_types;
// Get a list of custom field types so we can auto include any that modules rely on
$ft = $admin->getFieldTypes();
foreach ($ft as $type) {
    $custom_field_types[$type["id"]] = true;
}
// Infer tables/files to include from the modules
foreach ((array) $modules as $module_id) {
    if ($module_id) {
        $module = $admin->getModule($module_id);
        $actions = $admin->getModuleActions($module_id);
        // Get all the tables of the module's actions.
        foreach ($actions as $action) {
            if ($action["form"] || $action["view"] || $action["report"]) {
                if ($action["form"]) {
                    $auto = BigTreeAutoModule::getForm($action["form"]);
                    // Figure out what tables and field types the form uses and automatically add them.
                    foreach ($auto["fields"] as $field) {
                        // Database populated list? Include the table it pulls from.
                        if ($field["type"] == "list" && $field["options"]["list_type"] == "db") {
                            if (!in_array($field["options"]["pop-table"] . "#structure", $p["tables"]) && substr($field["options"]["pop-table"], 0, 8) != "bigtree_") {
Ejemplo n.º 2
0
<?php

BigTree::globalizePOSTVars("htmlspecialchars");
// Get cleaned up prices, dates, and entries
if ($early_bird) {
    $early_bird_date = "'" . date("Y-m-d H:i:s", strtotime(str_replace("@", "", $_POST["early_bird_date"]))) . "'";
    $early_bird_base_price = floatval(str_replace(array('$', ',', ' '), '', $_POST["early_bird_base_price"]));
} else {
    $early_bird_date = "NULL";
}
$base_price = floatval(str_replace(array('$', ',', ' '), '', $_POST["base_price"]));
$max_entries = intval($max_entries);
// Create the form.
$form = BigTreeAutoModule::createItem("btx_form_builder_forms", array("title" => $title, "paid" => $paid, "base_price" => $base_price, "early_bird_base_price" => $early_bird_base_price, "early_bird_date" => $early_bird_date, "limit_entries" => $limit_entries, "max_entries" => $max_entries));
// Setup the default column, sort position, alignment inside columns.
$position = count($_POST["type"]);
$column = 0;
$alignment = "";
foreach ($_POST["type"] as $key => $type) {
    if ($type == "column_start") {
        // If we're starting a set of columns and don't have an alignment it's a new set.
        if (!$alignment) {
            $column = BigTreeAutoModule::createItem("btx_form_builder_fields", array("form" => $form, "type" => "column", "position" => $position));
            $alignment = "left";
            // Otherwise we're starting the second column of the set, just change the alignment.
        } elseif ($alignment == "left") {
            $alignment = "right";
        }
    } elseif ($type == "column_end") {
        if ($alignment == "right") {
            $column = 0;