forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_form.php
151 lines (132 loc) · 7.25 KB
/
edit_form.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
/**
* Form for editing profile block settings
*
* @package block_myprofile
* @copyright 2010 Remote-Learner.net
* @author Olav Jordan <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class block_myprofile_edit_form extends block_edit_form {
protected function specific_definition($mform) {
global $CFG;
$mform->addElement('header', 'configheader', get_string('myprofile_settings', 'block_myprofile'));
$mform->addElement('selectyesno', 'config_display_picture', get_string('display_picture', 'block_myprofile'));
if (isset($this->block->config->display_picture)) {
$mform->setDefault('config_display_picture', $this->block->config->display_picture);
} else {
$mform->setDefault('config_display_picture', '1');
}
$mform->addElement('selectyesno', 'config_display_country', get_string('display_country', 'block_myprofile'));
if (isset($this->block->config->display_country)) {
$mform->setDefault('config_display_country', $this->block->config->display_country);
} else {
$mform->setDefault('config_display_country', '1');
}
$mform->addElement('selectyesno', 'config_display_city', get_string('display_city', 'block_myprofile'));
if (isset($this->block->config->display_city)) {
$mform->setDefault('config_display_city', $this->block->config->display_city);
} else {
$mform->setDefault('config_display_city', '1');
}
$mform->addElement('selectyesno', 'config_display_email', get_string('display_email', 'block_myprofile'));
if (isset($this->block->config->display_email)) {
$mform->setDefault('config_display_email', $this->block->config->display_email);
} else {
$mform->setDefault('config_display_email', '1');
}
$mform->addElement('selectyesno', 'config_display_icq', get_string('display_icq', 'block_myprofile'));
if (isset($this->block->config->display_icq)) {
$mform->setDefault('config_display_icq', $this->block->config->display_icq);
} else {
$mform->setDefault('config_display_icq', '0');
}
$mform->addElement('selectyesno', 'config_display_skype', get_string('display_skype', 'block_myprofile'));
if (isset($this->block->config->display_skype)) {
$mform->setDefault('config_display_skype', $this->block->config->display_skype);
} else {
$mform->setDefault('config_display_skype', '0');
}
$mform->addElement('selectyesno', 'config_display_yahoo', get_string('display_yahoo', 'block_myprofile'));
if (isset($this->block->config->display_yahoo)) {
$mform->setDefault('config_display_yahoo', $this->block->config->display_yahoo);
} else {
$mform->setDefault('config_display_yahoo', '0');
}
$mform->addElement('selectyesno', 'config_display_aim', get_string('display_aim', 'block_myprofile'));
if (isset($this->block->config->display_aim)) {
$mform->setDefault('config_display_aim', $this->block->config->display_aim);
} else {
$mform->setDefault('config_display_aim', '0');
}
$mform->addElement('selectyesno', 'config_display_msn', get_string('display_msn', 'block_myprofile'));
if (isset($this->block->config->display_msn)) {
$mform->setDefault('config_display_msn', $this->block->config->display_msn);
} else {
$mform->setDefault('config_display_msn', '0');
}
$mform->addElement('selectyesno', 'config_display_phone1', get_string('display_phone1', 'block_myprofile'));
if (isset($this->block->config->display_phone1)) {
$mform->setDefault('config_display_phone1', $this->block->config->display_phone1);
} else {
$mform->setDefault('config_display_phone1', '0');
}
$mform->addElement('selectyesno', 'config_display_phone2', get_string('display_phone2', 'block_myprofile'));
if (isset($this->block->config->display_phone2)) {
$mform->setDefault('config_display_phone2', $this->block->config->display_phone2);
} else {
$mform->setDefault('config_display_phone2', '0');
}
$mform->addElement('selectyesno', 'config_display_institution', get_string('display_institution', 'block_myprofile'));
if (isset($this->block->config->display_institution)) {
$mform->setDefault('config_display_institution', $this->block->config->display_institution);
} else {
$mform->setDefault('config_display_institution', '0');
}
$mform->addElement('selectyesno', 'config_display_address', get_string('display_address', 'block_myprofile'));
if (isset($this->block->config->display_address)) {
$mform->setDefault('config_display_address', $this->block->config->display_address);
} else {
$mform->setDefault('config_display_address', '0');
}
$mform->addElement('selectyesno', 'config_display_firstaccess', get_string('display_firstaccess', 'block_myprofile'));
if (isset($this->block->config->display_firstaccess)) {
$mform->setDefault('config_display_firstaccess', $this->block->config->display_firstaccess);
} else {
$mform->setDefault('config_display_firstaccess', '0');
}
$mform->addElement('selectyesno', 'config_display_lastaccess', get_string('display_lastaccess', 'block_myprofile'));
if (isset($this->block->config->display_lastaccess)) {
$mform->setDefault('config_display_lastaccess', $this->block->config->display_lastaccess);
} else {
$mform->setDefault('config_display_lastaccess', '0');
}
$mform->addElement('selectyesno', 'config_display_currentlogin', get_string('display_currentlogin', 'block_myprofile'));
if (isset($this->block->config->display_currentlogin)) {
$mform->setDefault('config_display_currentlogin', $this->block->config->display_currentlogin);
} else {
$mform->setDefault('config_display_currentlogin', '0');
}
$mform->addElement('selectyesno', 'config_display_lastip', get_string('display_lastip', 'block_myprofile'));
if (isset($this->block->config->display_lastip)) {
$mform->setDefault('config_display_lastip', $this->block->config->display_lastip);
} else {
$mform->setDefault('config_display_lastip', '0');
}
}
}