/[pub]/suikawiki/script/misc/plugins/view/menu.pm
Suika

Contents of /suikawiki/script/misc/plugins/view/menu.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 16 23:05:50 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#Menu#}->{Name} = q#Menu#;
7 $Info{q#Menu#}->{q#Version#} = q#2004.1205.0529#;
8 $Info{q#Menu#}->{q#InterfaceVersion#} = q#2.9.1#;
9 $Info{q#Menu#}->{q#mkpluginVersion#} = q#2.1.21#;
10 $Info{q#Menu#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::Menu1041105052955PjN_#;
11 $Info{q#Menu#}->{q#Date.RCS#} = q#$Date: 2004/03/10 07:00:32 $#;
12 $Info{q#Menu#}->{RequiredPlugin} = [q#Error#, q#HTML#, q#WikiLinking#, q#WikiStruct#];
13 $Info{q#Menu#}->{Description} = [[q#Navigation menu bar#, q#en#, q##]];
14 $Info{q#Menu#}->{License} = [[q#%%Perl%%#, q##, q##]];
15 $Info{q#Menu#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]];
16
17 push @SuikaWiki::View::Implementation::CommonViewDefs, {
18 condition => {q#mode#, q#mininav#, q#http_method#, [q#GET#, q#HEAD#]},
19 object_class => q#SuikaWiki::Plugin::plugin::Menu1041105052955PjN_::mininav1041105052955Rcvu#,
20 };
21 package SuikaWiki::Plugin::plugin::Menu1041105052955PjN_::mininav1041105052955Rcvu;
22
23
24 our @ISA = q#SuikaWiki::View::template#;
25
26 sub main ($$$) {
27 my ($self, $opt, $opt2) = @_;
28 require SuikaWiki::Output::HTTP;
29 $opt2->{output} = SuikaWiki::Output::HTTP->new
30 (wiki => $self->{view}->{wiki},
31 view => $self->{view}, viewobj => $self);
32 for (@{$self->{view}->{wiki}->{var}->{client}->{used_for_negotiate}},
33 'Accept-Language') {
34 $opt2->{output}->add_negotiate_header_field ($_);
35 }
36
37 $opt2->{template} = q#%html-document (
38 title => {%res (name => {View:Mininav:WebPageTitle});}p,
39 link-meta => {%template (name => links);}p,
40 content => {
41 %section (type => body, content=>{
42 %block (
43 id => side-menu,
44 class => mininav,
45 content => {
46 %read (when-no-converter => 406);
47 %link-to-wikipage (
48 rel => view,
49 mode => mininav, up-to-date,
50 class => wiki-cmd,
51 label => {%link-to-it (
52 label => {%res (name=>ReloadThisPage);}p,
53 );},
54 description => {%res (name=>ReloadThisPageLong);}p,
55 );
56 }p,
57 );
58 %section (
59 title => {%res (name => {Error:Title});}p, heading,
60 content => {%error-list;}p,
61 );
62 }p);
63 }p,
64 );#;
65 $opt2->{o} = bless {
66 ## SuikaWiki 3 WikiPlugin interface
67 wiki => $self->{view}->{wiki},
68 plugin => $self->{view}->{wiki}->{plugin},
69 var => {},
70 }, 'SuikaWiki::Plugin';
71 $opt2->{output}->{status_code} = 200;
72
73 $opt2->{output}->{entity}->{media_type} = q#text/html#;
74
75 $opt2->{output}->{entity}->{charset} = $self->{view}->{wiki}->{config}->{charset}->{output};
76 $opt2->{output}->set_expires (%{$self->{view}->{wiki}->{config}->{entity}->{expires}->{q#view#}});
77 $opt2->{output}->{entity}->{body_is_octet_stream} = 0;
78
79 $self->{view}->{wiki}->init_db;
80 $self->main_pre ($opt, $opt2);
81
82 require Message::Markup::XML::Serialize::HTML;
83 use Message::Util::Error;
84 try {
85 $opt2->{output}->{entity}->{body}
86 = Message::Markup::XML::Serialize::HTML::html_simple
87 (SuikaWiki::Plugin->formatter ('view')
88 ->replace ($opt2->{template}, param => $opt2->{o}));
89 } $self->{view}->{wiki}->{config}->{catch}->{ formatter_view };
90 $opt2->{output}->output (output => 'http-cgi');
91
92 $self->main_post ($opt, $opt2);
93 }
94
95 push @{$SuikaWiki::View::Implementation::TemplateFragment{q#links#}}, {
96 Main => q#%link-wiki (
97 page => {Wiki//MenuBar},
98 mode => mininav,
99 rel => {sidebar navigator},
100 ); #,
101 Order => 0,
102 Description => [[q#Link to MenuBar WikiPage, with relationship of "sidebar", "navigation".#, q#en#, q##]],
103 };
104
105 package SuikaWiki::Plugin::Resource;
106
107 our $BaseResource;
108 $BaseResource->{q#en#}->{q##}->{q#ReloadThisPage#} = q#Reload#;
109 $BaseResource->{q#en#}->{q##}->{q#ReloadThisPageLong#} = q#Reload this WikiPage#;
110 $BaseResource->{q#und#}->{q##}->{q#View:Mininav:WebPageTitle#} = q#%page-name;#;
111 package SuikaWiki::Plugin::Registry;
112
113 $Info{q#Menu#}->{provide} = {q#viewfragment#, [{q#Name#, q#links#}], q#viewdef#, [{q#Description#, [q#Mini navigation menu bar#, q#en#, q##], q#Name#, q#mininav#}]};
114
115 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24