/[pub]/suikawiki/script/lib/SuikaWiki/Plugin/WikiPage.wps
Suika

Contents of /suikawiki/script/lib/SuikaWiki/Plugin/WikiPage.wps

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sun Jan 12 09:15:07 2003 UTC (22 years, 3 months ago) by w
Branch: MAIN
Changes since 1.2: +54 -9 lines
Most of do_* are integred

1 w 1.1 Name:
2     WikiPage
3     FullName:
4     Getting WikiPage information
5     URI:
6     IW:SuikaWiki:WikiAdmin
7    
8     {
9     Name:
10     wikiform_input/recent-change-list
11     FullName:
12     Recent-changed-pages list
13     Format:
14     eval q{
15 w 1.3 if ($o->{to} eq 'RSS') {
16     require Yuki::RSS;
17     my $rss = new Yuki::RSS (version => '1.0');
18     my $myuri = $o->uri ('wiki');
19     $rss->stylesheet (
20     href => $myuri . "?mycmd=css;mypage=WikiStyle:RSS",
21     type => 'text/css',
22     );
23     $rss->channel(
24     title => $o->resource ('RSS:WikiTitle'),
25     link => $myuri,
26     description => $o->resource ('RSS:WikiDescription'),
27     'dc:language' => $main::lang,
28     );
29     for my $title ($main::database->recent_changes ($p->{n} || 10)) {
30     next unless $title;
31     $rss->add_item (
32     title => $o->escape ($title),
33     link => $myuri . '?' . $o->encode ($title),
34     description => $o->escape(&main::get_subjectline($title,delimiter=>'')),
35     'dc:date' => $main::database->mtime ($title),
36     );
37     }
38     $r = $rss->as_string;
39     } else {
40     $r = qq(<ol class="recent-changes">\n);
41     for ($main::database->recent_changes ($p->{n} || 10)) {
42     next unless $_;
43     my @date = gmtime $main::database->mtime ($_);
44     $date[0] = sprintf '%04d-%02d-%02d %02d:%02d:%02d+00:00', $date[5]+1900,$date[4]+1,@date[3,2,1,0];
45     $r .= qq(<li><span class="date">$date[0]</span> <a href="@{[$o->uri('wiki')]}?@{[$o->encode($_)]}" class="wiki">) . $o->escape ($_) . qq(</a>);
46     $r .= ' <span class="summary">'.$o->escape (&main::get_subjectline ($_)).'</span>' if $p->{summary};
47     $r .= qq(</li>\n);
48     }
49     $r .= '</ol>';
50 w 1.1 }
51     } or $r = '';
52     }
53    
54     {
55     Name:
56     wikiform_input/page-list
57     FullName:
58     WikiPage list
59     Format:
60     eval q{
61     $r = qq(<ul class="pages">\n);
62     my $re = $p->{match} || '.';
63     for (grep /$re/, keys %main::database) {
64 w 1.2 $r .= qq(<li><a href="@{[$o->uri('wiki')]}?@{[$o->encode($_)]}" class="wiki">) . $o->escape ($_) . qq(</a>);
65 w 1.1 $r .= ' <span class="summary">'.$o->escape (&main::get_subjectline ($_)).'</span>' if $p->{summary};
66     $r .= qq(</li>\n);
67     }
68     $r .= '</ul>';
69     } or $r = '';
70 w 1.3 }
71    
72     {
73     Name:
74     wikiformat/SuikaWiki/0.9-to-RSS
75     FullName:
76     SuikaWiki/0.9 document format -> RSS
77     URI:
78     IW:SuikaWiki:SuikaWiki
79     Format:
80     $o->{content} =~ s($main::embed_command{form}){
81     my $i = $2;
82     $i =~ s/\\(.)/$1/gs;
83     if ($i =~ /(%recent-change-list(?:\((?:[^)]|\\.)*\))?;)/s) {
84     $r = $o->formatter ('form_input')->replace ($1 => $o);
85     return $r;
86     }
87     ''}ge;
88     $r = '<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>';
89 w 1.1 }
90    
91     POD:LICENSE:
92     Copyright 2003 Wakaba <w@suika.fam.cx>
93    
94     %%GNUGPL2%%

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24