]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Portland/lib/RecentChanges.php
rcs_id no longer makes sense with Subversion global version number
[SourceForge/phpwiki.git] / themes / Portland / lib / RecentChanges.php
1 <?php // rcs_id('$Id$');
2 /*
3  * Extensions/modifications to the stock RecentChanges (and PageHistory) format.
4  */
5
6
7 require_once('lib/plugin/RecentChanges.php');
8 require_once('lib/plugin/PageHistory.php');
9
10 function Portland_RC_revision_formatter (&$fmt, &$rev) {
11         $class = 'rc-' . $fmt->importance($rev);
12         $time = $fmt->time($rev);
13         if ($rev->get('is_minor_edit')) {
14             $minor_flag = HTML::small("(" . _("minor edit") . ")");
15         }
16         else {
17             $time = HTML::strong($time);
18             $minor_flag = '';
19         }
20
21         return HTML::li(array('class' => $class),
22                         $fmt->diffLink($rev), ' ',
23                         $fmt->pageLink($rev), ' ',
24                         $time, ' ',
25                         $minor_flag, ' ',
26                         " . . . ", $fmt->summaryAsHTML($rev), ' ',
27                         " . . . ",
28                         $fmt->authorLink($rev)
29                        );
30     }
31
32
33 class _Portland_RecentChanges_Formatter
34 extends _RecentChanges_HtmlFormatter
35 {
36     function format_revision (&$rev) {
37         return Portland_RC_revision_formatter($this, $rev);
38     }
39     function summaryAsHTML ($rev) {
40         if ( !($summary = $this->summary($rev)) )
41             return '';
42         return  HTML::strong( array('class' => 'wiki-summary'),
43                               "(",
44                               TransformLinks($summary, $rev->get('markup'), $rev->getPageName()),
45                               ")");
46     }
47 }
48
49 class _Portland_PageHistory_Formatter
50 extends _PageHistory_HtmlFormatter
51 {
52     function format_revision (&$rev) {
53         return Portland_RC_revision_formatter($this, $rev);
54     }
55     function summaryAsHTML ($rev) {
56         if ( !($summary = $this->summary($rev)) )
57             return '';
58         return  HTML::strong( array('class' => 'wiki-summary'),
59                               "(",
60                               TransformLinks($summary, $rev->get('markup'), $rev->getPageName()),
61                               ")");
62     }
63 }
64
65
66 // (c-file-style: "gnu")
67 // Local Variables:
68 // mode: php
69 // tab-width: 8
70 // c-basic-offset: 4
71 // c-hanging-comment-ender-p: nil
72 // indent-tabs-mode: nil
73 // End:   
74 ?>