Changeset 964
- Timestamp:
- 08/18/08 15:05:07 (3 months ago)
- Files:
-
- trunk/CrossPoster/plugins/CrossPoster/CrossPoster.pl (deleted)
- trunk/CrossPoster/plugins/CrossPoster/config.yaml (added)
- trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/Account.pm (modified) (1 diff)
- trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/App/CMS.pm (modified) (7 diffs)
- trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/Cache.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/Account.pm
r938 r964 25 25 blog_id => 1, 26 26 }, 27 meta => 1,28 27 primary_key => 'id', 29 28 datasource => 'crossposter_account', trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/App/CMS.pm
r938 r964 7 7 use MT::Util qw( encode_url start_background_task ); 8 8 9 sub load_crossposter_list_filters { 10 my $plugin = MT->component('CrossPoster'); 11 my %filters; 12 my $connectors = MT->registry('crossposter_connectors'); 13 foreach my $connector_key ( keys %$connectors ) { 14 $filters{$connector_key} = { 15 label => $plugin->translate('[_1] Accounts', $connectors->{$connector_key}->{label}), 16 handler => sub { 17 my ( $terms, $args ) = @_; 18 $terms->{connector_key} = $connector_key; 19 }, 20 }; 21 } 22 my @connectors = 23 sort { $filters{$a}{label} cmp $filters{$b}{label} } keys %filters; 24 my $order = 100; 25 foreach (@connectors) { 26 $filters{$_}{order} = $order; 27 $order += 100; 28 } 29 return \%filters; 30 } 31 9 32 sub list_crossposting_account { 10 my $plugin = shift;11 33 my ($app) = @_; 12 34 my $q = $app->param; 35 my $plugin = MT->component('CrossPoster'); 13 36 my $blog_id = $q->param('blog_id'); 14 37 … … 49 72 50 73 sub edit_crossposting_account { 51 my $plugin = shift; 52 my ($app) = @_; 53 74 my ($app) = @_; 54 75 my $q = $app->param; 76 my $plugin = MT->component('CrossPoster'); 55 77 my $blog_id = $app->param('blog_id'); 56 78 my $id = $app->param('id'); … … 90 112 91 113 sub _cfg_content_nav { 92 my $plugin = shift;93 114 my ($cb, $app, $tmpl) = @_; 94 115 my $old = qq{</ul>}; … … 102 123 103 124 sub _edit_entry_param { 104 my $plugin = shift;105 125 my ($cb, $app, $param, $tmpl) = @_; 126 my $plugin = MT->component('CrossPoster'); 106 127 107 128 my $blog_id = $app->param('blog_id'); … … 199 220 200 221 sub post_save_account { 201 my $plugin = shift;202 222 my ($cb, $account) = @_; 203 223 my $app = MT->instance; 224 my $plugin = MT->component('CrossPoster'); 204 225 205 226 my $connector_class = $account->connector->{class}; … … 214 235 215 236 sub CMSPostSave_entry { 216 my $plugin = shift;217 237 my ($cb, $app, $entry) = @_; 238 my $plugin = MT->component('CrossPoster'); 218 239 219 240 my @param = $app->param(); … … 232 253 233 254 sub _cross_post { 234 my ($plugin, $cb, $app, $entry, $account_id) = @_; 255 my ($cb, $app, $entry, $account_id) = @_; 256 my $plugin = MT->component('CrossPoster'); 235 257 my ($username, $passwd, $api_url, $content, $xml_entry, $api_response); 236 258 trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/Cache.pm
r938 r964 20 20 entry_id => 1 21 21 }, 22 meta => 1,23 22 audit => 1, 24 23 primary_key => 'id',
