Changeset 665:315ff9eb4199 for plugins/widgets/index.php
- Timestamp:
- 07/31/11 10:34:58 (14 years ago)
- Branch:
- themes
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgets/index.php
r500 r665 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 … … 187 204 '</div>'. 188 205 '</fieldset>'. 189 '<p><input type="submit" class="js-remove" name="append" value="'.__(' add widgets to sidebars').'" />'.206 '<p><input type="submit" class="js-remove" name="append" value="'.__('Add widgets to sidebars').'" />'. 190 207 $core->formNonce().'</p>'. 191 208 '</form>'; … … 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">'. 208 231 $core->formNonce(). 209 '<input type="submit" name="wup" value="'.__(' update sidebars').'" /> '.210 '<input type="submit" class="reset" name="wreset" value="'.__(' reset sidebars').'" /></p>'.232 '<input type="submit" name="wup" value="'.__('Update sidebars').'" /> '. 233 '<input type="submit" class="reset" name="wreset" value="'.__('Reset sidebars').'" /></p>'. 211 234 '</form>'; 212 235
Note: See TracChangeset
for help on using the changeset viewer.