本文整理汇总了PHP中Pages::FindById方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::FindById方法的具体用法?PHP Pages::FindById怎么用?PHP Pages::FindById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::FindById方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_page_content
function display_page_content()
{
$listname = getRequestVarAtIndex(2);
switch ($listname) {
case "portfolio":
foreach ($_POST as $ordered_objects => $order_value) {
// splits up the key to see if we are ordering a section, item or ignoring a portfolio area
$ordered_parts = explode("_", $ordered_objects);
// NOTICE: I have learned that when there are portfoli orphans, this reordering script breaks. I removed the hidden fields in the Orphans section, but check in on that if you notice reordering breaking again.
//$debug = "";
if ($ordered_parts[0] != "PortFolioAreas") {
if ($ordered_parts[0] == "SectionOrder") {
$section = Sections::FindById($ordered_parts[1]);
$section->display_order = $order_value;
$section->save();
//$debug .= $section->display_name." updated";
} else {
$section = Sections::FindById($ordered_parts[0]);
$item = Items::FindById($ordered_parts[1]);
$item->updateOrderInSection($section, $order_value);
//$debug .= $item->display_name." updated";
}
}
//setFlash( "<h3>".$debug."</h3>" );
//setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
}
break;
case "areaspages":
foreach ($_POST as $ordered_objects => $order_value) {
// splits up the key to see if we are ordering a section, item or ignoring a portfolio area
$ordered_parts = explode("_", $ordered_objects);
//$debug = "";
if ($ordered_parts[0] == "AreaOrder") {
$area = Areas::FindById($ordered_parts[1]);
$area->display_order = $order_value;
$area->save();
//$debug .= "$area->display_name updated";
} else {
if ($ordered_parts[0] == "SubPage") {
$page = Pages::FindById($ordered_parts[1]);
$page->display_order = $order_value;
$page->save();
//$debug .= "$page->display_name sub page updated";
} else {
$area = Areas::FindById($ordered_parts[0]);
$page = Pages::FindById($ordered_parts[1]);
$page->updateOrderInArea($area, $order_value);
//$debug .= "$page->display_name updated in $area->display_name";
}
}
}
//setFlash( "<h3>".$debug."</h3>" );
//setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
break;
}
}
示例2: DisplayAdminPageEditLink
function DisplayAdminPageEditLink($id)
{
$page = Pages::FindById($id);
return "<a href=" . get_link("admin/edit_page/" . $page->id) . ">Edit {$page->display_name}</a>\n";
}
示例3: GetPageURL
function GetPageURL($pageid, $thisarea = "", $rooturl = false)
{
$link = $rooturl ? "http://" . SITE_URL . BASEHREF : BASEHREF;
$link .= REWRITE_URLS ? "" : "?id=";
if (!empty($pageid)) {
$page = Pages::FindById($pageid);
if ($page->public) {
return $page->get_url($thisarea, "", $rooturl);
} else {
return null;
}
} else {
return null;
}
}
示例4: get_link_to_page
function get_link_to_page($pageid)
{
// Still useful in some cases when we don't want to get the object beforehand
$page = Pages::FindById($pageid);
return $page->get_url();
}
示例5: display_page_content
function display_page_content()
{
$page_id = requestIdParam();
$page = Pages::FindById($page_id);
// get all the areas
$areas = Areas::FindAll();
$page_areas = $page->getAreas();
// I know MOST pages dont use the error_container anymore, but this one should! If the user uses any of the drop downs before they pick an Area, the page will not submit and the user will not be able to see the error.
?>
<script type="text/javascript">
//<![CDATA[
$().ready(function() {
$("#edit_page").validate({
errorLabelContainer: $("#error_container"),
<?php
if (SUB_PAGES) {
?>
rules: {
display_name: "required"
},
messages: {
display_name: "Please enter a display name for this page"
}
<?php
} else {
?>
rules: {
display_name: "required",
"selected_areas[]": "required"
},
messages: {
display_name: "Please enter a display name for this page",
"selected_areas[]": "You unchecked an area and forgot to choose a new one! Select at least one area to include the page in. If you need to hide it, make it not public."
}
<?php
}
?>
});
});
//]]>
</script>
<div id="edit-header" class="areanav">
<div class="nav-left column">
<h1>Edit Page : <a href="<?php
$page->the_url();
?>
" title="View <?php
$page->the_url();
?>
">View Page</a></h1>
</div>
<div class="nav-right column">
<?php
quick_link();
?>
</div>
<div class="clearleft"></div>
</div>
<form method="POST" id="edit_page">
<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
<p class="display_name">
<label for="display_name">Display Name:</label><span class="hint">This is the Proper Name of the page; how it will display in the navigation.</span><br />
<?php
textField("display_name", $page->display_name, "required: true");
?>
</p>
<?php
if (ALLOW_SHORT_PAGE_NAMES) {
?>
<p>
<label for="name">Short Name:</label><span class="hint">This is the short name of the page, which gets used in the link. No spaces, commas, or quotes please.</span><br />
<?php
textField("name", $page->name);
?>
</p>
<?php
} else {
hiddenField("name", $page->name);
?>
<p class="page-url">Page URL: <span class="page-url"><?php
echo 'http://' . SITE_URL . BASEHREF . "<mark>" . ltrim($page->get_url(), "/") . "</mark>";
?>
</span></p>
<?php
}
?>
<p>
<label for="name">Public:</label> <?php
checkBoxField("public", $page->public);
?>
//.........这里部分代码省略.........
示例6: displayPage
function displayPage($pageid, $filtered = true)
{
$page = Pages::FindById($pageid);
if ($filtered && $page->public) {
return $page->getContent();
} elseif ($page->public) {
return $page->content;
}
}