Dotclear


Ignore:
Timestamp:
08/13/11 11:44:35 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
default
Parents:
682:5c856b1a2962 (diff), 675:7845286256ac (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Remerge themes dans default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/index.php

    r557 r683  
    1414include dirname(__FILE__).'/_default_widgets.php'; 
    1515 
    16 # Loading navigation and extra widgets 
     16# Loading navigation, extra widgets and custom widgets 
    1717$widgets_nav = null; 
    1818if ($core->blog->settings->widgets->widgets_nav) { 
     
    2323     $widgets_extra = dcWidgets::load($core->blog->settings->widgets->widgets_extra); 
    2424} 
     25$widgets_custom = null; 
     26if ($core->blog->settings->widgets->widgets_custom) { 
     27     $widgets_custom = dcWidgets::load($core->blog->settings->widgets->widgets_custom); 
     28} 
    2529 
    2630$append_combo = array( 
    2731     '-' => 0, 
    2832     __('navigation') => 'nav', 
    29      __('extra') => 'extra' 
     33     __('extra') => 'extra', 
     34     __('custom') => 'custom' 
    3035); 
    3136 
     
    3641     $addw = array(); 
    3742     foreach ($_POST['addw'] as $k => $v) { 
    38           if (($v == 'extra' || $v == 'nav') && $__widgets->{$k} !== null ) { 
     43          if (($v == 'extra' || $v == 'nav' || $v == 'custom') && $__widgets->{$k} !== null ) { 
    3944               $addw[$k] = $v; 
    4045          } 
     
    4954          if (!($widgets_extra instanceof dcWidgets)) { 
    5055               $widgets_extra = new dcWidgets(); 
     56          } 
     57          if (!($widgets_custom instanceof dcWidgets)) { 
     58               $widgets_custom = new dcWidgets(); 
    5159          } 
    5260           
     
    6068                         $widgets_extra->append($__widgets->{$k}); 
    6169                         break; 
    62                      
     70                    case 'custom': 
     71                         $widgets_custom->append($__widgets->{$k}); 
     72                         break; 
    6373               } 
    6474          } 
     
    6878               $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); 
    6979               $core->blog->settings->widgets->put('widgets_extra',$widgets_extra->store()); 
     80               $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 
    7081               $core->blog->triggerBlog(); 
    7182               http::redirect($p_url); 
     
    101112               $_POST['w']['extra'] = array(); 
    102113          } 
     114          if (!isset($_POST['w']['custom'])) { 
     115               $_POST['w']['custom'] = array(); 
     116          } 
    103117           
    104118          $widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets); 
    105119          $widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets); 
     120          $widgets_custom = dcWidgets::loadArray($_POST['w']['custom'],$__widgets); 
    106121           
    107122          $core->blog->settings->addNamespace('widgets'); 
    108123          $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); 
    109124          $core->blog->settings->widgets->put('widgets_extra',$widgets_extra->store()); 
     125          $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 
    110126          $core->blog->triggerBlog(); 
    111127           
     
    124140          $core->blog->settings->widgets->put('widgets_nav',''); 
    125141          $core->blog->settings->widgets->put('widgets_extra',''); 
     142          $core->blog->settings->widgets->put('widgets_custom',''); 
    126143          $core->blog->triggerBlog(); 
    127144           
     
    204221'</div>'; 
    205222 
     223# Custom sidebar 
     224echo 
     225'<div id="sidebarCustom" class="widgets">'. 
     226sidebarWidgets('dndcustom',__('Custom sidebar'),$widgets_custom,'custom',$__default_widgets['custom'],$j). 
     227'</div>'; 
     228 
    206229echo 
    207230'<p id="sidebarsControl">'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map