]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Portland/lib/RecentChanges.php
include [all] Include and file path should be devided with single space. File path...
[SourceForge/phpwiki.git] / themes / Portland / 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 Portland_RC_revision_formatter (&$fmt, &$rev) {
10         $class = 'rc-' . $fmt->importance($rev);
11         $time = $fmt->time($rev);
12         if ($rev->get('is_minor_edit')) {
13             $minor_flag = HTML::small("(" . _("minor edit") . ")");
14         }
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         return Portland_RC_revision_formatter($this, $rev);
36     }
37     function summaryAsHTML ($rev) {
38         if ( !($summary = $this->summary($rev)) )
39             return '';
40         return  HTML::strong( array('class' => 'wiki-summary'),
41                               "(",
42                               TransformLinks($summary, $rev->get('markup'), $rev->getPageName()),
43                               ")");
44     }
45 }
46
47 class _Portland_PageHistory_Formatter
48 extends _PageHistory_HtmlFormatter
49 {
50     function format_revision (&$rev) {
51         return Portland_RC_revision_formatter($this, $rev);
52     }
53     function summaryAsHTML ($rev) {
54         if ( !($summary = $this->summary($rev)) )
55             return '';
56         return  HTML::strong( array('class' => 'wiki-summary'),
57                               "(",
58                               TransformLinks($summary, $rev->get('markup'), $rev->getPageName()),
59                               ")");
60     }
61 }
62
63 // Local Variables:
64 // mode: php
65 // tab-width: 8
66 // c-basic-offset: 4
67 // c-hanging-comment-ender-p: nil
68 // indent-tabs-mode: nil
69 // End:
70 ?>