Author: HideyoImazu
Date: 2017-05-31 07:29:40 +0000 (Wed, 31 May 2017)
New Revision: 30344
Trac url: http://develop.twiki.org/trac/changeset/30344
Modified:
twiki/branches/TWikiRelease06x00/core/data/TWiki/VarWEBLIST.txt
twiki/branches/TWikiRelease06x00/core/lib/TWiki.pm
Log:
Item7813: WEBLIST{} to have reverse="on" parameter
Modified: twiki/branches/TWikiRelease06x00/core/data/TWiki/VarWEBLIST.txt
===================================================================
--- twiki/branches/TWikiRelease06x00/core/data/TWiki/VarWEBLIST.txt 2017-05-31 07:29:04 UTC (rev 30343)
+++ twiki/branches/TWikiRelease06x00/core/data/TWiki/VarWEBLIST.txt 2017-05-31 07:29:40 UTC (rev 30344)
@@ -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/branches/TWikiRelease06x00/core/lib/TWiki.pm
===================================================================
--- twiki/branches/TWikiRelease06x00/core/lib/TWiki.pm 2017-05-31 07:29:04 UTC (rev 30343)
+++ twiki/branches/TWikiRelease06x00/core/lib/TWiki.pm 2017-05-31 07:29:40 UTC (rev 30344)
@@ -4785,6 +4785,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;
@@ -4821,6 +4822,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;
|