From: <de...@de...> - 2017-05-31 07:38:15
|
Author: HideyoImazu Date: 2017-05-31 07:29:04 +0000 (Wed, 31 May 2017) New Revision: 30343 Trac url: http://develop.twiki.org/trac/changeset/30343 Modified: twiki/trunk/core/data/TWiki/VarWEBLIST.txt twiki/trunk/core/lib/TWiki.pm Log: Item7813: WEBLIST{} to have reverse="on" parameter Modified: twiki/trunk/core/data/TWiki/VarWEBLIST.txt =================================================================== --- twiki/trunk/core/data/TWiki/VarWEBLIST.txt 2017-05-30 06:20:28 UTC (rev 30342) +++ twiki/trunk/core/data/TWiki/VarWEBLIST.txt 2017-05-31 07:29:04 UTC (rev 30343) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1486862407" format="1.1" version="$Rev$"}% +%META:TOPICINFO{author="TWikiContributor" date="1496216059" format="1.1" version="$Rev$"}% %META:TOPICPARENT{name="TWikiVariables"}% #VarWEBLIST ---+++ WEBLIST{"format"} -- index of all webs @@ -40,6 +40,7 @@ | =depth="1"= | Specify the maximum depth of recursive search. E.g. =%<nop>WEBLIST{depth="1"}%= shows only top level webs. =%<nop>WEBLIST{subwebs="Foo" depth="1"}%= shows the direct subwebs of Foo. | (no maximum depth) | | =limit="30"= | Limit number of webs to show | =""= (all) | | =overlimit="..."= | Message shown if over limit, such as: =overlimit=" * [<nop>[%<nop>SYSTEMWEB%.SiteMap][More...]]"= | =""= | + | =reverse="on"= | Reverse the order of the result. | =""= (off) | * Example: =%<nop>WEBLIST{"$listindent * [<nop>[$name.%HOMETOPIC%]]"}%= - creates a indented bullet list of all webs. * Example: =<form><select name="web"> %<nop>WEBLIST{"<option $marker value=$qname>$name</option>" webs="Trash, public" selection="%<nop>WEB%" separator=" "}% </select></form>= - creates a dropdown of all public webs + Trash web, with the current web highlighted. * Category: SearchingAndListingVariables, SystemInformationVariables Modified: twiki/trunk/core/lib/TWiki.pm =================================================================== --- twiki/trunk/core/lib/TWiki.pm 2017-05-30 06:20:28 UTC (rev 30342) +++ twiki/trunk/core/lib/TWiki.pm 2017-05-31 07:29:04 UTC (rev 30343) @@ -4800,6 +4800,7 @@ my $limit = $params->{limit} || '32000'; my $overlimit = $params->{overlimit} || ''; my $depth = $params->{depth}; + my $reverse = isTrue($params->{reverse}); if ( defined($depth) ) { if ( $depth =~ /^(\d+)/ ) { $depth = $1; @@ -4836,6 +4837,7 @@ my @items; my $indent = CGI::span({class=>'twikiWebIndent'},''); my $i = 0; + @list = reverse @list if ( $reverse ); foreach my $item ( @list ) { if( $exclude && $item =~ /^($exclude)$/ ) { next; |