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: 2003/10/25 02:22:06 $ |
18 |
|
19 |
ViewDefinition: |
20 |
@Mode: RandomJump |
21 |
@Condition: |
22 |
@@output: http-cgi |
23 |
@Description: |
24 |
@@@:Redirection to some WikiPage selected randomly |
25 |
@@lang:en |
26 |
@method: |
27 |
@@@: |
28 |
$self->{view}->init_db; |
29 |
my @list = $self->{view}->{wiki}->{db}->keys ('content'); |
30 |
|
31 |
my $uri = SuikaWiki::Plugin->_uri_wiki_page |
32 |
(join ('//', @{$list[rand @list]}), |
33 |
up_to_date => 1, absolute => 1); |
34 |
|
35 |
require SuikaWiki::Output::HTTP; |
36 |
my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki}); |
37 |
$output->set_redirect (uri => $uri, status_code => 303); |
38 |
$output->output (output => 'http-cgi'); |
39 |
@@Name: main |
40 |
|
41 |
ViewFragment: |
42 |
@Name: navbar |
43 |
@Description: |
44 |
@@@: "Go somewhere" button on navigation bar |
45 |
@@lang:en |
46 |
@Order: 110 |
47 |
@Formatting: |
48 |
%link-to-wikipage ( |
49 |
mode => RandomJump, |
50 |
up-to-date, |
51 |
rel => jump, |
52 |
label => {%link-to-it ( |
53 |
label => {%res (name => GoSomewhere);}p, |
54 |
description => {%res (name => GoSomewhereLong);}p, |
55 |
class => randomlink, |
56 |
);}, |
57 |
); |
58 |
|
59 |
ViewFragment: |
60 |
@Name: links |
61 |
@Description: |
62 |
@@@: "Go somewhere" link |
63 |
@@lang:en |
64 |
@Formatting: |
65 |
%link-wiki(mode=>RandomJump,up-to-date,rel=>jump, |
66 |
class=>randomlink, |
67 |
title=>"%res(name=>GoSomewhereLink);"p); |
68 |
|
69 |
Resource: |
70 |
@GoSomewhere: |
71 |
@@@: Lucky |
72 |
@@lang:en |
73 |
@GoSomewhereLink: |
74 |
@@@: Go somewhere in this wiki |
75 |
@@lang:en |
76 |
@GoSomewhereLong: |
77 |
@@@: Go somewhere in this wiki |
78 |
@@lang:en |