diff -uwbBN -x .cvsignore -x createweb ../twiki.cvs/twiki/bin/mailnotify bin/mailnotify --- ../twiki.cvs/twiki/bin/mailnotify Fri Nov 17 12:50:19 2000 +++ bin/mailnotify Thu Dec 28 12:04:12 2000 @@ -27,9 +27,13 @@ $debug && print "- to suppress all normal output: mailnotify -q\n"; my $dataDir = &wiki::getDataDir(); - opendir( DIR, "$dataDir" ) or die "could not open $dataDir"; - @weblist = grep !/^\.\.?$/, readdir DIR; - closedir DIR; + +#AS 27-12-00 changed to allow subwebs +# opendir( DIR, "$dataDir" ) or die "could not open $dataDir"; +# @weblist = grep !/^\.\.?$/, readdir DIR; +# closedir DIR; + @weblist = &wiki::getAllWebs(); +#/AS foreach $web ( @weblist ) { if( -d "$dataDir/$web" ) { processWeb( $web ); diff -uwbBN -x .cvsignore -x createweb ../twiki.cvs/twiki/bin/statistics bin/statistics --- ../twiki.cvs/twiki/bin/statistics Fri Nov 17 12:50:19 2000 +++ bin/statistics Thu Dec 28 12:04:06 2000 @@ -110,9 +110,13 @@ } else { # do all webs: my $dataDir = &wiki::getDataDir(); - opendir( DIR, "$dataDir" ) or die "could not open $dataDir"; - @weblist = grep !/^\.\.?$/, readdir DIR; - closedir DIR; + +#AS 27-12-00 changed to allow subwebs +# opendir( DIR, "$dataDir" ) or die "could not open $dataDir"; +# @weblist = grep !/^\.\.?$/, readdir DIR; +# closedir DIR; + @weblist = &wiki::getAllWebs(); +#/AS foreach $web ( @weblist ) { if( -d "$dataDir/$web" ) diff -uwbBN -x .cvsignore -x createweb ../twiki.cvs/twiki/bin/wikicfg.pm bin/wikicfg.pm --- ../twiki.cvs/twiki/bin/wikicfg.pm Fri Nov 17 12:50:20 2000 +++ bin/wikicfg.pm Thu Dec 28 14:34:16 2000 @@ -190,65 +191,143 @@ # ========================= -sub extendHandleCommonTags +#AS 1 Nov 2000 added column definitions and table options +use vars qw( @colOptions + $colDefPattern ); +$colDefPattern = qr/^((\s*[clr]\s*\|)+)([^|]*)$/io ; +sub emitTR { + my ( $pre, $cells, $insideTABLE ) = @_; + my $colOptions = ""; + if( $insideTABLE ) { + $cells = "|$cells"; + } else { + @colOptions = ('align="left"'); + if ( $cells =~ m/$colDefPattern/ ) { + $cells = ""; + $pre .= "
| @o; + my $opt = ""; + foreach $opt (@rops) { - # This is the place to define customized tags and variables - # Called by sub handleCommonTags, after %INCLUDE:"..."% - - my( $text, $topic, $theWeb ) = @_; - - # for compatibility for earlier TWiki versions: - $text=~ s/%INCLUDE:"(.*?)"%/&handleIncludeFile($1)/geo; - $text=~ s/%INCLUDE:"(.*?)"%/&handleIncludeFile($1)/geo; # allow two level includes - - # do custom extension rule, like for example: - # $text=~ s/%WIKIWEB%/$wikiToolName.$theWeb/go; - - return $text; + $cells =~ s@\|@ | @o; } - + $cells =~ s@\|@ | @go;
+ return $pre . $cells;
+}
+#/AS
# =========================
-sub extendGetRenderedVersionOutsidePRE
-{
- # This is the place to define customized rendering rules
- # Called by sub getRenderedVersion, in loop outside of tag
+#AS 5 Dec 2000 collect all Web's topic names
+sub getTopicNames {
+ my ($web) = @_ ;
- my( $text, $theWeb ) = @_;
-
- # do custom extension rule, like for example:
- # s/old/new/go;
+ if (!defined $web) {
+ $web="";
+ }
- # render *_text_* as "bold italic" text:
- s/(^|\s)\*_([^\s].*?[^\s])_\*(\s|$)/$1$2<\/EM><\/STRONG>$3/go;
+ #FIXME untaint web name?
- # Use alternate %Web:WikiName% syntax (versus the standard Web.WikiName).
- # This is an old JosWiki render option. (Uncomment for JosWiki compatibility)
-# s/(^|\s|\()\%([^\s].*?[^\s]):([^\s].*?[^\s])\%/&internalLink($2,$3,"$2:$3",$1,1)/geo;
+ # get list of all topics by scanning $dataDir
+ opendir DIR, "$dataDir/$web" ;
+ my @tmpList = readdir(DIR);
+ closedir(DIR);
+
+ # this is not magic, it just looks like it.
+ my @topicList = sort
+ grep { s#^.+/([^/]+)\.txt$#$1# }
+ grep { ! -d }
+ map { "$dataDir/$web/$_" }
+ grep { ! /^\.\.?$/ } @tmpList;
+
+ # (old comment)
+ # what that does (looking from the bottom up) is take the file
+ # list, filter out the dot directories and dot files, turn the
+ # list into full paths instead of just file names, filter out
+ # any directories, strip the path back off, and sort
+ # whatever was left after all that (which should be merely a
+ # list of topic's names.)
- # Use "forced" non-WikiName links (i.e. %Linkname%)
- # This is an old JosWiki render option. (Uncomment for JosWiki compatibility)
-# s/(^|\s|\()\%([^\s].*?[^\s])\%/&internalLink($theWeb,$2,$2,$1,1)/geo;
+ return @topicList ;
+}
+#/AS
- # Use "forced" non-WikiName links (i.e. %Web.Linkname%)
- # This is an old JosWiki render option combined with the new Web.LinkName notation
- # (Uncomment for JosWiki compatibility)
-# s/(^|\s|\()\%([a-zA-Z0-9]+)\.(.*?[^\s])\%(\s|\)|$)/&internalLink($2,$3,$3,$1,1)/geo;
+# =========================
+#AS 5 Dec 2000 collect immediate subWeb names
+sub getSubWebs {
+ my ($web) = @_ ;
- return $_;
+ if (!defined $web) {
+ $web="";
}
+ #FIXME untaint web name?
+
+ # get list of all subwebs by scanning $dataDir
+ opendir DIR, "$dataDir/$web" ;
+ my @tmpList = readdir(DIR);
+ closedir(DIR);
+
+ # this is not magic, it just looks like it.
+ my @webList = sort
+ grep { s#^.+/([^/]+)$#$1# }
+ grep { -d }
+ map { "$dataDir/$web/$_" }
+ grep { ! /^\.\.?$/ } @tmpList;
+
+ # (old comment)
+ # what that does (looking from the bottom up) is take the file
+ # list, filter out the dot directories and dot files, turn the
+ # list into full paths instead of just file names, filter out
+ # any directories, strip the path back off, and sort
+ # whatever was left after all that (which should be merely a
+ # list of topic's names.)
+ return @webList ;
+}
+#/AS
# =========================
-sub extendGetRenderedVersionInsidePRE
-{
- # This is the place to define customized rendering rules
- # Called by sub getRenderedVersion, in loop inside of |