芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/ancien-site-2019/site/libraries/joomla/form/fields/checkboxes.php
element['class'] ? ' class="checkboxes '.(string) $this->element['class'].'"' : ' class="checkboxes"'; // Start the checkbox field output. $html[] = '
'; // Get the field options. $options = $this->getOptions(); // Build the checkbox field output. $html[] = '
'; foreach ($options as $i => $option) { // Initialize some option attributes. $checked = (in_array((string) $option->value, (array) $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[] = '
'; $html[] = '
'.JText::_($option->text).'
'; $html[] = '
'; } $html[] = '
'; // End the checkbox field output. $html[] = '
'; return implode($html); } /** * Method to get the field options. * * @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; } }