Skip to content

Commit

Permalink
Item11808: perltidy them all, so people are not accidentally impacted…
Browse files Browse the repository at this point in the history
… by the new enforced rule -- Sorry Micha, could not find a way to define specific values within the file

git-svn-id: http://svn.foswiki.org/trunk/WikiWorkbenchContrib@14686 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed May 4, 2012
1 parent 8a97913 commit ab3c790
Showing 1 changed file with 35 additions and 31 deletions.
66 changes: 35 additions & 31 deletions lib/Foswiki/Form/Wikiapp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,53 @@ 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;
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>';
}

$value = '<a href="%SCRIPTURLPATH{"view"}%/' . $value . '/' . $Foswiki::cfg{HomeTopicName} . '">' . $label . '</a>';
}

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

1;
Expand Down

0 comments on commit ab3c790

Please sign in to comment.