Skip to content

Commit

Permalink
Item11808: reverting perltidy
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/WikiWorkbenchContrib@14759 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed May 7, 2012
1 parent ab3c790 commit ddd10b6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 39 deletions.
8 changes: 4 additions & 4 deletions lib/Foswiki/Contrib/WikiWorkbenchContrib/build.pl
@@ -1,12 +1,12 @@
#!/usr/bin/perl -w

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

use Foswiki::Contrib::Build;
$build = new Foswiki::Contrib::Build('WikiWorkbenchContrib');
$build->build( $build->{target} );
$build->build($build->{target});

66 changes: 31 additions & 35 deletions lib/Foswiki/Form/Wikiapp.pm
Expand Up @@ -9,53 +9,49 @@ our @ISA = ('Foswiki::Form::Select');
our $APPLICATIONS = 'Applications';

sub getOptions {
my $this = shift;
my $this = shift;

my $vals = $this->{_options};
return $vals if $vals;
my $vals = $this->{_options};
return $vals if $vals;

require Foswiki::WebFilter;
my $f = new Foswiki::WebFilter('allowed');
my @apps = ();
require Foswiki::WebFilter;
my $f = new Foswiki::WebFilter('allowed');
my @apps = ();

foreach my $app ( $Foswiki::Plugins::SESSION->deepWebList($f) ) {
next unless $app =~ /^$APPLICATIONS/;
$app =~ s/\//./g;
$app =~ s/.*\.(.+?)$/$1/;
foreach my $app ($Foswiki::Plugins::SESSION->deepWebList($f)) {
next unless $app =~ /^$APPLICATIONS/;
$app =~ s/\//./g;
$app =~ s/.*\.(.+?)$/$1/;

$app = 'WikiWorkbench' if $app eq $APPLICATIONS;
push @apps, $app;
}
$app = 'WikiWorkbench' if $app eq $APPLICATIONS;
push @apps, $app;
}

@apps = sort @apps;
unshift @apps, 'none';
@apps = sort @apps;
unshift @apps, 'none';

$this->{_options} = \@apps;
$this->{_options} = \@apps;

return $this->{_options};
return $this->{_options};
}

sub renderForDisplay {
my ( $this, $format, $value, $attrs ) = @_;

unless ( $value eq 'none' ) {
my $label = $value;

if ( $value eq 'WikiWorkbench' ) {
$value = $APPLICATIONS;
}
else {
$value = $APPLICATIONS . '.' . $value;
}

$value =
'<a href="%SCRIPTURLPATH{"view"}%/'
. $value . '/'
. $Foswiki::cfg{HomeTopicName} . '">'
. $label . '</a>';
my ($this, $format, $value, $attrs) = @_;


unless ($value eq 'none') {
my $label = $value;

if ($value eq 'WikiWorkbench') {
$value = $APPLICATIONS;
} else {
$value = $APPLICATIONS . '.' . $value;
}

return $this->SUPER::renderForDisplay( $format, $value, $attrs );
$value = '<a href="%SCRIPTURLPATH{"view"}%/' . $value . '/' . $Foswiki::cfg{HomeTopicName} . '">' . $label . '</a>';
}

return $this->SUPER::renderForDisplay($format, $value, $attrs);
}

1;
Expand Down

0 comments on commit ddd10b6

Please sign in to comment.