Changeset 117:dbe66b29e1cd for plugins
- Timestamp:
- 05/02/11 21:38:54 (14 years ago)
- Branch:
- userprefs
- Location:
- plugins/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgets/class.widgets.php
r0 r117 220 220 } 221 221 222 public function formSettings($pr='' )222 public function formSettings($pr='',&$i=0) 223 223 { 224 224 $res = ''; 225 225 foreach ($this->settings as $id => $s) 226 226 { 227 $wfid = "wf-".$i; 227 228 $iname = $pr ? $pr.'['.$id.']' : $id; 228 229 switch ($s['type']) … … 230 231 case 'text': 231 232 $res .= 232 '<p><label >'.$s['title'].' '.233 form::field(array($iname ),20,255,html::escapeHTML($s['value']),'maximal').233 '<p><label for="'.$wfid.'">'.$s['title'].' '. 234 form::field(array($iname,$wfid),20,255,html::escapeHTML($s['value']),'maximal'). 234 235 '</label></p>'; 235 236 break; 236 237 case 'textarea': 237 238 $res .= 238 '<p><label >'.$s['title'].' '.239 form::textarea(array($iname ),30,5,html::escapeHTML($s['value']),'maximal').239 '<p><label for="'.$wfid.'">'.$s['title'].' '. 240 form::textarea(array($iname,$wfid),30,5,html::escapeHTML($s['value']),'maximal'). 240 241 '</label></p>'; 241 242 break; … … 243 244 $res .= 244 245 '<p>'.form::hidden(array($iname),'0'). 245 '<label class="classic" >'.246 form::checkbox(array($iname ),'1',$s['value']).' '.$s['title'].246 '<label class="classic" for="'.$wfid.'">'. 247 form::checkbox(array($iname,$wfid),'1',$s['value']).' '.$s['title']. 247 248 '</label></p>'; 248 249 break; 249 250 case 'combo': 250 251 $res .= 251 '<p><label>'.$s['title'].' '. 252 form::combo(array($iname),$s['options'],$s['value']). 253 '</label></p>'; 254 break; 255 } 252 '<p><label for="'.$wfid.'">'.$s['title'].' '. 253 form::combo(array($iname,$wfid),$s['options'],$s['value']). 254 '</label></p>'; 255 break; 256 } 257 $i++; 256 258 } 257 259 -
plugins/widgets/index.php
r3 r117 165 165 '<div id="widgets">'; 166 166 167 $j = 0; 167 168 foreach ($__widgets->elements(true) as $w) { 168 169 echo … … 172 173 '<p class="js-remove"><label class="classic">'.__('Append to:').' '. 173 174 form::combo(array('addw['.$w->id().']'),$append_combo).'</label></p>'. 174 '<div class="widgetSettings">'.$w->formSettings('w[void][0]' ).'</div>'.175 '<div class="widgetSettings">'.$w->formSettings('w[void][0]',$j).'</div>'. 175 176 '</div>'; 177 $j++; 176 178 } 177 179 … … 187 189 echo 188 190 '<div id="sidebarNav" class="widgets">'. 189 sidebarWidgets('dndnav',__('Navigation sidebar'),$widgets_nav,'nav',$__default_widgets['nav'] ).191 sidebarWidgets('dndnav',__('Navigation sidebar'),$widgets_nav,'nav',$__default_widgets['nav'],$j). 190 192 '</div>'; 191 193 … … 193 195 echo 194 196 '<div id="sidebarExtra" class="widgets">'. 195 sidebarWidgets('dndextra',__('Extra sidebar'),$widgets_extra,'extra',$__default_widgets['extra'] ).197 sidebarWidgets('dndextra',__('Extra sidebar'),$widgets_extra,'extra',$__default_widgets['extra'],$j). 196 198 '</div>'; 197 199 … … 262 264 dcPage::helpBlock($widget_elements); 263 265 264 function sidebarWidgets($id,$title,$widgets,$pr,$default_widgets )266 function sidebarWidgets($id,$title,$widgets,$pr,$default_widgets,&$j) 265 267 { 266 268 $res = '<fieldset><legend>'.$title.'</legend><div id="'.$id.'">'; … … 287 289 form::checkbox(array($iname.'[_rem]'),'1',0).' '.__('Remove widget'). 288 290 '</label></p>'. 289 '<div class="widgetSettings">'.$w->formSettings($iname ).'</div>'.291 '<div class="widgetSettings">'.$w->formSettings($iname,&$j).'</div>'. 290 292 '</div>'; 291 293 292 294 $i++; 295 $j++; 293 296 } 294 297
Note: See TracChangeset
for help on using the changeset viewer.