]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Portland/lib/RecentChanges.php
Merge OldTextFormattingRules into TextFormattingRules; rename underscore plugins
[SourceForge/phpwiki.git] / themes / Portland / lib / RecentChanges.php
1 <?php
2 /*
3  * Extensions/modifications to the stock RecentChanges (and PageHistory) format.
4  */
5
6 require_once 'lib/plugin/RecentChanges.php';
7 require_once 'lib/plugin/PageHistory.php';
8
9 function Portland_RC_revision_formatter(&$fmt, &$rev)
10 {
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     } else {
16         $time = HTML::strong($time);
17         $minor_flag = '';
18     }
19
20     return HTML::li(array('class' => $class),
21         $fmt->diffLink($rev), ' ',
22         $fmt->pageLink($rev), ' ',
23         $time, ' ',
24         $minor_flag, ' ',
25         " . . . ", $fmt->summaryAsHTML($rev), ' ',
26         " . . . ",
27         $fmt->authorLink($rev)
28     );
29 }
30
31 class _Portland_RecentChanges_Formatter
32     extends _RecentChanges_HtmlFormatter
33 {
34     function format_revision(&$rev)
35     {
36         return Portland_RC_revision_formatter($this, $rev);
37     }
38
39     function summaryAsHTML($rev)
40     {
41         if (!($summary = $this->summary($rev)))
42             return '';
43         return HTML::strong(array('class' => 'wiki-summary'),
44             "(",
45             TransformLinks($summary, $rev->getPageName()),
46             ")");
47     }
48 }
49
50 class _Portland_PageHistory_Formatter
51     extends _PageHistory_HtmlFormatter
52 {
53     function format_revision(&$rev)
54     {
55         return Portland_RC_revision_formatter($this, $rev);
56     }
57
58     function summaryAsHTML($rev)
59     {
60         if (!($summary = $this->summary($rev)))
61             return '';
62         return HTML::strong(array('class' => 'wiki-summary'),
63             "(",
64             TransformLinks($summary, $rev->getPageName()),
65             ")");
66     }
67 }
68
69 // Local Variables:
70 // mode: php
71 // tab-width: 8
72 // c-basic-offset: 4
73 // c-hanging-comment-ender-p: nil
74 // indent-tabs-mode: nil
75 // End: