Changeset 2509:5ab9027dee05 for plugins
- Timestamp:
- 11/01/13 14:26:00 (12 years ago)
- Branch:
- 2.6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgets/index.php
r2448 r2509 53 53 } 54 54 } 55 55 56 56 # Append 1 widget 57 57 $wid = false; … … 60 60 $wid = $wid[0]; 61 61 } 62 62 63 63 # Append widgets 64 64 if (!empty($addw)) … … 73 73 $widgets_custom = new dcWidgets(); 74 74 } 75 75 76 76 foreach ($addw as $k => $v) 77 77 { … … 91 91 } 92 92 } 93 93 94 94 try { 95 95 $core->blog->settings->addNamespace('widgets'); … … 151 151 $_POST['w'] = array(); 152 152 } 153 153 154 154 try 155 155 { … … 163 163 } 164 164 } 165 165 166 166 if (!isset($_POST['w']['nav'])) { 167 167 $_POST['w']['nav'] = array(); … … 173 173 $_POST['w']['custom'] = array(); 174 174 } 175 175 176 176 $widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets); 177 177 $widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets); 178 178 $widgets_custom = dcWidgets::loadArray($_POST['w']['custom'],$__widgets); 179 179 180 180 $core->blog->settings->addNamespace('widgets'); 181 181 $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); … … 183 183 $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 184 184 $core->blog->triggerBlog(); 185 185 186 dcPage::addSuccessNotice(__('Sidebars and their widgets have been saved.')); 186 187 http::redirect($p_url); 187 188 } … … 200 201 $core->blog->settings->widgets->put('widgets_custom',''); 201 202 $core->blog->triggerBlog(); 202 203 204 dcPage::addSuccessNotice(__('Sidebars have been resetting.')); 203 205 http::redirect($p_url); 204 206 } … … 218 220 dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 219 221 ?> 220 <?php 221 $core->auth->user_prefs->addWorkspace('accessibility'); 222 <?php 223 $core->auth->user_prefs->addWorkspace('accessibility'); 222 224 $user_dm_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop; 223 225 ?> … … 304 306 ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</dt>'. 305 307 '<dd>'; 306 308 307 309 $w_settings = $w->settings(); 308 310 if (empty($w_settings)) … … 329 331 break; 330 332 } 331 333 332 334 $widget_elements->content .= 333 335 '<li>'. … … 347 349 { 348 350 $res = '<h3>'.$title.'</h3>'; 349 351 350 352 if (!($widgets instanceof dcWidgets)) 351 353 { 352 354 $widgets = $default_widgets; 353 355 } 354 356 355 357 $res .= '<ul id="'.$id.'" class="connected">'; 356 358 357 359 $res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget as far.').'</li>'; 358 360 359 361 $i = 0; 360 362 foreach ($widgets->elements() as $w) … … 364 366 $altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"'; 365 367 $altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"'; 366 368 367 369 $iname = 'w['.$pr.']['.$i.']'; 368 370 369 371 $res .= 370 372 '<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())). … … 380 382 '<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'. 381 383 '</li>'; 382 384 383 385 $i++; 384 386 $j++; 385 387 } 386 388 387 389 $res .= '</ul>'; 388 390 389 391 $res .= '<ul class="sortable-delete"'.($i > 0 ? '':' style="display: none;"').'><li class="sortable-delete-placeholder">'. 390 392 __('Drag widgets here to remove.').'</li></ul>'; 391 393 392 394 return $res; 393 395 }
Note: See TracChangeset
for help on using the changeset viewer.