-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom_radio.php
33 lines (28 loc) · 1.14 KB
/
custom_radio.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
<?php
global $CFG;
require_once("$CFG->dirroot/lib/pear/HTML/QuickForm/radio.php");
class Custom_QuickForm_radio extends HTML_QuickForm_radio {
function toHtml()
{
$newLabel = '';
$result = '';
if (($this->getAttribute('id') != "rate0") and (!$this->getAttribute('noedit'))) {
$newLabel = '<label for="' . $this->getAttribute('id') . '"><i class="fa"></i></label>';
} else {
if ($this->getAttribute('noedit')) {
$result .= '<label><i class="fa"></i></label>';
if ($this->getAttribute('selected')) {
$checked = 'checked="true"';
} else {
$checked = '';
}
} else {
$checked = 'checked="true"';
}
$result .= '<input type="radio" id="' . $this->getAttribute('id') . '" name="' . $this->getAttribute('name') . '" value="' . $this->getAttribute('value') . '" '.$checked.'>';
return $result;
}
$newLabel = $newLabel. $this->_text ;
return $newLabel . HTML_QuickForm_input::toHtml();
}
}