当前位置: 首页>>代码示例>>PHP>>正文


PHP BigTree::safeEncode方法代码示例

本文整理汇总了PHP中BigTree::safeEncode方法的典型用法代码示例。如果您正苦于以下问题:PHP BigTree::safeEncode方法的具体用法?PHP BigTree::safeEncode怎么用?PHP BigTree::safeEncode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BigTree的用法示例。


在下文中一共展示了BigTree::safeEncode方法的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 
            }
        }
    }
开发者ID:matthisamoto,项目名称:Graphfan,代码行数:25,代码来源:callouts.php

示例2: foreach

		</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"]) {
        ?>
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:31,代码来源:one-to-many.php

示例3:

?>
" 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 
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:31,代码来源:checkbox.php

示例4: ucwords

                        } 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 
                }
            }
开发者ID:matthisamoto,项目名称:Graphfan,代码行数:31,代码来源:images.php

示例5: cacheRecord

 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) . ")");
 }
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:100,代码来源:auto-modules.php

示例6: intval

		} 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();
开发者ID:keyanmca,项目名称:BigTree-CMS,代码行数:31,代码来源:resources.php

示例7: array

 // 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 {
开发者ID:matthisamoto,项目名称:Graphfan,代码行数:31,代码来源:process.php

示例8: array

<?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;
}
开发者ID:matthisamoto,项目名称:Graphfan,代码行数:19,代码来源:array.php

示例9:

        ?>
		<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.
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:31,代码来源:default.php

示例10:

" />
			<?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 {
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:31,代码来源:callouts.php

示例11: array

$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;
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:30,代码来源:photo-gallery.php

示例12: htmlspecialchars

<?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");
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:22,代码来源:preset.php

示例13: foreach

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;
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:31,代码来源:photo-gallery.php

示例14: htmlspecialchars

<?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;
?>
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:31,代码来源:view.php

示例15: foreach

						<?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>
开发者ID:kurt-planet,项目名称:BigTree-CMS,代码行数:31,代码来源:edit.php


注:本文中的BigTree::safeEncode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。