-
Notifications
You must be signed in to change notification settings - Fork 8
/
tag.php
66 lines (60 loc) · 2.32 KB
/
tag.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
/**
* Tag Field class for the SermonSpeaker
*
* @package SermonSpeaker
* @since 4.0
*/
class JFormFieldTag extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'Tag';
/**
* Flag to tell the field to always be in multiple values mode.
*
* @var boolean
* @since 1.6
*/
protected $forceMultiple = true;
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
$html = '';
$disabled = '';
// Add a Use Global option if useglobal="true" in XML file
if ($this->element['useglobal'] == 'true'){
$active0 = (!$this->value) ? ' checked="checked"' : '';
$active1 = ($this->value) ? ' checked="checked"' : '';
$disabled = (!$this->value) ? ' disabled="disabled"' : '';
$html .= '<input type="radio" name="'.$this->fieldname.'_radio" id="'.$this->id.'_radio0" value="0" onclick="this.form.elements[\''.$this->id.'_start\'].disabled = true; this.form.elements[\''.$this->id.'_end\'].disabled = true;"'.$active0.' /><input type="text" class="readonly" disabled="disabled" value="'.JText::_('JGLOBAL_USE_GLOBAL').'" />';
$html .= '<span class="faux-label"></span><input type="radio" name="'.$this->fieldname.'_radio" id="'.$this->id.'_radio1" value="1" onclick="this.form.elements[\''.$this->id.'_start\'].disabled = false; this.form.elements[\''.$this->id.'_end\'].disabled = false;"'.$active1.' />';
}
if (!isset($this->value[0])){
$this->value[0] = '';
}
if (!isset($this->value[1])){
$this->value[1] = '';
}
$html .= '<input type="text" size="10" name="'.$this->name.'" id="'.$this->id.'_start" value="'.htmlspecialchars($this->value[0], ENT_COMPAT, 'UTF-8').'" class="inputbox"'.$disabled.' />'
. '<span class="faux-label" style="clear:none; min-width:0px; margin-left:2px; margin-right:2px;">John 3,16</span>'
. '<input type="text" size="5" name="'.$this->name.'" id="'.$this->id.'_end" value="'.htmlspecialchars($this->value[1], ENT_COMPAT, 'UTF-8').'" class="inputbox"'.$disabled.' />'
;
return $html;
}
}