本文整理汇总了PHP中BigTree类的典型用法代码示例。如果您正苦于以下问题:PHP BigTree类的具体用法?PHP BigTree怎么用?PHP BigTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BigTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _localDrawCalloutLevel
function _localDrawCalloutLevel($keys, $level)
{
global $field;
foreach ($level as $key => $value) {
if (is_array($value)) {
_localDrawCalloutLevel(array_merge($keys, array($key)), $value);
} else {
?>
<input type="hidden" name="<?php
echo $field["key"];
?>
[<?php
echo implode("][", $keys);
?>
][<?php
echo $key;
?>
]" value="<?php
echo BigTree::safeEncode($value);
?>
" />
<?php
}
}
}
示例2: _localCleanup
function _localCleanup()
{
// Remove the package directory, we do it backwards because the "deepest" files are last
$contents = @array_reverse(BigTree::directoryContents(SERVER_ROOT . "cache/package/"));
foreach ((array) $contents as $file) {
@unlink($file);
@rmdir($file);
}
@rmdir(SERVER_ROOT . "cache/package/");
}
示例3: oAuthRedirect
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}");
}
示例4: __construct
function __construct($cache = true)
{
parent::__construct("bigtree-internal-salesforce-api", "Salesforce API", "org.bigtreecms.api.salesforce", $cache);
// Set OAuth Return URL
$this->ReturnURL = ADMIN_ROOT . "developer/services/salesforce/return/";
// Change things if we're in the test environment.
if ($this->Settings["test_environment"]) {
$this->AuthorizeURL = str_ireplace("login.", "test.", $this->AuthorizeURL);
$this->TokenURL = str_replace("login.", "test.", $this->TokenURL);
}
// Get a new access token for this session.
$this->Connected = false;
if ($this->Settings["refresh_token"]) {
$response = json_decode(BigTree::cURL($this->TokenURL, array("grant_type" => "refresh_token", "client_id" => $this->Settings["key"], "client_secret" => $this->Settings["secret"], "refresh_token" => $this->Settings["refresh_token"])), true);
if ($response["access_token"]) {
$this->InstanceURL = $response["instance_url"];
$this->EndpointURL = $this->InstanceURL . "/services/data/v28.0/";
$this->Settings["token"] = $response["access_token"];
$this->Connected = true;
}
}
}
示例5: htmlspecialchars
} else {
?>
<input type="text" disabled="disabled" value="Please select "Other Table"" />
<?php
}
?>
</div>
</fieldset>
<fieldset>
<label>Sort By</label>
<div data-name="mtm-sort" class="sort_by pop-dependant mtm-other-table">
<?php
if ($data["mtm-other-table"]) {
?>
<select name="mtm-sort"><?php
BigTree::getFieldSelectOptions($data["mtm-other-table"], $data["mtm-sort"], true);
?>
</select>
<?php
} else {
?>
<input type="text" disabled="disabled" value="Please select "Other Table"" />
<?php
}
?>
</div>
</fieldset>
<fieldset>
<label>List Parser Function</label>
<input type="text" name="mtm-list-parser" value="<?php
echo htmlspecialchars($data["mtm-list-parser"]);
示例6: foreach
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/");
示例7: update
function update($id, $fields, $values = false, $ignore_cache = false)
{
$id = sqlescape($id);
// Turn a key => value array into pairs
if ($values === false && is_array($fields)) {
$values = $fields;
$fields = array_keys($fields);
}
// Multiple columns to update
if (is_array($fields)) {
$query_parts = array();
foreach ($fields as $key) {
$val = current($values);
if (is_array($val)) {
$val = BigTree::json(BigTree::translateArray($val));
} else {
$val = BigTreeAdmin::autoIPL($val);
}
$query_parts[] = "`{$key}` = '" . sqlescape($val) . "'";
next($values);
}
sqlquery("UPDATE `" . $this->Table . "` SET " . implode(", ", $query_parts) . " WHERE id = '{$id}'");
// Single column to update
} else {
if (is_array($values)) {
$val = json_encode(BigTree::translateArray($values));
} else {
$val = BigTreeAdmin::autoIPL($values);
}
sqlquery("UPDATE `" . $this->Table . "` SET `{$fields}` = '" . sqlescape($val) . "' WHERE id = '{$id}'");
}
if (!$ignore_cache) {
BigTreeAutoModule::recacheItem($id, $this->Table);
}
}
示例8: array
<?php
$bigtree["report"] = BigTreeAutoModule::getReport($bigtree["module_action"]["report"]);
$bigtree["form"] = BigTreeAutoModule::getRelatedFormForReport($bigtree["report"]);
$bigtree["view"] = $bigtree["report"]["view"] ? BigTreeAutoModule::getView($bigtree["report"]["view"]) : BigTreeAutoModule::getRelatedViewForReport($bigtree["report"]);
if ($admin->Level > 1) {
$bigtree["subnav_extras"][] = array("link" => ADMIN_ROOT . "developer/modules/reports/edit/" . $bigtree["report"]["id"] . "/?return=front", "icon" => "setup", "title" => "Edit in Developer");
}
$action = $bigtree["commands"][0];
if ($action == "csv") {
include BigTree::path("admin/auto-modules/reports/csv.php");
} elseif ($action == "view") {
include BigTree::path("admin/auto-modules/reports/view.php");
} else {
include BigTree::path("admin/auto-modules/reports/filter.php");
}
示例9:
<?php
if ($_SERVER["HTTP_REFERER"] != ADMIN_ROOT . "users/profile/") {
?>
<div class="container">
<section>
<p>To update your profile, please access your <a href="<?php
echo ADMIN_ROOT;
?>
users/profile/">Profile</a> page directly.</p>
</section>
</div>
<?php
} else {
if ($_POST["password"] && !$admin->validatePassword($_POST["password"])) {
$_SESSION["bigtree_admin"]["update_profile"] = $_POST;
$admin->growl("Users", "Invalid Password", "error");
BigTree::redirect(ADMIN_ROOT . "users/profile/");
}
$admin->updateProfile($_POST);
$admin->growl("Users", "Updated Profile");
BigTree::redirect(ADMIN_ROOT . "dashboard/");
}
示例10: json_decode
$table = $_POST["table"];
$type = $_POST["type"];
$options = json_decode(str_replace(array("\r", "\n"), array('\\r', '\\n'), $_POST["data"]), true);
$filter = isset($options["filter"]) ? $options["filter"] : "";
?>
<div style="width: 450px;">
<fieldset>
<label>Filter Function <small>(function name only, <a href="http://www.bigtreecms.org/docs/dev-guide/modules/advanced-techniques/view-filters/" target="_blank">learn more</a>)</small></label>
<input type="text" name="filter" value="<?php
echo htmlspecialchars($filter);
?>
" />
</fieldset>
<?php
$path = BigTree::path("admin/ajax/developer/view-options/" . $type . ".php");
if (file_exists($path)) {
include $path;
}
?>
</div>
<script>
BigTree.localTable = false;
$(".table_select").change(function() {
x = 0;
BigTree.localTable = $(this).val();
$(this).parents("fieldset").nextAll("fieldset").each(function() {
div = $(this).find("div");
示例11: oAuthRefreshToken
function oAuthRefreshToken()
{
$r = json_decode(BigTree::cURL($this->TokenURL, array("client_id" => $this->Settings["key"], "client_secret" => $this->Settings["secret"], "refresh_token" => $this->Settings["refresh_token"], "grant_type" => "refresh_token")));
if ($r->access_token) {
$this->Settings["token"] = $r->access_token;
$this->Settings["expires"] = strtotime("+" . $r->expires_in . " seconds");
}
}
示例12: array
<?php
//!BigTree Warnings
$warnings = array();
$writable_directories = array("cache/", "custom/inc/modules/", "custom/admin/ajax/developer/field-options/", "custom/admin/form-field-types/draw/", "custom/admin/form-field-types/process/", "templates/routed/", "templates/basic/", "templates/callouts/", "site/files/");
foreach ($writable_directories as $directory) {
if (!BigTree::isDirectoryWritable(SERVER_ROOT . $directory)) {
$warnings[] = array("parameter" => "Directory Permissions Error", "rec" => "Make " . SERVER_ROOT . $directory . " writable.", "status" => "bad");
}
}
// Go through every module form and look for uploads, make sure the directories exist and are writable.
$forms = array_merge($admin->getModuleForms(), $admin->getModuleEmbedForms());
foreach ($forms as $form) {
foreach (array_filter((array) $form["fields"]) as $key => $data) {
if ($data["directory"]) {
if (!BigTree::isDirectoryWritable(SITE_ROOT . $data["directory"])) {
$warnings[] = array("parameter" => "Directory Permissions Error", "rec" => "Make " . SITE_ROOT . $data["directory"] . " writable.", "status" => "bad");
}
}
}
}
// Search all content for links to the admin.
$bad = $admin->getPageAdminLinks();
foreach ($bad as $f) {
$warnings[] = array("parameter" => "Bad Admin Links", "rec" => 'Remove links to Admin on <a href="' . ADMIN_ROOT . 'pages/edit/' . $f["id"] . '/">' . $f["nav_title"] . '</a>', "status" => "ok");
}
if (!file_exists(SITE_ROOT . "favicon.ico")) {
$warnings[] = array("parameter" => "Missing Favicon", "rec" => "Create a favicon and place it in the /site/ root.", "status" => "ok");
}
//!Server Parameters
$mysql = extension_loaded('mysql') || extension_loaded("mysqli") ? "good" : "bad";
示例13: foreach
}
?>
<?php
foreach ($list as $option) {
?>
<option value="<?php
echo BigTree::safeEncode($option["value"]);
?>
"<?php
if ($field["value"] == $option["value"]) {
?>
selected="selected"<?php
}
if ($option["access_level"]) {
?>
data-access-level="<?php
echo $option["access_level"];
?>
"<?php
}
?>
><?php
echo BigTree::safeEncode(BigTree::trimLength(strip_tags($option["description"]), 100));
?>
</option>
<?php
}
?>
</select>
<?php
}
示例14: array_filter
<?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
示例15: foreach
BigTree::globalizeArray($view);
?>
<div class="table" id="" class="image_list">
<summary><h2>Search Results</h2></summary>
<header>
<span class="view_column">Click an image to edit it.</span>
</header>
<section>
<ul id="image_list_<?php
echo $view["id"];
?>
" class="image_list">
<?php
foreach ($items as $item) {
if ($options["preview_prefix"]) {
$preview_image = BigTree::prefixFile($item[$options["image"]], $options["preview_prefix"]);
} else {
$preview_image = $item[$options["image"]];
}
?>
<li id="row_<?php
echo $item["id"];
?>
">
<a class="image" href="<?php
echo $view["edit_url"] . $item["id"];
?>
/"><img src="<?php
echo $preview_image;
?>
" alt="" /></a>