Beispiel #1
0
									<span class="permission_level"><input type="radio" data-category="Module" data-key="<?php 
            echo $m["id"];
            ?>
" name="permissions[module][<?php 
            echo $m["id"];
            ?>
]" value="n" <?php 
            if (!$permissions["module"][$m["id"]] || $permissions["module"][$m["id"]] == "n") {
                ?>
checked="checked" <?php 
            }
            ?>
/></span>
									<?php 
            if (isset($gbp["enabled"]) && $gbp["enabled"]) {
                if (BigTree::tableExists($gbp["other_table"])) {
                    $categories = array();
                    $ot = sqlescape($gbp["other_table"]);
                    $tf = sqlescape($gbp["title_field"]);
                    if ($tf && $ot) {
                        $q = sqlquery("SELECT id,`{$tf}` FROM `{$ot}` ORDER BY `{$tf}` ASC");
                        ?>
									<ul class="depth_2"<?php 
                        if ($closed) {
                            ?>
 style="display: none;"<?php 
                        }
                        ?>
>
										<?php 
                        while ($c = sqlfetch($q)) {
Beispiel #2
0
<?php

$db_error = false;
$is_group_based_perm = false;
$list = array();
// Database populated list.
if ($field["options"]["list_type"] == "db") {
    $list_table = $field["options"]["pop-table"];
    $list_id = $field["options"]["pop-id"];
    $list_title = $field["options"]["pop-description"];
    $list_sort = $field["options"]["pop-sort"];
    // If debug is on we're going to check if the tables exists...
    if ($bigtree["config"]["debug"] && !BigTree::tableExists($list_table)) {
        $db_error = true;
    } else {
        $q = sqlquery("SELECT `id`,`{$list_title}` FROM `{$list_table}` ORDER BY {$list_sort}");
        // Check if we're doing module based permissions on this table.
        if ($bigtree["module"] && $bigtree["module"]["gbp"]["enabled"] && $form["table"] == $bigtree["module"]["gbp"]["table"] && $key == $bigtree["module"]["gbp"]["group_field"]) {
            $is_group_based_perm = true;
            while ($f = sqlfetch($q)) {
                // Find out whether the logged in user can access a given group, and if so, specify the access level.
                $access_level = $admin->canAccessGroup($bigtree["module"], $f["id"]);
                if ($access_level) {
                    $list[] = array("value" => $f["id"], "description" => $f[$list_title], "access_level" => $access_level);
                }
            }
            // We're not doing module group based permissions, get a regular list.
        } else {
            while ($f = sqlfetch($q)) {
                $list[] = array("value" => $f["id"], "description" => $f[$list_title]);
            }
Beispiel #3
0
<?php

BigTree::globalizePOSTVars();
$errors = array();
// Check if the table exists
if (BigTree::tableExists($table)) {
    $errors["table"] = "The table you chose already exists.";
}
// Check if the class name exists
if (class_exists($class)) {
    $errors["class"] = "The class name you chose already exists.";
}
if (count($errors)) {
    $_SESSION["developer"]["designer_errors"] = $errors;
    $_SESSION["developer"]["saved_module"] = $_POST;
    BigTree::redirect(DEVELOPER_ROOT . "modules/designer/");
}
if ($group_new) {
    $group = $admin->createModuleGroup($group_new, "on");
} else {
    $group = $group_existing;
}
$id = $admin->createModule($name, $group, $class, $table, $gbp, $icon);
// Create the table.
sqlquery("CREATE TABLE `{$table}` (`id` int(11) UNSIGNED NOT NULL auto_increment, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci");
BigTree::redirect(DEVELOPER_ROOT . "modules/designer/form/?table=" . urlencode($table) . "&module={$id}");