mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 19:06:41 +02:00
MDL-79705 profilefield_checkbox: display data as simple Yes/No.
This commit is contained in:
parent
23b86254d3
commit
cb32f17584
1 changed files with 2 additions and 12 deletions
|
@ -14,17 +14,10 @@
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/**
|
|
||||||
* Strings for component 'profilefield_checkbox', language 'en', branch 'MOODLE_20_STABLE'
|
|
||||||
*
|
|
||||||
* @package profilefield_checkbox
|
|
||||||
* @copyright 2008 onwards Shane Elliot {@link http://pukunui.com}
|
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class profile_field_checkbox
|
* Class profile_field_checkbox
|
||||||
*
|
*
|
||||||
|
* @package profilefield_checkbox
|
||||||
* @copyright 2008 onwards Shane Elliot {@link http://pukunui.com}
|
* @copyright 2008 onwards Shane Elliot {@link http://pukunui.com}
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
@ -52,10 +45,7 @@ class profile_field_checkbox extends profile_field_base {
|
||||||
* @return string HTML.
|
* @return string HTML.
|
||||||
*/
|
*/
|
||||||
public function display_data() {
|
public function display_data() {
|
||||||
$options = new stdClass();
|
return $this->data ? get_string('yes') : get_string('no');
|
||||||
$options->para = false;
|
|
||||||
$checked = intval($this->data) === 1 ? 'checked="checked"' : '';
|
|
||||||
return '<input disabled="disabled" type="checkbox" name="'.$this->inputname.'" '.$checked.' />';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue