Dotclear

Changeset 2509:5ab9027dee05 for plugins


Ignore:
Timestamp:
11/01/13 14:26:00 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Message:

Add success messages in widgets/index.php, fixes #1834

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/index.php

    r2448 r2509  
    5353          } 
    5454     } 
    55            
     55 
    5656     # Append 1 widget 
    5757     $wid = false; 
     
    6060          $wid = $wid[0]; 
    6161     } 
    62       
     62 
    6363     # Append widgets 
    6464     if (!empty($addw)) 
     
    7373               $widgets_custom = new dcWidgets(); 
    7474          } 
    75            
     75 
    7676          foreach ($addw as $k => $v) 
    7777          { 
     
    9191               } 
    9292          } 
    93            
     93 
    9494          try { 
    9595               $core->blog->settings->addNamespace('widgets'); 
     
    151151          $_POST['w'] = array(); 
    152152     } 
    153       
     153 
    154154     try 
    155155     { 
     
    163163               } 
    164164          } 
    165            
     165 
    166166          if (!isset($_POST['w']['nav'])) { 
    167167               $_POST['w']['nav'] = array(); 
     
    173173               $_POST['w']['custom'] = array(); 
    174174          } 
    175            
     175 
    176176          $widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets); 
    177177          $widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets); 
    178178          $widgets_custom = dcWidgets::loadArray($_POST['w']['custom'],$__widgets); 
    179            
     179 
    180180          $core->blog->settings->addNamespace('widgets'); 
    181181          $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); 
     
    183183          $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 
    184184          $core->blog->triggerBlog(); 
    185            
     185 
     186          dcPage::addSuccessNotice(__('Sidebars and their widgets have been saved.')); 
    186187          http::redirect($p_url); 
    187188     } 
     
    200201          $core->blog->settings->widgets->put('widgets_custom',''); 
    201202          $core->blog->triggerBlog(); 
    202            
     203 
     204          dcPage::addSuccessNotice(__('Sidebars have been resetting.')); 
    203205          http::redirect($p_url); 
    204206     } 
     
    218220               dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 
    219221  ?> 
    220   <?php  
    221      $core->auth->user_prefs->addWorkspace('accessibility');  
     222  <?php 
     223     $core->auth->user_prefs->addWorkspace('accessibility'); 
    222224     $user_dm_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop; 
    223225  ?> 
     
    304306     ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</dt>'. 
    305307     '<dd>'; 
    306       
     308 
    307309     $w_settings = $w->settings(); 
    308310     if (empty($w_settings)) 
     
    329331                         break; 
    330332               } 
    331                 
     333 
    332334               $widget_elements->content .= 
    333335               '<li>'. 
     
    347349{ 
    348350     $res = '<h3>'.$title.'</h3>'; 
    349       
     351 
    350352     if (!($widgets instanceof dcWidgets)) 
    351353     { 
    352354          $widgets = $default_widgets; 
    353355     } 
    354       
     356 
    355357     $res .= '<ul id="'.$id.'" class="connected">'; 
    356       
     358 
    357359     $res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget as far.').'</li>'; 
    358       
     360 
    359361     $i = 0; 
    360362     foreach ($widgets->elements() as $w) 
     
    364366          $altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"'; 
    365367          $altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"'; 
    366            
     368 
    367369          $iname = 'w['.$pr.']['.$i.']'; 
    368            
     370 
    369371          $res .= 
    370372          '<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())). 
     
    380382          '<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'. 
    381383          '</li>'; 
    382            
     384 
    383385          $i++; 
    384386          $j++; 
    385387     } 
    386       
     388 
    387389     $res .= '</ul>'; 
    388       
     390 
    389391     $res .= '<ul class="sortable-delete"'.($i > 0 ? '':' style="display: none;"').'><li class="sortable-delete-placeholder">'. 
    390392               __('Drag widgets here to remove.').'</li></ul>'; 
    391       
     393 
    392394     return $res; 
    393395} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map