Changeset 683:b32debb0479b for plugins/widgets/index.php
- Timestamp:
- 08/13/11 11:44:35 (14 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgets/index.php
r557 r683 14 14 include dirname(__FILE__).'/_default_widgets.php'; 15 15 16 # Loading navigation and extrawidgets16 # Loading navigation, extra widgets and custom widgets 17 17 $widgets_nav = null; 18 18 if ($core->blog->settings->widgets->widgets_nav) { … … 23 23 $widgets_extra = dcWidgets::load($core->blog->settings->widgets->widgets_extra); 24 24 } 25 $widgets_custom = null; 26 if ($core->blog->settings->widgets->widgets_custom) { 27 $widgets_custom = dcWidgets::load($core->blog->settings->widgets->widgets_custom); 28 } 25 29 26 30 $append_combo = array( 27 31 '-' => 0, 28 32 __('navigation') => 'nav', 29 __('extra') => 'extra' 33 __('extra') => 'extra', 34 __('custom') => 'custom' 30 35 ); 31 36 … … 36 41 $addw = array(); 37 42 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 ) { 39 44 $addw[$k] = $v; 40 45 } … … 49 54 if (!($widgets_extra instanceof dcWidgets)) { 50 55 $widgets_extra = new dcWidgets(); 56 } 57 if (!($widgets_custom instanceof dcWidgets)) { 58 $widgets_custom = new dcWidgets(); 51 59 } 52 60 … … 60 68 $widgets_extra->append($__widgets->{$k}); 61 69 break; 62 70 case 'custom': 71 $widgets_custom->append($__widgets->{$k}); 72 break; 63 73 } 64 74 } … … 68 78 $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); 69 79 $core->blog->settings->widgets->put('widgets_extra',$widgets_extra->store()); 80 $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 70 81 $core->blog->triggerBlog(); 71 82 http::redirect($p_url); … … 101 112 $_POST['w']['extra'] = array(); 102 113 } 114 if (!isset($_POST['w']['custom'])) { 115 $_POST['w']['custom'] = array(); 116 } 103 117 104 118 $widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets); 105 119 $widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets); 120 $widgets_custom = dcWidgets::loadArray($_POST['w']['custom'],$__widgets); 106 121 107 122 $core->blog->settings->addNamespace('widgets'); 108 123 $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); 109 124 $core->blog->settings->widgets->put('widgets_extra',$widgets_extra->store()); 125 $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 110 126 $core->blog->triggerBlog(); 111 127 … … 124 140 $core->blog->settings->widgets->put('widgets_nav',''); 125 141 $core->blog->settings->widgets->put('widgets_extra',''); 142 $core->blog->settings->widgets->put('widgets_custom',''); 126 143 $core->blog->triggerBlog(); 127 144 … … 204 221 '</div>'; 205 222 223 # Custom sidebar 224 echo 225 '<div id="sidebarCustom" class="widgets">'. 226 sidebarWidgets('dndcustom',__('Custom sidebar'),$widgets_custom,'custom',$__default_widgets['custom'],$j). 227 '</div>'; 228 206 229 echo 207 230 '<p id="sidebarsControl">'.
Note: See TracChangeset
for help on using the changeset viewer.