]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/SpaceWiki/lib/RecentChanges.php
Renamed theme to SpaceWiki to avoid any future problems
[SourceForge/phpwiki.git] / themes / SpaceWiki / lib / RecentChanges.php
1 <?php rcs_id('$Id: RecentChanges.php,v 1.1 2002-02-22 23:46:56 carstenklapp Exp $');
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                     $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                               do_transform($summary, 'LinkTransform'),
49                               " ");
50     }
51
52     function diffLink ($rev) {
53         global $Theme;
54         return $Theme->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                               do_transform($summary, 'LinkTransform'),
71                               " ");
72     }
73 }
74
75
76 // (c-file-style: "gnu")
77 // Local Variables:
78 // mode: php
79 // tab-width: 8
80 // c-basic-offset: 4
81 // c-hanging-comment-ender-p: nil
82 // indent-tabs-mode: nil
83 // End:   
84 ?>