Changeset 1062

Show
Ignore:
Timestamp:
02/16/07 21:17:19 (2 years ago)
Author:
gboggs
Message:

* Forgot to propogate these changes to the other WM dev instances...
- Used a constant instead of literal 'New Widget Manager' instances.
- Set (and reset) the widget manager name so it appears in the example, when the list is rendered.
BugId: 46726

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/wheeljack/plugins/WidgetManager/lib/WidgetManager/App.pm

    r752 r1062  
    1313@WidgetManager::App::ISA = qw( MT::App ); 
    1414use WidgetManager::Util; 
     15 
     16use constant NEW_WM => 'New Widget Manager'; 
    1517 
    1618sub init { 
     
    160162    # Load the current widgetmanager data 
    161163    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
    163165    require WidgetManager::Plugin; 
    164166    my $modulesets = $app->plugin->load_selected_modules($blog_id); 
     
    178180    $modulesets->{$q->param('name')} = $str; 
    179181 
     182    # Set the widget manager name so it appears when the list is rendered. 
     183    $q->param('widgetmanager_name', $q->param('name')); 
     184 
    180185    $app->plugin->set_config_value('modulesets',$modulesets,"blog:$blog_id"); 
    181186 
     
    199204    my @ids = $q->param('id'); 
    200205    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); 
    201209 
    202210    $app->plugin->set_config_value('modulesets',$modulesets,"blog:$blog_id"); 
     
    267275 
    268276      # Find non-conflicting name for new Widget Manager 
    269       if ($widgetmanager eq 'New Widget Manager') {  
     277      if ($widgetmanager eq NEW_WM) {  
    270278          $widgetmanager = $app->plugin->translate('Widget Manager'); 
    271279          if (grep(/^\Q$widgetmanager\E$/, @names)) { 
     
    352360          }; 
    353361      } 
    354       if ($widgetmanager eq 'New Widget Manager') { $widgetmanager = $q->param('name'); } 
     362      if ($widgetmanager eq NEW_WM) { $widgetmanager = $q->param('name'); } 
    355363 
    356364      $tmpl->param(widgetmanagers => \@widgetmanagers); 
     
    361369      $tmpl->param(rebuild           => $app->{rebuild}); 
    362370      $tmpl->param(deleted           => $app->{deleted}); 
     371      $tmpl->param(widgetmanager_name => $q->param('widgetmanager_name') || $widgetmanager); 
    363372      return $app->plugin->l10n_filter($tmpl->output); 
    364373} 
  • branches/wheeljack/plugins/WidgetManager/tmpl/list.tmpl

    r810 r1062  
    5353 
    5454<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> 
    5656 
    5757<div class="list-wrapper">