/[pub]/suikawiki/script/misc/plugins/RandomJump.pm
Suika

Contents of /suikawiki/script/misc/plugins/RandomJump.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 16 23:05:49 2010 UTC (14 years, 5 months ago) by wakaba
Branch: MAIN
CVS Tags: suikawiki3-redirect, HEAD
added latest .pm files

1 use strict;
2 package SuikaWiki::Plugin::Registry;
3
4
5 our %Info;
6 $Info{q#RandomJump#}->{Name} = q#RandomJump#;
7 $Info{q#RandomJump#}->{q#Version#} = q#2004.0831.0328#;
8 $Info{q#RandomJump#}->{q#InterfaceVersion#} = q#2.9.1#;
9 $Info{q#RandomJump#}->{q#mkpluginVersion#} = q#2.1.19#;
10 $Info{q#RandomJump#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::RandomJump1040731032805VWQ1#;
11 $Info{q#RandomJump#}->{q#Date.RCS#} = q#$Date: 2004/02/14 10:53:48 $#;
12 $Info{q#RandomJump#}->{RequiredPlugin} = [q#WikiLinking#, q#WikiResource#];
13 $Info{q#RandomJump#}->{RequiredModule} = [q#SuikaWiki::Output::HTTP#];
14 $Info{q#RandomJump#}->{Description} = [[q#This plugin module provides "random jump" functions
15 to select wiki pages randomly.#, q#en#, q##]];
16 $Info{q#RandomJump#}->{License} = [[q#%%Perl%%#, q##, q##]];
17 $Info{q#RandomJump#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [q#w@suika.fam.cx#], [q##]]];
18
19 push @SuikaWiki::View::Implementation::CommonViewDefs, {
20 condition => {q#mode#, q#RandomJump#, q#output#, q#http-cgi#},
21 object_class => q#SuikaWiki::Plugin::plugin::RandomJump1040731032805VWQ1::RandomJump1040731032805f3Tu#,
22 };
23 package SuikaWiki::Plugin::plugin::RandomJump1040731032805VWQ1::RandomJump1040731032805f3Tu;
24
25
26 our @ISA = q#SuikaWiki::View::template#;
27 sub main ($$) {
28 my ($self, $opt, $opt2) = @_;
29
30 #line 1 "(WikiPlugin module source RandomJump.wp2, block ViewDefinition[Mode='RandomJump']/method[Name='main'])"
31 $self->{view}->init_db;
32 my @list = $self->{view}->{wiki}->{db}->keys ('content');
33 my $uri = $self->{view}->{wiki}->uri_reference
34 (page => $self->{view}->{wiki}->name ($list[rand @list]),
35 up_to_date => 1);
36 require SuikaWiki::Output::HTTP;
37 my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki});
38 $output->set_redirect (uri => $uri, status_code => 307);
39 $output->output (output => 'http-cgi');}
40
41 #line 1 "(WikiPlugin module RandomJump, chunk 1)"
42
43 push @{$SuikaWiki::View::Implementation::TemplateFragment{q#navbar#}}, {
44 Main => q#%link-to-wikipage (
45 mode => RandomJump, up-to-date,
46 rel => jump,
47 label => {%link-to-it (
48 label => {%res (name => GoSomewhere);}p,
49 description => {%res (name => GoSomewhereLong);}p,
50 class => randomlink,
51 );},
52 );#,
53 Order => 110,
54 Description => [[q#"Go somewhere" button on navigation bar#, q#en#, q##]],
55 };
56
57 push @{$SuikaWiki::View::Implementation::TemplateFragment{q#links#}}, {
58 Main => q#%link-wiki (mode => RandomJump, up-to-date,
59 rel => jump, class => randomlink,
60 description => {%res(name=>GoSomewhereLink);}p);#,
61 Order => 0,
62 Description => [[q#"Go somewhere" link#, q#en#, q##]],
63 };
64
65 package SuikaWiki::Plugin::Resource;
66
67 our $BaseResource;
68 $BaseResource->{q#en#}->{q##}->{q#GoSomewhere#} = q#Lucky#;
69 $BaseResource->{q#en#}->{q##}->{q#GoSomewhereLink#} = q#Go somewhere in this wiki#;
70 $BaseResource->{q#en#}->{q##}->{q#GoSomewhereLong#} = q#Go somewhere in this wiki#;
71 package SuikaWiki::Plugin::Registry;
72
73 $Info{q#RandomJump#}->{provide} = {q#viewfragment#, [{q#Name#, q#navbar#}, {q#Name#, q#links#}], q#viewdef#, [{q#Description#, [q#Redirection to some WikiPage selected randomly#, q#en#, q##], q#Name#, q#RandomJump#}]};
74
75 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24