コード例 #1
0
ファイル: callouts.php プロジェクト: matthisamoto/Graphfan
    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
0
		</li>
		<?php 
        $x++;
    }
    ?>
	</ul>
	<footer>
		<select>
			<?php 
    foreach ($list as $id => $title) {
        ?>
			<option value="<?php 
        echo BigTree::safeEncode($id);
        ?>
"><?php 
        echo BigTree::safeEncode(BigTree::trimLength(strip_tags($title), 100));
        ?>
</option>
			<?php 
    }
    ?>
		</select>
		<a href="#" class="add button"><span class="icon_small icon_small_add"></span>Add Item</a>
		<?php 
    if ($field["options"]["show_add_all"]) {
        ?>
		<a href="#" class="add_all button">Add All</a>
		<?php 
    }
    if ($field["options"]["show_reset"]) {
        ?>
コード例 #3
0
ファイル: checkbox.php プロジェクト: kurt-planet/BigTree-CMS
?>
" name="<?php 
echo $field["key"];
?>
" id="<?php 
echo $field["id"];
?>
" <?php 
if ($field["value"]) {
    ?>
checked="checked" <?php 
}
if ($field["options"]["custom_value"]) {
    ?>
 value="<?php 
    echo BigTree::safeEncode($field["options"]["custom_value"]);
    ?>
"<?php 
}
?>
 />
<?php 
if ($field["title"]) {
    ?>
<label<?php 
    if ($field["required"]) {
        ?>
 class="required"<?php 
    }
    ?>
 class="for_checkbox" for="<?php 
コード例 #4
0
ファイル: images.php プロジェクト: matthisamoto/Graphfan
                        } else {
                            $class = "icon_disabled";
                        }
                    } else {
                        $class = $admin->getActionClass($action, $item);
                    }
                    $link = "#" . $item["id"];
                    $action = ucwords($action);
                    if ($data != "on") {
                        $data = json_decode($data, true);
                        $class = $data["class"];
                        $link = MODULE_ROOT . $data["route"] . "/" . $item["id"] . "/";
                        if ($data["function"]) {
                            $link = call_user_func($data["function"], $item);
                        }
                        $action = BigTree::safeEncode($data["name"]);
                    }
                    ?>
				<a href="<?php 
                    echo $link;
                    ?>
" class="<?php 
                    echo $class;
                    ?>
" title="<?php 
                    echo $action;
                    ?>
"></a>
				<?php 
                }
            }
コード例 #5
0
 static function cacheRecord($item, $view, $parsers, $poplists, $original_item)
 {
     // If we have a filter function, ask it first if we should cache it
     if (isset($view["options"]["filter"]) && $view["options"]["filter"]) {
         if (!call_user_func($view["options"]["filter"], $item)) {
             return false;
         }
     }
     // Stringify any columns that happen to be arrays (potentially from a pending record)
     foreach ($item as $key => $val) {
         if (is_array($val)) {
             $item[$key] = json_encode($val);
         }
     }
     global $cms;
     // Setup the fields and VALUES to INSERT INTO the cache table.
     $status = "l";
     $pending_owner = 0;
     if ($item["bigtree_changes"]) {
         $status = "c";
     } elseif (isset($item["bigtree_pending"])) {
         $status = "p";
         $pending_owner = $item["bigtree_pending_owner"];
     }
     $fields = array("view", "id", "status", "position", "approved", "archived", "featured", "pending_owner");
     // No more notices.
     $approved = isset($item["approved"]) ? $item["approved"] : "";
     $featured = isset($item["featured"]) ? $item["featured"] : "";
     $archived = isset($item["archived"]) ? $item["archived"] : "";
     $position = isset($item["position"]) ? $item["position"] : 0;
     $vals = array("'" . $view["id"] . "'", "'" . $item["id"] . "'", "'{$status}'", "'{$position}'", "'{$approved}'", "'{$archived}'", "'{$featured}'", "'" . $pending_owner . "'");
     // Figure out which column we're going to use to sort the view.
     if ($view["options"]["sort"]) {
         $sort_field = BigTree::nextSQLColumnDefinition(ltrim($view["options"]["sort"], "`"));
     } else {
         $sort_field = false;
     }
     // Let's see if we have a grouping field.  If we do, let's get all that info and cache it as well.
     if (isset($view["options"]["group_field"]) && $view["options"]["group_field"]) {
         $value = $item[$view["options"]["group_field"]];
         // Check for a parser
         if (isset($view["options"]["group_parser"]) && $view["options"]["group_parser"]) {
             $value = BigTree::runParser($item, $value, $view["options"]["group_parser"]);
         }
         $fields[] = "group_field";
         $vals[] = "'" . sqlescape($value) . "'";
         if (is_numeric($value) && $view["options"]["other_table"]) {
             $f = sqlfetch(sqlquery("SELECT * FROM `" . $view["options"]["other_table"] . "` WHERE id = '{$value}'"));
             if ($view["options"]["ot_sort_field"]) {
                 $fields[] = "group_sort_field";
                 $vals[] = "'" . sqlescape($f[$view["options"]["ot_sort_field"]]) . "'";
             }
         }
     }
     // Check for a nesting column
     if (isset($view["options"]["nesting_column"]) && $view["options"]["nesting_column"]) {
         $fields[] = "group_field";
         $vals[] = "'" . sqlescape($item[$view["options"]["nesting_column"]]) . "'";
     }
     // Group based permissions data
     if (isset($view["gbp"]["enabled"]) && $view["gbp"]["table"] == $view["table"]) {
         $fields[] = "gbp_field";
         $vals[] = "'" . sqlescape($item[$view["gbp"]["group_field"]]) . "'";
         $fields[] = "published_gbp_field";
         $vals[] = "'" . sqlescape($original_item[$view["gbp"]["group_field"]]) . "'";
     }
     // Run parsers
     foreach ($parsers as $key => $parser) {
         $item[$key] = BigTree::runParser($item, $item[$key], $parser);
     }
     // Run pop lists
     foreach ($poplists as $key => $pop) {
         $f = sqlfetch(sqlquery("SELECT `" . $pop["description"] . "` FROM `" . $pop["table"] . "` WHERE id = '" . $item[$key] . "'"));
         if (is_array($f)) {
             $item[$key] = current($f);
         }
     }
     // Insert into the view cache
     if ($view["type"] == "images" || $view["type"] == "images-grouped") {
         $fields[] = "column1";
         $vals[] = "'" . $item[$view["options"]["image"]] . "'";
     } else {
         $x = 1;
         foreach ($view["fields"] as $field => $options) {
             $item[$field] = $cms->replaceInternalPageLinks($item[$field]);
             $fields[] = "column{$x}";
             if (isset($parsers[$field]) && $parsers[$field]) {
                 $vals[] = "'" . sqlescape(BigTree::safeEncode($item[$field])) . "'";
             } else {
                 $vals[] = "'" . sqlescape(BigTree::safeEncode(strip_tags($item[$field]))) . "'";
             }
             $x++;
         }
     }
     if ($sort_field) {
         $fields[] = "`sort_field`";
         $vals[] = "'" . sqlescape($item[$sort_field]) . "'";
     }
     sqlquery("INSERT INTO bigtree_module_view_cache (" . implode(",", $fields) . ") VALUES (" . implode(",", $vals) . ")");
 }
コード例 #6
0
ファイル: resources.php プロジェクト: keyanmca/BigTree-CMS
		} else {
			$val = $cms->replaceInternalPageLinks($val);
		}
	}
	unset($val);

	$bigtree["callout_count"] = intval($_POST["count"]);
	$bigtree["callout"] = $admin->getCallout($bigtree["resources"]["type"]);

	$cached_types = $admin->getCachedFieldTypes();
	$bigtree["field_types"] = $cached_types["callouts"];
	
	if ($bigtree["callout"]["description"]) {
?>
<p class="callout_description"><?php 
echo BigTree::safeEncode($bigtree["callout"]["description"]);
?>
</p>
<?
	}
?>
<p class="error_message" style="display: none;">Errors found! Please fix the highlighted fields before submitting.</p>
<div class="form_fields">
	<?			
		if (count($bigtree["callout"]["resources"])) {
			$cached_types = $admin->getCachedFieldTypes();
			$bigtree["field_types"] = $cached_types["callouts"];
	
			$bigtree["tabindex"] = 1000;	
			$bigtree["html_fields"] = array();
			$bigtree["simple_html_fields"] = array();
コード例 #7
0
ファイル: process.php プロジェクト: matthisamoto/Graphfan
 // Backwards compat.
 $field = array();
 $field["key"] = $key;
 $field["options"] = $options = $resource;
 $field["ignore"] = false;
 $field["input"] = $bigtree["post_data"][$key];
 $field["file_input"] = $bigtree["file_data"][$key];
 // If we have a customized handler for this data type, run it, otherwise, it's simply the post value.
 $field_type_path = BigTree::path("admin/form-field-types/process/" . $resource["type"] . ".php");
 if (file_exists($field_type_path)) {
     include $field_type_path;
 } else {
     if (is_array($bigtree["post_data"][$field["key"]])) {
         $field["output"] = $bigtree["post_data"][$field["key"]];
     } else {
         $field["output"] = BigTree::safeEncode($bigtree["post_data"][$field["key"]]);
     }
 }
 // Backwards compatibility with older custom field types
 if (!isset($field["output"]) && isset($value)) {
     $field["output"] = $value;
 }
 if (!BigTreeAutoModule::validate($field["output"], $field["options"]["validation"])) {
     $error = $field["options"]["error_message"] ? $field["options"]["error_message"] : BigTreeAutoModule::validationErrorMessage($field["output"], $field["options"]["validation"]);
     $bigtree["errors"][] = array("field" => $field["options"]["title"], "error" => $error);
 }
 if (!$field["ignore"]) {
     // Translate internal link information to relative links.
     if (is_array($field["output"])) {
         $field["output"] = BigTree::translateArray($field["output"]);
     } else {
コード例 #8
0
ファイル: array.php プロジェクト: matthisamoto/Graphfan
<?php

$field["output"] = array();
foreach ($field["input"] as $i) {
    $row = array();
    // Callouts may have the data already decoded.
    if (is_string($i)) {
        $i = json_decode($i, true);
    }
    // Run through the fields and htmlspecialchar the non-HTML ones.
    foreach ($field["options"]["fields"] as $array_field) {
        if ($array_field["type"] == "html") {
            $row[$array_field["key"]] = $i[$array_field["key"]];
        } else {
            $row[$array_field["key"]] = BigTree::safeEncode($i[$array_field["key"]]);
        }
    }
    $field["output"][] = $row;
}
コード例 #9
0
ファイル: default.php プロジェクト: kurt-planet/BigTree-CMS
        ?>
		<a href="<?php 
        echo ADMIN_ROOT . $item["link"];
        ?>
/" class="<?php 
        if ($x == 1) {
            ?>
 first<?php 
        }
        if ($x == count($breadcrumb)) {
            ?>
 last<?php 
        }
        ?>
"><?php 
        echo BigTree::safeEncode($item["title"]);
        ?>
</a>
		<?php 
        if ($x != count($breadcrumb)) {
            ?>
		<span class="divider">&rsaquo;</span>
		<?php 
        }
    }
    // If we're in a module and have related modules, use them for the related nav.
    if (isset($bigtree["related_modules"])) {
        $bigtree["page"]["related"]["nav"] = $bigtree["related_modules"];
        $bigtree["page"]["related"]["title"] = $bigtree["related_group"];
    }
    // Draw the related nav if it exists.
コード例 #10
0
ファイル: callouts.php プロジェクト: kurt-planet/BigTree-CMS
" />
			<?php 
    BigTreeAdmin::drawArrayLevel(array($x), $callout);
    ?>
			<h4>
				<?php 
    echo BigTree::safeEncode($callout["display_title"]);
    ?>
				<input type="hidden" name="<?php 
    echo $field["key"];
    ?>
[<?php 
    echo $x;
    ?>
][display_title]" value="<?php 
    echo BigTree::safeEncode($callout["display_title"]);
    ?>
" />
			</h4>
			<p><?php 
    echo $type["name"];
    ?>
</p>
			<div class="bottom">
				<span class="icon_drag"></span>
				<?php 
    if ($type["level"] > $admin->Level) {
        ?>
				<span class="icon_disabled has_tooltip" data-tooltip="<p>This callout requires a higher user level to edit.</p>"></span>
				<?php 
    } else {
コード例 #11
0
$photo_gallery = array();
if (is_array($field["input"])) {
    foreach ($field["input"] as $photo_count => $data) {
        // Existing Data
        if ($data["image"]) {
            $data["caption"] = BigTree::safeEncode($data["caption"]);
            $photo_gallery[] = $data;
            // Uploaded File
        } elseif ($field["file_input"][$photo_count]["image"]["name"]) {
            $field_copy = $field;
            $field_copy["file_input"] = $field["file_input"][$photo_count]["image"];
            $file = $admin->processImageUpload($field_copy);
            if ($file) {
                $photo_gallery[] = array("caption" => BigTree::safeEncode($data["caption"]), "image" => $file);
            }
            // File From Image Manager
        } elseif ($data["existing"]) {
            $data["existing"] = str_replace(WWW_ROOT, SITE_ROOT, $data["existing"]);
            $pinfo = BigTree::pathInfo($data["existing"]);
            $field_copy = $field;
            $field_copy["file_input"] = array("name" => $pinfo["basename"], "tmp_name" => SITE_ROOT . "files/" . uniqid("temp-") . ".img", "error" => false);
            BigTree::copyFile($data["existing"], $field_copy["file_input"]["tmp_name"]);
            $file = $admin->processImageUpload($field_copy);
            if ($file) {
                $photo_gallery[] = array("caption" => BigTree::safeEncode($data["caption"]), "image" => $file);
            }
        }
    }
}
$field["output"] = $photo_gallery;
コード例 #12
0
ファイル: preset.php プロジェクト: kurt-planet/BigTree-CMS
<?php

if ($_POST["id"]) {
    ?>
<input type="hidden" name="id" value="<?php 
    echo htmlspecialchars($_POST["id"]);
    ?>
" />
<?php 
}
?>
<fieldset>
	<label>Name</label>
	<input type="text" name="name" value="<?php 
echo BigTree::safeEncode($_POST["name"]);
?>
" />
</fieldset>
<?php 
$data = $_POST;
define("BIGTREE_CREATING_PRESET", true);
include BigTree::path("admin/ajax/developer/field-options/_image-options.php");
コード例 #13
0
if (is_array($field["input"])) {
    foreach ($field["input"] as $photo_count => $data) {
        // Existing Data
        if ($data["image"]) {
            $data["caption"] = BigTree::safeEncode($data["caption"]);
            $data["attribution"] = BigTree::safeEncode($data["attribution"]);
            $data["link"] = BigTree::safeEncode($data["link"]);
            $photo_gallery[] = $data;
            // Uploaded File
        } elseif ($field["file_input"][$photo_count]["image"]["name"]) {
            $field_copy = $field;
            $field_copy["file_input"] = $field["file_input"][$photo_count]["image"];
            $file = $admin->processImageUpload($field_copy);
            if ($file) {
                $photo_gallery[] = array("image" => $file, "caption" => BigTree::safeEncode($data["caption"]), "attribution" => BigTree::safeEncode($data["attribution"]), "link" => BigTree::safeEncode($data["link"]));
            }
            // File From Image Manager
        } elseif ($data["existing"]) {
            $data["existing"] = str_replace(WWW_ROOT, SITE_ROOT, $data["existing"]);
            $pinfo = BigTree::pathInfo($data["existing"]);
            $field_copy = $field;
            $field_copy["file_input"] = array("name" => $pinfo["basename"], "tmp_name" => SITE_ROOT . "files/" . uniqid("temp-") . ".img", "error" => false);
            BigTree::copyFile($data["existing"], $field_copy["file_input"]["tmp_name"]);
            $file = $admin->processImageUpload($field_copy);
            if ($file) {
                $photo_gallery[] = array("image" => $file, "caption" => BigTree::safeEncode($data["caption"]), "attribution" => BigTree::safeEncode($data["attribution"]), "link" => BigTree::safeEncode($data["link"]));
            }
        }
    }
}
$field["output"] = $photo_gallery;
コード例 #14
0
ファイル: view.php プロジェクト: kurt-planet/BigTree-CMS
<?php

$module = $admin->getModule($_GET["module"]);
$table = htmlspecialchars($_GET["table"]);
if (!$title) {
    // Get the title from the route
    $title = $_GET["title"];
    // Add an s to the name (i.e. View Goods)
    $title = substr($title, -1, 1) != "s" ? $title . "s" : $title;
    // If it ends in ys like Buddys then change it to Buddies
    if (substr($title, -2) == "ys") {
        $title = substr($title, 0, -2) . "ies";
    }
}
$title = BigTree::safeEncode($title);
?>
<div class="container">
	<header>
		<p>Step 3: Creating Your View</p>
	</header>
	<form method="post" action="<?php 
echo DEVELOPER_ROOT;
?>
modules/designer/view-create/" class="module">
		<input type="hidden" name="module" value="<?php 
echo $module["id"];
?>
" />
		<input type="hidden" name="table" value="<?php 
echo $table;
?>
コード例 #15
0
ファイル: edit.php プロジェクト: kurt-planet/BigTree-CMS
						<?php 
    $x++;
}
?>
					</ul>
					<footer>
						<select>
							<?php 
foreach ($callouts as $callout) {
    if (!in_array($callout["id"], $group["callouts"])) {
        ?>
							<option value="<?php 
        echo BigTree::safeEncode($callout["id"]);
        ?>
"><?php 
        echo BigTree::safeEncode(BigTree::trimLength(strip_tags($callout["name"]), 100));
        ?>
</option>
							<?php 
    }
}
?>
						</select>
						<a href="#" class="add button"><span class="icon_small icon_small_add"></span>Add Callout</a>
					</footer>
				</div>
			</fieldset>
		</section>
		<footer>
			<input type="submit" class="button blue" value="Update" />
		</footer>
コード例 #16
0
ファイル: array.php プロジェクト: matthisamoto/Graphfan
foreach ($entries as $entry) {
    ?>
		<li>
			<input type="hidden" name="<?php 
    echo $field["key"];
    ?>
[<?php 
    echo $x;
    ?>
]" value="<?php 
    echo htmlspecialchars(json_encode($entry));
    ?>
" />
			<span class="icon_sort"></span>
			<p><?php 
    echo BigTree::safeEncode(BigTree::trimLength(strip_tags(current($entry)), 100));
    ?>
</p>
			<a href="#" class="icon_delete"></a>
			<a href="#" class="icon_edit"></a>
		</li>
		<?php 
    $x++;
}
?>
	</ul>
	<footer>
		<a href="#" class="add button"><span class="icon_small icon_small_add"></span>Add Item</a>
	</footer>
</div>
<script>
コード例 #17
0
ファイル: _footer.php プロジェクト: kurt-planet/BigTree-CMS
?>
 Fastspot
					</p>
					<a href="<?php 
echo ADMIN_ROOT;
?>
credits/">Credits &amp; Licenses</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
					<a href="http://www.bigtreecms.org/" target="_blank">Support</a>&nbsp;&nbsp;&middot;&nbsp;&nbsp;
					<a href="http://www.fastspot.com/agency/contact/" target="_blank">Contact Us</a>
				</article>
			</section>
		</footer>
		<?php 
if (isset($_SESSION["bigtree_admin"]["growl"])) {
    ?>
		<script>BigTree.growl("<?php 
    echo BigTree::safeEncode($_SESSION["bigtree_admin"]["growl"]["title"]);
    ?>
","<?php 
    echo BigTree::safeEncode($_SESSION["bigtree_admin"]["growl"]["message"]);
    ?>
",5000,"<?php 
    echo htmlspecialchars($_SESSION["bigtree_admin"]["growl"]["type"]);
    ?>
");</script>
		<?php 
    unset($_SESSION["bigtree_admin"]["growl"]);
}
?>
 	</body>
</html>
コード例 #18
0
ファイル: dropdown.php プロジェクト: kurt-planet/BigTree-CMS
if ($field && $field["type"] == "list" && $field["options"]["list_type"] == "db") {
    $q = sqlquery("SELECT id,`" . $field["options"]["pop-description"] . "` FROM `" . $field["options"]["pop-table"] . "` ORDER BY " . $field["options"]["pop-sort"]);
    while ($f = sqlfetch($q)) {
        $list[] = array("value" => $f["id"], "description" => $f[$field["options"]["pop-description"]]);
    }
} else {
    $q = sqlquery("SELECT DISTINCT(`{$id}`) FROM `" . $bigtree["report"]["table"] . "` ORDER BY `{$id}`");
    while ($f = sqlfetch($q)) {
        $list[] = array("value" => $f[$id], "description" => $f[$id]);
    }
}
?>
<select name="<?php 
echo $id;
?>
">
	<option></option>
	<?php 
foreach ($list as $item) {
    ?>
	<option value="<?php 
    echo BigTree::safeEncode($item["value"]);
    ?>
"><?php 
    echo BigTree::safeEncode($item["description"]);
    ?>
</option>
	<?php 
}
?>
</select>
コード例 #19
0
ファイル: _header.php プロジェクト: keyanmca/BigTree-CMS
		$environment_alert = '<span><strong>Developer Mode</strong> &middot; Admin Area Restricted To Developers</span>';
	} elseif ($bigtree["config"]["environment"] == "dev" && $bigtree["config"]["environment_live_url"]) {
		$environment_alert = '<span><strong>Development Site</strong> &middot; Changes Will Not Affect Live Site!</span><a href="'.$bigtree["config"]["environment_live_url"].'">Go Live</a>';
	}
?>
<!doctype html> 
<!--[if lt IE 7 ]> <html lang="en" class="ie ie6"> <![endif]-->
<!--[if IE 7 ]>	<html lang="en" class="ie ie7"> <![endif]-->
<!--[if IE 8 ]>	<html lang="en" class="ie ie8"> <![endif]-->
<!--[if IE 9 ]>	<html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
	<head>
		<meta charset="utf-8" />
		<meta name="robots" content="noindex,nofollow" />
		<title><? if (isset($bigtree["admin_title"])) { ?><?php 
echo BigTree::safeEncode($bigtree["admin_title"]);
?>
 | <? } ?><?php 
echo $site["nav_title"];
?>
 Admin</title>
		<link rel="stylesheet" href="<?php 
echo ADMIN_ROOT;
?>
css/main.css" type="text/css" media="screen" />
		<?
			// Configuration based CSS
			if (isset($bigtree["config"]["admin_css"]) && is_array($bigtree["config"]["admin_css"])) {
				foreach ($bigtree["config"]["admin_css"] as $style) {
		?>
		<link rel="stylesheet" href="<?php 
コード例 #20
0
ファイル: text.php プロジェクト: kurt-planet/BigTree-CMS
			<?php 
            } else {
                $data = json_decode($data, true);
                $link = MODULE_ROOT . $data["route"] . "/" . $item["id"] . "/";
                if ($data["function"]) {
                    $link = call_user_func($data["function"], $item);
                }
                ?>
			<section class="view_action"><a href="<?php 
                echo $link;
                ?>
" class="<?php 
                echo $data["class"];
                ?>
" title="<?php 
                echo BigTree::safeEncode($data["name"]);
                ?>
"></a></section>
			<?php 
            }
        }
        ?>
		</li>
		<?php 
    }
}
?>
	</ul>
</div>
<?php 
include BigTree::path("admin/auto-modules/views/_common-js.php");
コード例 #21
0
ファイル: router.php プロジェクト: kalle0045/BigTree-CMS
	   - Not a forced secure page (i.e. checkout)
	   - User is logged BigTree admin
	   - User is logged into the BigTree admin FOR THIS PAGE
	   - Developer mode is either disabled OR the logged in user is a Developer
	*/
if (isset($bigtree["page"]) && !BigTreeCMS::$Secure && $_SESSION["bigtree_admin"]["id"] && $_COOKIE["bigtree_admin"]["email"] && (empty($bigtree["config"]["developer_mode"]) || $_SESSION["bigtree_admin"]["level"] > 1)) {
    $show_bar_default = $_COOKIE["hide_bigtree_bar"] ? false : true;
    $show_preview_bar = false;
    $return_link = "";
    if (!empty($_GET["bigtree_preview_return"])) {
        $show_bar_default = false;
        $show_preview_bar = true;
        $return_link = htmlspecialchars(urlencode($_GET["bigtree_preview_return"]));
    }
    // Pending Pages don't have their ID set.
    if (!isset($bigtree["page"]["id"])) {
        $bigtree["page"]["id"] = $bigtree["page"]["page"];
    }
    $bigtree["content"] = str_ireplace('</body>', '<script type="text/javascript" src="' . str_replace(array("http://", "https://"), "//", $bigtree["config"]["admin_root"]) . 'ajax/bar.js/?previewing=' . BIGTREE_PREVIEWING . '&amp;current_page_id=' . $bigtree["page"]["id"] . '&amp;show_bar=' . $show_bar_default . '&amp;username='******'&amp;show_preview=' . $show_preview_bar . '&amp;return_link=' . $return_link . '&amp;custom_edit_link=' . (empty($bigtree["bar_edit_link"]) ? "" : BigTree::safeEncode($bigtree["bar_edit_link"])) . '"></script></body>', $bigtree["content"]);
    // Don't cache the page with the BigTree bar
    $bigtree["config"]["cache"] = false;
}
echo $bigtree["content"];
// Write to the cache
if ($bigtree["config"]["cache"] && !defined("BIGTREE_DO_NOT_CACHE") && !count($_POST)) {
    $cache = ob_get_flush();
    if (!$bigtree["page"]["path"]) {
        $bigtree["page"]["path"] = "!";
    }
    BigTree::putFile(SERVER_ROOT . "cache/" . md5(json_encode($_GET)) . ".page", $cache);
}
コード例 #22
0
ファイル: admin.php プロジェクト: matthisamoto/Graphfan
 function updateModuleView($id, $title, $description, $table, $type, $options, $fields, $actions, $related_form, $preview_url = "")
 {
     $id = sqlescape($id);
     $title = sqlescape(BigTree::safeEncode($title));
     $description = sqlescape(BigTree::safeEncode($description));
     $table = sqlescape($table);
     $type = sqlescape($type);
     $options = sqlescape(json_encode($options));
     $fields = sqlescape(json_encode($fields));
     $actions = sqlescape(json_encode($actions));
     $related_form = $related_form ? intval($related_form) : "NULL";
     $preview_url = sqlescape(BigTree::safeEncode($this->makeIPL($preview_url)));
     sqlquery("UPDATE bigtree_module_views SET title = '{$title}', description = '{$description}', `table` = '{$table}', type = '{$type}', options = '{$options}', fields = '{$fields}', actions = '{$actions}', preview_url = '{$preview_url}', related_form = {$related_form} WHERE id = '{$id}'");
     sqlquery("UPDATE bigtree_module_actions SET name = 'View {$title}' WHERE view = '{$id}'");
     $this->updateModuleViewColumnNumericStatus(BigTreeAutoModule::getView($id));
 }
コード例 #23
0
ファイル: admin.php プロジェクト: kurt-planet/BigTree-CMS
 function updateTemplate($id, $name, $level, $module, $resources)
 {
     $clean_resources = array();
     foreach ($resources as $resource) {
         if ($resource["id"]) {
             $clean_resources[] = array("id" => BigTree::safeEncode($resource["id"]), "title" => BigTree::safeEncode($resource["title"]), "subtitle" => BigTree::safeEncode($resource["subtitle"]), "type" => BigTree::safeEncode($resource["type"]), "options" => json_decode($resource["options"], true));
         }
     }
     $id = sqlescape($id);
     $name = sqlescape(htmlspecialchars($name));
     $module = sqlescape($module);
     $resources = BigTree::json($clean_resources, true);
     $level = sqlescape($level);
     sqlquery("UPDATE bigtree_templates SET resources = '{$resources}', name = '{$name}', module = '{$module}', level = '{$level}' WHERE id = '{$id}'");
     $this->track("bigtree_templates", $id, "updated");
 }
コード例 #24
0
ファイル: matrix.php プロジェクト: kalle0045/BigTree-CMS
        echo $field["key"];
        ?>
[<?php 
        echo $x;
        ?>
][__internal-subtitle]" value="<?php 
        echo BigTree::safeEncode($item["__internal-subtitle"]);
        ?>
" />
				<span class="icon_sort"></span>
				<p>
					<?php 
        echo BigTree::trimLength(BigTree::safeEncode($item["__internal-title"]), 100);
        ?>
					<small><?php 
        echo BigTree::trimLength(BigTree::safeEncode($item["__internal-subtitle"]), 100);
        ?>
</small>
				</p>
				<a href="#" class="icon_delete"></a>
				<a href="#" class="icon_edit"></a>
			</li>
			<?php 
        $x++;
    }
    ?>
		</ul>
		<footer>
			<a href="#" class="add_item button"><span class="icon_small icon_small_add"></span>Add Item</a>
			<?php 
    if ($max) {
コード例 #25
0
ファイル: text.php プロジェクト: kurt-planet/BigTree-CMS
<?php

if (is_array($field["input"])) {
    foreach ($field["input"] as &$v) {
        $v = BigTree::safeEncode($v);
    }
    if ($field["options"]["sub_type"] == "phone") {
        $field["output"] = $field["input"]["phone_1"] . "-" . $field["input"]["phone_2"] . "-" . $field["input"]["phone_3"];
    } elseif ($field["options"]["sub_type"] == "address" || $field["options"]["sub_type"] == "name") {
        $field["output"] = $field["input"];
    }
} else {
    $field["output"] = BigTree::safeEncode($field["input"]);
}
コード例 #26
0
ファイル: module.php プロジェクト: kurt-planet/BigTree-CMS
if (array_filter($integrity_errors)) {
    $action = $admin->getModuleActionForForm($form);
    $module = $admin->getModule($action["module"]);
}
foreach ($integrity_errors as $field => $error_types) {
    foreach ($error_types as $type => $errors) {
        foreach ($errors as $error) {
            ?>
<li>
	<section class="integrity_errors">
		<a href="<?php 
            echo ADMIN_ROOT . $module["route"] . "/" . $action["route"] . "/" . htmlspecialchars($_GET["id"]);
            ?>
/" target="_blank">Edit</a>
		<span class="icon_small icon_small_warning"></span>
		<p>Broken <?php 
            echo $type == "img" ? "Image" : "Link";
            ?>
: <?php 
            echo BigTree::safeEncode($error);
            ?>
 in field &ldquo;<?php 
            echo $field;
            ?>
&rdquo;</p>
	</section>
</li>
<?php 
        }
    }
}
コード例 #27
0
ファイル: list.php プロジェクト: kalle0045/BigTree-CMS
    }
    ?>
	<?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 
}
コード例 #28
0
    ?>
[new]" id="<?php 
    echo $field["id"];
    ?>
" placeholder="YouTube or Vimeo URL" />
	<?php 
    if ($preview_image) {
        ?>
	<div class="currently">
		<a href="#" class="remove_resource"></a>
		<div class="currently_wrapper">
			<img src="<?php 
        echo $preview_image;
        ?>
" alt="" />
		</div>
		<label>CURRENT</label>
		<input type="hidden" name="<?php 
        echo $field["key"];
        ?>
[existing]" value="<?php 
        echo BigTree::safeEncode(json_encode($field["value"]));
        ?>
" />
	</div>
	<?php 
    }
    ?>
</div>
<?php 
}