Changeset 1062
- Timestamp:
- 02/16/07 21:17:19 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/wheeljack/plugins/WidgetManager/lib/WidgetManager/App.pm
r752 r1062 13 13 @WidgetManager::App::ISA = qw( MT::App ); 14 14 use WidgetManager::Util; 15 16 use constant NEW_WM => 'New Widget Manager'; 15 17 16 18 sub init { … … 160 162 # Load the current widgetmanager data 161 163 my $current = $q->param('widgetmanager'); 162 $current = $q->param('name') if $current eq 'New Widget Manager';164 $current = $q->param('name') if $current eq NEW_WM; 163 165 require WidgetManager::Plugin; 164 166 my $modulesets = $app->plugin->load_selected_modules($blog_id); … … 178 180 $modulesets->{$q->param('name')} = $str; 179 181 182 # Set the widget manager name so it appears when the list is rendered. 183 $q->param('widgetmanager_name', $q->param('name')); 184 180 185 $app->plugin->set_config_value('modulesets',$modulesets,"blog:$blog_id"); 181 186 … … 199 204 my @ids = $q->param('id'); 200 205 delete $modulesets->{$_} for @ids; 206 207 # Reset the widget manager name so the default appears when the list is rendered. 208 $q->param('widgetmanager_name' => NEW_WM); 201 209 202 210 $app->plugin->set_config_value('modulesets',$modulesets,"blog:$blog_id"); … … 267 275 268 276 # Find non-conflicting name for new Widget Manager 269 if ($widgetmanager eq 'New Widget Manager') {277 if ($widgetmanager eq NEW_WM) { 270 278 $widgetmanager = $app->plugin->translate('Widget Manager'); 271 279 if (grep(/^\Q$widgetmanager\E$/, @names)) { … … 352 360 }; 353 361 } 354 if ($widgetmanager eq 'New Widget Manager') { $widgetmanager = $q->param('name'); }362 if ($widgetmanager eq NEW_WM) { $widgetmanager = $q->param('name'); } 355 363 356 364 $tmpl->param(widgetmanagers => \@widgetmanagers); … … 361 369 $tmpl->param(rebuild => $app->{rebuild}); 362 370 $tmpl->param(deleted => $app->{deleted}); 371 $tmpl->param(widgetmanager_name => $q->param('widgetmanager_name') || $widgetmanager); 363 372 return $app->plugin->l10n_filter($tmpl->output); 364 373 } branches/wheeljack/plugins/WidgetManager/tmpl/list.tmpl
r810 r1062 53 53 54 54 <p><MT_TRANS phrase="To add a Widget Manager to your templates, use the following syntax:"></p> 55 <p><MT_TRANS phrase="<strong><$MTWidgetManager name=" Name of the Widget Manager"$></strong>"></p>55 <p><MT_TRANS phrase="<strong><$MTWidgetManager name="<TMPL_VAR NAME=WIDGETMANAGER_NAME>"$></strong>"></p> 56 56 57 57 <div class="list-wrapper">
