|
|
@ -25,19 +25,7 @@ retaining all the wonderful full-page editing features of a wiki. |
|
|
|
|
|
|
|
=head1 INSTALLATION |
|
|
|
|
|
|
|
This script is a self-contained package, which makes the code easy to test. |
|
|
|
To actually use it as a wala, create a script named "wala.pl" in the same |
|
|
|
directory, containing the following three lines: |
|
|
|
|
|
|
|
#!/usr/bin/perl |
|
|
|
use Wala; |
|
|
|
my $w = Wala->new(); |
|
|
|
$w->run; |
|
|
|
|
|
|
|
You can experiment with the wala by use'ing it and calling its functions |
|
|
|
without calling "run". By default, required directories and files should |
|
|
|
be created as needed, but you can visit wala.pl?setup in your browser, |
|
|
|
or call C<setup()> from a script at any time. |
|
|
|
TODO |
|
|
|
|
|
|
|
=head2 CONFIGURATION |
|
|
|
|
|
|
@ -59,7 +47,6 @@ You can set options directly from the calling script, like so: |
|
|
|
ScriptName => 'wala.pl', |
|
|
|
ShowSearchlinks => 1, # Display "see also" box on pages |
|
|
|
LogRelatedLinks => 1, # Log related links for a given change. |
|
|
|
CheckSetup => 1, # Check for setup files every time |
|
|
|
UseCache => 0, # Don't use caching behavior |
|
|
|
NoCache => qr/^([A-Z]|PageIndex|RecentChanges|HomePage|PageChangeTimes)$/x, |
|
|
|
); |
|
|
@ -136,7 +123,6 @@ my %WalaConf = ( |
|
|
|
TitleString => 'wala::', # Display before page names in titles |
|
|
|
ScriptName => 'wala.pl', # substr( $0, rindex( $0, "/" ) + 1 ); |
|
|
|
ShowSearchlinks => 1, # Display "see also" box on pages |
|
|
|
CheckSetup => 1, # Check for setup files every time |
|
|
|
UseCache => 0, # Don't use caching behavior |
|
|
|
NoCache => qr/^([A-Z]|PageIndex|RecentChanges|HomePage |
|
|
|
|PageChangeTimes)$/x, |
|
|
@ -206,7 +192,6 @@ sub run { |
|
|
|
my ($result); |
|
|
|
|
|
|
|
my $page = $self->HomePage; |
|
|
|
$self->setup() if $self->CheckSetup; |
|
|
|
$self->parse_cookies($ENV{'HTTP_COOKIE'}); |
|
|
|
|
|
|
|
my $querystring = $ENV{'QUERY_STRING'}; |
|
|
@ -957,13 +942,10 @@ sub print_page { |
|
|
|
|
|
|
|
# this takes care of several special pages. it also grabs links to search |
|
|
|
# engines and backreferences to other pages. |
|
|
|
if ($pagename eq 'RecentChanges') { |
|
|
|
$pagetext .= $self->print_recent_changes; |
|
|
|
} |
|
|
|
if ($pagename eq 'RecentChanges' ) { $pagetext .= $self->print_recent_changes; } |
|
|
|
elsif ($pagename eq 'PageIndex' ) { $pagetext .= $self->get_list_of_pages(); } |
|
|
|
elsif ($pagename eq 'PageChangeTimes') { $pagetext .= $self->get_change_times(); } |
|
|
|
elsif ($pagename =~ m/^([A-Za-z])$/ ) { $pagetext .= $self->get_list_of_pages("^$1.*"); } |
|
|
|
elsif ($pagename eq 'setup' ) { $pagetext .= $self->setup(); } |
|
|
|
elsif ($pagename eq $self->HomePage ) { $linklist = ''; } |
|
|
|
elsif (! $self->ShowSearchlinks ) { $linklist = ''; } |
|
|
|
else { |
|
|
|