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


PHP PageList::allUserPages方法代码示例

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


在下文中一共展示了PageList::allUserPages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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;
     }
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:67,代码来源:AllPages.php


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