芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/ancien-site-2019/site/libraries/joomla/form/fields/radio.php
element['class'] ? ' class="radio '.(string) $this->element['class'].'"' : ' class="radio"'; // Start the radio field output. $html[] = '
'; // Get the field options. $options = $this->getOptions(); // Build the radio field output. foreach ($options as $i => $option) { // Initialize some option attributes. $checked = ((string) $option->value == (string) $this->value) ? ' checked="checked"' : ''; $class = !empty($option->class) ? ' class="'.$option->class.'"' : ''; $disabled = !empty($option->disable) ? ' disabled="disabled"' : ''; // Initialize some JavaScript option attributes. $onclick = !empty($option->onclick) ? ' onclick="'.$option->onclick.'"' : ''; $html[] = '
'; $html[] = '
'.JText::alt($option->text, preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)).'
'; } // End the radio field output. $html[] = '
'; return implode($html); } /** * Method to get the field options for radio buttons. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // Initialize variables. $options = array(); foreach ($this->element->children() as $option) { // Only add
elements. if ($option->getName() != 'option') { continue; } // Create a new option object based on the
element. $tmp = JHtml::_('select.option', (string) $option['value'], trim((string) $option), 'value', 'text', ((string) $option['disabled']=='true')); // Set some option attributes. $tmp->class = (string) $option['class']; // Set some JavaScript option attributes. $tmp->onclick = (string) $option['onclick']; // Add the option object to the result set. $options[] = $tmp; } reset($options); return $options; } }