Skip to content

Commit

Permalink
Item2335: Fix up ManageOrphanePages so that it can be included from o…
Browse files Browse the repository at this point in the history
…ther webs. Added WebOrphans topics to System, Main, Sandbox and _default webs.

git-svn-id: http://svn.foswiki.org/trunk/OrphansPlugin@5444 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Nov 7, 2009
1 parent 5c99521 commit ffd7397
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 13 deletions.
3 changes: 3 additions & 0 deletions data/Main/WebOrphans.txt
@@ -0,0 +1,3 @@
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="$Rev: 4800 $"}%
%META:TOPICPARENT{name="WebManage"}%
%INCLUDE{"%SYSTEMWEB%.%TOPIC%"}%
3 changes: 3 additions & 0 deletions data/Sandbox/WebOrphans.txt
@@ -0,0 +1,3 @@
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="$Rev: 4800 $"}%
%META:TOPICPARENT{name="WebManage"}%
%INCLUDE{"%SYSTEMWEB%.%TOPIC%"}%
4 changes: 2 additions & 2 deletions data/System/ManageOrphanedPages.txt
Expand Up @@ -5,13 +5,13 @@ This page lets you search for topics in a web that are not referenced by any oth
Select the web using the form below, and choose whether to show all references to all topics, and whether to search all webs for references to topics, and hit the Go button. The resulting table shows all topics with an *delete* link that lets you delete the topic. Note that if you delete a topic, you will be navigated away from this page; you can hit "back" in your browser until you return here.

<form name="display" action="%SCRIPTURL{view}%/%WEB%/%TOPIC%">
| *Web* | <select name="qTheWeb"><option>%URLPARAM{"qTheWeb" default="%WEB%"}%</option>%WEBLIST{"<option>$name</option>" separator=" "}%</select> | Select web to search |
| *Web* | <select name="qTheWeb"><option>%URLPARAM{"qTheWeb" default="%BASEWEB%"}%</option>%WEBLIST{"<option>$name</option>" separator=" "}%</select> | Select web to search |
| *Ref counts* | <input type="checkbox" name="qAllRefs" %IF{'$qAllRefs=on' then="checked='checked'" else=""}% /> | Show reference counts for all topics in web (slower) |
| *All webs* |<input type="checkbox" name="qAllWebs" %IF{'$qAllWebs=on' then="checked='checked'" else=""}% /> | Look for references in all webs (even slower) |
| *&nbsp;* | <input type="submit" value="Go"> | Submit selection (or [[%TOPIC%][cancel]] it) |
<input type="hidden" name="qAction" value="orphans" />
</form>
%FINDORPHANS{web="%URLPARAM{"qTheWeb"}%" allrefs="%URLPARAM{"qAllRefs"}%" allwebs="%URLPARAM{"qAllWebs"}%" }%
%FINDORPHANS{web="%URLPARAM{"qTheWeb" default="%BASEWEB%"}%" allrefs="%URLPARAM{"qAllRefs"}%" allwebs="%URLPARAM{"qAllWebs"}%" }%

---
%T% For full information on the plugin that supports this page, see %SYSTEMWEB%.OrphansPlugin
4 changes: 3 additions & 1 deletion data/System/OrphansPlugin.txt
Expand Up @@ -27,7 +27,9 @@ Orphaned topics are displayed in a table, optionally with a reference count. Exa


---++ Tools
The plugin is used from a page in the %SYSTEMWEB% web, %SYSTEMWEB%.ManageOrphanedPages. Normally you should be able to get away with just this topic, though you can use the plugin from any topic in any web if you want to.
The plugin is used from a page in the %SYSTEMWEB% web, %SYSTEMWEB%.ManageOrphanedPages.

There is also %SYSTEMWEB%.WebOrphans, which may be included from a similarly named topic in other webs. By default %TOPIC% adds a WebOrphans topic to your System, Main, Sandbox and _default webs.

---++ Syntax Rules

Expand Down
3 changes: 3 additions & 0 deletions data/System/WebOrphans.txt
@@ -0,0 +1,3 @@
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="$Rev: 4109 $"}%
%META:TOPICPARENT{name="WebManage"}%
%INCLUDE{"ManageOrphanedPages"}%
3 changes: 3 additions & 0 deletions data/_default/WebOrphans.txt
@@ -0,0 +1,3 @@
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="$Rev: 4800 $"}%
%META:TOPICPARENT{name="WebManage"}%
%INCLUDE{"%SYSTEMWEB%.%TOPIC%"}%
8 changes: 6 additions & 2 deletions lib/Foswiki/Plugins/OrphansPlugin/MANIFEST
@@ -1,6 +1,10 @@
pub/System/OrphansPlugin/wikiringlogo20x20.png 0644
pub/System/OrphansPlugin/logo.png 0644
data/System/OrphansPlugin.txt 0644
data/Main/WebOrphans.txt 0644
data/Sandbox/WebOrphans.txt 0644
data/System/ManageOrphanedPages.txt 0644
data/System/WebOrphans.txt 0644
data/_default/WebOrphans.txt 0644
lib/Foswiki/Plugins/OrphansPlugin.pm 0644
lib/Foswiki/Plugins/OrphansPlugin/Orphans.pm 0644
pub/System/OrphansPlugin/logo.png 0644
pub/System/OrphansPlugin/wikiringlogo20x20.png 0644
37 changes: 29 additions & 8 deletions lib/Foswiki/Plugins/OrphansPlugin/build.pl
@@ -1,16 +1,37 @@
#!/usr/bin/perl -w
#
# Build file for OrphansPlugin
#
package OrphansPluginBuild;

# Standard preamble
use strict;

BEGIN {
foreach my $pc (split(/:/, $ENV{FOSWIKI_LIBS})) {
unshift @INC, $pc;
}
unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} );
}

use Foswiki::Contrib::Build;

$build = new Foswiki::Contrib::Build("OrphansPlugin");
# Declare our build package
package BuildBuild;
use base qw( Foswiki::Contrib::Build );

sub new {
my $class = shift;
return bless( $class->SUPER::new( "OrphansPlugin" ), $class );
}

# Example: Override the build target
sub target_build {
my $this = shift;

$this->SUPER::target_build();

# Do other build stuff here
}

package main;

# Create the build object
my $build = new BuildBuild();

# Build the target on the command line, or the default target
$build->build($build->{target});

0 comments on commit ffd7397

Please sign in to comment.