1 <?php rcs_id('$Id: PageList.php,v 1.68 2004-03-14 16:28:53 rurban Exp $');
4 * List a number of pagenames, optionally as table with various columns.
5 * This library relieves some work for these plugins:
7 * AllPages, BackLinks, LikePages, Mostpopular, TitleSearch and more
9 * It also allows dynamic expansion of those plugins to include more
10 * columns in their output.
12 * Column 'info=' arguments:
14 * 'pagename' _("Page Name")
15 * 'mtime' _("Last Modified")
17 * 'summary' _("Last Summary")
18 * 'version' _("Version")),
19 * 'author' _("Last Author")),
20 * 'locked' _("Locked"), _("locked")
21 * 'minor' _("Minor Edit"), _("minor")
22 * 'markup' _("Markup")
24 * 'owner' _("Owner"), //todo: implement this again for PagePerm
25 * 'group' _("Group"), //todo: implement this for PagePerm
27 * More columns for special plugins:
28 * Todo: move this admin action away, not really an info column
29 * 'checkbox' A selectable checkbox appears at the left.
30 * 'remove' _("Remove")
31 * 'perm' _("Permission Mask")
33 * 'renamed_pagename' _("Rename to")
36 * Symbolic 'info=' arguments:
37 * 'all' All columns except remove, content and renamed_pagename
38 * 'most' pagename, mtime, author, size, hits, ...
39 * 'some' pagename, mtime, author
41 * FIXME: In this refactoring I have un-implemented _ctime, _cauthor, and
42 * number-of-revision. Note the _ctime and _cauthor as they were implemented
43 * were somewhat flawed: revision 1 of a page doesn't have to exist in the
44 * database. If lots of revisions have been made to a page, it's more than likely
45 * that some older revisions (include revision 1) have been cleaned (deleted).
48 * limit, offset, rows arguments for multiple pages/multiple rows.
50 * check PagePerm "list" access-type
52 * ->supportedArgs() which arguments are supported, so that the plugin
53 * doesn't explictly need to declare it
55 class _PageList_Column_base {
56 var $_tdattr = array();
58 function _PageList_Column_base ($default_heading, $align = false) {
59 $this->_heading = $default_heading;
62 // align="char" isn't supported by any browsers yet :(
63 //if (is_array($align))
64 // $this->_tdattr = $align;
66 $this->_tdattr['align'] = $align;
70 function format ($pagelist, $page_handle, &$revision_handle) {
71 return HTML::td($this->_tdattr,
73 $this->_getValue($page_handle, $revision_handle),
77 function setHeading ($heading) {
78 $this->_heading = $heading;
83 if (in_array($this->_field,PageList::sortable_columns())) {
84 // multiple comma-delimited sortby args: "+hits,+pagename"
85 // asc or desc: +pagename, -pagename
86 $sortby = PageList::sortby($this->_field,'flip_order');
87 //Fixme: pass all also other GET args along. (limit, p[])
88 $s = HTML::a(array('href' =>
89 $GLOBALS['request']->GetURLtoSelf(array('sortby' => $sortby,
91 'class' => 'pagetitle',
92 'title' => sprintf(_("Sort by %s"),$this->_field)),
93 HTML::raw(' '), HTML::u($this->_heading), HTML::raw(' '));
95 $s = HTML(HTML::raw(' '), HTML::u($this->_heading), HTML::raw(' '));
97 return HTML::th(array('align' => 'center'),$s);
102 function button_heading () {
103 global $Theme, $request;
105 if (in_array($this->_field,PageList::sortable_columns())) {
106 // multiple comma-delimited sortby args: "+hits,+pagename"
108 $noimg = HTML::img(array('src' => $Theme->getButtonURL('no_order'),
112 if ($request->getArg('sortby')) {
113 if (PageList::sortby($this->_field,'check')) { // show icon?
114 $sortby = PageList::sortby($request->getArg('sortby'),'flip_order');
115 $request->setArg('sortby',$sortby);
116 $desc = (substr($sortby,0,1) == '-'); // asc or desc? (+pagename, -pagename)
117 $src = $Theme->getButtonURL($desc ? 'asc_order' : 'desc_order');
119 $sortby = PageList::sortby($this->_field,'init');
122 $sortby = PageList::sortby($this->_field,'init');
126 $img->setAttr('alt', _("Click to sort"));
128 $img = HTML::img(array('src' => $src,
131 'alt' => _("Click to reverse sort order")));
133 $s = HTML::a(array('href' =>
134 //Fixme: pass all also other GET args along. (limit, p[])
135 //Fixme: convert to POST submit[sortby]
136 $request->GetURLtoSelf(array('sortby' => $sortby,
138 'class' => 'gridbutton',
139 'title' => sprintf(_("Click to sort by %s"),$this->_field)),
146 HTML::raw(' '));
148 $s = HTML(HTML::raw(' '), $this->_heading, HTML::raw(' '));
150 return HTML::th(array('align' => 'center', 'valign' => 'middle',
151 'class' => 'gridbutton'), $s);
155 class _PageList_Column extends _PageList_Column_base {
156 function _PageList_Column ($field, $default_heading, $align = false) {
157 $this->_PageList_Column_base($default_heading, $align);
159 $this->_need_rev = substr($field, 0, 4) == 'rev:';
160 $this->_iscustom = substr($field, 0, 7) == 'custom:';
161 if ($this->_iscustom)
162 $this->_field = substr($field, 7);
163 elseif ($this->_need_rev)
164 $this->_field = substr($field, 4);
166 $this->_field = $field;
169 function _getValue ($page_handle, &$revision_handle) {
170 if ($this->_need_rev) {
171 if (!$revision_handle)
172 $revision_handle = $page_handle->getCurrentRevision();
173 return $revision_handle->get($this->_field);
176 return $page_handle->get($this->_field);
181 class _PageList_Column_size extends _PageList_Column {
182 function _getValue ($page_handle, &$revision_handle) {
183 if (!$revision_handle)
184 $revision_handle = $page_handle->getCurrentRevision();
185 return $this->_getSize($revision_handle);
188 function _getSize($revision_handle) {
189 $bytes = strlen($revision_handle->_data['%content']);
190 return ByteFormatter($bytes);
195 class _PageList_Column_bool extends _PageList_Column {
196 function _PageList_Column_bool ($field, $default_heading, $text = 'yes') {
197 $this->_PageList_Column($field, $default_heading, 'center');
198 $this->_textIfTrue = $text;
199 $this->_textIfFalse = new RawXml('—'); //mdash
202 function _getValue ($page_handle, &$revision_handle) {
203 $val = _PageList_Column::_getValue($page_handle, $revision_handle);
204 return $val ? $this->_textIfTrue : $this->_textIfFalse;
208 class _PageList_Column_checkbox extends _PageList_Column {
209 function _PageList_Column_checkbox ($field, $default_heading, $name='p') {
210 $this->_name = $name;
211 $heading = HTML::input(array('type' => 'button',
212 'title' => _("Click to de-/select all pages"),
214 'name' => $default_heading,
215 'value' => $default_heading,
216 'onclick' => "flipAll(this.form)"
218 $this->_PageList_Column($field, $heading, 'center');
220 function _getValue ($pagelist, $page_handle, &$revision_handle) {
221 $pagename = $page_handle->getName();
222 if (!empty($pagelist->_selected[$pagename])) {
223 return HTML::input(array('type' => 'checkbox',
224 'name' => $this->_name . "[$pagename]",
226 'checked' => 'CHECKED'));
228 return HTML::input(array('type' => 'checkbox',
229 'name' => $this->_name . "[$pagename]",
233 function format ($pagelist, $page_handle, &$revision_handle) {
234 return HTML::td($this->_tdattr,
236 $this->_getValue($pagelist, $page_handle, $revision_handle),
237 HTML::raw(' '));
241 class _PageList_Column_time extends _PageList_Column {
242 function _PageList_Column_time ($field, $default_heading) {
243 $this->_PageList_Column($field, $default_heading, 'right');
245 $this->Theme = &$Theme;
248 function _getValue ($page_handle, &$revision_handle) {
249 $time = _PageList_Column::_getValue($page_handle, $revision_handle);
250 return $this->Theme->formatDateTime($time);
254 class _PageList_Column_version extends _PageList_Column {
255 function _getValue ($page_handle, &$revision_handle) {
256 if (!$revision_handle)
257 $revision_handle = $page_handle->getCurrentRevision();
258 return $revision_handle->getVersion();
262 // If needed this could eventually become a subclass
263 // of a new _PageList_Column_action class for other actions.
264 // only for WikiAdminRemove or WikiAdminSelect
265 class _PageList_Column_remove extends _PageList_Column {
266 function _getValue ($page_handle, &$revision_handle) {
267 return Button(array('action' => 'remove'), _("Remove"),
268 $page_handle->getName());
272 // only for WikiAdminRename
273 class _PageList_Column_renamed_pagename extends _PageList_Column {
274 function _getValue ($page_handle, &$revision_handle) {
275 $post_args = $GLOBALS['request']->getArg('admin_rename');
276 $value = str_replace($post_args['from'], $post_args['to'],$page_handle->getName());
277 $div = HTML::div(" => ",HTML::input(array('type' => 'text',
278 'name' => 'rename[]',
279 'value' => $value)));
280 $new_page = $GLOBALS['request']->getPage($value);
281 if ($new_page->exists()) {
282 $div->setAttr('class','error');
283 $div->setAttr('title',_("This page already exists"));
289 // Output is hardcoded to limit of first 50 bytes. Otherwise
290 // on very large Wikis this will fail if used with AllPages
291 // (PHP memory limit exceeded)
292 class _PageList_Column_content extends _PageList_Column {
293 function _PageList_Column_content ($field, $default_heading, $align = false) {
294 _PageList_Column::_PageList_Column($field, $default_heading, $align);
296 if ($field == 'content') {
297 $this->_heading .= sprintf(_(" ... first %d bytes"),
299 } elseif ($field == 'hi_content') {
300 if (!empty($_POST['admin_replace'])) {
301 $search = $_POST['admin_replace']['from'];
302 $this->_heading .= sprintf(_(" ... around %s"),
307 function _getValue ($page_handle, &$revision_handle) {
308 if (!$revision_handle)
309 $revision_handle = $page_handle->getCurrentRevision();
310 // Not sure why implode is needed here, I thought
311 // getContent() already did this, but it seems necessary.
312 $c = implode("\n", $revision_handle->getContent());
313 if ($this->_field == 'hi_content') {
314 $search = $_POST['admin_replace']['from'];
315 if ($search and ($i = strpos($c,$search))) {
316 $l = strlen($search);
317 $j = max(0,$i - ($this->bytes / 2));
318 return HTML::div(array('style' => 'font-size:x-small'),
319 HTML::div(array('class' => 'transclusion'),
320 HTML::span(substr($c, $j, ($this->bytes / 2))),
321 HTML::span(array("style"=>"background:yellow"),$search),
322 HTML::span(substr($c, $i+$l, ($this->bytes / 2))))
325 $c = sprintf(_("%s not found"),
327 return HTML::div(array('style' => 'font-size:x-small','align'=>'center'),
330 } elseif (($len = strlen($c)) > $this->bytes) {
331 $c = substr($c, 0, $this->bytes);
333 include_once('lib/BlockParser.php');
334 // false --> don't bother processing hrefs for embedded WikiLinks
335 $ct = TransformText($c, $revision_handle->get('markup'), false);
336 return HTML::div(array('style' => 'font-size:x-small'),
337 HTML::div(array('class' => 'transclusion'), $ct),
338 // Don't show bytes here if size column present too
339 ($this->parent->_columns_seen['size'] or !$len) ? "" :
340 ByteFormatter($len, /*$longformat = */true));
344 class _PageList_Column_author extends _PageList_Column {
345 function _PageList_Column_author ($field, $default_heading, $align = false) {
346 _PageList_Column::_PageList_Column($field, $default_heading, $align);
347 global $WikiNameRegexp, $request;
348 $this->WikiNameRegexp = $WikiNameRegexp;
349 $this->dbi = &$request->getDbh();
352 function _getValue ($page_handle, &$revision_handle) {
353 $author = _PageList_Column::_getValue($page_handle, $revision_handle);
354 if (preg_match("/^$this->WikiNameRegexp\$/", $author) && $this->dbi->isWikiPage($author))
355 return WikiLink($author);
361 class _PageList_Column_perm extends _PageList_Column {
362 function _getValue ($page_handle, &$revision_handle) {
363 $perm_array = pagePermissions($page_handle->_pagename);
364 return pagePermissionsSimpleFormat($perm_array,
365 $page_handle->get('author'),$page_handle->get('group'));
368 var_dump($perm_array);
369 $xml = ob_get_contents();
376 class _PageList_Column_acl extends _PageList_Column {
377 function _getValue ($page_handle, &$revision_handle) {
378 $perm_tree = pagePermissions($page_handle->_pagename);
379 return pagePermissionsAclFormat($perm_tree);
382 var_dump($perm_array);
383 $xml = ob_get_contents();
390 class _PageList_Column_pagename extends _PageList_Column_base {
391 var $_field = 'pagename';
393 function _PageList_Column_pagename () {
394 $this->_PageList_Column_base(_("Page Name"));
396 $this->dbi = &$request->getDbh();
399 function _getValue ($page_handle, &$revision_handle) {
400 if ($this->dbi->isWikiPage($page_handle->getName()))
401 return WikiLink($page_handle);
403 return WikiLink($page_handle, 'unknown');
410 var $_group_rows = 3;
411 var $_columns = array();
412 var $_excluded_pages = array();
413 var $_rows = array();
415 var $_pagename_seen = false;
416 var $_types = array();
417 var $_options = array();
418 var $_selected = array();
419 var $_sortby = array();
421 function PageList ($columns = false, $exclude = false, $options = false) {
422 $this->_initAvailableColumns();
425 'all' => array_diff(array_keys($this->_types), // all but...
426 array('checkbox','remove','renamed_pagename',
427 'content','hi_content','perm','acl')),
428 'most' => array('pagename','mtime','author','size','hits'),
429 'some' => array('pagename','mtime','author')
432 if (!is_array($columns))
433 $columns = explode(',', $columns);
434 // expand symbolic columns:
435 foreach ($symbolic_columns as $symbol => $cols) {
436 if (in_array($symbol,$columns)) { // e.g. 'checkbox,all'
437 $columns = array_diff(array_merge($columns,$cols),array($symbol));
440 if (!in_array('pagename',$columns))
441 $this->_addColumn('pagename');
442 foreach ($columns as $col) {
443 $this->_addColumn($col);
446 $this->_addColumn('pagename');
448 $this->_options = $options;
449 if (!empty($options) and !empty($options['sortby'])) {
450 $sortby = $options['sortby'];
452 $sortby = $GLOBALS['request']->getArg('sortby');
454 $this->sortby($sortby,'init');
455 if (!empty($options) and !empty($options['limit'])) {
456 $limit = $options['limit'];
458 $limit = $GLOBALS['request']->getArg('limit');
461 if (!is_array($exclude))
462 $exclude = $this->explodePageList($exclude,false,$sortby,$limit);
463 $this->_excluded_pages = $exclude;
466 $this->_messageIfEmpty = _("<no matches>");
469 // Currently PageList takes these arguments:
470 // 1: info, 2: exclude, 3: hash of options
471 // Here we declare which options are supported, so that
472 // the calling plugin may simply merge this with its own default arguments
473 function supportedArgs () {
474 return array(//Currently supported options:
475 'info' => 'pagename',
476 'exclude' => '', // also wildcards and comma-seperated lists
478 // for the sort buttons in <th>
479 'sortby' => '', // same as for WikiDB::getAllPages
481 //PageList pager options:
482 // These options may also be given to _generate(List|Table) later
483 // But limit and offset might help the query WikiDB::getAllPages()
484 //cols => 1, // side-by-side display of list (1-3)
485 //limit => 50, // length of one column
486 //offset => 0, // needed internally for the pager
487 //paging => 'auto', // '': normal paging mode
488 // // 'auto': drop 'info' columns and enhance rows
489 // // when the list becomes large
490 // // 'none': don't page at all
494 function setCaption ($caption_string) {
495 $this->_caption = $caption_string;
498 function getCaption () {
499 // put the total into the caption if needed
500 if (is_string($this->_caption) && strstr($this->_caption, '%d'))
501 return sprintf($this->_caption, $this->getTotal());
502 return $this->_caption;
505 function setMessageIfEmpty ($msg) {
506 $this->_messageIfEmpty = $msg;
510 function getTotal () {
511 return count($this->_rows);
514 function isEmpty () {
515 return empty($this->_rows);
518 function addPage ($page_handle) {
519 if (is_string($page_handle)) {
520 if (empty($page_handle)) return;
521 if (in_array($page_handle, $this->_excluded_pages))
522 return; // exclude page.
523 $dbi = $GLOBALS['request']->getDbh();
524 $page_handle = $dbi->getPage($page_handle);
525 } elseif (is_object($page_handle)) {
526 if (in_array($page_handle->getName(), $this->_excluded_pages))
527 return; // exclude page.
529 //FIXME. only on sf.net
530 if (!is_object($page_handle)) {
531 trigger_error("PageList: Invalid page_handle $page_handle", E_USER_WARNING);
534 // enforce view permission
535 if (!mayAccessPage('view',$page_handle->getName()))
538 $group = (int)(count($this->_rows) / $this->_group_rows);
539 $class = ($group % 2) ? 'oddrow' : 'evenrow';
540 $revision_handle = false;
542 if (count($this->_columns) > 1) {
543 $row = HTML::tr(array('class' => $class));
544 foreach ($this->_columns as $col)
545 $row->pushContent($col->format($this, $page_handle, $revision_handle));
548 $col = $this->_columns[0];
549 $row = HTML::li(array('class' => $class),
550 $col->_getValue($page_handle, $revision_handle));
553 $this->_rows[] = $row;
556 function addPages ($page_iter) {
557 while ($page = $page_iter->next())
558 $this->addPage($page);
561 function addPageList (&$list) {
563 while ($page = next($list))
564 $this->addPage($page);
567 function getContent() {
568 // Note that the <caption> element wants inline content.
569 $caption = $this->getCaption();
571 if ($this->isEmpty())
572 return $this->_emptyList($caption);
573 elseif (count($this->_columns) == 1)
574 return $this->_generateList($caption);
576 return $this->_generateTable($caption);
579 function printXML() {
580 PrintXML($this->getContent());
584 return AsXML($this->getContent());
587 function sortable_columns() {
588 return array('pagename','mtime','hits');
592 * Handles sortby requests for the DB iterator and table header links
593 * Prefix the column with + or - like "+pagename","-mtime", ...
594 * supported columns: 'pagename','mtime','hits'
595 * supported actions: 'flip_order' "mtime" => "+mtime" => "-mtime" ...
596 * 'db' "-pagename" => "pagename DESC"
598 function sortby ($column, $action) {
599 if (empty($column)) return;
600 //support multiple comma-delimited sortby args: "+hits,+pagename"
601 if (strstr($column,',')) {
603 foreach (explode(',',$column) as $col) {
604 $result[] = $this->sortby($col,$action);
606 return join(",",$result);
608 if (substr($column,0,1) == '+') {
609 $order = '+'; $column = substr($column,1);
610 } elseif (substr($column,0,1) == '-') {
611 $order = '-'; $column = substr($column,1);
613 if (in_array($column,PageList::sortable_columns())) {
614 // default order: +pagename, -mtime, -hits
616 if (in_array($column,array('mtime','hits')))
620 if ($action == 'flip_order') {
621 return ($order == '+' ? '-' : '+') . $column;
622 } elseif ($action == 'init') {
623 $this->_sortby[$column] = $order;
624 return $order . $column;
625 } elseif ($action == 'check') {
626 return (!empty($this->_sortby[$column]) or
627 ($GLOBALS['request']->getArg('sortby') and
628 strstr($GLOBALS['request']->getArg('sortby'),$column)));
629 } elseif ($action == 'db') {
630 // asc or desc: +pagename, -pagename
631 return $column . ($order == '+' ? ' ASC' : ' DESC');
637 // echo implode(":",explodeList("Test*",array("xx","Test1","Test2")));
638 function explodePageList($input, $perm = false, $sortby=false, $limit=false) {
639 // expand wildcards from list of all pages
640 if (preg_match('/[\?\*]/',$input)) {
641 $dbi = $GLOBALS['request']->getDbh();
642 $allPagehandles = $dbi->getAllPages($perm,$sortby,$limit);
643 while ($pagehandle = $allPagehandles->next()) {
644 $allPages[] = $pagehandle->getName();
646 return explodeList($input, $allPages);
648 //TODO: do the sorting, normally not needed if used for exclude only
649 return explode(',',$input);
657 //Performance Fixme: Initialize only the requested objects
658 function _initAvailableColumns() {
659 if (!empty($this->_types))
665 => new _PageList_Column_content('rev:content', _("Content")),
666 'hi_content' // with highlighted search for SearchReplace
667 => new _PageList_Column_content('rev:hi_content', _("Content")),
669 => new _PageList_Column_remove('remove', _("Remove")),
671 => new _PageList_Column_renamed_pagename('rename', _("Rename to")),
673 => new _PageList_Column_perm('perm', _("Permission")),
675 => new _PageList_Column_acl('acl', _("ACL")),
677 => new _PageList_Column_checkbox('p', _("Select")),
679 => new _PageList_Column_pagename,
681 => new _PageList_Column_time('rev:mtime', _("Last Modified")),
683 => new _PageList_Column('hits', _("Hits"), 'right'),
685 => new _PageList_Column_size('rev:size', _("Size"), 'right'),
686 /*array('align' => 'char', 'char' => ' ')*/
688 => new _PageList_Column('rev:summary', _("Last Summary")),
690 => new _PageList_Column_version('rev:version', _("Version"),
693 => new _PageList_Column_author('rev:author', _("Last Author")),
695 => new _PageList_Column_author('owner', _("Owner")),
697 => new _PageList_Column_author('group', _("Group")),
699 => new _PageList_Column_bool('locked', _("Locked"),
702 => new _PageList_Column_bool('rev:is_minor_edit',
703 _("Minor Edit"), _("minor")),
705 => new _PageList_Column('rev:markup', _("Markup"))
709 function _addColumn ($column) {
711 $this->_initAvailableColumns();
713 if (isset($this->_columns_seen[$column]))
714 return false; // Already have this one.
715 $this->_columns_seen[$column] = true;
717 if (strstr($column, ':'))
718 list ($column, $heading) = explode(':', $column, 2);
720 if (!isset($this->_types[$column])) {
721 trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE);
725 $col = $this->_types[$column];
726 if (!empty($heading))
727 $col->setHeading($heading);
729 $this->_columns[] = $col;
734 // make a table given the caption
735 function _generateTable($caption) {
736 $table = HTML::table(array('cellpadding' => 0,
739 'class' => 'pagelist'));
741 $table->pushContent(HTML::caption(array('align'=>'top'), $caption));
743 //Warning: This is quite fragile. It depends solely on a private variable
745 if (!empty($this->_columns_seen['checkbox'])) {
746 $table->pushContent($this->_jsFlipAll());
749 $table_summary = array();
750 foreach ($this->_columns as $col) {
751 $row->pushContent($col->button_heading());
752 if (is_string($col->_heading))
753 $table_summary[] = $col->_heading;
755 // Table summary for non-visual browsers.
756 $table->setAttr('summary', sprintf(_("Columns: %s."),
757 implode(", ", $table_summary)));
759 $table->pushContent(HTML::thead($row),
760 HTML::tbody(false, $this->_rows));
764 function _jsFlipAll() {
766 function flipAll(formObj) {
768 for (var i=0;i < formObj.length;i++) {
769 fldObj = formObj.elements[i];
770 if (fldObj.type == 'checkbox') {
771 if (isFirstSet == -1)
772 isFirstSet = (fldObj.checked) ? true : false;
773 fldObj.checked = (isFirstSet) ? false : true;
779 function _generateList($caption) {
780 $list = HTML::ul(array('class' => 'pagelist'), $this->_rows);
782 //Warning: This is quite fragile. It depends solely on a private variable
784 // questionable if its of use here anyway. this is a one-col list only.
785 if (!empty($this->_columns_seen['checkbox'])) {
786 $out->pushContent($this->_jsFlipAll());
789 $out->pushContent(HTML::p($caption));
790 $out->pushContent($list);
794 function _emptyList($caption) {
797 $html->pushContent(HTML::p($caption));
798 if ($this->_messageIfEmpty)
799 $html->pushContent(HTML::blockquote(HTML::p($this->_messageIfEmpty)));
805 /* List pages with checkboxes to select from.
806 * The [Select] button toggles via _jsFlipAll
809 class PageList_Selectable
812 function PageList_Selectable ($columns=false, $exclude=false) {
814 if (!is_array($columns))
815 $columns = explode(',', $columns);
816 if (!in_array('checkbox',$columns))
817 array_unshift($columns,'checkbox');
819 $columns = array('checkbox','pagename');
821 PageList::PageList($columns,$exclude);
824 function addPageList ($array) {
825 while (list($pagename,$selected) = each($array)) {
826 if ($selected) $this->addPageSelected($pagename);
827 $this->addPage($pagename);
831 function addPageSelected ($pagename) {
832 $this->_selected[$pagename] = 1;
835 //insert javascript when clicked on Selected Select/Deselect all
838 // (c-file-style: "gnu")
843 // c-hanging-comment-ender-p: nil
844 // indent-tabs-mode: nil