1 |
#?SuikaWikiConfig/2.0 |
2 |
|
3 |
Plugin: |
4 |
@Name: RandomJump |
5 |
@Description: |
6 |
@@@: |
7 |
This plugin module provides "random jump" functions |
8 |
to select wiki pages randomly. |
9 |
@@lang:en |
10 |
@License: %%GPL%% |
11 |
@Author: |
12 |
@@Name: |
13 |
@@@@:Wakaba |
14 |
@@@lang:ja |
15 |
@@@script:Latn |
16 |
@@Mail:w@suika.fam.cx |
17 |
@Date.RCS: $Date: 2004/02/01 12:12:45 $ |
18 |
@RequiredModule[list]: |
19 |
SuikaWiki::Output::HTTP |
20 |
@RequiredPlugin[list]: |
21 |
WikiLinking |
22 |
WikiResource |
23 |
|
24 |
ViewDefinition: |
25 |
@Mode: RandomJump |
26 |
@Condition: |
27 |
@@output: http-cgi |
28 |
@Description: |
29 |
@@@:Redirection to some WikiPage selected randomly |
30 |
@@lang:en |
31 |
@method: |
32 |
@@@: |
33 |
$self->{view}->init_db; |
34 |
my @list = $self->{view}->{wiki}->{db}->keys ('content'); |
35 |
|
36 |
my $uri = $self->{view}->{wiki}->uri_reference |
37 |
(page => $self->{view}->{wiki}->name ($list[rand @list]), |
38 |
up_to_date => 1); |
39 |
|
40 |
require SuikaWiki::Output::HTTP; |
41 |
my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki}); |
42 |
$output->set_redirect (uri => $uri, status_code => 303); |
43 |
$output->output (output => 'http-cgi'); |
44 |
@@Name: main |
45 |
|
46 |
ViewFragment: |
47 |
@Name: navbar |
48 |
@Description: |
49 |
@@@: "Go somewhere" button on navigation bar |
50 |
@@lang:en |
51 |
@Order: 110 |
52 |
@Formatting: |
53 |
%link-to-wikipage ( |
54 |
mode => RandomJump, up-to-date, |
55 |
rel => jump, |
56 |
label => {%link-to-it ( |
57 |
label => {%res (name => GoSomewhere);}p, |
58 |
description => {%res (name => GoSomewhereLong);}p, |
59 |
class => randomlink, |
60 |
);}, |
61 |
); |
62 |
|
63 |
ViewFragment: |
64 |
@Name: links |
65 |
@Description: |
66 |
@@@: "Go somewhere" link |
67 |
@@lang:en |
68 |
@Formatting: |
69 |
%link-wiki (mode => RandomJump, up-to-date, |
70 |
rel => jump, class => randomlink, |
71 |
description => {%res(name=>GoSomewhereLink);}p); |
72 |
|
73 |
Resource: |
74 |
@GoSomewhere: |
75 |
@@@: Lucky |
76 |
@@lang:en |
77 |
@GoSomewhereLink: |
78 |
@@@: Go somewhere in this wiki |
79 |
@@lang:en |
80 |
@GoSomewhereLong: |
81 |
@@@: Go somewhere in this wiki |
82 |
@@lang:en |