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