]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/SpaceWiki/lib/RecentChanges.php
Merge OldTextFormattingRules into TextFormattingRules; rename underscore plugins
[SourceForge/phpwiki.git] / themes / SpaceWiki / 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 SpaceWiki_RC_revision_formatter(&$fmt, &$rev)
10 {
11     $class = 'rc-' . $fmt->importance($rev);
12
13     return HTML::li(array('class' => $class),
14         $fmt->diffLink($rev), ' ',
15         $fmt->pageLink($rev), ' ',
16         ' . ',
17         $rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)), ' ',
18         ' . . . ',
19         $fmt->summaryAsHTML($rev),
20         ' . . . ',
21         $fmt->authorLink($rev));
22 }
23
24 function SpaceWiki_PH_revision_formatter(&$fmt, &$rev)
25 {
26     $class = 'rc-' . $fmt->importance($rev);
27
28     return HTML::li(array('class' => $class),
29         $fmt->diffLink($rev), ' ',
30         $fmt->pageLink($rev), ' ',
31         $rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)), ' ',
32         ' . . . ',
33         $fmt->summaryAsHTML($rev),
34         ' . . . ',
35         $fmt->authorLink($rev),
36         ($fmt->importance($rev) == 'minor') ? HTML::small(" (" . _("minor edit") . ")") : '');
37 }
38
39 class _SpaceWiki_RecentChanges_Formatter
40     extends _RecentChanges_HtmlFormatter
41 {
42     function format_revision(&$rev)
43     {
44         return SpaceWiki_RC_revision_formatter($this, $rev);
45     }
46
47     function summaryAsHTML($rev)
48     {
49         if (!($summary = $this->summary($rev)))
50             return '';
51         return HTML::strong(array('class' => 'wiki-summary'),
52             " ",
53             TransformLinks($summary, $rev->getPageName()),
54             " ");
55     }
56
57     function diffLink($rev)
58     {
59         global $WikiTheme;
60         return $WikiTheme->makeButton(_("diff"), $this->diffURL($rev), 'wiki-rc-action');
61     }
62
63 }
64
65 class _SpaceWiki_PageHistory_Formatter
66     extends _PageHistory_HtmlFormatter
67 {
68     function format_revision(&$rev)
69     {
70         return SpaceWiki_PH_revision_formatter($this, $rev);
71     }
72
73     function summaryAsHTML($rev)
74     {
75         if (!($summary = $this->summary($rev)))
76             return '';
77         return HTML::strong(array('class' => 'wiki-summary'),
78             " ",
79             TransformLinks($summary, $rev->getPageName()),
80             " ");
81     }
82 }
83
84 // Local Variables:
85 // mode: php
86 // tab-width: 8
87 // c-basic-offset: 4
88 // c-hanging-comment-ender-p: nil
89 // indent-tabs-mode: nil
90 // End: