1 <?php
2 3 4 5 6 7 8
9
10 defined('JPATH_PLATFORM') or die;
11
12 13 14 15 16 17 18
19 class JFormFieldNote extends JFormField
20 {
21 22 23 24 25 26
27 protected $type = 'Note';
28
29 30 31 32 33 34 35
36 protected function getLabel()
37 {
38 if (empty($this->element['label']) && empty($this->element['description']))
39 {
40 return '';
41 }
42
43 $title = $this->element['label'] ? (string) $this->element['label'] : ($this->element['title'] ? (string) $this->element['title'] : '');
44 $heading = $this->element['heading'] ? (string) $this->element['heading'] : 'h4';
45 $description = (string) $this->element['description'];
46 $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
47 $close = (string) $this->element['close'];
48
49 $html = array();
50
51 if ($close)
52 {
53 $close = $close == 'true' ? 'alert' : $close;
54 $html[] = '<button type="button" class="close" data-dismiss="' . $close . '">×</button>';
55 }
56
57 $html[] = !empty($title) ? '<' . $heading . '>' . JText::_($title) . '</' . $heading . '>' : '';
58 $html[] = !empty($description) ? JText::_($description) : '';
59
60 return '</div><div ' . $class . '>' . implode('', $html);
61 }
62
63 64 65 66 67 68 69
70 protected function getInput()
71 {
72 return '';
73 }
74 }
75