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 .= "<TABLE $3>";
+	    my $colOptions = $1;
+	    $colOptions =~ s/\s*c\s*\|/align="center"|/gio;
+	    $colOptions =~ s/\s*l\s*\|/align="left"|/gio;
+	    $colOptions =~ s/\s*r\s*\|/align="right"|/gio;
+	    @colOptions = split( /\s*\|\s*/, $colOptions );
+	} else {
+	    $pre .= "<TABLE border=\"1\">";
+    	    $cells = "|$cells";
+	}
+    }
+    my ($fop, @rops) = @colOptions;
+    $cells =~ s@\|$@</TD></TR>@o;
+    $cells =~ s@^\|@<TR><TD $fop>@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@\|@</TD><TD $opt>@o;
 }
-
+    $cells =~ s@\|@</TD><TD>@go;
+    return $pre . $cells;
+}
+#/AS

 # =========================
-sub extendGetRenderedVersionOutsidePRE
-{
-    # This is the place to define customized rendering rules
-    # Called by sub getRenderedVersion, in loop outside of <PRE> 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<STRONG><EM>$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 <PRE> tag
+#AS 26 Dec 2000 recursively collects all Web names
+use vars qw ($subWebsAllowedP);
+$subWebsAllowedP = 1; # 1 = subwebs allowed, 0 = flat webs
+
+sub getAllWebs {
+    # returns a list of subweb names
+    my ($web) = @_ ;

-    my( $text, $theWeb ) = @_;
+    if (!defined $web) {
+	$web="";
+    }
+    my @webList =   map { s/^\///o }
+		    map { "$web/$_" }
+		    &getSubWebs($web);
+    if ($subWebsAllowedP) {
+        my @subWebs = @webList;
+	foreach $subWeb (@webList) {
+	    push @subWebs, &getAllWebs("$subWeb");
+	}
+	return @subWebs;
+    }
+    return @webList ;
+}
+#/AS

-    # do custom extension rule, like for example:
-    # s/old/new/go;
+# =========================
+#AS moved to wikiplugins.pm and to DefaultPlugin.pm
+# sub extendHandleCommonTagsOld
+# sub extendGetRenderedVersionOutsidePREOld
+# sub extendGetRenderedVersionInsidePREOld
+#/AS

-    return $_;
-}
+1;
diff -uwbBN -x .cvsignore -x createweb ../twiki.cvs/twiki/bin/wikisearch.pm bin/wikisearch.pm
--- ../twiki.cvs/twiki/bin/wikisearch.pm	Tue Dec  5 22:40:52 2000
+++ bin/wikisearch.pm	Thu Dec 28 12:08:41 2000
@@ -87,17 +87,19 @@
     } elsif ($searchAllFlag) {

         # get list of all webs by scanning $dataDir
-        opendir DIR, $dataDir;
-        my @tmpList = readdir(DIR);
-        closedir(DIR);
-
-        # this is not magic, it just looks like it.
-        @webList = sort
-	           grep { s#^.+/([^/]+)$#$1# }
-                   grep { -d }
-	           map  { "$dataDir/$_" }
-                   grep { ! /^\.\.?$/ } @tmpList;
-
+#AS 27-12-00 changed to allow subwebs
+	@webList = &wiki::getAllWebs();
+#        opendir DIR, $dataDir;
+#        my @tmpList = readdir(DIR);
+#        closedir(DIR);
+#
+#        # this is not magic, it just looks like it.
+#        @webList = sort
+#	           grep { s#^.+/([^/]+)$#$1# }
+#                   grep { -d }
+#	           map  { "$dataDir/$_" }
+#                   grep { ! /^\.\.?$/ } @tmpList;
+#/AS
         # 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
