Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
accesslevel.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Platform
4  * @subpackage Form
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die;
11 
12 JFormHelper::loadFieldClass('list');
13 
14 /**
15  * Form Field class for the Joomla Platform.
16  * Provides a list of access levels. Access levels control what users in specific
17  * groups can see.
18  *
19  * @package Joomla.Platform
20  * @subpackage Form
21  * @see JAccess
22  * @since 11.1
23  */
25 {
26  /**
27  * The form field type.
28  *
29  * @var string
30  * @since 11.1
31  */
32  protected $type = 'AccessLevel';
33 
34  /**
35  * Method to get the field input markup.
36  *
37  * @return string The field input markup.
38  *
39  * @since 11.1
40  */
41  protected function getInput()
42  {
43  $attr = '';
44 
45  // Initialize some field attributes.
46  $attr .= !empty($this->class) ? ' class="' . $this->class . '"' : '';
47  $attr .= $this->disabled ? ' disabled' : '';
48  $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
49  $attr .= $this->multiple ? ' multiple' : '';
50  $attr .= $this->required ? ' required aria-required="true"' : '';
51  $attr .= $this->autofocus ? ' autofocus' : '';
52 
53  // Initialize JavaScript field attributes.
54  $attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
55 
56  // Get the field options.
57  $options = $this->getOptions();
58 
59  return JHtml::_('access.level', $this->name, $this->value, $attr, $options, $this->id);
60  }
61 }