1 <?php rcs_id('$Id: PageList.php,v 1.67 2004-03-12 15:48:07 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")
35 * Symbolic 'info=' arguments:
36 * 'all' All columns except remove, content and renamed_pagename
37 * 'most' pagename, mtime, author, size, hits, ...
38 * 'some' pagename, mtime, author
40 * FIXME: In this refactoring I have un-implemented _ctime, _cauthor, and
41 * number-of-revision. Note the _ctime and _cauthor as they were implemented
42 * were somewhat flawed: revision 1 of a page doesn't have to exist in the
43 * database. If lots of revisions have been made to a page, it's more than likely
44 * that some older revisions (include revision 1) have been cleaned (deleted).
47 * limit, offset, rows arguments for multiple pages/multiple rows.
49 * check PagePerm "list" access-type
51 * ->supportedArgs() which arguments are supported, so that the plugin
52 * doesn't explictly need to declare it
54 class _PageList_Column_base {
55 var $_tdattr = array();
57 function _PageList_Column_base ($default_heading, $align = false) {
58 $this->_heading = $default_heading;
61 // align="char" isn't supported by any browsers yet :(
62 //if (is_array($align))
63 // $this->_tdattr = $align;
65 $this->_tdattr['align'] = $align;
69 function format ($pagelist, $page_handle, &$revision_handle) {
70 return HTML::td($this->_tdattr,
72 $this->_getValue($page_handle, $revision_handle),
76 function setHeading ($heading) {
77 $this->_heading = $heading;
82 if (in_array($this->_field,PageList::sortable_columns())) {
83 // multiple comma-delimited sortby args: "+hits,+pagename"
84 // asc or desc: +pagename, -pagename
85 $sortby = PageList::sortby($this->_field,'flip_order');
86 //Fixme: pass all also other GET args along. (limit, p[])
87 $s = HTML::a(array('href' =>
88 $GLOBALS['request']->GetURLtoSelf(array('sortby' => $sortby,
90 'class' => 'pagetitle',
91 'title' => sprintf(_("Sort by %s"),$this->_field)),
92 HTML::raw(' '), HTML::u($this->_heading), HTML::raw(' '));
94 $s = HTML(HTML::raw(' '), HTML::u($this->_heading), HTML::raw(' '));
96 return HTML::th(array('align' => 'center'),$s);
101 function button_heading () {
102 global $Theme, $request;
104 if (in_array($this->_field,PageList::sortable_columns())) {
105 // multiple comma-delimited sortby args: "+hits,+pagename"
107 $noimg = HTML::img(array('src' => $Theme->getButtonURL('no_order'),
111 if ($request->getArg('sortby')) {
112 if (PageList::sortby($this->_field,'check')) { // show icon?
113 $sortby = PageList::sortby($request->getArg('sortby'),'flip_order');
114 $request->setArg('sortby',$sortby);
115 $desc = (substr($sortby,0,1) == '-'); // asc or desc? (+pagename, -pagename)
116 $src = $Theme->getButtonURL($desc ? 'asc_order' : 'desc_order');
118 $sortby = PageList::sortby($this->_field,'init');
121 $sortby = PageList::sortby($this->_field,'init');
125 $img->setAttr('alt', _("Click to sort"));
127 $img = HTML::img(array('src' => $src,
130 'alt' => _("Click to reverse sort order")));
132 $s = HTML::a(array('href' =>
133 //Fixme: pass all also other GET args along. (limit, p[])
134 //Fixme: convert to POST submit[sortby]
135 $request->GetURLtoSelf(array('sortby' => $sortby,
137 'class' => 'gridbutton',
138 'title' => sprintf(_("Click to sort by %s"),$this->_field)),
145 HTML::raw(' '));
147 $s = HTML(HTML::raw(' '), $this->_heading, HTML::raw(' '));
149 return HTML::th(array('align' => 'center', 'valign' => 'middle',
150 'class' => 'gridbutton'), $s);
154 class _PageList_Column extends _PageList_Column_base {
155 function _PageList_Column ($field, $default_heading, $align = false) {
156 $this->_PageList_Column_base($default_heading, $align);
158 $this->_need_rev = substr($field, 0, 4) == 'rev:';
159 if ($this->_need_rev)
160 $this->_field = substr($field, 4);
162 $this->_field = $field;
165 function _getValue ($page_handle, &$revision_handle) {
166 if ($this->_need_rev) {
167 if (!$revision_handle)
168 $revision_handle = $page_handle->getCurrentRevision();
169 return $revision_handle->get($this->_field);
172 return $page_handle->get($this->_field);
177 class _PageList_Column_size extends _PageList_Column {
178 function _getValue ($page_handle, &$revision_handle) {
179 if (!$revision_handle)
180 $revision_handle = $page_handle->getCurrentRevision();
181 return $this->_getSize($revision_handle);
184 function _getSize($revision_handle) {
185 $bytes = strlen($revision_handle->_data['%content']);
186 return ByteFormatter($bytes);
191 class _PageList_Column_bool extends _PageList_Column {
192 function _PageList_Column_bool ($field, $default_heading, $text = 'yes') {
193 $this->_PageList_Column($field, $default_heading, 'center');
194 $this->_textIfTrue = $text;
195 $this->_textIfFalse = new RawXml('—'); //mdash
198 function _getValue ($page_handle, &$revision_handle) {
199 $val = _PageList_Column::_getValue($page_handle, $revision_handle);
200 return $val ? $this->_textIfTrue : $this->_textIfFalse;
204 class _PageList_Column_checkbox extends _PageList_Column {
205 function _PageList_Column_checkbox ($field, $default_heading, $name='p') {
206 $this->_name = $name;
207 $heading = HTML::input(array('type' => 'button',
208 'title' => _("Click to de-/select all pages"),
210 'name' => $default_heading,
211 'value' => $default_heading,
212 'onclick' => "flipAll(this.form)"
214 $this->_PageList_Column($field, $heading, 'center');
216 function _getValue ($pagelist, $page_handle, &$revision_handle) {
217 $pagename = $page_handle->getName();
218 if (!empty($pagelist->_selected[$pagename])) {
219 return HTML::input(array('type' => 'checkbox',
220 'name' => $this->_name . "[$pagename]",
222 'checked' => 'CHECKED'));
224 return HTML::input(array('type' => 'checkbox',
225 'name' => $this->_name . "[$pagename]",
229 function format ($pagelist, $page_handle, &$revision_handle) {
230 return HTML::td($this->_tdattr,
232 $this->_getValue($pagelist, $page_handle, $revision_handle),
233 HTML::raw(' '));
237 class _PageList_Column_time extends _PageList_Column {
238 function _PageList_Column_time ($field, $default_heading) {
239 $this->_PageList_Column($field, $default_heading, 'right');
241 $this->Theme = &$Theme;
244 function _getValue ($page_handle, &$revision_handle) {
245 $time = _PageList_Column::_getValue($page_handle, $revision_handle);
246 return $this->Theme->formatDateTime($time);
250 class _PageList_Column_version extends _PageList_Column {
251 function _getValue ($page_handle, &$revision_handle) {
252 if (!$revision_handle)
253 $revision_handle = $page_handle->getCurrentRevision();
254 return $revision_handle->getVersion();
258 // If needed this could eventually become a subclass
259 // of a new _PageList_Column_action class for other actions.
260 // only for WikiAdminRemove or WikiAdminSelect
261 class _PageList_Column_remove extends _PageList_Column {
262 function _getValue ($page_handle, &$revision_handle) {
263 return Button(array('action' => 'remove'), _("Remove"),
264 $page_handle->getName());
268 // only for WikiAdminRename
269 class _PageList_Column_renamed_pagename extends _PageList_Column {
270 function _getValue ($page_handle, &$revision_handle) {
271 $post_args = $GLOBALS['request']->getArg('admin_rename');
272 $value = str_replace($post_args['from'], $post_args['to'],$page_handle->getName());
273 $div = HTML::div(" => ",HTML::input(array('type' => 'text',
274 'name' => 'rename[]',
275 'value' => $value)));
276 $new_page = $GLOBALS['request']->getPage($value);
277 if ($new_page->exists()) {
278 $div->setAttr('class','error');
279 $div->setAttr('title',_("This page already exists"));
285 // Output is hardcoded to limit of first 50 bytes. Otherwise
286 // on very large Wikis this will fail if used with AllPages
287 // (PHP memory limit exceeded)
288 class _PageList_Column_content extends _PageList_Column {
289 function _PageList_Column_content ($field, $default_heading, $align = false) {
290 _PageList_Column::_PageList_Column($field, $default_heading, $align);
292 if ($field == 'content') {
293 $this->_heading .= sprintf(_(" ... first %d bytes"),
295 } elseif ($field == 'hi_content') {
296 if (!empty($_POST['admin_replace'])) {
297 $search = $_POST['admin_replace']['from'];
298 $this->_heading .= sprintf(_(" ... around %s"),
303 function _getValue ($page_handle, &$revision_handle) {
304 if (!$revision_handle)
305 $revision_handle = $page_handle->getCurrentRevision();
306 // Not sure why implode is needed here, I thought
307 // getContent() already did this, but it seems necessary.
308 $c = implode("\n", $revision_handle->getContent());
309 if ($this->_field == 'hi_content') {
310 $search = $_POST['admin_replace']['from'];
311 if ($search and ($i = strpos($c,$search))) {
312 $l = strlen($search);
313 $j = max(0,$i - ($this->bytes / 2));
314 return HTML::div(array('style' => 'font-size:x-small'),
315 HTML::div(array('class' => 'transclusion'),
316 HTML::span(substr($c, $j, ($this->bytes / 2))),
317 HTML::span(array("style"=>"background:yellow"),$search),
318 HTML::span(substr($c, $i+$l, ($this->bytes / 2))))
321 $c = sprintf(_("%s not found"),
323 return HTML::div(array('style' => 'font-size:x-small','align'=>'center'),
326 } elseif (($len = strlen($c)) > $this->bytes) {
327 $c = substr($c, 0, $this->bytes);
329 include_once('lib/BlockParser.php');
330 // false --> don't bother processing hrefs for embedded WikiLinks
331 $ct = TransformText($c, $revision_handle->get('markup'), false);
332 return HTML::div(array('style' => 'font-size:x-small'),
333 HTML::div(array('class' => 'transclusion'), $ct),
334 // Don't show bytes here if size column present too
335 ($this->parent->_columns_seen['size'] or !$len) ? "" :
336 ByteFormatter($len, /*$longformat = */true));
340 class _PageList_Column_author extends _PageList_Column {
341 function _PageList_Column_author ($field, $default_heading, $align = false) {
342 _PageList_Column::_PageList_Column($field, $default_heading, $align);
343 global $WikiNameRegexp, $request;
344 $this->WikiNameRegexp = $WikiNameRegexp;
345 $this->dbi = &$request->getDbh();
348 function _getValue ($page_handle, &$revision_handle) {
349 $author = _PageList_Column::_getValue($page_handle, $revision_handle);
350 if (preg_match("/^$this->WikiNameRegexp\$/", $author) && $this->dbi->isWikiPage($author))
351 return WikiLink($author);
357 class _PageList_Column_perm extends _PageList_Column {
358 function _getValue ($page_handle, &$revision_handle) {
359 $perm_array = pagePermissions($page_handle->_pagename);
360 return pagePermissionsSimpleFormat($perm_array,
361 $page_handle->get('author'),$page_handle->get('group'));
364 var_dump($perm_array);
365 $xml = ob_get_contents();
372 class _PageList_Column_acl extends _PageList_Column {
373 function _getValue ($page_handle, &$revision_handle) {
374 $perm_tree = pagePermissions($page_handle->_pagename);
375 return pagePermissionsAclFormat($perm_tree);
378 var_dump($perm_array);
379 $xml = ob_get_contents();
386 class _PageList_Column_pagename extends _PageList_Column_base {
387 var $_field = 'pagename';
389 function _PageList_Column_pagename () {
390 $this->_PageList_Column_base(_("Page Name"));
392 $this->dbi = &$request->getDbh();
395 function _getValue ($page_handle, &$revision_handle) {
396 if ($this->dbi->isWikiPage($page_handle->getName()))
397 return WikiLink($page_handle);
399 return WikiLink($page_handle, 'unknown');
406 var $_group_rows = 3;
407 var $_columns = array();
408 var $_excluded_pages = array();
409 var $_rows = array();
411 var $_pagename_seen = false;
412 var $_types = array();
413 var $_options = array();
414 var $_selected = array();
415 var $_sortby = array();
417 function PageList ($columns = false, $exclude = false, $options = false) {
418 $this->_initAvailableColumns();
421 'all' => array_diff(array_keys($this->_types), // all but...
422 array('checkbox','remove','renamed_pagename',
423 'content','hi_content','perm','acl')),
424 'most' => array('pagename','mtime','author','size','hits'),
425 'some' => array('pagename','mtime','author')
428 if (!is_array($columns))
429 $columns = explode(',', $columns);
430 // expand symbolic columns:
431 foreach ($symbolic_columns as $symbol => $cols) {
432 if (in_array($symbol,$columns)) { // e.g. 'checkbox,all'
433 $columns = array_diff(array_merge($columns,$cols),array($symbol));
436 if (!in_array('pagename',$columns))
437 $this->_addColumn('pagename');
438 foreach ($columns as $col) {
439 $this->_addColumn($col);
442 $this->_addColumn('pagename');
444 $this->_options = $options;
445 if (!empty($options) and !empty($options['sortby'])) {
446 $sortby = $options['sortby'];
448 $sortby = $GLOBALS['request']->getArg('sortby');
450 $this->sortby($sortby,'init');
451 if (!empty($options) and !empty($options['limit'])) {
452 $limit = $options['limit'];
454 $limit = $GLOBALS['request']->getArg('limit');
457 if (!is_array($exclude))
458 $exclude = $this->explodePageList($exclude,false,$sortby,$limit);
459 $this->_excluded_pages = $exclude;
462 $this->_messageIfEmpty = _("<no matches>");
465 // Currently PageList takes these arguments:
466 // 1: info, 2: exclude, 3: hash of options
467 // Here we declare which options are supported, so that
468 // the calling plugin may simply merge this with its own default arguments
469 function supportedArgs () {
470 return array(//Currently supported options:
471 'info' => 'pagename',
472 'exclude' => '', // also wildcards and comma-seperated lists
474 // for the sort buttons in <th>
475 'sortby' => '', // same as for WikiDB::getAllPages
477 //PageList pager options:
478 // These options may also be given to _generate(List|Table) later
479 // But limit and offset might help the query WikiDB::getAllPages()
480 //cols => 1, // side-by-side display of list (1-3)
481 //limit => 50, // length of one column
482 //offset => 0, // needed internally for the pager
483 //paging => 'auto', // '': normal paging mode
484 // // 'auto': drop 'info' columns and enhance rows
485 // // when the list becomes large
486 // // 'none': don't page at all
490 function setCaption ($caption_string) {
491 $this->_caption = $caption_string;
494 function getCaption () {
495 // put the total into the caption if needed
496 if (is_string($this->_caption) && strstr($this->_caption, '%d'))
497 return sprintf($this->_caption, $this->getTotal());
498 return $this->_caption;
501 function setMessageIfEmpty ($msg) {
502 $this->_messageIfEmpty = $msg;
506 function getTotal () {
507 return count($this->_rows);
510 function isEmpty () {
511 return empty($this->_rows);
514 function addPage ($page_handle) {
515 if (is_string($page_handle)) {
516 if (empty($page_handle)) return;
517 if (in_array($page_handle, $this->_excluded_pages))
518 return; // exclude page.
519 $dbi = $GLOBALS['request']->getDbh();
520 $page_handle = $dbi->getPage($page_handle);
521 } elseif (is_object($page_handle)) {
522 if (in_array($page_handle->getName(), $this->_excluded_pages))
523 return; // exclude page.
525 //FIXME. only on sf.net
526 if (!is_object($page_handle)) {
527 trigger_error("PageList: Invalid page_handle $page_handle", E_USER_WARNING);
530 // enforce view permission
531 if (!mayAccessPage('view',$page_handle->getName()))
534 $group = (int)(count($this->_rows) / $this->_group_rows);
535 $class = ($group % 2) ? 'oddrow' : 'evenrow';
536 $revision_handle = false;
538 if (count($this->_columns) > 1) {
539 $row = HTML::tr(array('class' => $class));
540 foreach ($this->_columns as $col)
541 $row->pushContent($col->format($this, $page_handle, $revision_handle));
544 $col = $this->_columns[0];
545 $row = HTML::li(array('class' => $class),
546 $col->_getValue($page_handle, $revision_handle));
549 $this->_rows[] = $row;
552 function addPages ($page_iter) {
553 while ($page = $page_iter->next())
554 $this->addPage($page);
557 function addPageList (&$list) {
559 while ($page = next($list))
560 $this->addPage($page);
563 function getContent() {
564 // Note that the <caption> element wants inline content.
565 $caption = $this->getCaption();
567 if ($this->isEmpty())
568 return $this->_emptyList($caption);
569 elseif (count($this->_columns) == 1)
570 return $this->_generateList($caption);
572 return $this->_generateTable($caption);
575 function printXML() {
576 PrintXML($this->getContent());
580 return AsXML($this->getContent());
583 function sortable_columns() {
584 return array('pagename','mtime','hits');
588 * Handles sortby requests for the DB iterator and table header links
589 * Prefix the column with + or - like "+pagename","-mtime", ...
590 * supported columns: 'pagename','mtime','hits'
591 * supported actions: 'flip_order' "mtime" => "+mtime" => "-mtime" ...
592 * 'db' "-pagename" => "pagename DESC"
594 function sortby ($column, $action) {
595 if (empty($column)) return;
596 //support multiple comma-delimited sortby args: "+hits,+pagename"
597 if (strstr($column,',')) {
599 foreach (explode(',',$column) as $col) {
600 $result[] = $this->sortby($col,$action);
602 return join(",",$result);
604 if (substr($column,0,1) == '+') {
605 $order = '+'; $column = substr($column,1);
606 } elseif (substr($column,0,1) == '-') {
607 $order = '-'; $column = substr($column,1);
609 if (in_array($column,PageList::sortable_columns())) {
610 // default order: +pagename, -mtime, -hits
612 if (in_array($column,array('mtime','hits')))
616 if ($action == 'flip_order') {
617 return ($order == '+' ? '-' : '+') . $column;
618 } elseif ($action == 'init') {
619 $this->_sortby[$column] = $order;
620 return $order . $column;
621 } elseif ($action == 'check') {
622 return (!empty($this->_sortby[$column]) or
623 ($GLOBALS['request']->getArg('sortby') and
624 strstr($GLOBALS['request']->getArg('sortby'),$column)));
625 } elseif ($action == 'db') {
626 // asc or desc: +pagename, -pagename
627 return $column . ($order == '+' ? ' ASC' : ' DESC');
633 // echo implode(":",explodeList("Test*",array("xx","Test1","Test2")));
634 function explodePageList($input, $perm = false, $sortby=false, $limit=false) {
635 // expand wildcards from list of all pages
636 if (preg_match('/[\?\*]/',$input)) {
637 $dbi = $GLOBALS['request']->getDbh();
638 $allPagehandles = $dbi->getAllPages($perm,$sortby,$limit);
639 while ($pagehandle = $allPagehandles->next()) {
640 $allPages[] = $pagehandle->getName();
642 return explodeList($input, $allPages);
644 //TODO: do the sorting, normally not needed if used for exclude only
645 return explode(',',$input);
653 //Performance Fixme: Initialize only the requested objects
654 function _initAvailableColumns() {
655 if (!empty($this->_types))
661 => new _PageList_Column_content('rev:content', _("Content")),
662 'hi_content' // with highlighted search for SearchReplace
663 => new _PageList_Column_content('rev:hi_content', _("Content")),
665 => new _PageList_Column_remove('remove', _("Remove")),
667 => new _PageList_Column_renamed_pagename('rename', _("Rename to")),
669 => new _PageList_Column_perm('perm', _("Permission")),
671 => new _PageList_Column_acl('acl', _("ACL")),
673 => new _PageList_Column_checkbox('p', _("Select")),
675 => new _PageList_Column_pagename,
677 => new _PageList_Column_time('rev:mtime', _("Last Modified")),
679 => new _PageList_Column('hits', _("Hits"), 'right'),
681 => new _PageList_Column_size('rev:size', _("Size"), 'right'),
682 /*array('align' => 'char', 'char' => ' ')*/
684 => new _PageList_Column('rev:summary', _("Last Summary")),
686 => new _PageList_Column_version('rev:version', _("Version"),
689 => new _PageList_Column_author('rev:author', _("Last Author")),
691 => new _PageList_Column_author('owner', _("Owner")),
693 => new _PageList_Column_author('group', _("Group")),
695 => new _PageList_Column_bool('locked', _("Locked"),
698 => new _PageList_Column_bool('rev:is_minor_edit',
699 _("Minor Edit"), _("minor")),
701 => new _PageList_Column('rev:markup', _("Markup"))
705 function _addColumn ($column) {
707 $this->_initAvailableColumns();
709 if (isset($this->_columns_seen[$column]))
710 return false; // Already have this one.
711 $this->_columns_seen[$column] = true;
713 if (strstr($column, ':'))
714 list ($column, $heading) = explode(':', $column, 2);
716 if (!isset($this->_types[$column])) {
717 trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE);
721 $col = $this->_types[$column];
722 if (!empty($heading))
723 $col->setHeading($heading);
725 $this->_columns[] = $col;
730 // make a table given the caption
731 function _generateTable($caption) {
732 $table = HTML::table(array('cellpadding' => 0,
735 'class' => 'pagelist'));
737 $table->pushContent(HTML::caption(array('align'=>'top'), $caption));
739 //Warning: This is quite fragile. It depends solely on a private variable
741 if (!empty($this->_columns_seen['checkbox'])) {
742 $table->pushContent($this->_jsFlipAll());
745 $table_summary = array();
746 foreach ($this->_columns as $col) {
747 $row->pushContent($col->button_heading());
748 if (is_string($col->_heading))
749 $table_summary[] = $col->_heading;
751 // Table summary for non-visual browsers.
752 $table->setAttr('summary', sprintf(_("Columns: %s."),
753 implode(", ", $table_summary)));
755 $table->pushContent(HTML::thead($row),
756 HTML::tbody(false, $this->_rows));
760 function _jsFlipAll() {
762 function flipAll(formObj) {
764 for (var i=0;i < formObj.length;i++) {
765 fldObj = formObj.elements[i];
766 if (fldObj.type == 'checkbox') {
767 if (isFirstSet == -1)
768 isFirstSet = (fldObj.checked) ? true : false;
769 fldObj.checked = (isFirstSet) ? false : true;
775 function _generateList($caption) {
776 $list = HTML::ul(array('class' => 'pagelist'), $this->_rows);
778 //Warning: This is quite fragile. It depends solely on a private variable
780 // questionable if its of use here anyway. this is a one-col list only.
781 if (!empty($this->_columns_seen['checkbox'])) {
782 $out->pushContent($this->_jsFlipAll());
785 $out->pushContent(HTML::p($caption));
786 $out->pushContent($list);
790 function _emptyList($caption) {
793 $html->pushContent(HTML::p($caption));
794 if ($this->_messageIfEmpty)
795 $html->pushContent(HTML::blockquote(HTML::p($this->_messageIfEmpty)));
801 /* List pages with checkboxes to select from.
802 * The [Select] button toggles via _jsFlipAll
805 class PageList_Selectable
808 function PageList_Selectable ($columns=false, $exclude=false) {
810 if (!is_array($columns))
811 $columns = explode(',', $columns);
812 if (!in_array('checkbox',$columns))
813 array_unshift($columns,'checkbox');
815 $columns = array('checkbox','pagename');
817 PageList::PageList($columns,$exclude);
820 function addPageList ($array) {
821 while (list($pagename,$selected) = each($array)) {
822 if ($selected) $this->addPageSelected($pagename);
823 $this->addPage($pagename);
827 function addPageSelected ($pagename) {
828 $this->_selected[$pagename] = 1;
831 //insert javascript when clicked on Selected Select/Deselect all
834 // (c-file-style: "gnu")
839 // c-hanging-comment-ender-p: nil
840 // indent-tabs-mode: nil