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