]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/PageList.php
oci8 patch by Philippe Vanhaesendonck + some ADODB notes+fixes
[SourceForge/phpwiki.git] / lib / PageList.php
1 <?php rcs_id('$Id: PageList.php,v 1.94 2004-06-27 10:26:02 rurban Exp $');
2
3 /**
4  * List a number of pagenames, optionally as table with various columns.
5  * This library relieves some work for these plugins:
6  *
7  * AllPages, BackLinks, LikePages, MostPopular, TitleSearch, WikiAdmin* and more
8  *
9  * It also allows dynamic expansion of those plugins to include more
10  * columns in their output.
11  *
12  * Column 'info=' arguments:
13  *
14  * 'pagename' _("Page Name")
15  * 'mtime'    _("Last Modified")
16  * 'hits'     _("Hits")
17  * 'summary'  _("Last Summary")
18  * 'version'  _("Version")),
19  * 'author'   _("Last Author")),
20  * 'locked'   _("Locked"), _("locked")
21  * 'minor'    _("Minor Edit"), _("minor")
22  * 'markup'   _("Markup")
23  * 'size'     _("Size")
24  * 'creator'  _("Creator")
25  * 'owner'    _("Owner")
26  * 'checkbox'  selectable checkbox at the left.
27  * 'content'  
28  *
29  * Special, custom columns: Either theme or plugin (WikiAdmin*) specific.
30  * 'remove'   _("Remove")     
31  * 'perm'     _("Permission Mask")
32  * 'acl'      _("ACL")
33  * 'renamed_pagename'   _("Rename to")
34  * 'ratingwidget', ... wikilens theme specific.
35  * 'custom'   See plugin/WikiTranslation
36  *
37  * Symbolic 'info=' arguments:
38  * 'all'       All columns except the special columns
39  * 'most'      pagename, mtime, author, size, hits, ...
40  * 'some'      pagename, mtime, author
41  *
42  * FIXME: In this refactoring I (Jeff) have un-implemented _ctime, _cauthor, and
43  * number-of-revision.  Note the _ctime and _cauthor as they were implemented
44  * were somewhat flawed: revision 1 of a page doesn't have to exist in the
45  * database.  If lots of revisions have been made to a page, it's more than likely
46  * that some older revisions (include revision 1) have been cleaned (deleted).
47  *
48  * DONE: 
49  *   paging support: limit, offset args
50  *   check PagePerm "list" access-type,
51  *   all columns are sortable (Thanks to the wikilens team).
52  *
53  * TODO: 
54  *   rows arguments for multiple pages/multiple rows.
55  *
56  *   ->supportedArgs() which arguments are supported, so that the plugin 
57  *                     doesn't explictly need to declare it 
58  *   Status: already merged in some plugins calls
59  *
60  *   new method:
61  *     list not as <ul> or table, but as simple comma-seperated list
62  *
63  *   fix memory exhaustion on large pagelists. 
64  *   Status: fixed 2004-06-25 16:19:36 rurban but needs further testing.
65  */
66 class _PageList_Column_base {
67     var $_tdattr = array();
68
69     function _PageList_Column_base ($default_heading, $align = false) {
70         $this->_heading = $default_heading;
71
72         if ($align) {
73             // align="char" isn't supported by any browsers yet :(
74             //if (is_array($align))
75             //    $this->_tdattr = $align;
76             //else
77             $this->_tdattr['align'] = $align;
78         }
79     }
80
81     function format ($pagelist, $page_handle, &$revision_handle) {
82         return HTML::td($this->_tdattr,
83                         HTML::raw('&nbsp;'),
84                         $this->_getValue($page_handle, $revision_handle),
85                         HTML::raw('&nbsp;'));
86     }
87
88     function getHeading () {
89         return $this->_heading;
90     }
91
92     function setHeading ($heading) {
93         $this->_heading = $heading;
94     }
95
96     // old-style heading
97     function heading () {
98         // allow sorting?
99         if (1 or in_array($this->_field, PageList::sortable_columns())) {
100             // multiple comma-delimited sortby args: "+hits,+pagename"
101             // asc or desc: +pagename, -pagename
102             $sortby = PageList::sortby($this->_field, 'flip_order');
103             //Fixme: pass all also other GET args along. (limit, p[])
104             //TODO: support GET and POST
105             $s = HTML::a(array('href' => 
106                                $GLOBALS['request']->GetURLtoSelf(array('sortby' => $sortby,
107                                                                        'nocache' => '1')),
108                                'class' => 'pagetitle',
109                                'title' => sprintf(_("Sort by %s"), $this->_field)), 
110                          HTML::raw('&nbsp;'), HTML::u($this->_heading), HTML::raw('&nbsp;'));
111         } else {
112             $s = HTML(HTML::raw('&nbsp;'), HTML::u($this->_heading), HTML::raw('&nbsp;'));
113         }
114         return HTML::th(array('align' => 'center'),$s);
115     }
116
117     // new grid-style
118     // see activeui.js 
119     function button_heading ($pagelist, $colNum) {
120         global $WikiTheme, $request;
121         // allow sorting?
122         if (1 or in_array($this->_field, PageList::sortable_columns())) {
123             // multiple comma-delimited sortby args: "+hits,+pagename"
124             $src = false; 
125             $noimg_src = $WikiTheme->getButtonURL('no_order');
126             if ($noimg_src)
127                 $noimg = HTML::img(array('src' => $noimg_src,
128                                          'width' => '7', 
129                                          'height' => '7',
130                                          'border' => 0,
131                                          'alt'    => '.'));
132             else 
133                 $noimg = HTML::raw('&nbsp;');
134             if ($request->getArg('sortby')) {
135                 if ($pagelist->sortby($colNum, 'check')) { // show icon?
136                     $sortby = $pagelist->sortby($request->getArg('sortby'), 'flip_order');
137                     $request->setArg('sortby', $sortby);
138                     $desc = (substr($sortby,0,1) == '-'); // asc or desc? (+pagename, -pagename)
139                     $src = $WikiTheme->getButtonURL($desc ? 'asc_order' : 'desc_order');
140                 } else {
141                     $sortby = $pagelist->sortby($colNum, 'init');
142                 }
143             } else {
144                 $sortby = $pagelist->sortby($colNum, 'init');
145             }
146             if (!$src) {
147                 $img = $noimg;
148                 //$img->setAttr('alt', _("Click to sort"));
149             } else {
150                 $img = HTML::img(array('src' => $src, 
151                                        'width' => '7', 
152                                        'height' => '7', 
153                                        'border' => 0,
154                                        'alt' => _("Click to reverse sort order")));
155             }
156             $s = HTML::a(array('href' => 
157                                //Fixme: pass all also other GET args along. (limit, p[])
158                                //Fixme: convert to POST submit[sortby]
159                                $request->GetURLtoSelf(array('sortby' => $sortby,
160                                                             'nocache' => '1')),
161                                'class' => 'gridbutton', 
162                                'title' => sprintf(_("Click to sort by %s"), $this->_field)),
163                          HTML::raw('&nbsp;'),
164                          $noimg,
165                          HTML::raw('&nbsp;'),
166                          $this->_heading,
167                          HTML::raw('&nbsp;'),
168                          $img,
169                          HTML::raw('&nbsp;'));
170         } else {
171             $s = HTML(HTML::raw('&nbsp;'), $this->_heading, HTML::raw('&nbsp;'));
172         }
173         return HTML::th(array('align' => 'center', 'valign' => 'middle', 
174                               'class' => 'gridbutton'), $s);
175     }
176
177     /**
178      * Take two columns of this type and compare them.
179      * An undefined value is defined to be < than the smallest defined value.
180      * This base class _compare only works if the value is simple (e.g., a number).
181      *
182      * @param  $colvala  $this->_getValue() of column a
183      * @param  $colvalb  $this->_getValue() of column b
184      *
185      * @return -1 if $a < $b, 1 if $a > $b, 0 otherwise.
186      */
187     function _compare($colvala, $colvalb) {
188         if (is_string($colvala))
189             return strcmp($colvala,$colvalb);
190         $ret = 0;
191         if (($colvala === $colvalb) || (!isset($colvala) && !isset($colvalb))) {
192             ;
193         } else {
194             $ret = (!isset($colvala) || ($colvala < $colvalb)) ? -1 : 1;
195         }
196         return $ret; 
197     }
198 };
199
200 class _PageList_Column extends _PageList_Column_base {
201     function _PageList_Column ($field, $default_heading, $align = false) {
202         $this->_PageList_Column_base($default_heading, $align);
203
204         $this->_need_rev = substr($field, 0, 4) == 'rev:';
205         $this->_iscustom = substr($field, 0, 7) == 'custom:';
206         if ($this->_iscustom) {
207             $this->_field = substr($field, 7);
208         }
209         elseif ($this->_need_rev)
210             $this->_field = substr($field, 4);
211         else
212             $this->_field = $field;
213     }
214
215     function _getValue ($page_handle, &$revision_handle) {
216         if ($this->_need_rev) {
217             if (!$revision_handle)
218                 $revision_handle = $page_handle->getCurrentRevision();
219             return $revision_handle->get($this->_field);
220         }
221         else {
222             return $page_handle->get($this->_field);
223         }
224     }
225     
226     function _getSortableValue ($page_handle, &$revision_handle) {
227         return _PageList_Column::_getValue($page_handle, $revision_handle);
228     }
229 };
230
231 /* overcome a call_user_func limitation by not being able to do:
232  * call_user_func_array(array(&$class, $class_name), $params);
233  * So we need $class = new $classname($params);
234  * And we add a 4th param for the parent $pagelist object
235  */
236 class _PageList_Column_custom extends _PageList_Column {
237     function _PageList_Column_custom($params) {
238         $this->_pagelist =& $params[3];
239         $this->_PageList_Column($params[0], $params[1], $params[2]);
240     }
241 }
242
243 class _PageList_Column_size extends _PageList_Column {
244     function _getValue ($page_handle, &$revision_handle) {
245         if (!$revision_handle)
246             $revision_handle = $page_handle->getCurrentRevision();
247         return $this->_getSize($revision_handle);
248     }
249     
250     function _getSortableValue ($page_handle, &$revision_handle) {
251         if (!$revision_handle)
252             $revision_handle = $page_handle->getCurrentRevision();
253         return (empty($revision_handle->_data['%content'])) 
254                ? 0 : strlen($revision_handle->_data['%content']);
255     }
256
257     function _getSize($revision_handle) {
258         $bytes = @strlen($revision_handle->_data['%content']);
259         return ByteFormatter($bytes);
260     }
261 }
262
263
264 class _PageList_Column_bool extends _PageList_Column {
265     function _PageList_Column_bool ($field, $default_heading, $text = 'yes') {
266         $this->_PageList_Column($field, $default_heading, 'center');
267         $this->_textIfTrue = $text;
268         $this->_textIfFalse = new RawXml('&#8212;'); //mdash
269     }
270
271     function _getValue ($page_handle, &$revision_handle) {
272         //FIXME: check if $this is available in the parent (->need_rev)
273         $val = _PageList_Column::_getValue($page_handle, $revision_handle);
274         return $val ? $this->_textIfTrue : $this->_textIfFalse;
275     }
276 };
277
278 class _PageList_Column_checkbox extends _PageList_Column {
279     function _PageList_Column_checkbox ($field, $default_heading, $name='p') {
280         $this->_name = $name;
281         $heading = HTML::input(array('type'  => 'button',
282                                      'title' => _("Click to de-/select all pages"),
283                                      //'width' => '100%',
284                                      'name'  => $default_heading,
285                                      'value' => $default_heading,
286                                      'onclick' => "flipAll(this.form)"
287                                      ));
288         $this->_PageList_Column($field, $heading, 'center');
289     }
290     function _getValue ($pagelist, $page_handle, &$revision_handle) {
291         $pagename = $page_handle->getName();
292         $selected = !empty($pagelist->_selected[$pagename]);
293         if (strstr($pagename,'[') or strstr($pagename,']')) {
294             $pagename = str_replace(array('[',']'),array('%5B','%5D'),$pagename);
295         }
296         if ($selected) {
297             return HTML::input(array('type' => 'checkbox',
298                                      'name' => $this->_name . "[$pagename]",
299                                      'value' => 1,
300                                      'checked' => 'CHECKED'));
301         } else {
302             return HTML::input(array('type' => 'checkbox',
303                                      'name' => $this->_name . "[$pagename]",
304                                      'value' => 1));
305         }
306     }
307     function format ($pagelist, $page_handle, &$revision_handle) {
308         return HTML::td($this->_tdattr,
309                         HTML::raw('&nbsp;'),
310                         $this->_getValue($pagelist, $page_handle, $revision_handle),
311                         HTML::raw('&nbsp;'));
312     }
313 };
314
315 class _PageList_Column_time extends _PageList_Column {
316     function _PageList_Column_time ($field, $default_heading) {
317         $this->_PageList_Column($field, $default_heading, 'right');
318         global $WikiTheme;
319         $this->Theme = &$WikiTheme;
320     }
321
322     function _getValue ($page_handle, &$revision_handle) {
323         $time = _PageList_Column::_getValue($page_handle, $revision_handle);
324         return $this->Theme->formatDateTime($time);
325     }
326 };
327
328 class _PageList_Column_version extends _PageList_Column {
329     function _getValue ($page_handle, &$revision_handle) {
330         if (!$revision_handle)
331             $revision_handle = $page_handle->getCurrentRevision();
332         return $revision_handle->getVersion();
333     }
334 };
335
336 // Output is hardcoded to limit of first 50 bytes. Otherwise
337 // on very large Wikis this will fail if used with AllPages
338 // (PHP memory limit exceeded)
339 // FIXME: old PHP without superglobals
340 class _PageList_Column_content extends _PageList_Column {
341     function _PageList_Column_content ($field, $default_heading, $align = false) {
342         $this->_PageList_Column($field, $default_heading, $align);
343         $this->bytes = 50;
344         if ($field == 'content') {
345             $this->_heading .= sprintf(_(" ... first %d bytes"),
346                                        $this->bytes);
347         } elseif ($field == 'hi_content') {
348             if (!empty($_POST['admin_replace'])) {
349                 $search = $_POST['admin_replace']['from'];
350                 $this->_heading .= sprintf(_(" ... around %s"),
351                                            '»'.$search.'«');
352             }
353         }
354     }
355     function _getValue ($page_handle, &$revision_handle) {
356         if (!$revision_handle)
357             $revision_handle = $page_handle->getCurrentRevision();
358         // Not sure why implode is needed here, I thought
359         // getContent() already did this, but it seems necessary.
360         $c = implode("\n", $revision_handle->getContent());
361         if ($this->_field == 'hi_content') {
362             $search = $_POST['admin_replace']['from'];
363             if ($search and ($i = strpos($c,$search))) {
364                 $l = strlen($search);
365                 $j = max(0,$i - ($this->bytes / 2));
366                 return HTML::div(array('style' => 'font-size:x-small'),
367                                  HTML::div(array('class' => 'transclusion'),
368                                            HTML::span(substr($c, $j, ($this->bytes / 2))),
369                                            HTML::span(array("style"=>"background:yellow"),$search),
370                                            HTML::span(substr($c, $i+$l, ($this->bytes / 2))))
371                                  );
372             } else {
373                 $c = sprintf(_("%s not found"),
374                              '»'.$search.'«');
375                 return HTML::div(array('style' => 'font-size:x-small','align'=>'center'),
376                                  $c);
377             }
378         } elseif (($len = strlen($c)) > $this->bytes) {
379             $c = substr($c, 0, $this->bytes);
380         }
381         include_once('lib/BlockParser.php');
382         // false --> don't bother processing hrefs for embedded WikiLinks
383         $ct = TransformText($c, $revision_handle->get('markup'), false);
384         return HTML::div(array('style' => 'font-size:x-small'),
385                          HTML::div(array('class' => 'transclusion'), $ct),
386                          // Don't show bytes here if size column present too
387                          ($this->parent->_columns_seen['size'] or !$len) ? "" :
388                            ByteFormatter($len, /*$longformat = */true));
389     }
390     
391     function _getSortableValue ($page_handle, &$revision_handle) {
392         return substr(_PageList_Column::_getValue($page_handle, $revision_handle),0,50);
393     }
394 };
395
396 class _PageList_Column_author extends _PageList_Column {
397     function _PageList_Column_author ($field, $default_heading, $align = false) {
398         _PageList_Column::_PageList_Column($field, $default_heading, $align);
399         $this->dbi =& $GLOBALS['request']->getDbh();
400     }
401
402     function _getValue ($page_handle, &$revision_handle) {
403         $author = _PageList_Column::_getValue($page_handle, $revision_handle);
404         if (isWikiWord($author) && $this->dbi->isWikiPage($author))
405             return WikiLink($author);
406         else
407             return $author;
408     }
409 };
410
411 class _PageList_Column_owner extends _PageList_Column_author {
412     function _getValue ($page_handle, &$revision_handle) {
413         $author = $page_handle->getOwner();
414         if (isWikiWord($author) && $this->dbi->isWikiPage($author))
415             return WikiLink($author);
416         else
417             return $author;
418     }
419 };
420
421 class _PageList_Column_creator extends _PageList_Column_author {
422     function _getValue ($page_handle, &$revision_handle) {
423         $author = $page_handle->getCreator();
424         if (isWikiWord($author) && $this->dbi->isWikiPage($author))
425             return WikiLink($author);
426         else
427             return $author;
428     }
429 };
430
431 class _PageList_Column_pagename extends _PageList_Column_base {
432     var $_field = 'pagename';
433
434     function _PageList_Column_pagename () {
435         $this->_PageList_Column_base(_("Page Name"));
436         global $request;
437         $this->dbi = &$request->getDbh();
438     }
439
440     function _getValue ($page_handle, &$revision_handle) {
441         if ($this->dbi->isWikiPage($page_handle->getName()))
442             return WikiLink($page_handle);
443         else
444             return WikiLink($page_handle, 'unknown');
445     }
446     
447     function _getSortableValue ($page_handle, &$revision_handle) {
448         return $page_handle->getName();
449     }
450
451     /**
452      * Compare two pagenames for sorting.  See _PageList_Column::_compare.
453      **/
454     function _compare($colvala, $colvalb) {
455         return strcmp($colvala, $colvalb);
456     }
457 };
458
459 /**
460  * A class to bundle up a page with a reference to PageList, so that
461  * the compare function for usort() has access to it all.
462  * This is a hack necessitated by the interface to usort()-- comparators
463  * can't get information upon construction; you get a comparator by class
464  * name, not by instance.
465  * @author: Dan Frankowski
466  */
467 class _PageList_Page {
468     var $_pagelist;
469     var $_page;
470
471     function _PageList_Page($pagelist, $page_handle) {
472         $this->_pagelist = $pagelist;
473         $this->_page = $page_handle;
474     }
475
476     function getPageList() {
477         return $this->_pagelist;
478     }
479
480     function getPage() {
481         return $this->_page;
482     }
483 }
484
485 class PageList {
486     var $_group_rows = 3;
487     var $_columns = array();
488     var $_columnsMap = array();      // Maps column name to column number.
489     var $_excluded_pages = array();
490     var $_pages = array();
491     var $_caption = "";
492     var $_pagename_seen = false;
493     var $_types = array();
494     var $_options = array();
495     var $_selected = array();
496     var $_sortby = array();
497     var $_maxlen = 0;
498
499     function PageList ($columns = false, $exclude = false, $options = false) {
500         if ($options)
501             $this->_options = $options;
502
503         // let plugins predefine only certain objects, such its own custom pagelist columns
504         if (!empty($this->_options['types'])) {
505             $this->_types = $this->_options['types'];
506             unset($this->_options['types']);
507         }
508         $this->_initAvailableColumns();
509         $symbolic_columns = 
510             array(
511                   'all' =>  array_diff(array_keys($this->_types), // all but...
512                                        array('checkbox','remove','renamed_pagename',
513                                              'content','hi_content','perm','acl')),
514                   'most' => array('pagename','mtime','author','size','hits'),
515                   'some' => array('pagename','mtime','author')
516                   );
517         if ($columns) {
518             if (!is_array($columns))
519                 $columns = explode(',', $columns);
520             // expand symbolic columns:
521             foreach ($symbolic_columns as $symbol => $cols) {
522                 if (in_array($symbol,$columns)) { // e.g. 'checkbox,all'
523                     $columns = array_diff(array_merge($columns,$cols),array($symbol));
524                 }
525             }
526             if (!in_array('pagename',$columns))
527                 $this->_addColumn('pagename');
528             foreach ($columns as $col) {
529                 $this->_addColumn($col);
530             }
531         }
532         // If 'pagename' is already present, _addColumn() will not add it again
533         $this->_addColumn('pagename');
534
535         foreach (array('sortby','limit','paging','count') as $key) {
536           if (!empty($options) and !empty($options[$key])) {
537             $this->_options[$key] = $options[$key];
538           } else {
539             $this->_options[$key] = $GLOBALS['request']->getArg($key);
540           }
541         }
542         $this->_options['sortby'] = $this->sortby($this->_options['sortby'], 'init');
543         if ($exclude) {
544             if (!is_array($exclude))
545                 $exclude = $this->explodePageList($exclude,false,
546                                                   $this->_options['sortby'],
547                                                   $this->_options['limit']);
548             $this->_excluded_pages = $exclude;
549         }
550         $this->_messageIfEmpty = _("<no matches>");
551     }
552
553     // Currently PageList takes these arguments:
554     // 1: info, 2: exclude, 3: hash of options
555     // Here we declare which options are supported, so that 
556     // the calling plugin may simply merge this with its own default arguments 
557     function supportedArgs () {
558         return array(//Currently supported options:
559                      'info'              => 'pagename',
560                      'exclude'           => '',          // also wildcards and comma-seperated lists
561
562                      /* select pages by meta-data: */
563                      'author'   => false, // current user by []
564                      'owner'    => false, // current user by []
565                      'creator'  => false, // current user by []
566
567                      // for the sort buttons in <th>
568                      'sortby'            => 'pagename', // same as for WikiDB::getAllPages
569
570                      //PageList pager options:
571                      // These options may also be given to _generate(List|Table) later
572                      // But limit and offset might help the query WikiDB::getAllPages()
573                      'cols'     => 1,       // side-by-side display of list (1-3)
574                      'limit'    => 0,       // number of rows (pagesize)
575                      'paging'   => 'auto',  // 'auto'  normal paging mode
576                      //                     // 'smart' drop 'info' columns and enhance rows 
577                      //                     //         when the list becomes large
578                      //                     // 'none'  don't page at all
579                      //'azhead' => 0        // provide shortcut links to pages starting with different letters
580                      );
581     }
582
583     function setCaption ($caption_string) {
584         $this->_caption = $caption_string;
585     }
586
587     function getCaption () {
588         // put the total into the caption if needed
589         if (is_string($this->_caption) && strstr($this->_caption, '%d'))
590             return sprintf($this->_caption, $this->getTotal());
591         return $this->_caption;
592     }
593
594     function setMessageIfEmpty ($msg) {
595         $this->_messageIfEmpty = $msg;
596     }
597
598
599     function getTotal () {
600         return !empty($this->_options['count'])
601                ? (integer) $this->_options['count'] : count($this->_pages);
602     }
603
604     function isEmpty () {
605         return empty($this->_pages);
606     }
607
608     function addPage($page_handle) {
609         $this->_pages[] = new _PageList_Page($this, $page_handle);
610     }
611
612     function _getPageFromHandle($ph) {
613         $page_handle = $ph;
614         if (is_string($page_handle)) {
615             if (empty($page_handle)) return $page_handle;
616             $dbi = $GLOBALS['request']->getDbh();
617             $page_handle = $dbi->getPage($page_handle);
618         }
619         return $page_handle;
620     }
621
622     /**
623      * Take a PageList_Page object, and return an HTML object to display
624      * it in a table or list row.
625      */
626     function _renderPageRow ($pagelist_page) {
627         $page_handle = $pagelist_page->getPage();
628
629         $page_handle = $this->_getPageFromHandle($page_handle);
630         if (!isset($page_handle) || empty($page_handle)
631             || in_array($page_handle->getName(), $this->_excluded_pages))
632             return; // exclude page.
633             
634         //FIXME. only on sf.net
635         if (!is_object($page_handle)) {
636             trigger_error("PageList: Invalid page_handle $page_handle", E_USER_WARNING);
637             return;
638         }
639         // enforce view permission
640         if (!mayAccessPage('view',$page_handle->getName()))
641             return;
642
643         $group = (int)($this->getTotal() / $this->_group_rows);
644         $class = ($group % 2) ? 'oddrow' : 'evenrow';
645         $revision_handle = false;
646         $this->_maxlen = max($this->_maxlen, strlen($page_handle->getName()));
647
648         if (count($this->_columns) > 1) {
649             $row = HTML::tr(array('class' => $class));
650             foreach ($this->_columns as $col)
651                 $row->pushContent($col->format($this, $page_handle, $revision_handle));
652         }
653         else {
654             $col = $this->_columns[0];
655             $row = $col->_getValue($page_handle, $revision_handle);
656         }
657
658         return $row;
659     }
660
661     function addPages ($page_iter) {
662         //Todo: if limit check max(strlen(pagename))
663         while ($page = $page_iter->next())
664             $this->addPage($page);
665     }
666
667     function addPageList (&$list) {
668         reset ($list);
669         while ($page = next($list))
670             $this->addPage((string)$page);
671     }
672
673     function maxLen() {
674         global $DBParams, $request;
675         if ($DBParams['dbtype'] == 'SQL' or $DBParams['dbtype'] == 'ADODB') {
676             $dbi =& $request->getDbh();
677             extract($dbi->_backend->_table_names);
678             if ($DBParams['dbtype'] == 'SQL') {
679                 //FIXME: LIMIT not portable
680                 $res = $dbi->_backend->_dbh->getOne("SELECT max(length(pagename)) FROM $page_tbl LIMIT 1");
681                 if (DB::isError($res) || empty($res)) return false;
682                 else return $res;
683             } elseif ($DBParams['dbtype'] == 'ADODB') {
684                 //FIXME: LIMIT not portable
685                 $row = $dbi->_backend->_dbh->getRow("SELECT max(length(pagename)) FROM $page_tbl LIMIT 1");
686                 return $row ? $row[0] : false;
687             }
688         } else 
689             return false;
690     }
691
692     function getContent() {
693         // Note that the <caption> element wants inline content.
694         $caption = $this->getCaption();
695
696         if ($this->isEmpty())
697             return $this->_emptyList($caption);
698         elseif (count($this->_columns) == 1)
699             return $this->_generateList($caption);
700         else
701             return $this->_generateTable($caption);
702     }
703
704     function printXML() {
705         PrintXML($this->getContent());
706     }
707
708     function asXML() {
709         return AsXML($this->getContent());
710     }
711     
712     /** Now all columns are sortable. 
713      *  These are the colums which have native WikiDB backend methods. 
714      */
715     function sortable_columns() {
716         return array('pagename','mtime','hits');
717     }
718
719     /** 
720      * Handle sortby requests for the DB iterator and table header links.
721      * Prefix the column with + or - like "+pagename","-mtime", ...
722      * supported actions: 'flip_order' "mtime" => "+mtime" => "-mtime" ...
723      *                    'db'         "-pagename" => "pagename DESC"
724      * Now all columns are sortable. (patch by DanFr)
725      */
726     function sortby ($column, $action) {
727         if (empty($column)) return;
728         //support multiple comma-delimited sortby args: "+hits,+pagename"
729         if (strstr($column,',')) {
730             $result = array();
731             foreach (explode(',',$column) as $col) {
732                 $result[] = $this->sortby($col,$action);
733             }
734             return join(",",$result);
735         }
736         if (substr($column,0,1) == '+') {
737             $order = '+'; $column = substr($column,1);
738         } elseif (substr($column,0,1) == '-') {
739             $order = '-'; $column = substr($column,1);
740         }
741         // default order: +pagename, -mtime, -hits
742         if (empty($order))
743             if (in_array($column,array('mtime','hits')))
744                 $order = '-';
745             else
746                 $order = '+';
747         if ($action == 'flip_order') {
748             return ($order == '+' ? '-' : '+') . $column;
749         } elseif ($action == 'init') {
750             $this->_sortby[$column] = $order;
751             return $order . $column;
752         } elseif ($action == 'check') {
753             return (!empty($this->_sortby[$column]) or 
754                     ($GLOBALS['request']->getArg('sortby') and 
755                      strstr($GLOBALS['request']->getArg('sortby'),$column)));
756         } elseif ($action == 'db') {
757             // asc or desc: +pagename, -pagename
758             return $column . ($order == '+' ? ' ASC' : ' DESC');
759         }
760         return '';
761     }
762
763     // echo implode(":",explodeList("Test*",array("xx","Test1","Test2")));
764     function explodePageList($input, $perm = false, $sortby=false, $limit=false) {
765         // expand wildcards from list of all pages
766         if (preg_match('/[\?\*]/',$input)) {
767             $dbi = $GLOBALS['request']->getDbh();
768             $allPagehandles = $dbi->getAllPages($perm,$sortby,$limit);
769             while ($pagehandle = $allPagehandles->next()) {
770                 $allPages[] = $pagehandle->getName();
771             }
772             return explodeList($input, $allPages);
773         } else {
774             //TODO: do the sorting, normally not needed if used for exclude only
775             return explode(',',$input);
776         }
777     }
778
779     function allPagesByAuthor($wildcard, $perm=false, $sortby=false, $limit=false) {
780         $dbi = $GLOBALS['request']->getDbh();
781         $allPagehandles = $dbi->getAllPages($perm, $sortby, $limit);
782         $allPages = array();
783         if ($wildcard === '[]') {
784             $wildcard = $GLOBALS['request']->_user->getAuthenticatedId();
785             if (!$wildcard) return $allPages;
786         }
787         while ($pagehandle = $allPagehandles->next()) {
788             $name = $pagehandle->getName();
789             $author = $pagehandle->getAuthor();
790             if ($author) {
791                 if (preg_match('/[\?\*]/', $wildcard)) {
792                     if (glob_match($wildcard, $author))
793                         $allPages[] = $name;
794                 } elseif ($wildcard == $author) {
795                       $allPages[] = $name;
796                 }
797             }
798         }
799         return $allPages;
800     }
801
802     function allPagesByOwner($wildcard, $perm=false, $sortby=false, $limit=false) {
803         $dbi = $GLOBALS['request']->getDbh();
804         $allPagehandles = $dbi->getAllPages($perm, $sortby, $limit);
805         $allPages = array();
806         if ($wildcard === '[]') {
807             $wildcard = $GLOBALS['request']->_user->getAuthenticatedId();
808             if (!$wildcard) return $allPages;
809         }
810         while ($pagehandle = $allPagehandles->next()) {
811             $name = $pagehandle->getName();
812             $owner = $pagehandle->getOwner();
813             if ($owner) {
814                 if (preg_match('/[\?\*]/', $wildcard)) {
815                     if (glob_match($wildcard, $owner))
816                         $allPages[] = $name;
817                 } elseif ($wildcard == $owner) {
818                       $allPages[] = $name;
819                 }
820             }
821         }
822         return $allPages;
823     }
824
825     function allPagesByCreator($wildcard, $perm=false, $sortby=false, $limit=false) {
826         $dbi = $GLOBALS['request']->getDbh();
827         $allPagehandles = $dbi->getAllPages($perm, $sortby, $limit);
828         $allPages = array();
829         if ($wildcard === '[]') {
830             $wildcard = $GLOBALS['request']->_user->getAuthenticatedId();
831             if (!$wildcard) return $allPages;
832         }
833         while ($pagehandle = $allPagehandles->next()) {
834             $name = $pagehandle->getName();
835             $creator = $pagehandle->getCreator();
836             if ($creator) {
837                 if (preg_match('/[\?\*]/', $wildcard)) {
838                     if (glob_match($wildcard, $creator))
839                         $allPages[] = $name;
840                 } elseif ($wildcard == $creator) {
841                       $allPages[] = $name;
842                 }
843             }
844         }
845         return $allPages;
846     }
847
848     ////////////////////
849     // private
850     ////////////////////
851     /** Plugin and theme hooks: 
852      *  If the pageList is initialized with $options['types'] these types are also initialized, 
853      *  overriding the standard types.
854      */
855     function _initAvailableColumns() {
856         global $customPageListColumns;
857         $standard_types =
858             array(
859                   'content'
860                   => new _PageList_Column_content('rev:content', _("Content")),
861                   // new: plugin specific column types initialised by the relevant plugins
862                   /*
863                   'hi_content' // with highlighted search for SearchReplace
864                   => new _PageList_Column_content('rev:hi_content', _("Content")),
865                   'remove'
866                   => new _PageList_Column_remove('remove', _("Remove")),
867                   // initialised by the plugin
868                   'renamed_pagename'
869                   => new _PageList_Column_renamed_pagename('rename', _("Rename to")),
870                   'perm'
871                   => new _PageList_Column_perm('perm', _("Permission")),
872                   'acl'
873                   => new _PageList_Column_acl('acl', _("ACL")),
874                   */
875                   'checkbox'
876                   => new _PageList_Column_checkbox('p', _("Select")),
877                   'pagename'
878                   => new _PageList_Column_pagename,
879                   'mtime'
880                   => new _PageList_Column_time('rev:mtime', _("Last Modified")),
881                   'hits'
882                   => new _PageList_Column('hits', _("Hits"), 'right'),
883                   'size'
884                   => new _PageList_Column_size('rev:size', _("Size"), 'right'),
885                                               /*array('align' => 'char', 'char' => ' ')*/
886                   'summary'
887                   => new _PageList_Column('rev:summary', _("Last Summary")),
888                   'version'
889                   => new _PageList_Column_version('rev:version', _("Version"),
890                                                  'right'),
891                   'author'
892                   => new _PageList_Column_author('rev:author', _("Last Author")),
893                   'owner'
894                   => new _PageList_Column_owner('author_id', _("Owner")),
895                   'creator'
896                   => new _PageList_Column_creator('author_id', _("Creator")),
897                   /*
898                   'group'
899                   => new _PageList_Column_author('group', _("Group")),
900                   */
901                   'locked'
902                   => new _PageList_Column_bool('locked', _("Locked"),
903                                                _("locked")),
904                   'minor'
905                   => new _PageList_Column_bool('rev:is_minor_edit',
906                                                _("Minor Edit"), _("minor")),
907                   'markup'
908                   => new _PageList_Column('rev:markup', _("Markup")),
909                   // 'rating' initialised by the wikilens theme hook: addPageListColumn
910                   /*
911                   'rating'
912                   => new _PageList_Column_rating('rating', _("Rate")),
913                   */
914                   );
915         if (empty($this->_types))
916             $this->_types = array();
917         // add plugin specific pageList columns, initialized by $options['types']
918         $this->_types = array_merge($standard_types, $this->_types);
919         // add theme custom specific pageList columns: 
920         //   set the 4th param as the current pagelist object.
921         if (!empty($customPageListColumns)) {
922             foreach ($customPageListColumns as $column => $params) {
923                 $class_name = array_shift($params);
924                 $params[3] =& $this;
925                 $class = new $class_name($params);
926             }
927             $this->_types = array_merge($this->_types, $customPageListColumns);
928         }
929     }
930
931     function getOption($option) {
932         if (array_key_exists($option, $this->_options)) {
933             return $this->_options[$option];
934         }
935         else {
936             return null;
937         }
938     }
939
940     /**
941      * Add a column to this PageList, given a column name.
942      * The name is a type, and optionally has a : and a label. Examples:
943      *
944      *   pagename
945      *   pagename:This page
946      *   mtime
947      *   mtime:Last modified
948      *
949      * If this function is called multiple times for the same type, the
950      * column will only be added the first time, and ignored the succeeding times.
951      * If you wish to add multiple columns of the same type, use addColumnObject().
952      *
953      * @param column name
954      * @return  true if column is added, false otherwise
955      */
956     function _addColumn ($column) {
957         
958         if (isset($this->_columns_seen[$column]))
959             return false;       // Already have this one.
960         if (!isset($this->_types[$column]))
961             $this->_initAvailableColumns();
962         $this->_columns_seen[$column] = true;
963
964         if (strstr($column, ':'))
965             list ($column, $heading) = explode(':', $column, 2);
966
967         if (!isset($this->_types[$column])) {
968             $silently_ignore = array('numbacklinks','rating','coagreement','minmisery',
969                                      'averagerating','top3recs');
970             if (!in_array($column,$silently_ignore))
971                 trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE);
972             return false;
973         }
974         if ($column == 'ratingwidget' and !$GLOBALS['request']->_user->isSignedIn())
975             return false;
976
977         $this->addColumnObject($this->_types[$column]);
978
979         return true;
980     }
981
982     /**
983      * Add a column to this PageList, given a column object.
984      *
985      * @param $col object   An object derived from _PageList_Column.
986      **/
987     function addColumnObject($col) {
988         if (is_array($col)) {// custom column object
989             $params =& $col;
990             $class_name = array_shift($params);
991             $params[3] =& $this;
992             $col = new $class_name($params);
993         }
994         $heading = $col->getHeading();
995         if (!empty($heading))
996             $col->setHeading($heading);
997
998         $this->_columns[] = $col;
999         $this->_columnsMap[$col->_field] = count($this->_columns)-1;
1000     }
1001
1002     /**
1003      * Compare _PageList_Page objects.
1004      **/
1005     function _pageCompare($a, $b) {
1006         $pagelist = $a->getPageList();
1007         $pagea = $a->getPage();
1008         $pageb = $b->getPage();
1009         if (count($pagelist->_sortby) == 0) {
1010             // No columns to sort by
1011             return 0;
1012         }
1013         else {
1014             foreach ($pagelist->_sortby as $colNum => $direction) {
1015                 if (!isset($pagelist->_columns_seen[$colNum])) return 0;
1016                 $colkey = $colNum;
1017                 if (!is_int($colkey)) { // or column fieldname
1018                     $colkey = $pagelist->_columnsMap[$colNum];
1019                 }
1020                 $col = $pagelist->_columns[$colkey];
1021
1022                 $revision_handle = false;
1023                 $pagea = PageList::_getPageFromHandle($pagea);  // If a string, convert to page
1024                 assert(isa($pagea, 'WikiDB_Page'));
1025                 assert(isset($col));
1026                 $aval = $col->_getSortableValue($pagea, $revision_handle);
1027                 $pageb = PageList::_getPageFromHandle($pageb);  // If a string, convert to page
1028                 
1029                 $revision_handle = false;
1030                 assert(isa($pageb, 'WikiDB_Page'));
1031                 $bval = $col->_getSortableValue($pageb, $revision_handle);
1032
1033                 $cmp = $col->_compare($aval, $bval);
1034                 if ($direction === "-") {
1035                     // Reverse the sense of the comparison
1036                     $cmp *= -1;
1037                 }
1038
1039                 if ($cmp !== 0) {
1040                     // This is the first comparison that is not equal-- go with it
1041                     return $cmp;
1042                 }
1043             }
1044             return 0;
1045         }
1046     }
1047
1048     /**
1049      * Put pages in order according to the sortby arg, if given
1050      */
1051     function _sortPages() {
1052         if (count($this->_sortby) > 0) {
1053             // There are columns to sort by
1054             usort($this->_pages, array('PageList', '_pageCompare'));
1055         }        
1056     }
1057
1058     function limit($limit) {
1059         if (strstr($limit,','))
1060             return split(',',$limit);
1061         else
1062             return array(0,$limit);
1063     }
1064     
1065     // make a table given the caption
1066     function _generateTable($caption) {
1067         $this->_sortPages();
1068
1069         $rows = array();
1070         foreach ($this->_pages as $pagenum => $page) {
1071             $rows[] = $this->_renderPageRow($page);
1072         }
1073
1074         $table = HTML::table(array('cellpadding' => 0,
1075                                    'cellspacing' => 1,
1076                                    'border'      => 0,
1077                                    'class'       => 'pagelist'));
1078         if ($caption)
1079             $table->pushContent(HTML::caption(array('align'=>'top'), $caption));
1080
1081         //Warning: This is quite fragile. It depends solely on a private variable
1082         //         in ->_addColumn()
1083         if (!empty($this->_columns_seen['checkbox'])) {
1084             $table->pushContent($this->_jsFlipAll());
1085         }
1086         $do_paging = ( isset($this->_options['paging']) and 
1087                        !empty($this->_options['limit']) and $this->getTotal() and
1088                        $this->_options['paging'] != 'none' );
1089         $row = HTML::tr();
1090         $table_summary = array();
1091         $i = 0;
1092         foreach ($this->_columns as $col) {
1093             $heading = $col->button_heading($this, $i);
1094             if ($do_paging and 
1095                 isset($col->_field) and $col->_field == 'pagename' and 
1096                 ($maxlen = $this->maxLen()))
1097                 $heading->setAttr('width',$maxlen * 7);
1098             $row->pushContent($heading);
1099             if (is_string($col->getHeading()))
1100                 $table_summary[] = $col->getHeading();
1101             $i++;
1102         }
1103         // Table summary for non-visual browsers.
1104         $table->setAttr('summary', sprintf(_("Columns: %s."), 
1105                                            implode(", ", $table_summary)));
1106
1107         if ( $do_paging ) {
1108             // if there are more pages than the limit, show a table-header, -footer
1109             list($offset,$pagesize) = $this->limit($this->_options['limit']);
1110             $numrows = $this->getTotal();
1111             if (!$pagesize or
1112                 (!$offset and $numrows <= $pagesize) or
1113                 ($offset + $pagesize < 0)) 
1114             {
1115                 $table->pushContent(HTML::thead($row),
1116                                     HTML::tbody(false, $rows));
1117                 return $table;
1118             }
1119             global $request;
1120             include_once('lib/Template.php');
1121
1122             $tokens = array();
1123             $pagename = $request->getArg('pagename');
1124             $defargs = $request->args;
1125             unset($defargs['pagename']); unset($defargs['action']);
1126             //$defargs['nocache'] = 1;
1127             $prev = $defargs;
1128             $tokens['PREV'] = false; $tokens['PREV_LINK'] = "";
1129             $tokens['COLS'] = count($this->_columns);
1130             $tokens['COUNT'] = $numrows; 
1131             $tokens['OFFSET'] = $offset; 
1132             $tokens['SIZE'] = $pagesize;
1133             $tokens['NUMPAGES'] = (int)($numrows / $pagesize)+1;
1134             $tokens['ACTPAGE'] = (int) (($offset+1) / $pagesize)+1;
1135             if ($offset > 0) {
1136                 $prev['limit'] = min(0,$offset - $pagesize) . ",$pagesize";
1137                 $prev['count'] = $numrows;
1138                 $tokens['LIMIT'] = $prev['limit'];
1139                 $tokens['PREV'] = true;
1140                 $tokens['PREV_LINK'] = WikiURL($pagename,$prev);
1141                 $prev['limit'] = "0,$pagesize";
1142                 $tokens['FIRST_LINK'] = WikiURL($pagename,$prev);
1143             }
1144             $next = $defargs;
1145             $tokens['NEXT'] = false; $tokens['NEXT_LINK'] = "";
1146             if ($offset + $pagesize < $numrows) {
1147                 $next['limit'] = min($offset + $pagesize,$numrows - $pagesize) . ",$pagesize";
1148                 $next['count'] = $numrows;
1149                 $tokens['LIMIT'] = $next['limit'];
1150                 $tokens['NEXT'] = true;
1151                 $tokens['NEXT_LINK'] = WikiURL($pagename,$next);
1152                 $next['limit'] = $numrows - $pagesize . ",$pagesize";
1153                 $tokens['LAST_LINK'] = WikiURL($pagename,$next);
1154             }
1155             $paging = new Template("pagelink", $request, $tokens);
1156             $table->pushContent(HTML::thead($paging),
1157                                 HTML::tbody(false, HTML($row, $rows)),
1158                                 HTML::tfoot($paging));
1159             return $table;
1160         }
1161         $table->pushContent(HTML::thead($row),
1162                             HTML::tbody(false, $rows));
1163         return $table;
1164     }
1165
1166     function _jsFlipAll() {
1167       return JavaScript("
1168 function flipAll(formObj) {
1169   var isFirstSet = -1;
1170   for (var i=0;i < formObj.length;i++) {
1171       fldObj = formObj.elements[i];
1172       if (fldObj.type == 'checkbox') { 
1173          if (isFirstSet == -1)
1174            isFirstSet = (fldObj.checked) ? true : false;
1175          fldObj.checked = (isFirstSet) ? false : true;
1176        }
1177    }
1178 }");
1179     }
1180
1181     function _generateList($caption) {
1182         $list = HTML::ul(array('class' => 'pagelist'));
1183         $i = 0;
1184         foreach ($this->_pages as $pagenum => $page) {
1185             $pagehtml = $this->_renderPageRow($page);
1186             $group = ($i++ / $this->_group_rows);
1187             $class = ($group % 2) ? 'oddrow' : 'evenrow';
1188             $list->pushContent(HTML::li(array('class' => $class),$pagehtml));
1189         }
1190         $out = HTML();
1191         //Warning: This is quite fragile. It depends solely on a private variable
1192         //         in ->_addColumn()
1193         // Questionable if its of use here anyway. This is a one-col pagename list only.
1194         //if (!empty($this->_columns_seen['checkbox'])) $out->pushContent($this->_jsFlipAll());
1195         if ($caption)
1196             $out->pushContent(HTML::p($caption));
1197         $out->pushContent($list);
1198         return $out;
1199     }
1200
1201     function _emptyList($caption) {
1202         $html = HTML();
1203         if ($caption)
1204             $html->pushContent(HTML::p($caption));
1205         if ($this->_messageIfEmpty)
1206             $html->pushContent(HTML::blockquote(HTML::p($this->_messageIfEmpty)));
1207         return $html;
1208     }
1209
1210     // Condense list: "Page1, Page2, ..." 
1211     // Alternative $seperator = HTML::Raw(' &middot; ')
1212     function _generateCommaList($seperator = ', ') {
1213         return HTML(join($seperator, $list));
1214     }
1215
1216 };
1217
1218 /* List pages with checkboxes to select from.
1219  * The [Select] button toggles via _jsFlipAll
1220  */
1221
1222 class PageList_Selectable
1223 extends PageList {
1224
1225     function PageList_Selectable ($columns=false, $exclude=false, $options = false) {
1226         if ($columns) {
1227             if (!is_array($columns))
1228                 $columns = explode(',', $columns);
1229             if (!in_array('checkbox',$columns))
1230                 array_unshift($columns,'checkbox');
1231         } else {
1232             $columns = array('checkbox','pagename');
1233         }
1234         PageList::PageList($columns, $exclude, $options);
1235     }
1236
1237     function addPageList ($array) {
1238         while (list($pagename,$selected) = each($array)) {
1239             if ($selected) $this->addPageSelected((string)$pagename);
1240             $this->addPage((string)$pagename);
1241         }
1242     }
1243
1244     function addPageSelected ($pagename) {
1245         $this->_selected[$pagename] = 1;
1246     }
1247 }
1248
1249 // $Log: not supported by cvs2svn $
1250 // Revision 1.93  2004/06/25 14:29:17  rurban
1251 // WikiGroup refactoring:
1252 //   global group attached to user, code for not_current user.
1253 //   improved helpers for special groups (avoid double invocations)
1254 // new experimental config option ENABLE_XHTML_XML (fails with IE, and document.write())
1255 // fixed a XHTML validation error on userprefs.tmpl
1256 //
1257 // Revision 1.92  2004/06/21 17:01:39  rurban
1258 // fix typo and rating method call
1259 //
1260 // Revision 1.91  2004/06/21 16:22:29  rurban
1261 // add DEFAULT_DUMP_DIR and HTML_DUMP_DIR constants, for easier cmdline dumps,
1262 // fixed dumping buttons locally (images/buttons/),
1263 // support pages arg for dumphtml,
1264 // optional directory arg for dumpserial + dumphtml,
1265 // fix a AllPages warning,
1266 // show dump warnings/errors on DEBUG,
1267 // don't warn just ignore on wikilens pagelist columns, if not loaded.
1268 // RateIt pagelist column is called "rating", not "ratingwidget" (Dan?)
1269 //
1270 // Revision 1.90  2004/06/18 14:38:21  rurban
1271 // adopt new PageList style
1272 //
1273 // Revision 1.89  2004/06/17 13:16:08  rurban
1274 // apply wikilens work to PageList: all columns are sortable (slightly fixed)
1275 //
1276 // Revision 1.88  2004/06/14 11:31:35  rurban
1277 // renamed global $Theme to $WikiTheme (gforge nameclash)
1278 // inherit PageList default options from PageList
1279 //   default sortby=pagename
1280 // use options in PageList_Selectable (limit, sortby, ...)
1281 // added action revert, with button at action=diff
1282 // added option regex to WikiAdminSearchReplace
1283 //
1284 // Revision 1.87  2004/06/13 16:02:12  rurban
1285 // empty list of pages if user=[] and not authenticated.
1286 //
1287 // Revision 1.86  2004/06/13 15:51:37  rurban
1288 // Support pagelist filter for current author,owner,creator by []
1289 //
1290 // Revision 1.85  2004/06/13 15:33:19  rurban
1291 // new support for arguments owner, author, creator in most relevant
1292 // PageList plugins. in WikiAdmin* via preSelectS()
1293 //
1294 // Revision 1.84  2004/06/08 13:51:56  rurban
1295 // some comments only
1296 //
1297 // Revision 1.83  2004/05/18 13:35:39  rurban
1298 //  improve Pagelist layout by equal pagename width for limited lists
1299 //
1300 // Revision 1.82  2004/05/16 22:07:35  rurban
1301 // check more config-default and predefined constants
1302 // various PagePerm fixes:
1303 //   fix default PagePerms, esp. edit and view for Bogo and Password users
1304 //   implemented Creator and Owner
1305 //   BOGOUSERS renamed to BOGOUSER
1306 // fixed syntax errors in signin.tmpl
1307 //
1308 // Revision 1.81  2004/05/13 12:30:35  rurban
1309 // fix for MacOSX border CSS attr, and if sort buttons are not found
1310 //
1311 // Revision 1.80  2004/04/20 00:56:00  rurban
1312 // more paging support and paging fix for shorter lists
1313 //
1314 // Revision 1.79  2004/04/20 00:34:16  rurban
1315 // more paging support
1316 //
1317 // Revision 1.78  2004/04/20 00:06:03  rurban
1318 // themable paging support
1319 //
1320 // Revision 1.77  2004/04/18 01:11:51  rurban
1321 // more numeric pagename fixes.
1322 // fixed action=upload with merge conflict warnings.
1323 // charset changed from constant to global (dynamic utf-8 switching)
1324 //
1325
1326 // (c-file-style: "gnu")
1327 // Local Variables:
1328 // mode: php
1329 // tab-width: 8
1330 // c-basic-offset: 4
1331 // c-hanging-comment-ender-p: nil
1332 // indent-tabs-mode: nil
1333 // End:
1334 ?>