1 <?php
 2  3  4  5  6  7  8 
 9 
10 defined('JPATH_PLATFORM') or die;
11 
12 JFormHelper::loadFieldClass('list');
13 
14 15 16 17 18 19 20 21 
22 class JFormFieldAccessLevel extends JFormFieldList
23 {
24     25 26 27 28 29 
30     protected $type = 'AccessLevel';
31 
32     33 34 35 36 37 38 
39     protected function getInput()
40     {
41         $attr = '';
42 
43         
44         $attr .= !empty($this->class) ? ' class="' . $this->class . '"' : '';
45         $attr .= $this->disabled ? ' disabled' : '';
46         $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
47         $attr .= $this->multiple ? ' multiple' : '';
48         $attr .= $this->required ? ' required aria-required="true"' : '';
49         $attr .= $this->autofocus ? ' autofocus' : '';
50 
51         
52         $attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
53 
54         
55         $options = $this->getOptions();
56 
57         return JHtml::_('access.level', $this->name, $this->value, $attr, $options, $this->id);
58     }
59 }
60