/[pub]/suikawiki/script/default/suikawiki-config.ph
Suika

Contents of /suikawiki/script/default/suikawiki-config.ph

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Jan 26 01:43:24 2003 UTC (22 years, 3 months ago) by w
Branch: MAIN
Changes since 1.2: +52 -56 lines
Update view definitions.

1 use strict;
2 #
3 # You MUST modify following '$modifier_...' variables.
4 #
5 # our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited.
6 # our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited.
7 #our $modifier_dbtype = 'Yuki::YukiWikiDB'; # Slow, available on all environment.
8 #our $modifier_dbtype = 'Yuki::YukiWikiDB2'; # Slow, available on all environment.
9 our $modifier_dbtype = 'Yuki::YukiWikiDBMeta'; # Slow, available on all environment.
10 our $url_cgi; {
11 my $scheme = 'http';
12 $scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#;
13 $url_cgi = "$scheme://$main::ENV{SERVER_NAME}:$main::ENV{SERVER_PORT}/~wakaba/wiki/wiki";
14 ## - MUST NOT include [&<>"] and/or non-URI characters
15 }
16 our %uri = (
17 external_script => 'script/',
18 );
19 $uri{wiki} = $url_cgi;
20 $SuikaWiki::Plugin::plugin_directory = q(lib/SuikaWiki/Plugin/);
21 our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script)
22 CacheHeadline => q(./wikidata/.headline.cache),
23 CachePrefix => q(./wikidata/.cache.),
24 CacheSearchResult => q(./wikidata/.search.cache),
25 WikiDataBase => q(./wikidata/page),
26 );
27 our $use_exists = 0; # If you can use 'exists' method for your DB.
28 ##############################
29 our %PageName = (
30 FrontPage => 'HomePage',
31 IndexPage => 'IndexPage',
32 SearchPage => 'SearchPage',
33 CreatePage => 'CreatePage',
34 ErrorPage => 'ErrorPage',
35 RecentChanges => 'RecentChanges',
36 AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11",
37 UserAgentList => 'WikiUserAgentList',
38 );
39 our $kanjicode = 'euc';
40 our $lang = 'ja';
41
42 $wiki::useragent::UseLog = 0; ## Use User-Agent name log (WikiUserAgentList) or not
43 $wiki::diff::UseDiff = 1; ## Use diff mode or not
44
45 ## Definition of views
46
47 my %vd;
48 $vd{links} = <<'EOH';
49 %styles-wiki-html(page=>\"WikiStyleList:HTML\");
50 %link-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,title=>\"%res(name=>EditThisPageLink);\");
51 %link-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,title=>\"%res(name=>AdminEditThisPageLink);\",add_param=>\"admin=1\");
52 %link-wiki(rel=>view,class=>wiki-cmd,title=>\"%res(name=>ViewThisPageLink);\",up_to_date);
53 %link-wiki(rel=>myself,class=>wiki,title=>\"%res(name=>GoToMyselfLink);\");
54 %link-wiki(page=>IndexPage,rel=>index,class=>wiki,title=>\"%res(name=>GoToIndexPageLink);\");
55 %link-wiki(page=>HomePage,rel=>home,class=>wiki,title=>\"%res(name=>GoToHomePageLink);\");
56 %link-wiki(page=>WikiNews,rel=>News,class=>wiki,title=>\"%res(name=>GoToWikiNewsLink);\");
57 %link-wiki(page=>RecentChanges,rel=>News,class=>wiki,title=>\"%res(name=>GoToRecentChangesLink);\");
58 %link-wiki(page=>RecentChanges,mode=>rss,rel=>News,class=>wiki,title=>\"%res(name=>GoToRssPageLink);\",type=>\"application/xml\");
59 %link-wiki(page=>SearchPage,rel=>search,class=>wiki,title=>\"%res(name=>GoToSearchPageLink);\");
60 %link-wiki(page=>WikiHelp,mode=>read,rel=>help,class=>wiki,title=>\"%res(name=>GoToWikiHelpLink);\");
61 %link-wiki(page=>WikiPageLicense,rel=>copyright,class=>wiki,title=>\"%res(name=>GoToWikiPageLicenseLink);\");
62 %link-wiki(mode=>map,rel=>contents,class=>wiki-cmd,title=>\"%res(name=>ShowMapOfThisPageLink);\");
63 %link-wiki(mode=>RandomJump,up_to_date,rel=>lucky,class=>\"wiki randomlink\",title=>\"%res(name=>GoSomewhereLink);\");
64 EOH
65 #%link-viewcvs(href=>\"http://path-to-viewcvs/path-to-repository/\",rel=>history,class=>wiki-cmd,title=>\"%res(name=>ViewHistoryOfThisPageLink);\",hreflang=>en);
66 $vd{links} .= q( %link-wiki(mode=>diff,rel=>history,class=>wiki-cmd,title=>\"%res(name=>ViewDiffOfThisPageLink);\");) if $wiki::diff::UseDiff;
67 $vd{links} .= <<EOH;
68 %link-wiki(href=>\\\"javascript:var%20WikiName=prompt('Please%20input%20the%20WikiName:','','Jump%20to%20SuikaWiki');if(WikiName)%7B_content.location.href='$url_cgi%3F'+encodeURIComponent(WikiName)%7D\\\",rel=>jump,class=>wiki-cmd,title=>\\\"%res(name=>JumpToLink);\\\");
69 %link-wiki(href=>\\\"javascript:var%20WikiName=prompt('Please%20input%20the%20WikiName:','','Jump%20to%20SuikaWiki');if(WikiName)%7B_content.location.href='$url_cgi%3Fmycmd=edit;mypage='+encodeURIComponent(WikiName)%7D\\\",rel=>jump,class=>wiki-cmd,title=>\\\"%res(name=>JumpToEditLink);\\\");
70 EOH
71 $vd{navbar} = <<'EOH';
72 %anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>\\\"%res(name=>EditThisPage);\\\",title=>\\\"%res(name=>EditThisPageLong,accesskey=>E);\\\");
73 %anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>\\\"%res(name=>ViewThisPage);\\\",title=>\\\"%res(name=>ViewThisPageLong);\\\");
74 %anchor-wiki(page=>CreatePage,class=>wiki,label=>\\\"%res(name=>GoToCreatePage);\\\",title=>\\\"%res(name=>GoToCreatePageLong);\\\");
75 %anchor-wiki(page=>IndexPage,class=>wiki,label=>\\\"%res(name=>GoToIndexPage);\\\",title=>\\\"%res(name=>GoToIndexPageLong);\\\");
76 %anchor-wiki(page=>HomePage,class=>wiki,label=>\\\"%res(name=>GoToHomePage);\\\",title=>\\\"%res(name=>GoToHomePageLong);\\\");
77 %anchor-wiki(page=>SearchPage,class=>wiki,label=>\\\"%res(name=>GoToSearchPage);\\\",title=>\\\"%res(name=>GoToSearchPageLong);\\\");
78 %anchor-wiki(mode=>RandomJump,up_to_date,rel=>lucky,class=>\\\"wiki randomlink\\\",label=>\\\"%res(name=>GoSomewhere);\\\",title=>\\\"%res(name=>GoSomewhereLong);\\\");
79 %anchor-wiki(page=>RecentChanges,class=>wiki,label=>\\\"%res(name=>GoToRecentChanges);\\\",title=>\\\"%res(name=>GoToRecentChangesLong);\\\");
80 EOH
81
82 our %ViewDefinition = (
83 read => {media => {type => 'text/html', charset => 1, expires => 120}, check => sub {1},
84 #xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 120},
85 template => <<EOH},
86 %html-start;%html-head(title=>"%res(name=>\\"View:WebPageTitle\\");",link_meta=>"$vd{links}");
87 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
88 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
89 %section(level=>2,id=>read,add_to_toc=>0,content=>\\"%read(comment);\\");
90 %section(level=>2,id=>\\"see-also\\",title=>SeeAlso,heading,content=>\\"%search-result;\\");
91 %section(level=>2,id=>referer,title=>Referer,heading,content=>\\"%referer-list;\\");
92 %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\");
93 %section(id=>last-modified,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"LastModified=\\\\\\");%last-modified;\\");
94 %section(class=>tools,add_to_toc=>0,content=>\\\"$vd{navbar}\\\");
95 %section(id=>footer,add_to_toc=>0,content=>\\"
96 <a href=\\\\\\"http://www.hyuki.com/yukiwiki/\\\\\\" title=\\\\\\"YukiWiki 2.0.beta1.2002-05-29 &copy; 2000-2002 by Hiroshi Yuki\\\\\\">%res(name=>\\\\\\"About:Name:YukiWiki\\\\\\");</a>
97 <a href=\\\\\\"http://digit.que.ne.jp/work/\\\\\\" title=\\\\\\"WalWiki 2.0.beta1.wal.1 &copy; 2000-2002 by Makio Tsukamoto\\\\\\">%res(name=>\\\\\\"About:Name:WalWiki\\\\\\");</a>
98 <a href=\\\\\\"http://suika.fam.cx/gate/cvs/wakaba/wiki/\\\\\\" title=\\\\\\"%res(name=>\\\\\\"About:SuikaWiki:JumpToCVS\\\\\\");\\\\\\">%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;</a>
99 \\");
100 %apply-user-preferred-style;");%html-end;
101 EOH
102 map => {media => {type => 'text/html', charset => 1, expires => 120}, check => sub {1},
103 #xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 120},
104 template => <<EOH},
105 %html-start;%html-head(title=>"%res(name=>\\"Map:WebPageTitle\\");",link_meta=>"$vd{links}");
106 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
107 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
108 %section(level=>2,id=>\\"link-map\\",title=>\\"Map:Title\\",heading,content=>\\"
109 <p>%res(name=>\\\\\\"Map:Description\\\\\\");</p>
110 %link-map;
111 \\");
112 %section(level=>2,id=>\\"see-also\\",title=>SeeAlso,heading,content=>\\"%search-result;\\");
113 %section(level=>2,id=>referer,title=>Referer,heading,content=>\\"%referer-list;\\");
114 %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\");
115 %section(class=>tools,add_to_toc=>0,content=>\\\"$vd{navbar}\\\");
116 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
117 %apply-user-preferred-style;");%html-end;
118 EOH
119
120 edit => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1},
121 #xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60},
122 template => <<EOH},
123 %html-start;%html-head(title=>"%res(name=>\\"Edit:WebPageTitle\\");",link_meta=>"$vd{links} %html-meta(name=>ROBOTS,content=>NOINDEX);");
124 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
125 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
126 %section(level=>2,id=>edit,title=>\\"Edit:Title\\",heading,content=>\\"
127 %edit-form;
128 %section(level=>3,id=>edit-help,add_to_toc=>0,content=>\\\\\\"%read(page=>WikiEditHelp);\\\\\\");
129 \\");
130 %section(level=>2,id=>\\"see-also\\",title=>SeeAlso,heading,content=>\\"%search-result;\\");
131 %section(level=>2,id=>referer,title=>Referer,heading,content=>\\"%referer-list;\\");
132 %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\");
133 %section(id=>last-modified,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"LastModified=\\\\\\");%last-modified;\\");
134 %section(class=>tools,add_to_toc=>0,content=>\\\"$vd{navbar}\\\");
135 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
136 %apply-user-preferred-style;");%html-end;
137 EOH
138 adminedit => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1},
139 xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60},
140 template => <<EOH},
141 %html-start;%html-head(title=>"%res(name=>\\"Edit:Admin:WebPageTitle\\");",link_meta=>"$vd{links} %html-meta(name=>ROBOTS,content=>NOINDEX);");
142 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
143 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
144 %section(level=>2,id=>edit,title=>\\"Edit:Title\\",heading,content=>\\"%edit-form(admin);\\");
145 %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\");
146 %section(id=>last-modified,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"LastModified=\\\\\\");%last-modified;\\");
147 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
148 %apply-user-preferred-style;");%html-end;
149 EOH
150 -conflict => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1},
151 #xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60},
152 template => <<EOH},
153 %html-start;%html-head(title=>"%res(name=>\\"Edit:Conflict:WebPageTitle\\");",link_meta=>"$vd{links} %html-meta(name=>ROBOTS,content=>NOINDEX);");
154 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
155 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
156 %section(level=>2,id=>edit-conflict,title=>\\"Edit:Conflict:Title\\",heading,content=>\\"
157 <p>%res(name=>\\\\\\"Edit:Conflict:Description\\\\\\");</p>
158 %conflict-form;
159 %section(level=>3,id=>edit-conflict-diff,title=>\\\\\\"Edit:Conflict:Diff:Title\\\\\\",heading,content=>\\\\\\"
160 <p>%res(name=>\\\\\\\\\\\\\\"Edit:Conflict:Diff:Description\\\\\\\\\\\\\\");</p>
161 %conflict-diff;
162 \\\\\\");
163 \\");
164 %section(level=>2,id=>edit,title=>\\"Edit:Title\\",heading,content=>\\"
165 <p>%res(name=>\\\\\\"Edit:Conflict:Edit:Description\\\\\\");</p>
166 %edit-form;
167 %section(level=>3,id=>edit-help,add_to_toc=>0,content=>\\\\\\"%read(page=>WikiEditHelp);\\\\\\");
168 \\");
169 %section(level=>2,id=>\\"see-also\\",title=>SeeAlso,heading,content=>\\"%search-result;\\");
170 %section(level=>2,id=>referer,title=>Referer,heading,content=>\\"%referer-list;\\");
171 %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\");
172 %section(class=>tools,add_to_toc=>0,content=>\\\"$vd{navbar}\\\");
173 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
174 %apply-user-preferred-style;");%html-end;
175 EOH
176 -wrote => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1},
177 xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60},
178 template => <<EOH},
179 %html-start;%html-head(title=>"%res(name=>\\"Edit:Wrote:WebPageTitle\\");",link_meta=>"$vd{links} %html-meta(name=>ROBOTS,content=>NOINDEX);");
180 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
181 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
182 <p>%res(name=>\\"Edit:SavedSuccessfully\\");</p>
183 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
184 %apply-user-preferred-style;");%html-end;
185 EOH
186 -deleted => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1},
187 xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60},
188 template => <<EOH},
189 %html-start;%html-head(title=>"%res(name=>\\"Edit:Deleted:WebPageTitle\\");",link_meta=>"$vd{links} %html-meta(name=>ROBOTS,content=>NOINDEX);");
190 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
191 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
192 <p>%res(name=>\\"Edit:PageIsDeletedSuccessfully\\");</p>
193 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
194 %apply-user-preferred-style;");%html-end;
195 EOH
196 -error => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1},
197 xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60},
198 template => <<EOH},
199 %html-start;%html-head(title=>"%res(name=>\\"Error:WebPageTitle\\");",link_meta=>"$vd{links} %html-meta(name=>ROBOTS,content=>NOINDEX);");
200 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
201 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
202 %section(level=>2,id=>error,title=>\\"Error:Title\\",heading,content=>\\"
203 <p>%error-message;</p>
204 \\");
205 %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\");
206 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
207 %apply-user-preferred-style;");%html-end;
208 EOH
209
210 css => {media => {type => 'text/css', charset => 1, expires => 3600},
211 check => sub { ref $_[0]->format_converter ($_[0]->{magic} => 'CSS') ? 1 : 0 },
212 template => '%read(to=>CSS);'},
213 rss => {media => {type => 'application/rss+xml', charset => 1, expires => 3600},
214 check => sub { ref $_[0]->format_converter ($_[0]->{magic} => 'RSS') ? 1 : 0 },
215 template => '%read(to=>RSS);'},
216 -UnsupportedMediaType => {media => {type => 'text/html', charset => 1, expires => -1},
217 xmedia => {type => 'application/xhtml+xml', charset => 1, expires => -1},
218 check => sub {1}, template => <<EOH},
219 %html-start;%html-head(title=>"%page-name;",link_meta=>"$vd{links}");
220 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
221 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
222 %section(level=>2,title=>\\"UnsupportedMediaType:Title\\",heading,content=>\\"
223 %res(name=>\\\\\\"UnsupportedMediaType:Description\\\\\\");
224 \\");
225 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
226 %apply-user-preferred-style;");%html-end;
227 EOH
228 );
229
230
231 $ViewDefinition{diff} = {media => {type => 'text/html', charset => 1, expires => 120},
232 #xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 120},
233 template => <<EOH, check => sub {1}} if $wiki::diff::UseDiff;
234 %html-start;%html-head(title=>"%res(name=>\\"Diff:WebPageTitle\\");",link_meta=>"$vd{links}");
235 %section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>"
236 %section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\");
237 %section(level=>2,id=>\\"diff\\",title=>\\"Diff:Title\\",heading,content=>\\"
238 <p>%res(name=>\\\\\\"Diff:Notice\\\\\\");</p>
239 %diff-between-previous;
240 \\");
241 %section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\");
242 %section(class=>tools,add_to_toc=>0,content=>\\\"$vd{navbar}\\\");
243 %section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\");
244 ");
245 EOH
246
247 =head1 NAME
248
249 suikawiki-config.ph --- SuikaWiki: site configuration script
250
251 =head1 LICENSE
252
253 Copyright 2003 Wakaba <w@suika.fam.cx>
254
255 This program is free software; you can redistribute it and/or
256 modify it under the same terms as Perl itself.
257
258 =cut
259
260 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24