Changeset 3827:9f0c774b0866
- Timestamp:
- 08/27/18 09:16:04 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgets/class.widgets.php
r3825 r3827 274 274 return false; 275 275 } 276 } elseif ($type == 'textarea') { 277 // If any, the 4th argument should be an array (key → value) 278 $options = @func_get_arg(4); 276 // If any, the 5th argument should be an array (key → value) of opts 277 $opts = @func_get_arg(5); 278 } else { 279 // If any, the 4th argument should be an array (key → value) of opts 280 $opts = @func_get_arg(4); 279 281 } 280 282 … … 288 290 $this->settings[$name]['options'] = $options; 289 291 } 292 if (isset($opt)) { 293 $this->settings[$name]['opts'] = $opts; 294 } 290 295 } 291 296 … … 311 316 $wfid = "wf-" . $i; 312 317 $iname = $pr ? $pr . '[' . $id . ']' : $id; 318 $class = (isset($s['opts']) && isset($s['opts']['class']) ? ' ' . $s['opts']['class'] : ''); 313 319 switch ($s['type']) { 314 320 case 'text': 315 321 $res .= 316 322 '<p><label for="' . $wfid . '">' . $s['title'] . '</label> ' . 317 form::field(array($iname, $wfid), 20, 255, html::escapeHTML($s['value']), 'maximal' ) .323 form::field(array($iname, $wfid), 20, 255, html::escapeHTML($s['value']), 'maximal' . $class) . 318 324 '</p>'; 319 325 break; 320 326 case 'textarea': 321 $class = (isset($s['options']) && isset($s['options']['class']) ? ' ' . $s['options']['class'] : '');322 327 $res .= 323 328 '<p><label for="' . $wfid . '">' . $s['title'] . '</label> ' . … … 329 334 '<p>' . form::hidden(array($iname), '0') . 330 335 '<label class="classic" for="' . $wfid . '">' . 331 form::checkbox(array($iname, $wfid), '1', $s['value'] ) . ' ' . $s['title'] .336 form::checkbox(array($iname, $wfid), '1', $s['value'], $class) . ' ' . $s['title'] . 332 337 '</label></p>'; 333 338 break; … … 339 344 $res .= 340 345 '<label class="classic" for="' . $wfid . '-' . $k . '">' . 341 form::radio(array($iname, $wfid . '-' . $k), $v[1], $s['value'] == $v[1] ) . ' ' . $v[0] .346 form::radio(array($iname, $wfid . '-' . $k), $v[1], $s['value'] == $v[1], $class) . ' ' . $v[0] . 342 347 '</label>'; 343 348 } … … 348 353 $res .= 349 354 '<p><label for="' . $wfid . '">' . $s['title'] . '</label> ' . 350 form::combo(array($iname, $wfid), $s['options'], $s['value'] ) .355 form::combo(array($iname, $wfid), $s['options'], $s['value'], $class) . 351 356 '</p>'; 352 357 break;
Note: See TracChangeset
for help on using the changeset viewer.