Skip to content

Commit

Permalink
[PATCH 16/24] Small enhancements and refinements, but largely this co…
Browse files Browse the repository at this point in the history
…mmit deals with the initial implementation of the refactoring of how plugins are configured and how users access their respective plugin conf forms.

Signed-off-by: Open Melody Software Group <admin@openmelody.org>
  • Loading branch information
byrnereese authored and Open Melody Software Group committed Nov 17, 2009
1 parent b9beda8 commit 778dd25
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 414 deletions.
6 changes: 3 additions & 3 deletions lib/MT/App/CMS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ sub core_methods {
'list_tag' => "${pkg}Tag::list",
'list_association' => "${pkg}User::list_association",
'list_role' => "${pkg}User::list_role",
'list_plugin' => "${pkg}Plugin::list_plugins",

'asset_insert' => "${pkg}Asset::insert",
'asset_userpic' => "${pkg}Asset::asset_userpic",
Expand All @@ -86,15 +87,14 @@ sub core_methods {
'cfg_blog_settings' => "${pkg}Blog::cfg_blog_settings",
'cfg_plugins' => "${pkg}Plugin::cfg_plugins",

'cfg_spam' => "${pkg}Comment::cfg_spam",

# Rendered obsolete by cfg_blog_settings
# 'cfg_archives' => "${pkg}Blog::cfg_archives",
# 'cfg_web_services' => "${pkg}Blog::cfg_web_services",
# 'cfg_prefs' => "${pkg}Blog::cfg_prefs",
# 'cfg_comments' => "${pkg}Comment::cfg_comments",
# 'cfg_registration' => "${pkg}Comment::cfg_registration",
# 'cfg_entry' => "${pkg}Entry::cfg_entry",
# 'cfg_spam' => "${pkg}Comment::cfg_spam",
# 'cfg_trackbacks' => "${pkg}TrackBack::cfg_trackbacks",

## Save
Expand Down Expand Up @@ -1385,7 +1385,7 @@ sub core_menus {
'prefs:plugins' => {
label => "Plugins",
order => 110,
mode => "cfg_plugin_settings",
mode => "cfg_plugins",
view => "blog",
permission => "administer_blog",
},
Expand Down
58 changes: 32 additions & 26 deletions lib/MT/CMS/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,43 @@ package MT::CMS::Plugin;
use strict;
use MT::Util qw( remove_html );

sub list_plugins {
my $app = shift;
my $q = $app->param;
my %param;

my $cfg = $app->config;
$param{can_config} = $app->user->can_manage_plugins;
$param{use_plugins} = $cfg->UsePlugins;
$param{nav_config} = 1;
$param{nav_settings} = 1;
$param{nav_plugins} = 1;
$param{switched} = 1 if $app->param('switched');
$param{mod_perl} = 1 if $ENV{MOD_PERL};
$param{screen_id} = "list-plugins";
$param{screen_class} = "plugin-settings";
build_plugin_table( $app, param => \%param, scope => 'system' );
$app->load_tmpl( 'list_plugin.tmpl', \%param );
}

sub cfg_plugins {
my $app = shift;
my $q = $app->query;
my %param;
$param{screen_class} = 'settings-screen';
if ( $q->param('blog_id') ) {
$q->param( '_type', 'blog' );
$q->param( 'id', scalar $q->param('blog_id') );
$param{screen_id} = "list-plugins";
$param{screen_class} .= " plugin-settings";
$param{output} = 'cfg_plugin.tmpl';
$app->forward("view", \%param);
}
else {
my $cfg = $app->config;
$param{can_config} = $app->user->can_manage_plugins;
$param{use_plugins} = $cfg->UsePlugins;
build_plugin_table( $app, param => \%param, scope => 'system' );
$param{nav_config} = 1;
$param{nav_settings} = 1;
$param{nav_plugins} = 1;
$param{switched} = 1 if $q->param('switched');
$param{'reset'} = 1 if $q->param('reset');
$param{saved} = 1 if $q->param('saved');
$param{mod_perl} = 1 if $ENV{MOD_PERL};
$app->add_breadcrumb( $app->translate("Plugin Settings") );
$param{screen_id} = "list-plugins";
$param{screen_class} = "plugin-settings";

$app->load_tmpl( 'cfg_plugin.tmpl', \%param );
}

my $cfg = $app->config;
$param{can_config} = $app->user->can_manage_plugins;
$param{use_plugins} = $cfg->UsePlugins;
$param{switched} = 1 if $app->param('switched');
$param{reset} = 1 if $app->param('reset');
$param{saved} = 1 if $app->param('saved');
$param{mod_perl} = 1 if $ENV{MOD_PERL};
$param{screen_id} = "list-plugins";
$param{screen_class} = "plugin-settings";
build_plugin_table( $app, param => \%param, scope => $q->param('blog_id') ? 'blog:'.$q->param('blog_id') : 'system' );

$app->load_tmpl( 'cfg_plugin.tmpl', \%param );
}

sub save_config {
Expand Down
11 changes: 11 additions & 0 deletions mt-static/melody/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
width: 150px;
}

/* New Plugins Settings Screen */
.plugin_form {
display: none;
}
#list-plugins .plugin_form h3.plugin-name {
margin-bottom: 10px;
}
#list-plugins #main-content-inner {
border-bottom: 0;
}

/* Redesign Blog Settings */
.blog-preferences {
display: none;
Expand Down
Loading

0 comments on commit 778dd25

Please sign in to comment.