joomla-platform / libraries / joomla / html / html / select.php

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
<?php
/**
 * @package     Joomla.Platform
 * @subpackage  HTML
 *
 * @copyright   Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * Utility class for creating HTML select lists
 *
 * @static
 * @package		Joomla.Platform
 * @subpackage	HTML
 * @since		11.1
 */
abstract class JHtmlSelect
{
	/**
	 * Default values for options. Organized by option group.
	 *
	 * @var array
	 */
	static protected $_optionDefaults = array(
		'option' => array(
			'option.attr' => null,
			'option.disable' => 'disable',
			'option.id' => null,
			'option.key' => 'value',
			'option.key.toHtml' => true,
			'option.label' => null,
			'option.label.toHtml' => true,
			'option.text' => 'text',
			'option.text.toHtml' => true,
		),
	);

	/**
	* Generates a yes/no radio list.
	*
	* @param string The value of the HTML name attribute
	* @param string Additional HTML attributes for the <select> tag
	* @param mixed The key that is selected
	* @return string HTML for the radio list
	*/
	public static function booleanlist(
		$name, $attribs = null, $selected = null, $yes = 'JYES', $no = 'JNO', $id = false
	) {
		$arr = array(
			JHtml::_('select.option', '0', JText::_($no)),
			JHtml::_('select.option', '1', JText::_($yes))
		);
		return JHtml::_('select.radiolist', $arr, $name, $attribs, 'value', 'text', (int) $selected, $id);
	}

	/**
	 * Generates an HTML selection list.
	 *
	 * @param	array	An array of objects, arrays, or scalars.
	 * @param	string  The value of the HTML name attribute.
	 * @param	mixed	Additional HTML attributes for the <select> tag. This
	 * 					can be an array of attributes, or an array of options. Treated as options
	 * 					if it is the last argument passed. Valid options are:
	 * 						Format options, see {@see JHtml::$formatOptions}.
	 * 						Selection options, see {@see JHtmlSelect::options()}.
	 * 						list.attr, string|array: Additional attributes for the select
	 * 						element.
	 *						id, string: Value to use as the select element id attribute.
	 * 						Defaults to the same as the name.
	 * 						list.select, string|array: Identifies one or more option elements
	 * 							to be selected, bassed on the option key values.
	 * 						
	 * @param	string  The name of the object variable for the option value. If
	 * set to null, the index of the value array is used.
	 * @param	string  The name of the object variable for the option text.
	 * @param	mixed	The key that is selected (accepts an array or a string).
	 * 
	 * @return  string  HTML for the select list.
	 */
	public static function genericlist(
		$data, $name, $attribs = null, $optKey = 'value', $optText = 'text',
		$selected = null, $idtag = false, $translate = false
	) {
		// Set default options
		$options = array_merge(
			JHtml::$formatOptions,
			array(
				'format.depth' => 0,
				'id' => false,
			)
		);
		if (is_array($attribs) && func_num_args() == 3) {
			// Assume we have an options array
			$options = array_merge($options, $attribs);
		} else {
			// Get options from the parameters
			$options['id'] = $idtag;
			$options['list.attr'] = $attribs;
			$options['list.translate'] = $translate;
			$options['option.key'] = $optKey;
			$options['option.text'] = $optText;
			$options['list.select'] = $selected;
		}
		$attribs = '';
		if (isset($options['list.attr'])) {
			if (is_array($options['list.attr'])) {
				$attribs = JArrayHelper::toString($options['list.attr']);
			} else {
				$attribs = $options['list.attr'];
			}
			if ($attribs != '') {
				$attribs = ' ' . $attribs;
			}
		}

		$id = $options['id'] !== false ? $options['id'] : $name;
		$id = str_replace(array('[', ']'), '', $id);

		$baseIndent = str_repeat($options['format.indent'], $options['format.depth']++);
		$html = $baseIndent . '<select' . ($id !== '' ? ' id="' . $id . '"' : '')
			. ' name="' . $name . '"'
			. $attribs . '>'
			. $options['format.eol']
			. self::options($data, $options)
			. $baseIndent . '</select>'
			. $options['format.eol']
		;
		return $html;
	}

	/**
	 * Generates a grouped HTML selection list from nested arrays.
	 *
	 * @param	array	An array of groups, each of which is an array of
	 * options.
	 * @param	string  The value of the HTML name attribute
	 * @param	array	Options, an array of key/value pairs. Valid options are:
	 * 					Format options, {@see JHtml::$formatOptions}.
	 * 					Selection options. See {@see JTtmlSelect::options()}.
	 * 					group.id: The property in each group to use as the group id
	 * 					attribute. Defaults to none.
	 * 					group.label: The property in each group to use as the group
	 * 					label. Defaults to "text". If set to null, the data array index key is
	 * 					used.
	 * 					group.items: The property in each group to use as the array of
	 * 					items in the group. Defaults to "items". If set to null, group.id and
	 * 					group. label are forced to null and the data element is assumed to be a
	 * 					list of selections.
	 * 					id: Value to use as the select element id attribute. Defaults to
	 *					the same as the name.
	 * 					list.attr: Attributes for the select element. Can be a string or
	 * 					an array of key/value pairs. Defaults to none.
	 * 					list.select: either the value of one selected option or an array
	 * 					of selected options. Default: none.
	 * 					list.translate: Boolean. If set, text and labels are translated via
	 * 					JText::_().
	 * 
	 * @throws JException If a group has unprocessable contents.
	 * 
	 * @return string  HTML for the select list
	 */
	public static function groupedlist($data, $name, $options = array())
	{
		// Set default options and overwrite with anything passed in
		$options = array_merge(
			JHtml::$formatOptions,
			array(
				'format.depth' => 0,
				'group.items' => 'items',
				'group.label' => 'text',
				'group.label.toHtml' => true,
				'id' => false,
			),
			$options
		);
		// Apply option rules
		if ($options['group.items'] === null)
		{
			$options['group.label'] = null;
		}
		$attribs = '';
		if (isset($options['list.attr']))
		{
			if (is_array($options['list.attr']))
			{
				$attribs = JArrayHelper::toString($options['list.attr']);
			}
			else
			{
				$attribs = $options['list.attr'];
			}
			if ($attribs != '')
			{
				$attribs = ' ' . $attribs;
			}
		}

		$id = $options['id'] !== false ? $options['id'] : $name;
		$id = str_replace(array('[', ']'), '', $id);

		// Disable groups in the options.
		$options['groups'] = false;

		$baseIndent = str_repeat($options['format.indent'], $options['format.depth']++);
		$html = $baseIndent . '<select' . ($id !== '' ? ' id="' . $id . '"' : '')
			. ' name="' . $name . '"'
			. $attribs . '>'
			. $options['format.eol']
		;
		$groupIndent = str_repeat($options['format.indent'], $options['format.depth']++);
		foreach($data as $dataKey => $group)
		{
			$label = $dataKey;
			$id = '';
			$noGroup = is_int($dataKey);
			if ($options['group.items'] == null)
			{
				// Sub-list is an associative array
				$subList = $group;
			}
			elseif (is_array($group))
			{
				// Sub-list is in an element of an array.
				$subList = $group[$options['group.items']];
				if (isset($group[$options['group.label']]))
				{
					$label = $group[$options['group.label']];
					$noGroup = false;
				}
				if (isset($options['group.id']) && isset($group[$options['group.id']]))
				{
					$id = $group[$options['group.id']];
					$noGroup = false;
				}
			}
			elseif (is_object($group))
			{
				// Sub-list is in a property of an object
				$subList = $group->$options['group.items'];
				if (isset($group->$options['group.label']))
				{
					$label = $group->$options['group.label'];
					$noGroup = false;
				}
				if (isset($options['group.id']) && isset($group->$options['group.id']))
				{
					$id = $group->$options['group.id'];
					$noGroup = false;
				}
			}
			else
			{
				throw new JException('Invalid group contents.', 1, E_WARNING);
			}
			if($noGroup)
			{
				$html.=self::options($subList, $options);
			}
			else
			{
				$html .= $groupIndent
					. '<optgroup' . (empty($id) ? '' : ' id="' . $id . '"')
					. ' label="'
					. ($options['group.label.toHtml'] ? htmlspecialchars($label, ENT_COMPAT, 'UTF-8') : $label)
					. '">'
					. $options['format.eol']
					. self::options($subList, $options)
					. $groupIndent . '</optgroup>'
					. $options['format.eol']
				;
			}
		}
		$html .= $baseIndent . '</select>' . $options['format.eol'];

		return $html;
	}

	/**
	* Generates a selection list of integers.
	*
	* @param int The start integer
	* @param int The end integer
	* @param int The increment
	* @param string The value of the HTML name attribute
	* @param mixed Additional HTML attributes for the <select> tag, an array of
	* attributes, or an array of options. Treated as options if it is the last
	* argument passed.
	* @param mixed The key that is selected
	* @param string The printf format to be applied to the number
	* 
	* @return string HTML for the select list
	*/
	public static function integerlist(
		$start, $end, $inc, $name, $attribs = null, $selected = null, $format = ''
	) {
		// Set default options
		$options = array_merge(
			JHtml::$formatOptions,
			array(
				'format.depth' => 0,
				'option.format' => '',
				'id' => null,
			)
		);
		if (is_array($attribs) && func_num_args() == 5) {
			// Assume we have an options array
			$options = array_merge($options, $attribs);
			// Extract the format and remove it from downstream options
			$format = $options['option.format'];
			unset($options['option.format']);
		} else {
			// Get options from the parameters
			$options['list.attr'] = $attribs;
			$options['list.select'] = $selected;
		}
		$start = intval($start);
		$end = intval($end);
		$inc = intval($inc);

		$data = array();
		for ($i = $start; $i <= $end; $i += $inc)
		{
			$data[$i] = $format ? sprintf($format, $i) : $i;
		}

		// Tell genericlist() to use array keys
		$options['option.key'] = null;

		return JHtml::_('select.genericlist', $data, $name, $options);
	}

	/**
	 * Create a placeholder for an option group.
	 *
	 * @deprecated From version 1.6. See {@see JHtmlSelect::groupedList()}.
	 * @param	string  The text for the option
	 * @param	string  The returned object property name for the value
	 * @param	string  The returned object property name for the text
	 * @return  object
	 */
	public static function optgroup($text, $optKey = 'value', $optText = 'text')
	{
		// Set initial state
		static $state = 'open';

		// Toggle between open and close states:
		switch($state)
		{
			case 'open':
				$obj = new stdClass;
				$obj->$optKey = '<OPTGROUP>';
				$obj->$optText = $text;
				$state = 'close';
				break;
			case 'close':
				$obj = new stdClass;
				$obj->$optKey = '</OPTGROUP>';
				$obj->$optText = $text;
				$state = 'open';
				break;
		}

		return $obj;
	}

	/**
	 * Create an object that represents an option in an option list.
	 *
	 * @param	string  The value of the option
	 * @param	string  The text for the option
	 * @param	string|array If a string, the returned object property name for
	 * 					the value. If an array, options. Valid options are:
	 * 					attr: String|array. Additional attributes for this option.
	 * 					Defaults to none.
	 * 					disable: Boolean. If set, this option is disabled.
	 * 					label: String. The value for the option label.
	 * 					option.attr: The property in each option array to use for
	 * 					additional selection attributes. Defaults to none.
	 * 					option.disable: The property that will hold the disabled state.
	 * 					Defaults to "disable".
	 * 					option.key: The property that will hold the selection value.
	 * 					Defaults to "value".
	 * 					option.label: The property in each option array to use as the
	 * 					selection label attribute. If a "label" option is provided, defaults to
	 * 					"label", if no label is given, defaults to null (none).
	 * 					option.text: The property that will hold the the displayed text.
	 * 					Defaults to "text". If set to null, the option array is assumed to be a
	 * 					list of displayable scalars.
	 * 
	 * @param	string  The property that will hold the the displayed text. This
	 * 					parameter is ignored if an options array is passed.
	 * 
	 * @return  object
	 */
	public static function option(
		$value, $text = '', $optKey = 'value', $optText = 'text', $disable = false
	) {
		$options = array(
			'attr' => null,
			'disable' => false,
			'option.attr' => null,
			'option.disable' => 'disable',
			'option.key' => 'value',
			'option.label' => null,
			'option.text' => 'text',
		);
		if (is_array($optKey)) {
			// Merge in caller's options
			$options = array_merge($options, $optKey);
		} else {
			// Get options from the parameters
			$options['option.key'] = $optKey;
			$options['option.text'] = $optText;
			$options['disable'] = $disable;
		}
		$obj = new JObject;
		$obj->$options['option.key'] = $value;
		$obj->$options['option.text'] = trim($text) ? $text : $value;

		/*
		 * If a label is provided, save it. If no label is provided and there is
		 * a label name, initialise to an empty string.
		 */
		$hasProperty = $options['option.label'] !== null;
		if (isset($options['label'])) {
			$labelProperty = $hasProperty ? $options['option.label'] : 'label';
			$obj->$labelProperty = $options['label'];
		} elseif ($hasProperty) {
			$obj->$options['option.label'] = '';
		}

		// Set attributes only if there is a property and a value
		if ($options['attr'] !== null) {
			$obj->$options['option.attr'] = $options['attr'];
		}

		// Set disable only if it has a property and a value
		if ($options['disable'] !== null) {
			$obj->$options['option.disable'] = $options['disable'];
		}
		return $obj;
	}

	/**
	 * Generates the option tags for an HTML select list (with no select tag
	 * surrounding the options).
	 *
	 * @param	array	An array of objects, arrays, or values.
	 * @param	mixed	If a string, this is the name of the object variable for
	 * 					the option value. If null, the index of the array of objects is used. If
	 * 					an array, this is a set of options, as key/value pairs. Valid options
	 * 					are:
	 * 					Format options, {@see JHtml::$formatOptions}.
	 * 					groups: Boolean. If set, looks for keys with the value
	 * 					"&lt;optgroup>" and synthesizes groups from them. Deprecated. Defaults
	 * 					true for backwards compatibility.
	 * 					list.select: either the value of one selected option or an array
	 * 					of selected options. Default: none.
	 * 					list.translate: Boolean. If set, text and labels are translated via
	 * 					JText::_(). Default is false.
	 * 					option.id: The property in each option array to use as the
	 * 					selection id attribute. Defaults to none.
	 * 					option.key: The property in each option array to use as the
	 * 					selection value. Defaults to "value". If set to null, the index of the
	 * 					option array is used.
	 * 					option.label: The property in each option array to use as the
	 * 					selection label attribute. Defaults to null (none).
	 * 					option.text: The property in each option array to use as the
	 * 					displayed text. Defaults to "text". If set to null, the option array is
	 * 					assumed to be a list of displayable scalars.
	 * 					option.attr: The property in each option array to use for
	 * 					additional selection attributes. Defaults to none.
	 * 					option.disable: The property that will hold the disabled state.
	 * 					Defaults to "disable".
	 * 					option.key: The property that will hold the selection value.
	 * 					Defaults to "value".
	 * 					option.text: The property that will hold the the displayed text.
	 * 					Defaults to "text". If set to null, the option array is assumed to be a
	 * 					list of displayable scalars.
	 * 
	 * @param	string  The name of the object variable for the option text.
	 * @param	mixed	The key that is selected (accepts an array or a string)
	 * 
	 * @return  string  HTML for the select list
	 */
	public static function options(
		$arr, $optKey = 'value', $optText = 'text', $selected = null, $translate = false
	) {
		$options = array_merge(
			JHtml::$formatOptions,
			self::$_optionDefaults['option'],
			array(
				'format.depth' => 0,
				'groups' => true,
				'list.select' => null,
				'list.translate' => false,
			)
		);
		if (is_array($optKey)) {
			// Set default options and overwrite with anything passed in
			$options = array_merge($options, $optKey);
		} else {
			// Get options from the parameters
			$options['option.key'] = $optKey;
			$options['option.text'] = $optText;
			$options['list.select'] = $selected;
			$options['list.translate'] = $translate;
		}

		$html = '';
		$baseIndent = str_repeat($options['format.indent'], $options['format.depth']);

		foreach ($arr as $elementKey => &$element)
		{
			$attr = '';
			$extra = '';
			$label = '';
			$id = '';
			if (is_array($element))
			{
				$key = $options['option.key'] === null
					? $elementKey : $element[$options['option.key']];
				$text = $element[$options['option.text']];
				if (isset($element[$options['option.attr']])) {
					$attr = $element[$options['option.attr']];
				}
				if (isset($element[$options['option.id']])) {
					$id = $element[$options['option.id']];
				}
				if (isset($element[$options['option.label']])) {
					$label = $element[$options['option.label']];
				}
				if (isset($element[$options['option.disable']]) && $element[$options['option.disable']]) {
					$extra .= ' disabled="disabled"';
				}
			} elseif (is_object($element)) {
				$key = $options['option.key'] === null
					? $elementKey : $element->$options['option.key'];
				$text = $element->$options['option.text'];
				if (isset($element->$options['option.attr'])) {
					$attr = $element->$options['option.attr'];
				}
				if (isset($element->$options['option.id'])) {
					$id = $element->$options['option.id'];
				}
				if (isset($element->$options['option.label'])) {
					$label = $element->$options['option.label'];
				}
				if (isset($element->$options['option.disable']) && $element->$options['option.disable']) {
					$extra .= ' disabled="disabled"';
				}
			} else {
				// This is a simple associative array
				$key = $elementKey;
				$text = $element;
			}

			/*
			 * The use of options that contain optgroup HTML elements was
			 * somewhat hacked for J1.5. J1.6 introduces the grouplist() method
			 * to handle this better. The old solution is retained through the
			 * "groups" option, which defaults true in J1.6, but should be
			 * deprecated at some point in the future.
			 */
			$key = (string) $key;
			if ($options['groups'] && $key == '<OPTGROUP>') {
				$html .= $baseIndent . '<optgroup label="'
					. ($options['list.translate'] ? JText::_($text) : $text)
					. '">' . $options['format.eol'];
				$baseIndent = str_repeat($options['format.indent'], ++$options['format.depth']);
			} else if ($options['groups'] && $key == '</OPTGROUP>') {
				$baseIndent = str_repeat($options['format.indent'], --$options['format.depth']);
				$html .= $baseIndent . '</optgroup>' . $options['format.eol'];
			} else {
				// if no string after hypen - take hypen out
				$splitText = explode(' - ', $text, 2);
				$text = $splitText[0];
				if (isset($splitText[1])) {
					$text .= ' - ' . $splitText[1];
				}

				if ($options['list.translate'] && !empty($label)) {
					$label = JText::_($label);
				}
				if ($options['option.label.toHtml']) {
					$label = htmlentities($label);
				}
				if (is_array($attr)) {
					$attr = JArrayHelper::toString($attr);
				} else {
					$attr = trim($attr);
				}
				$extra = ($id ? ' id="' . $id . '"' : '')
					. ($label ? ' label="' . $label . '"' : '')
					. ($attr ? ' ' . $attr : '')
					. $extra
				;
				if (is_array($options['list.select']))
				{
					foreach ($options['list.select'] as $val)
					{
						$key2 = is_object($val) ? $val->$options['option.key'] : $val;
						if ($key == $key2) {
							$extra .= ' selected="selected"';
							break;
						}
					}
				} elseif ((string)$key == (string)$options['list.select']) {
					$extra .= ' selected="selected"';
				}

				if ($options['list.translate']) {
					$text = JText::_($text);
				}

				// Generate the option, encoding as required
				$html .= $baseIndent . '<option value="'
					. ($options['option.key.toHtml'] ? htmlspecialchars($key, ENT_COMPAT, 'UTF-8') : $key) . '"'
					. $extra . '>'
					. ($options['option.text.toHtml'] ? htmlentities(html_entity_decode($text), ENT_COMPAT, 'UTF-8') : $text)
					. '</option>'
					. $options['format.eol']
				;
			}
		}

		return $html;
	}

	/**
	* Generates an HTML radio list.
	*
	* @param array An array of objects
	* @param string The value of the HTML name attribute
	* @param string Additional HTML attributes for the <select> tag
	* @param mixed The key that is selected
	* @param string The name of the object variable for the option value
	* @param string The name of the object variable for the option text
	* 
	* @return string HTML for the select list
	*/
	public static function radiolist(
		$data, $name, $attribs = null, $optKey = 'value', $optText = 'text',
		$selected = null, $idtag = false, $translate = false
	) {
		reset($data);
		$html = '';

		if (is_array($attribs)) {
			$attribs = JArrayHelper::toString($attribs);
		}

		$id_text = $idtag ? $idtag : $name;

		foreach ($data as $ind => $obj)
		{
			$k  = $obj->$optKey;
			$t  = $translate ? JText::_($obj->$optText) : $obj->$optText;
			$id = (isset($obj->id) ? $obj->id : null);

			$extra  = '';
			$extra  .= $id ? ' id="' . $obj->id . '"' : '';
			if (is_array($selected))
			{
				foreach ($selected as $val)
				{
					$k2 = is_object($val) ? $val->$optKey : $val;
					if ($k == $k2)
					{
						$extra .= ' selected="selected"';
						break;
					}
				}
			} else {
				$extra .= ((string)$k == (string)$selected ? ' checked="checked"' : '');
			}
			$html .= "\n\t" .'<input type="radio" name="' . $name . '"'
				. ' id="' . $id_text . $k . '" value="' . $k .'"'
				. ' ' . $extra . ' ' . $attribs . '/>'
				. "\n\t" . '<label for="' . $id_text . $k . '" id="' . $id_text . $k . '-lbl" class="radiobtn-'.strtolower($obj->$optText).'">'. $t .'</label>';
		}
		$html .= "\n";
		return $html;
	}

}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.