Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Retab. Remove trailing whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
finn committed Apr 6, 2010
1 parent 980549e commit 5e0a60a
Show file tree
Hide file tree
Showing 7 changed files with 1,062 additions and 1,062 deletions.
2 changes: 1 addition & 1 deletion plugins/EntryEvents/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ callbacks:
MT::App::CMS::template_param.edit_entry: $EntryEvent::EntryEvent::CMS::param_edit_entry
cms_post_save.entry: $EntryEvent::EntryEvent::CMS::post_save_entry
MT::Entry::post_remove: $EntryEvent::EntryEvent::CMS::post_remove_entry

tags:
block:
Events: $EntryEvent::EntryEvent::Tags::all_events_container
Expand Down
94 changes: 47 additions & 47 deletions plugins/EntryEvents/lib/EntryEvent/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,59 @@ use base 'MT::App';
use JSON;

sub init {
my $app = shift;
$app->SUPER::init(@_) or return;
$app->add_methods(
events => \&events,
);
$app->{default_mode} = 'events';
$app;
my $app = shift;
$app->SUPER::init(@_) or return;
$app->add_methods(
events => \&events,
);
$app->{default_mode} = 'events';
$app;
}

sub events {
my $app = shift;
my $start_time = $app->param('start_time');
my $days = $app->param('days');
my $category_id = $app->param('category_id');

my $tmpl_id = $app->param('tmpl_id');
my $tmpl_name = $app->param('tmpl_name');

return '' unless ($tmpl_id || $tmpl_name);
my $app = shift;
my $start_time = $app->param('start_time');
my $days = $app->param('days');
my $category_id = $app->param('category_id');

require MT::Template;
require MT::Template::Context;
require MT::Builder;

my $tmpl;
if ($tmpl_name) {
$tmpl = MT::Template->load({ name => $tmpl_name });
} elsif ($tmpl_id) {
$tmpl = MT::Template->load($tmpl_id);
}
return '' unless ($tmpl);

my $ctx = new MT::Template::Context;
# we want to restrict the amt of time you can request here to a max of one week
if (!$days || $days > 7) {
$days = 7;
}

$ctx->stash('start_time', $start_time);
$ctx->stash('days', $days);
my $tmpl_id = $app->param('tmpl_id');
my $tmpl_name = $app->param('tmpl_name');

if ($category_id && $category_id =~ m/,/) {
my @ids = split(",", $category_id);
my @cats = MT::Category->load({ id => \@ids });
$ctx->stash('categories', \@cats);
} else {
my $cat = MT::Category->load($category_id);
$ctx->stash('category', $cat);
}
return '' unless ($tmpl_id || $tmpl_name);


my $page = $tmpl->build($ctx);
return $page || '';
require MT::Template;
require MT::Template::Context;
require MT::Builder;

my $tmpl;
if ($tmpl_name) {
$tmpl = MT::Template->load({ name => $tmpl_name });
} elsif ($tmpl_id) {
$tmpl = MT::Template->load($tmpl_id);
}
return '' unless ($tmpl);

my $ctx = new MT::Template::Context;
# we want to restrict the amt of time you can request here to a max of one week
if (!$days || $days > 7) {
$days = 7;
}

$ctx->stash('start_time', $start_time);
$ctx->stash('days', $days);

if ($category_id && $category_id =~ m/,/) {
my @ids = split(",", $category_id);
my @cats = MT::Category->load({ id => \@ids });
$ctx->stash('categories', \@cats);
} else {
my $cat = MT::Category->load($category_id);
$ctx->stash('category', $cat);
}


my $page = $tmpl->build($ctx);
return $page || '';
}


Expand Down
Loading

0 comments on commit 5e0a60a

Please sign in to comment.