Skip to content

Commit

Permalink
[#680 state:resolved] Added a callback to DePo Clean to remove Action…
Browse files Browse the repository at this point in the history
… Streams widget if Action Streams is not installed.
  • Loading branch information
MikeThomsen committed Jan 23, 2011
1 parent 5a4d6c9 commit bd8f17c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/DePoClean.plugin/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ static_version: 1
plugin_link: http://openmelody.org
l10n_class: DePoCleanTheme::L10N

callbacks:
blog_template_set_change: $DePoClean::DePoCleanTheme::Callbacks::_ts_change

template_sets:
DePoClean_theme:
label: 'DePoClean'
Expand Down
20 changes: 20 additions & 0 deletions addons/DePoClean.plugin/lib/DePoCleanTheme/Callbacks.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package DePoCleanTheme::Callbacks;
use strict;

sub _ts_change {
my ($cb, $param) = @_;
my $blog = $param->{blog};
my $blog_template_set = $blog->template_set || '';
return 1
if 'DePoClean_theme' ne $blog_template_set;
return 1
if MT->component('ActionStreams');
my $template = MT->model('template')->load({
blog_id => $blog->id,
identifier => 'action_streams'
});

$template->remove if $template;
}

1;

0 comments on commit bd8f17c

Please sign in to comment.