Skip to content

Commit

Permalink
Perltidied
Browse files Browse the repository at this point in the history
  • Loading branch information
jayallen committed Jul 11, 2011
1 parent a5ff603 commit 17a8ec2
Show file tree
Hide file tree
Showing 55 changed files with 2,604 additions and 2,488 deletions.
20 changes: 11 additions & 9 deletions addons/ConfigAssistant.pack/lib/ConfigAssistant/Init.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sub init_app {
# been merged with Config Assistant, so is not needed anymore.)
my $switch = $cfg->PluginSwitch || {};
$switch->{'AutoPrefs/config.yaml'} = $switch->{'AutoPrefs'} = 0;
$cfg->PluginSwitch( $switch );
$cfg->PluginSwitch($switch);

# FIXME This needs some commentary...
init_options($app);
Expand All @@ -32,14 +32,16 @@ sub init_app {

# Static files only get copied during an upgrade.
if ( $app->id eq 'upgrade' ) {

# Because no schema version is set, the upgrade process does nothing
# during the plugin's initial install. So, in order to copy static
# files on first run, we set an initial schema version which triggers
# the framework.
my $schemas = $cfg->PluginSchemaVersion || {};
my $schemas = $cfg->PluginSchemaVersion || {};
$schemas->{ $plugin->id } ||= '0.1';

# $schemas->{$plugin->id} = '0.1'; ## UNCOMMENT TO TEST UPGRADE ##
$cfg->PluginSchemaVersion( $schemas );
$cfg->PluginSchemaVersion($schemas);
}

# TODO - This should not have to reinstall a subroutine. It should invoke
Expand Down Expand Up @@ -79,9 +81,9 @@ sub init_options {
my $option
= $r->{'template_sets'}->{$set}->{'options'}->{$opt};

# To avoid option names that may collide with other
# options in other template sets settings are derived
# by combining the name of the template set and the
# To avoid option names that may collide with other
# options in other template sets settings are derived
# by combining the name of the template set and the
# option's key.
my $optname = $set . '_' . $opt;
if ( _option_exists( $sig, $optname ) ) {
Expand All @@ -91,7 +93,7 @@ sub init_options {
else {

# if ( my $default = $option->{default} ) {
# if ( !ref($default)
# if ( !ref($default)
# && ( $default =~ /^\s*sub/
# || $default =~ /^\$/)) {
# $default
Expand All @@ -110,7 +112,7 @@ sub init_options {
$obj->{'registry'}->{'settings'}->{$optname}
= { scope => 'blog', %$option, };
}
}
} ## end else [ if ( _option_exists( $sig...))]
} ## end foreach my $opt ( keys %{ $r...})
} ## end if ( $r->{'template_sets'...})
} # end foreach (@sets)
Expand Down Expand Up @@ -184,7 +186,7 @@ sub load_tags {
class => 'system',
category => 'plugin',
level => MT::Log::ERROR(),
}
}
);
}
}
Expand Down
Loading

0 comments on commit 17a8ec2

Please sign in to comment.