本文整理汇总了PHP中PageList::addPageList方法的典型用法代码示例。如果您正苦于以下问题:PHP PageList::addPageList方法的具体用法?PHP PageList::addPageList怎么用?PHP PageList::addPageList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageList
的用法示例。
在下文中一共展示了PageList::addPageList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
extract($args);
$pagelist = new PageList($info, $exclude, $args);
// should attributes be listed as pagename here?
$pagelist->addPageList($dbi->listRelations($mode == 'all', $mode == 'attributes', !empty($sortby)));
return $pagelist;
}
示例2: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
extract($args);
if ($debug) {
$timer = new DebugTimer();
}
$group = $request->getGroup();
if (method_exists($group, '_allUsers')) {
$allusers = $group->_allUsers();
} else {
$allusers = array();
}
$args['count'] = count($allusers);
// deleted pages show up as version 0.
$pagelist = new PageList($info, $exclude, $args);
if (!$noheader) {
$pagelist->setCaption(_("Authenticated users on this wiki (%d total):"));
}
if ($include_empty and empty($info)) {
$pagelist->_addColumn('version');
}
list($offset, $pagesize) = $pagelist->limit($args['limit']);
if (!$pagesize) {
$pagelist->addPageList($allusers);
} else {
for ($i = $offset; $i < $offset + $pagesize - 1; $i++) {
if ($i >= $args['count']) {
break;
}
$pagelist->addPage($allusers[$i]);
}
}
/*
$page_iter = $dbi->getAllPages($include_empty, $sortby, $limit);
while ($page = $page_iter->next()) {
if ($page->isUserPage($include_empty))
$pagelist->addPage($page);
}
*/
if ($debug) {
return HTML($pagelist, HTML::p(fmt("Elapsed time: %s s", $timer->getStats())));
} else {
return $pagelist;
}
}
示例3: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
extract($args);
// There's probably a more efficient way to do this (eg a
// tailored SQL query via the backend, but this does the job
$allpages_iter = $dbi->getAllPages($include_empty);
$pages = array();
while ($page = $allpages_iter->next()) {
$links_iter = $page->getBackLinks();
// Test for absence of backlinks. If a page is linked to
// only by itself, it is still an orphan
$parent = $links_iter->next();
if (!$parent or $parent->getName() == $page->getName() and !$links_iter->next()) {
$pages[] = $page;
}
}
$args['count'] = count($pages);
$pagelist = new PageList($info, $exclude, $args);
if (!$noheader) {
$pagelist->setCaption(_("Orphaned Pages in this wiki (%d total):"));
}
// deleted pages show up as version 0.
if ($include_empty) {
$pagelist->_addColumn('version');
}
list($offset, $pagesize) = $pagelist->limit($args['limit']);
if (!$pagesize) {
$pagelist->addPageList($pages);
} else {
for ($i = $offset; $i < $offset + $pagesize - 1; $i++) {
if ($i >= $args['count']) {
break;
}
$pagelist->addPage($pages[$i]);
}
}
return $pagelist;
}
示例4: run
function run($dbi, $argstr, $request, $basepage)
{
$args = $this->getArgs($argstr, $request);
$pages = false;
// Todo: extend given _GET args
if (DEBUG && $args['debug']) {
$timer = new DebugTimer();
}
$caption = _("All pages in this wiki (%d total):");
if (!empty($args['userpages'])) {
$pages = PageList::allUserPages($args['include_empty'], $args['sortby'], '');
$caption = _("List of user-created pages (%d total):");
$args['count'] = $request->getArg('count');
} elseif (!empty($args['owner'])) {
$pages = PageList::allPagesByOwner($args['owner'], $args['include_empty'], $args['sortby'], '');
$args['count'] = $request->getArg('count');
if (!$args['count']) {
$args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
}
$caption = fmt("List of pages owned by [%s] (%d total):", WikiLink($args['owner'] == '[]' ? $request->_user->getAuthenticatedId() : $args['owner'], 'if_known'), $args['count']);
$pages->_options['count'] = $args['count'];
} elseif (!empty($args['author'])) {
$pages = PageList::allPagesByAuthor($args['author'], $args['include_empty'], $args['sortby'], '');
$args['count'] = $request->getArg('count');
if (!$args['count']) {
$args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
}
$caption = fmt("List of pages last edited by [%s] (%d total):", WikiLink($args['author'] == '[]' ? $request->_user->getAuthenticatedId() : $args['author'], 'if_known'), $args['count']);
$pages->_options['count'] = $args['count'];
} elseif (!empty($args['creator'])) {
$pages = PageList::allPagesByCreator($args['creator'], $args['include_empty'], $args['sortby'], '');
$args['count'] = $request->getArg('count');
if (!$args['count']) {
$args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
}
$caption = fmt("List of pages created by [%s] (%d total):", WikiLink($args['creator'] == '[]' ? $request->_user->getAuthenticatedId() : $args['creator'], 'if_known'), $args['count']);
$pages->_options['count'] = $args['count'];
//} elseif ($pages) {
// $args['count'] = count($pages);
} else {
if (!$request->getArg('count')) {
$args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
} else {
$args['count'] = $request->getArg('count');
}
}
if (empty($args['count']) and !empty($pages)) {
$args['count'] = count($pages);
}
$pagelist = new PageList($args['info'], $args['exclude'], $args);
if (!$args['noheader']) {
$pagelist->setCaption($caption);
}
// deleted pages show up as version 0.
//if ($args['include_empty'])
// $pagelist->_addColumn('version');
if ($pages !== false) {
$pagelist->addPageList($pages);
} else {
$pagelist->addPages($dbi->getAllPages($args['include_empty'], $args['sortby'], $args['limit']));
}
if (DEBUG && $args['debug']) {
return HTML($pagelist, HTML::p(fmt("Elapsed time: %s s", $timer->getStats())));
} else {
return $pagelist;
}
}
示例5: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
extract($args);
// If the ratings table does not exist, or on dba it will break otherwise.
// Check if Theme isa 'wikilens'
if ($info == 'pagename' and isa($GLOBALS['WikiTheme'], 'wikilens')) {
$info .= ",top3recs";
}
if ($info) {
$info = split(',', $info);
} else {
$info = array();
}
if (in_array('top3recs', $info)) {
require_once 'lib/wikilens/Buddy.php';
require_once 'lib/wikilens/PageListColumns.php';
$active_user = $request->getUser();
$active_userid = $active_user->_userid;
// if userids is null or empty, fill it with just the active user
if (!isset($userids) || !is_array($userids) || !count($userids)) {
// TKL: moved getBuddies call inside if statement because it was
// causing the userids[] parameter to be ignored
if (is_string($active_userid) and strlen($active_userid) and $active_user->isSignedIn()) {
$userids = getBuddies($active_userid, $dbi);
} else {
$userids = array();
// XXX: this wipes out the category caption...
$caption = _("You must be logged in to view ratings.");
}
}
// find out which users we should show ratings for
$allowed_users = array();
foreach ($userids as $userid) {
$user = new RatingsUser($userid);
if ($user->allow_view_ratings($active_user)) {
array_push($allowed_users, $user);
}
// PHP's silly references... (the behavior with this line commented
// out is... odd)
unset($user);
}
$options = array('dimension' => $dimension, 'users' => $allowed_users);
$args = array_merge($options, $args);
}
if (empty($pages) and $pages != '0') {
return '';
}
if (in_array('numbacklinks', $info)) {
$args['types']['numbacklinks'] = new _PageList_Column_ListPages_count('numbacklinks', _("#"), true);
}
if (in_array('numpagelinks', $info)) {
$args['types']['numpagelinks'] = new _PageList_Column_ListPages_count('numpagelinks', _("#"));
}
$pagelist = new PageList($info, $exclude, $args);
$pages_array = is_string($pages) ? explodePageList($pages) : (is_array($pages) ? $pages : array());
$pagelist->addPageList($pages_array);
return $pagelist;
}