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


PHP PageList::_addColumn方法代码示例

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


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

示例1: 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;
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:46,代码来源:AllUsers.php

示例2: 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;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:39,代码来源:OrphanedPages.php

示例3: run

 function run($dbi, $argstr, $request, $basepage)
 {
     $args = $this->getArgs($argstr, $request);
     $pages = false;
     // Todo: extend given _GET args
     if ($args['debug']) {
         $timer = new DebugTimer();
     }
     $caption = _("All pages in this wiki (%d total):");
     if (!empty($args['owner'])) {
         $pages = PageList::allPagesByOwner($args['owner'], $args['include_empty'], $args['sortby'], $args['limit']);
         if ($args['owner']) {
             $caption = fmt("List of pages owned by [%s] (%d total):", WikiLink($args['owner'] == '[]' ? $request->_user->getAuthenticatedId() : $args['owner'], 'if_known'), count($pages));
         }
     } elseif (!empty($args['author'])) {
         $pages = PageList::allPagesByAuthor($args['author'], $args['include_empty'], $args['sortby'], $args['limit']);
         if ($args['author']) {
             $caption = fmt("List of pages last edited by [%s] (%d total):", WikiLink($args['author'] == '[]' ? $request->_user->getAuthenticatedId() : $args['author'], 'if_known'), count($pages));
         }
     } elseif (!empty($args['creator'])) {
         $pages = PageList::allPagesByCreator($args['creator'], $args['include_empty'], $args['sortby'], $args['limit']);
         if ($args['creator']) {
             $caption = fmt("List of pages created by [%s] (%d total):", WikiLink($args['creator'] == '[]' ? $request->_user->getAuthenticatedId() : $args['creator'], 'if_known'), count($pages));
         }
         //} 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 ($args['debug']) {
         return HTML($pagelist, HTML::p(fmt("Elapsed time: %s s", $timer->getStats())));
     } else {
         return $pagelist;
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:55,代码来源:AllPages.php


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