本文整理汇总了PHP中Pages::FindAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::FindAll方法的具体用法?PHP Pages::FindAll怎么用?PHP Pages::FindAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::FindAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: numberOfPagesReferencing
function numberOfPagesReferencing()
{
$pages = Pages::FindAll();
// this should work, but it doesn't ensure that the >>s are balanced (ie, it will also match <<image>>)
$anyImagePattern = "/([>{2}<{2}]){$oldName}([>{2}<{2}])/";
foreach ($pages as $page) {
$replacement = '$1' . $newName . '$2';
$page->content = updateContent($page->content, $anyImagePattern, $replacement);
$page->save();
}
return 0;
}
示例2: display_page_content
//.........这里部分代码省略.........
$pageorder = $page->getOrderInArea($area);
echo <<<EOT
\t\t\t\t\t<ul class="row">
\t\t\t\t\t\t<li class="item_line">
\t\t\t\t\t\t\t<input class="page_order" type="hidden" title="PageOrder_{$page->id}" name="{$inputname}" value="{$pageorder}" />
\t\t\t\t\t\t\t<span class="item-link"><a href="{$pagelink}">{$page->display_name}<small>Edit</small></a></span>
\t\t\t\t\t\t\t<span class="item-public">{$pagepublic}</span>
\t\t\t\t\t\t\t<span class="item-path">/{$thisShortName}/{$page->name}</span>
EOT;
if (SUB_PAGES) {
$children = $page->get_children();
if (count($children > 0)) {
echo "\t\t\t\t\t<div class=\"sub_drag\">\n";
foreach ($children as $page) {
$pagelink = get_link("/admin/edit_page/" . $page->id);
$pagepublic = $page->public ? "" : " <span class=\"red\">not public → <a href=\"" . get_link($area->name . "/" . $page->name) . "\" target=\"_blank\">Preview</a></span>";
$inputname = "SubPage_" . $page->id;
$pageorder = $page->getOrderInArea($area);
echo <<<EOT
\t\t\t\t\t\t<ul class="row">
\t\t\t\t\t\t\t<li class="item_line sub_page">
\t\t\t\t\t\t\t\t<span class="item-link"><a href="{$pagelink}">{$page->display_name}<small>Edit</small></a></span>
\t\t\t\t\t\t\t\t<span class="item-public">{$pagepublic}</span>
\t\t\t\t\t\t\t\t<span class="item-path">/{$thisShortName}/{$page->name}</span>
\t\t\t\t\t\t\t\t<input class="sub_page_order" type="hidden" title="PageOrder_{$page->id}" name="{$inputname}" value="{$pageorder}" />
\t\t\t\t\t\t\t</li>
\t\t\t\t\t\t</ul>
EOT;
}
echo "\t\t\t\t\t</div>\n";
}
}
echo <<<EOT
\t\t\t\t\t\t</li>
\t\t\t\t\t</ul>
EOT;
}
// End item_drag div
echo "\t\t\t\t\t\t\t</div>\n";
// End li.c_group
echo "\t\t\t\t\t\t</li>\n";
// End ul.row
echo "\t\t\t\t\t</ul>\n";
}
// End foreach section
// End ul.row cat_drag
echo "\t\t\t\t</ul>\n";
// End ul.row
echo "\t\t\t</ul>\n";
// end first li
echo "\t</ul>\n";
// Find Orphans
$orphanlist = "";
$allpages = Pages::FindAll();
foreach ($allpages as $page) {
$possiblearea = $page->getAreas();
if (!$possiblearea) {
$orphanlist .= "\t<a href=\"" . get_link("/admin/edit_page/" . $page->id) . "\">{$page->display_name}</a><br />\n";
}
}
if ($orphanlist != "") {
echo "\t<p> </p>\n\t<h3>Orphaned Pages</h3>\n";
echo $orphanlist;
}
?>
<p> </p>
<p><strong>Extra:</strong> If a page is not Public, you can still view it by clicking the red “Preview” link. This will open a new window with the page as long as you are logged in (the content will be as recent as the most recent Save). As long as you remain logged in, you may edit the page in one window or tab and preview the content in another window or tab (click refresh after each page save to see the latest changes). </p>
</form>
<?php
// Content Chunks
$chunks = Chunks::FindAll();
if (count($chunks) > 0) {
?>
<h1 id="chunks-list">Content Chunks</h1>
<p class="announce">Content Chunks are small pieces of editable text that are used by templates. Typically, they do not deserve an entire page, so we put them here. Chunks can not be created or deleted, as they have been set up when templates were set up. </p>
<div id="table-header" class="documents">
<strong class="item-link">Chunk Name</strong>
<span class="item-filename">Description</span>
</div>
<ul id="listitems" class="managelist">
<?php
foreach ($chunks as $chunk) {
echo "\t\t<li>\n\t\t\t<span class=\"item-link\"><a href=\"" . get_link("/admin/edit_chunk/{$chunk->id}") . "\">{$chunk->slug} <small>EDIT</small></a></span>\n\t\t\t<span class=\"item-filename\" style=\"width: 50%\">{$chunk->description}</span>\n\t\t</li>\n";
}
?>
</ul>
<?php
}
$thisuser = Users::GetCurrentUser();
if ($thisuser->id == "1") {
echo '<p><a class="hcd_button" href="' . get_link("admin/edit_chunk/add") . '">Create a new Chunk</a></p>';
}
}
示例3: display_page_content
//.........这里部分代码省略.........
$section = $theitem->theSection();
$sectionname = empty($section->name) ? "orphan_section" : $section->name;
$item_revised = empty($theitem->date_revised) ? '' : formatDateTimeView($theitem->date_revised, "m/d g:i A");
echo "<li>\n\t\t\t\t\t\t\t<a class=\"item-link\" href=\"" . get_link("admin/portfolio_edit/{$sectionname}/" . $theitem->id) . "\">" . $theitem->get_title() . "</a>\n\t\t\t\t\t\t\t<span class=\"item-public\">{$itempublic}</span>\n\t\t\t\t\t\t\t<span class=\"item-revised\">{$item_revised}</span>\n\t\t\t\t\t\t</li>";
}
}
?>
</ul>
</div>
<?php
$count_dashes++;
}
if ($count_dashes == 2) {
echo "<div class=\"clearleft\"></div>\n";
}
?>
<div class="dashboard-widget column">
<h1>Pages</h1>
<p>
<a class="hcdbutton" href="<?php
echo get_link("admin/list_pages");
?>
">List Pages</a>
<a class="hcdbutton" href="<?php
echo get_link("admin/add_page");
?>
">Add Page</a>
<a class="hcdbutton" href="<?php
echo get_link("admin/edit_page/add");
?>
">Add Area</a>
<?php
$chunks = Chunks::FindAll();
if (count($chunks) > 0) {
?>
<a class="hcdbutton" href="<?php
echo get_link("admin/list_pages#chunks-list");
?>
">List Chunks</a>
<?php
}
?>
</p>
<h4>Recently Added Pages:</h4>
<ul>
<?php
$pages = Pages::FindAll("id DESC");
if (!empty($pages)) {
$counter = 0;
foreach ($pages as $thepage) {
if ($counter < 5) {
$pagepublic = $thepage->public ? "" : "<span class=\"red\">(not public)</span>";
//$item_revised = ( empty($theitem->date_revised) ) ? '' : formatDateTimeView( $theitem->date_revised, "m/d g:i A" );
echo "<li>\n\t\t\t\t\t\t\t\t<a class=\"item-link\" href=\"" . get_link("admin/edit_page/" . $thepage->id) . "\">" . $thepage->get_title() . "</a>\n\t\t\t\t\t\t\t\t<span class=\"item-public\">{$pagepublic}</span>\n\t\t\t\t\t\t\t</li>";
$counter++;
}
}
}
?>
</ul>
<h4>Quick select</h4>
<?php
quick_link();
?>
</div>
示例4: UpdateProductReferences
function UpdateProductReferences($oldName, $newName)
{
$pages = Pages::FindAll();
$anyProductPattern = "/{{2}(product:{$oldName}+){{2}/";
foreach ($pages as $page) {
$replacement = '{{product:' . $newName . '{{';
$page->content = updateContent($page->content, $anyProductPattern, $replacement);
$page->save();
}
}