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