Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
note.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 /**
13  * Form Field class for the Joomla Platform.
14  * Supports a one line text field.
15  *
16  * @package Joomla.Platform
17  * @subpackage Form
18  * @link http://www.w3.org/TR/html-markup/input.text.html#input.text
19  * @since 11.1
20  */
22 {
23  /**
24  * The form field type.
25  *
26  * @var string
27  * @since 11.1
28  */
29  protected $type = 'Note';
30 
31  /**
32  * Method to get the field label markup.
33  *
34  * @return string The field label markup.
35  *
36  * @since 11.1
37  */
38  protected function getLabel()
39  {
40  if (empty($this->element['label']) && empty($this->element['description']))
41  {
42  return '';
43  }
44 
45  $title = $this->element['label'] ? (string) $this->element['label'] : ($this->element['title'] ? (string) $this->element['title'] : '');
46  $heading = $this->element['heading'] ? (string) $this->element['heading'] : 'h4';
47  $description = (string) $this->element['description'];
48  $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
49  $close = (string) $this->element['close'];
50 
51  $html = array();
52 
53  if ($close)
54  {
55  $close = $close == 'true' ? 'alert' : $close;
56  $html[] = '<button type="button" class="close" data-dismiss="' . $close . '">&times;</button>';
57  }
58 
59  $html[] = !empty($title) ? '<' . $heading . '>' . JText::_($title) . '</' . $heading . '>' : '';
60  $html[] = !empty($description) ? JText::_($description) : '';
61 
62  return '</div><div ' . $class . '>' . implode('', $html);
63  }
64 
65  /**
66  * Method to get the field input markup.
67  *
68  * @return string The field input markup.
69  *
70  * @since 11.1
71  */
72  protected function getInput()
73  {
74  return '';
75  }
76 }