if (isset($_POST["view"])) { $bigtree["view"] = BigTreeAutoModule::getView($_POST["view"]); $bigtree["module"] = $admin->getModule(BigTreeAutoModule::getModuleForView($bigtree["view"])); } $permission = $admin->getAccessLevel($bigtree["module"]["id"]); // Setup the preview action if we have a preview URL and field. if ($bigtree["view"]["preview_url"]) { $bigtree["view"]["actions"]["preview"] = "on"; } $module_page = ADMIN_ROOT . $bigtree["module"]["route"] . "/"; // Retrieve our results. if (isset($_POST["search"]) && $_POST["search"] || isset($_GET["search"]) && $_GET["search"]) { $search = isset($_GET["search"]) ? $_GET["search"] : $_POST["search"]; $bigtree["view"]["options"]["per_page"] = 10000000; $r = BigTreeAutoModule::getSearchResults($bigtree["view"], 1, $search, "column1 ASC", false); $items = $r["results"]; } else { $items = BigTreeAutoModule::getViewData($bigtree["view"], "position DESC, CAST(id AS UNSIGNED) ASC", "both"); $search = ""; } // We're going to append information to the end of an edit string so that we can return to the same page / set of search results after submitting a form. $edit_append = "?view_data=" . base64_encode(serialize(array("view" => $bigtree["view"]["id"], "search" => $search))); foreach ($items as $item) { // Stop the item status notice if (!isset($item["status"])) { $item["status"] = false; } if ($item["status"] == "p") { $status = "Pending"; $status_class = "pending";
<?php $view = BigTreeAutoModule::getView(end($bigtree["path"])); $entries = BigTreeAutoModule::getSearchResults($view, 1); $entries = array_slice($entries["results"], 0, 5); if ($view == "images" || $view == "images-group") { ?> <p>The view type does not have any style settings.</p> <?php } else { $fields = $view["fields"]; $actions = $view["actions"]; if ($view["preview_url"]) { $actions["preview"] = "on"; } ?> <section class="inset_block"> <p>Drag the bounds of the columns to resize them. Don't forget to save your changes.</p> </section> <div class="table"> <summary><h2>Example View Information</h2></summary> <header> <?php $x = 0; foreach ($fields as $key => $field) { $x++; ?> <span class="view_column" style="width: <?php echo $field["width"]; ?> px; cursor: move;" name="<?php
} elseif (isset($options["sort"])) { $sort = $options["sort"]; } else { $sort = "id DESC"; } // Same thing we were going to do above but omit the sort stuff. $edit_append = "?view_data=" . base64_encode(serialize(array("view" => $bigtree["view"]["id"], "search" => $search, "page" => $page))); } $module_page = ADMIN_ROOT . $bigtree["module"]["route"] . "/"; // Setup the preview action if we have a preview URL and field. if ($bigtree["view"]["preview_url"]) { $actions["preview"] = "on"; } $perm = $admin->getAccessLevel($bigtree["module"]); // Handle how many pages we have and get our results. $data = BigTreeAutoModule::getSearchResults($bigtree["view"], $page, $search, $sort, false); $pages = $data["pages"]; $items = $data["results"]; foreach ($items as $item) { // If it's straight from the db, it's published. if (!isset($item["status"])) { $item["status"] = ""; } if ($item["status"] == "p") { $status = "Pending"; $status_class = "pending"; } elseif ($item["status"] == "c") { $status = "Changed"; $status_class = "pending"; } else { $status = "Published";
?> Actions<?php } ?> </span> </header> <?php $gc = 0; foreach ($groups as $group => $title) { // If the group title contains the search phrase, show everything in that group. if (!$search || strpos(strtolower($title), strtolower($search)) !== false) { $search_in = ""; } else { $search_in = $search; } $r = BigTreeAutoModule::getSearchResults($bigtree["view"], 1, $search_in, $sort, $group); if (count($r["results"])) { $gc++; ?> <header class="group"><?php echo isset($group_title_overrides[$title]) ? $group_title_overrides[$title] : $title; ?> </header> <ul id="sort_table_<?php echo $gc; ?> "> <?php foreach ($r["results"] as $item) { if ($item["status"] == "p") { $status = "Pending";