Skip to content

Commit

Permalink
Item14693: depend on new TopicTitlePlugin
Browse files Browse the repository at this point in the history
Item14696: extended WebFilter to properly adhere to SITEMAPLIST and NOSEARCHALL
  • Loading branch information
MichaelDaum committed May 28, 2018
1 parent a614a4c commit cf93818
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 123 deletions.
14 changes: 7 additions & 7 deletions .gitignore
@@ -1,8 +1,8 @@
*.swp
FlexWebListPlugin.md5
FlexWebListPlugin.sha1
FlexWebListPlugin.tgz
FlexWebListPlugin.txt
FlexWebListPlugin.zip
FlexWebListPlugin_installer
FlexWebListPlugin_installer.pl
/FlexWebListPlugin.md5
/FlexWebListPlugin.sha1
/FlexWebListPlugin.tgz
/FlexWebListPlugin.txt
/FlexWebListPlugin.zip
/FlexWebListPlugin_installer
/FlexWebListPlugin_installer.pl
68 changes: 49 additions & 19 deletions data/System/FlexWebListExamples.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1437150802" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1527514311" format="1.1" version="1"}%
%META:TOPICPARENT{name="FlexWebListPlugin"}%
---+!! %TOPIC%

Expand All @@ -8,57 +8,73 @@ for a better illustration of the examples below.

%TOC%

---++ No params
---++ No params (almost)
<verbatim>
%FLEXWEBLIST%
%FLEXWEBLIST{separator=", "}%
</verbatim>
%FLEXWEBLIST%
<noautolink>
%FLEXWEBLIST{separator=", "}%
</noautolink>

---++ Influencing order
<verbatim>
%FLEXWEBLIST{webs="%USERSWEB%,public,%SYSTEMWEB%"}%
%FLEXWEBLIST{webs="%USERSWEB%,public,%SYSTEMWEB%" separator=", "}%
</verbatim>
%FLEXWEBLIST{webs="%USERSWEB%,public,%SYSTEMWEB%"}%
<noautolink>
%FLEXWEBLIST{webs="%USERSWEB%,public,%SYSTEMWEB%" separator=", "}%
</noautolink>

---++ Controlling subwebs
---+++ No subwebs
<verbatim>
%FLEXWEBLIST{subwebs="none"}%
%FLEXWEBLIST{subwebs="none" separator=", "}%
</verbatim>
%FLEXWEBLIST{subwebs="none"}%
<noautolink>
%FLEXWEBLIST{subwebs="none" separator=", "}%
</noautolink>

---+++ Only subwebs
<verbatim>
%FLEXWEBLIST{subwebs="only"}%
%FLEXWEBLIST{subwebs="only" separator=", "}%
</verbatim>
%FLEXWEBLIST{subwebs="only"}%
<noautolink>
%FLEXWEBLIST{subwebs="only" separator=", "}%
</noautolink>

---+++ Subwebs of "Sandbox"
<verbatim>
%FLEXWEBLIST{subwebs="Sandbox"}%
%FLEXWEBLIST{subwebs="Sandbox" separator=", "}%
</verbatim>
%FLEXWEBLIST{subwebs="Sandbox"}%
<noautolink>
%FLEXWEBLIST{subwebs="Sandbox" separator=", "}%
</noautolink>

---++ Using include and exclude

---+++ Exclude <nop>TestCases and Trash webs
<verbatim>
%FLEXWEBLIST{exclude="(TestCases|Trash).*" subwebs="none"}%
%FLEXWEBLIST{exclude="(TestCases|Trash).*" subwebs="none" separator=", "}%
</verbatim>
%FLEXWEBLIST{exclude="(TestCases|Trash).*" subwebs="none"}%
<noautolink>
%FLEXWEBLIST{exclude="(TestCases|Trash).*" subwebs="none" separator=", "}%
</noautolink>

---+++ Include Sandbox web and all of its subwebs
<verbatim>
%FLEXWEBLIST{include="Sandbox(/\w+)?"}%
%FLEXWEBLIST{include="Sandbox(/\w+)?" separator=", "}%
</verbatim>
%FLEXWEBLIST{include="Sandbox(/\w+)?"}%
<noautolink>
%FLEXWEBLIST{include="Sandbox(/\w+)?" separator=", "}%
</noautolink>

---++ Creating lists
---+++ Simple nested list
<verbatim>
%FLEXWEBLIST{format="$indent * [[$web.%HOMETOPIC%][$name]]$n"}%
</verbatim>
<noautolink>
%FLEXWEBLIST{format="$indent * [[$web.%HOMETOPIC%][$name]]$n"}%
</noautolink>

---+++ Nested list using HTML
<verbatim>
Expand All @@ -69,7 +85,9 @@ for a better illustration of the examples below.
footer="</li></ul>"
}%
</verbatim>
<noautolink>
%FLEXWEBLIST{header="<ul>" format="<li>[[$web.%HOMETOPIC%][$name]]" separator="</li>" footer="</li></ul>"}%
</noautolink>

---+++ Nested calls to FLEXWEBLIST
<verbatim>
Expand All @@ -84,6 +102,7 @@ for a better illustration of the examples below.
}$percnt"
}%
</verbatim>
<noautolink>
%FLEXWEBLIST{
exclude="(TestCases|Trash).*"
subwebs="none"
Expand All @@ -94,6 +113,7 @@ for a better illustration of the examples below.
format=\"$dollarindent * [[$dollarweb.%HOMETOPIC%][$dollarname]]$dollarn\"
}$percnt"
}%
</noautolink>
---+++ Twisty weblist
needs the Foswiki:Extensions/TwistyPlugin
<verbatim>
Expand All @@ -107,6 +127,7 @@ needs the Foswiki:Extensions/TwistyPlugin
footer="</li></ul>"
}%
</verbatim>
<noautolink>
%FLEXWEBLIST{
header="<ul><li>"
format="
Expand All @@ -116,17 +137,19 @@ needs the Foswiki:Extensions/TwistyPlugin
separator="$percntENDTWISTY$percnt</li><li>"
footer="</li></ul>"
}%

</noautolink>

---++ Sitemap
<noautolink>
%FLEXWEBLIST{
webs="%USERSWEB%,public,%SYSTEMWEB%"
webs="sitemap"
header="<div class=\"header\">"
format="<div class=\"web\">
[[$web.%HOMETOPIC%][$name]] $percntVAR{\"WEBSUMMARY\" web=\"$web\"}$percnt
</div>"
footer="</div>"
}%
<literal>
<style type="text/css">
.web,
.header {
Expand All @@ -143,6 +166,8 @@ needs the Foswiki:Extensions/TwistyPlugin
font-weight:bold;
}
</style>
</literal>
</noautolink>

---++ Mapping names
<verbatim>
Expand All @@ -151,11 +176,12 @@ needs the Foswiki:Extensions/TwistyPlugin
format="$indent * [[$web.%HOMETOPIC%][$name]]$n"
}%
</verbatim>
<noautolink>
%FLEXWEBLIST{
map="TestCases=Tests,%SYSTEMWEB%=Documentation,%USERSWEB%=Users"
format="$indent * [[$web.%HOMETOPIC%][$name]]$n"
}%

</noautolink>

---++ Marking a selection
---+++ Using marker
Expand All @@ -167,12 +193,14 @@ needs the Foswiki:Extensions/TwistyPlugin
selection="%BASEWEB%"
}%
</verbatim>
<noautolink>
%FLEXWEBLIST{
exclude="(TestCases|Trash).*"
format="$indent * <span class=\"$marker\"> $web </span>$n"
marker="foswikiAlert"
selection="%BASEWEB%"
}%
</noautolink>
---+++ Using markerformat
<verbatim>
%FLEXWEBLIST{
Expand All @@ -183,10 +211,12 @@ needs the Foswiki:Extensions/TwistyPlugin
selection="%BASEWEB%"
}%
</verbatim>
<noautolink>
%FLEXWEBLIST{
exclude="(TestCases|Trash).*"
format="$indent * [[$web.%HOMETOPIC%][$name]]$n"
markerformat="$indent *
[[$web.%HOMETOPIC%][<span class=\"foswikiAlert\">$name</span>]]$n"
selection="%BASEWEB%"
}%
</noautolink>
27 changes: 13 additions & 14 deletions data/System/FlexWebListPlugin.txt
@@ -1,6 +1,6 @@
%META:TOPICINFO{author="ProjectContributor" date="1437150802" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1527514311" format="1.1" version="1"}%
---+!! <nop>%TOPIC%
%SHORTDESCRIPTION%
%FORMFIELD{"Description"}%

%TOC%

Expand All @@ -20,6 +20,7 @@ while using the specified format strings to produce the output.
Parameters:
* =webs=: a list of webs to be displayed and/or
"public" - a list of all non-hidden webs,
"sitemap" - a list of all non-hidden webs that are supposed to be listed on a sitemap,
"webtemplate" - a list of all template webs;
"publiccurrent" - a list of all non-hidden webs including the current one;
(defaults to "public")
Expand Down Expand Up @@ -136,7 +137,7 @@ The following picture illustrates when which format strings are used
---++ Examples
See [[FlexWebListExamples]] and [[FlexWebListTree]].

---++ Plugin Installation Instructions
---++ Installation Instructions
%$INSTALL_INSTRUCTIONS%

---++ Dependencies
Expand All @@ -145,6 +146,7 @@ See [[FlexWebListExamples]] and [[FlexWebListTree]].
---++ Change History

%TABLE{columnwidths="7em" tablewidth="100%"}%
| 28 May 2018: | extended !WebFilter to properly adhere to SITEMAPLIST and NOSEARCHALL |
| 17 Jul 2015: | more caching issues fixed |
| 26 Sep 2014: | fixed caching issue when using Foswiki:Extensions/VirtualHostingContrib (Foswiki:Main/MaikGlatki) |
| 28 May 2014: | !TopicTitle defaults to web name (not !WebHome) if not set otherwise |
Expand All @@ -158,7 +160,7 @@ See [[FlexWebListExamples]] and [[FlexWebListTree]].
| 17 Nov 2009: | fixed processing subwebs and marker format |
| 02 Jul 2009: | added =$color=, =$sitemapuseto=, =$sitemapwhat= and =$url=; fixed examples |
| 17 Apr 2009: | converted to foswiki |
| 03 Jul 2008: | don't blat if there's a subweb with no parent web, habbens in Trash from time to time |
| 03 Jul 2008: | don't blat if there's a subweb with no parent web, happens in Trash from time to time |
| 15 Feb 2008: | explicitly disable unwanted webs |
| 17 Jan 2008: | added treeview example based on Foswiki:Extensions/JQueryPlugin |
| 03 Jan 2008: | fixed hiding of subwebs |
Expand All @@ -180,16 +182,13 @@ See [[FlexWebListExamples]] and [[FlexWebListTree]].
| 26 Jul 2006: | first release |
| 05 Jul 2006: | initial version |

<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
%META:FIELD{name="Copyright" title="Copyright" value="2006-2015, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions/%TOPIC%"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Release" title="Release" value="%$RELEASE%"}%
%META:FIELD{name="Version" title="Version" value="%25$VERSION%25"}%
%META:FIELD{name="Release" title="Release" value="%25$RELEASE%25"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/FlexWebListPlugin"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/%TOPIC%"}%
%META:FIELD{name="Version" title="Version" value="%$VERSION%"}%
%META:FIELD{name="Copyright" title="Copyright" value="2006-2018, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions/%25TOPIC%25"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/%25TOPIC%25"}%
11 changes: 8 additions & 3 deletions lib/Foswiki/Plugins/FlexWebListPlugin.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2006-2015 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2006-2018 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -17,8 +17,8 @@ package Foswiki::Plugins::FlexWebListPlugin;
use strict;
use warnings;

our $VERSION = '2.00';
our $RELEASE = '25 Sep 2015';
our $VERSION = '2.10';
our $RELEASE = '28 May 2018';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'Flexible way to display hierarchical weblists';
our %cores = ();
Expand All @@ -36,6 +36,8 @@ sub getCore() {

# Item12972: get the core for this host; note there might be separate cores
# when using VirtualHostingContrib

# SMELL: why - cores are destroyed after each call???
my $core = $cores{$Foswiki::cfg{DefaultUrlHost}};

unless ($core) {
Expand All @@ -47,6 +49,9 @@ sub getCore() {
}

sub finishPlugin {
foreach my $core (values %cores) {
$core->reset();
}
%cores = ();
}

Expand Down

0 comments on commit cf93818

Please sign in to comment.