1 |
use strict; |
use strict; |
2 |
# |
|
3 |
# You MUST modify following '$modifier_...' variables. |
## URI (or part of URI) of Wiki CGI itself and its external addons |
4 |
# |
## Note: If your Wiki CGI URI is <http://foo.example/path/to/wiki.cgi>, |
5 |
# our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited. |
## cookie-path: /path/to/ |
6 |
# our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited. |
## script-short-name: wiki.cgi |
7 |
#our $modifier_dbtype = 'Yuki::YukiWikiDB'; # Slow, available on all environment. |
## URI parts MUST NOT contains "&" and/or non-URI characters. |
8 |
#our $modifier_dbtype = 'Yuki::YukiWikiDB2'; # Slow, available on all environment. |
our %uri = ( |
9 |
our $modifier_dbtype = 'Yuki::YukiWikiDBMeta'; # Slow, available on all environment. |
cookie_path => '/temp/suikawiki/', |
10 |
our $url_cgi; { |
external_script => '../wiki/script/', |
11 |
|
script_short_name => 'wiki', |
12 |
|
); |
13 |
|
our $url_cgi; { |
14 |
my $scheme = 'http'; |
my $scheme = 'http'; |
15 |
$scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; |
$scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; |
16 |
$url_cgi = "$scheme://$main::ENV{SERVER_NAME}:$main::ENV{SERVER_PORT}/~wakaba/suikawiki/wiki"; |
$url_cgi = "$scheme://$main::ENV{SERVER_NAME}:$main::ENV{SERVER_PORT}$uri{cookie_path}$uri{script_short_name}"; |
17 |
## - MUST NOT include [&<>"] and/or non-URI characters |
} |
18 |
} |
$uri{wiki} = $url_cgi; |
19 |
our %uri = ( |
|
20 |
cookie_path => '/~wakaba/suikawiki/', |
## Path to modules and databases |
21 |
external_script => '../wiki/script/', |
use lib qw!../wiki/lib!; |
22 |
); |
$SuikaWiki::Plugin::plugin_directory = q(../wiki/lib/SuikaWiki/Plugin/); |
23 |
$uri{wiki} = $url_cgi; |
our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script) |
24 |
$SuikaWiki::Plugin::plugin_directory = q(../wiki/lib/SuikaWiki/Plugin/); |
CachePrefix => q(./wikidata/.cache.), |
25 |
our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script) |
WikiDataBase => q(./wikidata/page), |
26 |
CachePrefix => q(./wikidata/.cache.), |
); |
27 |
WikiDataBase => q(./wikidata/page), |
|
28 |
); |
## Type of WikiPage Database |
29 |
############################## |
#our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited. |
30 |
our %PageName = ( |
#our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited. |
31 |
FrontPage => 'HomePage', |
#our $modifier_dbtype = 'Yuki::YukiWikiDB'; # Slow, available on all environment. |
32 |
IndexPage => 'IndexPage', |
#our $modifier_dbtype = 'Yuki::YukiWikiDB2'; # Slow, available on all environment. |
33 |
SearchPage => 'SearchPage', |
our $modifier_dbtype = 'Yuki::YukiWikiDBMeta'; # Slow, available on all environment. |
34 |
CreatePage => 'CreatePage', |
our $use_exists = 1; # If you can use 'exists' method for your DB. |
35 |
ErrorPage => 'ErrorPage', |
|
36 |
RecentChanges => 'RecentChanges', |
## Name of Special WikiPage (linked as parts of navigations) |
37 |
AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", |
our %PageName = ( |
38 |
UserAgentList => 'WikiUserAgentList', |
FrontPage => 'HomePage', |
39 |
); |
IndexPage => 'IndexPage', |
40 |
our $kanjicode = 'euc'; |
SearchPage => 'SearchPage', |
41 |
our $lang = 'ja'; |
CreatePage => 'CreatePage', |
42 |
|
RecentChanges => 'RecentChanges', |
43 |
|
UserAgentList => 'WikiUserAgentList', |
44 |
|
AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", |
45 |
|
); |
46 |
|
|
47 |
$wiki::useragent::UseLog = 0; ## Use User-Agent name log (WikiUserAgentList) or not |
## (Should be reimplemented) |
48 |
$wiki::diff::UseDiff = 1; ## Use diff mode or not |
our $kanjicode = 'euc'; |
49 |
|
our $lang = 'ja'; |
50 |
|
$wiki::useragent::UseLog = 0; ## Use User-Agent name log (WikiUserAgentList) or not |
51 |
|
|
52 |
|
## Misc. options |
53 |
|
$wiki::diff::UseDiff = 1; ## Use diff mode or not |
54 |
|
|
55 |
|
## Namespace of WikiName |
56 |
|
package wiki::page::ns; |
57 |
|
our $delimiter = '//'; |
58 |
|
our $self = '.'; |
59 |
|
our $parent = '..'; |
60 |
|
package main; |
61 |
|
|
62 |
|
## Definition of views |
63 |
|
|
64 |
my %vd; |
my %vd; |
65 |
$vd{links} = <<'EOH'; |
$vd{links} = <<'EOH'; |
76 |
%link-wiki(page=>SearchPage,rel=>search,class=>wiki,title=>\"%res(name=>GoToSearchPageLink);\"); |
%link-wiki(page=>SearchPage,rel=>search,class=>wiki,title=>\"%res(name=>GoToSearchPageLink);\"); |
77 |
%link-wiki(page=>WikiHelp,mode=>read,rel=>help,class=>wiki,title=>\"%res(name=>GoToWikiHelpLink);\"); |
%link-wiki(page=>WikiHelp,mode=>read,rel=>help,class=>wiki,title=>\"%res(name=>GoToWikiHelpLink);\"); |
78 |
%link-wiki(page=>WikiPageLicense,rel=>copyright,class=>wiki,title=>\"%res(name=>GoToWikiPageLicenseLink);\"); |
%link-wiki(page=>WikiPageLicense,rel=>copyright,class=>wiki,title=>\"%res(name=>GoToWikiPageLicenseLink);\"); |
79 |
%link-wiki(mode=>map,rel=>contents,class=>wiki-cmd,title=>\"%res(name=>ShowMapOfThisPageLink);\"); |
%link-wiki(mode=>map,rel=>sitemap,class=>wiki-cmd,title=>\"%res(name=>ShowMapOfThisPageLink);\"); |
80 |
%link-wiki(mode=>RandomJump,up_to_date,rel=>lucky,class=>\"wiki randomlink\",title=>\"%res(name=>GoSomewhereLink);\"); |
%link-wiki(mode=>RandomJump,up_to_date,rel=>lucky,class=>\"wiki randomlink\",title=>\"%res(name=>GoSomewhereLink);\"); |
81 |
|
%link-wiki(page=>WikiMenuBar,mode=>mininav,rel=>\"sidebar navigator\",class=>wiki); |
82 |
|
%link-favicon(use_page_icon); |
83 |
EOH |
EOH |
84 |
#%link-viewcvs(href=>\"http://path-to-viewcvs/path-to-repository/\",rel=>history,class=>wiki-cmd,title=>\"%res(name=>ViewHistoryOfThisPageLink);\",hreflang=>en); |
#%link-viewcvs(href=>\"http://path-to-viewcvs/path-to-repository/\",rel=>history,class=>wiki-cmd,title=>\"%res(name=>ViewHistoryOfThisPageLink);\",hreflang=>en); |
85 |
$vd{links} .= q( %link-wiki(mode=>diff,rel=>history,class=>wiki-cmd,title=>\"%res(name=>ViewDiffOfThisPageLink);\");) if $wiki::diff::UseDiff; |
$vd{links} .= q( %link-wiki(mode=>diff,rel=>history,class=>wiki-cmd,title=>\"%res(name=>ViewDiffOfThisPageLink);\");) if $wiki::diff::UseDiff; |
117 |
<a href=\\\\\\"http://suika.fam.cx/gate/cvs/wakaba/wiki/\\\\\\" title=\\\\\\"%res(name=>\\\\\\"About:SuikaWiki:JumpToCVS\\\\\\");\\\\\\">%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;</a> |
<a href=\\\\\\"http://suika.fam.cx/gate/cvs/wakaba/wiki/\\\\\\" title=\\\\\\"%res(name=>\\\\\\"About:SuikaWiki:JumpToCVS\\\\\\");\\\\\\">%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;</a> |
118 |
\\"); |
\\"); |
119 |
%apply-user-preferred-style;");%html-end; |
%apply-user-preferred-style;");%html-end; |
120 |
|
%log-hotness(); |
121 |
EOH |
EOH |
122 |
map => {media => {type => 'text/html', charset => 1, expires => 120}, check => sub {1}, |
map => {media => {type => 'text/html', charset => 1, expires => 120}, check => sub {1}, |
123 |
#xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 120}, |
#xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 120}, |
202 |
<p>%res(name=>\\"Edit:SavedSuccessfully\\");</p> |
<p>%res(name=>\\"Edit:SavedSuccessfully\\");</p> |
203 |
%section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\"); |
%section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\"); |
204 |
%apply-user-preferred-style;");%html-end; |
%apply-user-preferred-style;");%html-end; |
205 |
|
%log-hotness(weight=>2); |
206 |
EOH |
EOH |
207 |
-deleted => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1}, |
-deleted => {media => {type => 'text/html', charset => 1, expires => 60}, check => sub {1}, |
208 |
xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60}, |
xmedia => {type => 'application/xhtml+xml', charset => 1, expires => 60}, |
231 |
css => {media => {type => 'text/css', charset => 1, expires => 3600}, |
css => {media => {type => 'text/css', charset => 1, expires => 3600}, |
232 |
check => sub { ref $_[0]->format_converter ($_[0]->{magic} => 'CSS') ? 1 : 0 }, |
check => sub { ref $_[0]->format_converter ($_[0]->{magic} => 'CSS') ? 1 : 0 }, |
233 |
template => '%read(to=>CSS);'}, |
template => '%read(to=>CSS);'}, |
234 |
|
image_jpeg => {media => {type => 'image/jpeg', expires => 240*3600}, |
235 |
|
check => sub { ref ($_[0]->format_converter ($_[0]->{magic} => 'image_jpeg')) |
236 |
|
&& $_[0]->{magic} =~ m#image-type="image/jpeg"# ? 1 : 0 }, |
237 |
|
template => '%read(to=>image_jpeg);'}, |
238 |
|
image_png => {media => {type => 'image/png', expires => 240*3600}, |
239 |
|
check => sub { ref ($_[0]->format_converter ($_[0]->{magic} => 'image_png')) |
240 |
|
&& $_[0]->{magic} =~ m#image-type="image/png"# ? 1 : 0 }, |
241 |
|
template => '%read(to=>image_png);'}, |
242 |
rss => {media => {type => 'application/rss+xml', charset => 1, expires => 3600}, |
rss => {media => {type => 'application/rss+xml', charset => 1, expires => 3600}, |
243 |
check => sub { ref $_[0]->format_converter ($_[0]->{magic} => 'RSS') ? 1 : 0 }, |
check => sub { ref $_[0]->format_converter ($_[0]->{magic} => 'RSS') ? 1 : 0 }, |
244 |
template => '%read(to=>RSS);'}, |
template => '<?xml version="1.0"?>%styles-wiki-xml(page=>"WikiStyleList:RSS");%read(to=>RSS);'}, |
245 |
-UnsupportedMediaType => {media => {type => 'text/html', charset => 1, expires => -1}, |
-UnsupportedMediaType => {media => {type => 'text/html', charset => 1, expires => -1}, |
246 |
xmedia => {type => 'application/xhtml+xml', charset => 1, expires => -1}, |
xmedia => {type => 'application/xhtml+xml', charset => 1, expires => -1}, |
247 |
check => sub {1}, template => <<EOH}, |
check => sub {1}, template => <<EOH}, |
251 |
%section(level=>2,title=>\\"UnsupportedMediaType:Title\\",heading,content=>\\" |
%section(level=>2,title=>\\"UnsupportedMediaType:Title\\",heading,content=>\\" |
252 |
%res(name=>\\\\\\"UnsupportedMediaType:Description\\\\\\"); |
%res(name=>\\\\\\"UnsupportedMediaType:Description\\\\\\"); |
253 |
\\"); |
\\"); |
|
%section(level=>2,id=>\\"see-also\\",title=>SeeAlso,heading,content=>\\"%search-result;\\"); |
|
|
%section(level=>2,id=>referer,title=>Referer,heading,content=>\\"%referer-list;\\"); |
|
|
%section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\"); |
|
|
%section(class=>tools,add_to_toc=>0,content=>\\"$vd{navbar}\\"); |
|
254 |
%section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\"); |
%section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\"); |
255 |
%apply-user-preferred-style;");%html-end; |
%apply-user-preferred-style;");%html-end; |
256 |
EOH |
EOH |
270 |
%section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\"); |
%section(level=>2,id=>toc,title=>\\"TOC:Title\\",heading,add_to_toc=>0,content=>\\"%toc(drag);\\"); |
271 |
%section(class=>tools,add_to_toc=>0,content=>\\\"$vd{navbar}\\\"); |
%section(class=>tools,add_to_toc=>0,content=>\\\"$vd{navbar}\\\"); |
272 |
%section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\"); |
%section(id=>footer,add_to_toc=>0,content=>\\"%res(name=>\\\\\\"About:Name:SuikaWiki\\\\\\"); %wiki-version;\\"); |
273 |
%apply-user-preferred-style;");%html-end; |
"); |
274 |
EOH |
EOH |
275 |
|
|
276 |
$ViewDefinition{WithMenu} = {%{$ViewDefinition{read}}, template => <<EOH}; |
$ViewDefinition{WithMenu} = {%{$ViewDefinition{read}}, template => <<EOH}; |
277 |
%html-start;%html-head(title=>"%res(name=>\\"View:WebPageTitle\\");",link_meta=>"$vd{links}"); |
%html-start;%html-head(title=>"%res(name=>\\"View:WebPageTitle\\");",link_meta=>"$vd{links}"); |
278 |
|
%log-hotness; |
279 |
%section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>" |
%section(level=>1,add_to_toc=>0,type=>body,title=>"%page-name;",heading,content=>" |
280 |
<div id=\\\"myuri\\\">%uri-wiki();</div> |
<div id=\\\"myuri\\\">%img-favicon(use_page_icon);%uri-wiki();</div> |
281 |
%section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\" |
%section(id=>tools1,class=>tools,add_to_toc=>0,content=>\\" |
282 |
%anchor-wiki(rel=>view,up_to_date,mode=>default,class=>wiki-cmd,label=>\\\\\\"%res(name=>ReloadThisPage);\\\\\\",title=>\\\\\\"%res(name=>ReloadThisPageLong);\\\\\\"); |
%anchor-wiki(rel=>view,up_to_date,mode=>default,class=>wiki-cmd,label=>\\\\\\"%res(name=>ReloadThisPage);\\\\\\",title=>\\\\\\"%res(name=>ReloadThisPageLong);\\\\\\"); |
283 |
$vd{navbar} |
$vd{navbar} |
298 |
%apply-user-preferred-style;");%html-end; |
%apply-user-preferred-style;");%html-end; |
299 |
EOH |
EOH |
300 |
|
|
301 |
1; |
$ViewDefinition{mininav} = {%{$ViewDefinition{read}}, template => <<EOH}; |
302 |
|
%html-start;%html-head(title=>"%res(name=>\\"View:WebPageTitle\\");",link_meta=>"$vd{links}"); |
303 |
|
%section(level=>1,add_to_toc=>0,type=>body,content=>" |
304 |
|
%section(level=>2,id=>side-menu,class=>\\"mininav\\",add_to_toc=>0,content=>\\" |
305 |
|
%read; |
306 |
|
%anchor-wiki(rel=>view,mode=>mininav,class=>wiki-cmd,target=>_self,label=>\\\\\\"%res(name=>ReloadThisPage);\\\\\\",title=>\\\\\\"%res(name=>ReloadThisPageLong);\\\\\\"); |
307 |
|
\\"); |
308 |
|
%apply-user-preferred-style;");%html-end; |
309 |
|
EOH |
310 |
|
|
311 |
|
=head1 NAME |
312 |
|
|
313 |
|
suikawiki-config.ph --- SuikaWiki: site configuration script |
314 |
|
|
315 |
|
=head1 LICENSE |
316 |
|
|
317 |
|
Copyright 2003 Wakaba <w@suika.fam.cx> |
318 |
|
|
319 |
|
This program is free software; you can redistribute it and/or |
320 |
|
modify it under the same terms as Perl itself. |
321 |
|
|
322 |
|
=cut |
323 |
|
|
324 |
|
1; # $Date$ |