/[pub]/suikawiki/wikidata/suikawiki-config.ph
Suika

Contents of /suikawiki/wikidata/suikawiki-config.ph

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Tue Apr 29 10:43:21 2003 UTC (21 years ago) by wakaba
Branch: MAIN
Changes since 1.7: +42 -182 lines
Most of definitions are moved to plugins.

1 use strict;
2
3 ## 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 ## cookie-path: /path/to/
6 ## script-short-name: wiki.cgi
7 ## URI parts MUST NOT contains "&" and/or non-URI characters.
8 our %uri = (
9 cookie_path => '/temp/suikawiki/',
10 external_script => '../wiki/script/',
11 script_short_name => 'wiki',
12 ## If you use CVS repository of WikiDatabase,
13 #cvs_repository => 'http://path-to-viewcvs/path-to-repository/',
14 );
15 our $url_cgi; {
16 my $scheme = 'http';
17 $scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#;
18 $url_cgi = "$scheme://$main::ENV{SERVER_NAME}:$main::ENV{SERVER_PORT}$uri{cookie_path}$uri{script_short_name}";
19 }
20 $uri{wiki} = $url_cgi;
21
22 ## Path to modules and databases
23 use lib qw!/home/wakaba/temp/msg!; # temporary
24 use lib qw!../wiki/lib!;
25 $SuikaWiki::Plugin::plugin_directory = q(../wiki/lib/SuikaWiki/Plugin/);
26 our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script)
27 CachePrefix => q(./wikidata/.cache.),
28 TempPrefix => q(./wikidata/.tmp.),
29 WikiDataBase => q(./wikidata/page),
30 );
31
32 ## Type of WikiPage Database
33 #our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited.
34 #our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited.
35 #our $modifier_dbtype = 'Yuki::YukiWikiDB'; # Slow, available on all environment.
36 #our $modifier_dbtype = 'Yuki::YukiWikiDB2'; # Slow, available on all environment.
37 our $modifier_dbtype = 'Yuki::YukiWikiDBMeta'; # Slow, available on all environment.
38 our $use_exists = 1; # If you can use 'exists' method for your DB.
39
40 ## Name of Special WikiPage (linked as parts of navigations)
41 our %PageName = (
42 FrontPage => 'HomePage',
43 IndexPage => 'IndexPage',
44 SearchPage => 'SearchPage',
45 CreatePage => 'CreatePage',
46 RecentChanges => 'RecentChanges',
47 ResourceNS => 'Wiki//Resource//',
48 StyleList => 'Wiki//Style//List//',
49 UserAgentList => 'Wiki//UserAgentList',
50 AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11",
51 );
52
53 ## (Should be reimplemented)
54 our $kanjicode = 'euc';
55 our $lang = 'ja';
56 $wiki::useragent::UseLog = 0; ## Use User-Agent name log (WikiUserAgentList) or not
57
58 ## Misc. options
59
60 ## Definition of views
61
62 require SuikaWiki::View;
63 SuikaWiki::View->template ('links')->add_line (<<'EOH');
64 %link-wiki(page=>IndexPage,rel=>index,class=>wiki,title=>"%res(name=>GoToIndexPageLink,safe);"p);
65 %link-wiki(page=>HomePage,rel=>home,class=>wiki,title=>"%res(name=>GoToHomePageLink,safe);"p);
66 %link-wiki(page=>"Wiki//News",rel=>News,class=>wiki,title=>"%res(name=>GoToWikiNewsLink,safe);"p);
67 %link-wiki(page=>SearchPage,rel=>search,class=>wiki,title=>"%res(name=>GoToSearchPageLink,safe);"p);
68 %link-wiki(page=>"Wiki//Help",mode=>read,rel=>help,class=>wiki,title=>"%res(name=>GoToWikiHelpLink,safe);"p);
69 %link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink,safe);"p);
70 %link-wiki(mode=>RandomJump,up_to_date,rel=>jump,class=>"wiki randomlink",title=>"%res(name=>GoSomewhereLink,safe);"p);
71 %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,safe);"p);
72 %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,safe);"p);
73 EOH
74 SuikaWiki::View->template ('navbar')->add_line (<<'EOH');
75 %anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>"%res(name=>EditThisPage,safe);"p,title=>"%res(name=>EditThisPageLong);"p,accesskey=>E);
76 %anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>"%res(name=>ViewThisPage,safe);"p,title=>"%res(name=>ViewThisPageLong);"p);
77 %anchor-wiki(page=>CreatePage,class=>wiki,label=>"%res(name=>GoToCreatePage,safe);"p,title=>"%res(name=>GoToCreatePageLong,safe);"p);
78 %anchor-wiki(page=>IndexPage,class=>wiki,label=>"%res(name=>GoToIndexPage,safe);"p,title=>"%res(name=>GoToIndexPageLong,safe);"p);
79 %anchor-wiki(page=>HomePage,class=>wiki,label=>"%res(name=>GoToHomePage,safe);"p,title=>"%res(name=>GoToHomePageLong,safe);"p);
80 %anchor-wiki(page=>SearchPage,class=>wiki,label=>"%res(name=>GoToSearchPage,safe);"p,title=>"%res(name=>GoToSearchPageLong,safe);"p);
81 %anchor-wiki(mode=>RandomJump,up-to-date,rel=>lucky,class=>"wiki randomlink",label=>"%res(name=>GoSomewhere,safe);"p,title=>"%res(name=>GoSomewhereLong,safe);"p);
82 %anchor-wiki(page=>RecentChanges,class=>wiki,label=>"%res(name=>GoToRecentChanges,safe);"p,title=>"%res(name=>GoToRecentChangesLong,safe);"p);
83 EOH
84
85 push @{$SuikaWiki::Plugin::On{Load}}, sub {
86 SuikaWiki::View->definition ('read')->property (template => <<'EOH');
87 %html-document(title=>{%res(name=>{View:WebPageTitle});}p,link-meta=>{%predefined-template(name=>links);}p,content=>{
88 %section(level=>1,add-to-toc=>0,type=>body,title=>{%ns-short-page-name;}p,heading,content=>{
89 %section(id=>tools1,class=>tools,add-to-toc=>0,content=>{%predefined-template(name=>navbar);}p);
90 %section(level=>2,id=>read,add-to-toc=>0,content=>{
91 %if-calender(month,true=>{
92 %format(context=>form_input,template=>{%calender;});
93 },false=>{
94 %if-calender(true=>{
95 %format(context=>form_input,template=>{%calender-months;});
96 });
97 });
98 %read(comment);
99 }p);
100 %section(level=>2,id=>children,title=>{%res(name=>{Children:Title});}p,heading,
101 content=>{%page-list(ns=>{%page-name;}p,recursive=>0,type=>both,template=>{
102 %wiki-link(label=>{%ns-short-page-or-ns-name;}p);
103 });}p);
104 %section(level=>2,id=>see-also,title=>{%res(name=>SeeAlso);}p,heading,content=>{%search-result;}p);
105 %section(level=>2,id=>referer,title=>{%res(name=>Referer);}p,heading,content=>{%referer-list;}p);
106 %section(level=>2,id=>toc,title=>{%res(name=>{TOC:Title};}p,heading,add_to_toc=>0,content=>{%toc(drag);}p);
107 %section(id=>last-modified,add_to_toc=>0,content=>{%res(name=>{LastModified=});%last-modified;}p);
108 %section(class=>tools,add_to_toc=>0,content=>{%predefined-template(name=>navbar);}p);
109 %section(id=>footer,add-to-toc=>0,content=>{%predefined-template(name=>footer);}p);
110 }p);
111 }p);%log-hotness;
112 EOH
113 SuikaWiki::View->definition ('-wrote')->property (template => SuikaWiki::View->definition ('-wrote')->property ('template').q(%log-hotness(weight=>2);));
114 };
115
116 =head1 NAME
117
118 suikawiki-config.ph --- SuikaWiki: site configuration script
119
120 =head1 LICENSE
121
122 Copyright 2003 Wakaba <w@suika.fam.cx>
123
124 This program is free software; you can redistribute it and/or
125 modify it under the same terms as Perl itself.
126
127 =cut
128
129 1; # $Date: 2003/04/03 01:10:10 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24