Fixed some bad text
[moodle.git] / user / edit.html
blob7c7ee543d8c05ce8390636cbc78f4aab4dd95d0e
1 <?php
2 if (!isset($user->htmleditor)) {
3 $user->htmleditor = 1;
5 if (!isset($user->picture)) {
6 $user->picture = NULL;
8 if (empty($user->lang)) {
9 $user->lang = $CFG->lang;
14 <form method="post" enctype="multipart/form-data" action="edit.php">
15 <table cellpadding=9 cellspacing=0 >
16 <?php
17 if (isadmin()) {
18 $theadmin = get_admin();
19 $adminself = (($theadmin->id == $USER->id) and ($USER->id == $user->id));
20 echo "<tr valign=top>";
21 echo "<td><p>".get_string("username").":</td>";
22 if ($adminself || is_internal_auth() ){
23 echo "<td><input type=\"text\" name=\"username\" size=20 value=\"";
24 p($user->username);
25 echo "\">";
26 if (isset($err["username"])) formerr($err["username"]);
27 } else {
28 echo "<td>";
29 p($user->username);
30 echo "<input type=\"hidden\" name=\"username\" value=\"";
31 p($user->username);
32 echo "\">";
34 echo "</td>";
35 echo "</tr>";
37 if ($adminself || is_internal_auth() ){
38 echo "<tr valign=top>";
39 echo "<td><p>".get_string("newpassword").":</td>";
40 echo "<td><input type=\"text\" name=\"newpassword\" size=20 value=\"";
41 if (isset($user->newpassword)) p($user->newpassword);
42 echo "\">";
43 if (isset($err["newpassword"])) {
44 formerr($err["newpassword"]);
45 } else if (empty($user->newpassword)) {
46 echo " (".get_string("leavetokeep").")";
48 echo "</td>";
49 echo "</tr>";
50 echo "<tr><td colspan=2><HR></td></tr>";
54 <tr valign=top>
55 <td><p><?php print_string("firstname") ?>:</td>
56 <td><input type="text" name="firstname" size=30 value="<?php p($user->firstname) ?>">
57 <?php if (isset($err["firstname"])) formerr($err["firstname"]); ?>
58 </td>
59 </tr>
60 <tr valign=top>
61 <td><p><?php print_string("lastname") ?>:</td>
62 <td><input type="text" name="lastname" size=30 value="<?php p($user->lastname) ?>">
63 <?php if (isset($err["lastname"])) formerr($err["lastname"]); ?>
64 </td>
65 </tr>
66 <tr valign=top>
67 <td><p><?php print_string("email") ?>:</td>
68 <td><input type="text" name="email" size=30 value="<?php p($user->email) ?>">
69 <?php if (isset($err["email"])) formerr($err["email"]); ?>
70 </td>
71 </tr>
72 <tr valign=top>
73 <td><p><?php print_string("emaildisplay") ?>:</td>
74 <td><?php
75 $choices["0"] = get_string("emaildisplayno");
76 $choices["1"] = get_string("emaildisplayyes");
77 $choices["2"] = get_string("emaildisplaycourse");
78 choose_from_menu ($choices, "maildisplay", $user->maildisplay, "") ?>
79 </td>
80 </tr>
81 <tr valign=top>
82 <td><p><?php print_string("emailformat") ?>:</td>
83 <td><?php
84 unset($choices);
85 $choices["0"] = get_string("textformat");
86 $choices["1"] = get_string("htmlformat");
87 choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
88 </td>
89 </tr>
90 <tr valign=top>
91 <td><p><?php print_string("autosubscribe") ?>:</td>
92 <td><?php
93 unset($choices);
94 $choices["1"] = get_string("autosubscribeyes");
95 $choices["0"] = get_string("autosubscribeno");
96 choose_from_menu ($choices, "autosubscribe", $user->autosubscribe, "") ?>
97 </td>
98 </tr>
99 <?php if ($CFG->htmleditor) { ?>
100 <tr valign=top>
101 <td><p><?php print_string("textediting") ?>:</td>
102 <td><?php
103 unset($choices);
104 $choices["0"] = get_string("texteditor");
105 $choices["1"] = get_string("htmleditor");
106 choose_from_menu ($choices, "htmleditor", $user->htmleditor, "") ?>
107 </td>
108 </tr>
109 <?php } ?>
110 <tr valign=top>
111 <td><p><?php print_string("city") ?>:</td>
112 <td><input type="text" name="city" size=25 value="<?php p($user->city) ?>">
113 <?php if (isset($err["city"])) formerr($err["city"]); ?>
114 </td>
115 </tr>
116 <tr valign=top>
117 <td><p><?php print_string("country") ?>:</td>
118 <td><?php
120 if (!$user->country and $CFG->country) {
121 $user->country = $CFG->country;
124 choose_from_menu (get_list_of_countries(), "country", $user->country, get_string("selectacountry")."...", "", "") ?>
125 <?php if (isset($err["country"])) formerr($err["country"]); ?>
126 </td>
127 </tr>
128 <tr valign=top>
129 <td><p><?php print_string("preferredlanguage") ?>:</td>
130 <td><?php if ($languages = get_list_of_languages()) {
131 if (!$user->lang) {
132 $user->lang = $CFG->lang;
134 choose_from_menu ($languages, "lang", $user->lang, "", "", "");
136 if (isset($err["lang"])) formerr($err["lang"]);
138 </td>
139 </tr>
140 <tr valign=top>
141 <td><p><?php print_string("timezone") ?>:</td>
142 <td><?php
143 if (abs($user->timezone) > 13) {
144 $user->timezone = 99;
146 $timenow = time();
148 for ($tz = -26; $tz <= 26; $tz++) {
149 $zone = (float)$tz/2.0;
150 $usertime = $timenow + ($tz * 1800);
151 if ($tz == 0) {
152 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
153 } else if ($tz < 0) {
154 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
155 } else {
156 $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
160 choose_from_menu ($timezones, "timezone", $user->timezone, get_string("serverlocaltime"), "", "99");
162 echo "(".get_string("currentlocaltime").")";
164 </td>
165 </tr>
166 <tr valign=top>
167 <td><p><?php print_string("userdescription") ?>:</td>
168 <td><?php if (isset($err["description"])) {
169 formerr($err["description"]);
170 echo "<br />";
171 } ?>
172 <textarea name=description cols=50 rows=10 wrap=virtual><?php p($user->description) ?></textarea>
173 <?php helpbutton("text", get_string("helptext")) ?>
174 </td>
175 </tr>
176 <tr>
177 <td colspan=2><br /><b><?php print_string("followingoptional") ?>:</b>&nbsp;&nbsp;&nbsp;
178 <?php print_user_picture($user->id, $course->id, $user->picture, false, false, false); ?>
179 </td>
180 </tr>
183 <?php
184 $maxbytes = get_max_upload_file_size($CFG->maxbytes, $course->maxbytes);
185 if (!empty($CFG->gdversion) and $maxbytes and empty($CFG->disableuserimages)) {
187 <tr valign=top>
188 <td><p><?php print_string("newpicture") ?>:</td>
189 <td>
190 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $maxbytes ?>">
191 <input type="file" name="imagefile" size=40>
192 <?php helpbutton("picture", get_string("helppicture"));
193 print_string("maxsize", "", display_size($maxbytes));
194 if (isset($err["imagefile"])) formerr($err["imagefile"]);
196 </td>
197 </tr>
198 <?php } ?>
200 <tr valign=top>
201 <td><p><?php print_string("webpage") ?>:</td>
202 <td><input type="text" name="url" size=50 value="<?php p($user->url) ?>">
203 <?php if (isset($err["url"])) formerr($err["url"]); ?>
204 </td>
205 </tr>
206 <tr valign=top>
207 <td><p><?php print_string("icqnumber") ?>:</td>
208 <td><input type="text" name="icq" size=25 value="<?php p($user->icq) ?>">
209 <?php if (isset($err["icq"])) formerr($err["icq"]); ?>
210 </td>
211 </tr>
212 <tr valign=top>
213 <td><p><?php print_string("idnumber") ?>:</td>
214 <td><input type="text" name="idnumber" size=25 value="<?php p($user->idnumber) ?>"> <?php p($teacheronly) ?>
215 <?php if (isset($err["idnumber"])) formerr($err["idnumber"]); ?>
216 </td>
217 </tr>
218 <?php if (isadmin()) { ?>
219 <tr valign=top>
220 <td><p><?php print_string("institution") ?>:</td>
221 <td><input type="text" name="institution" size=25 value="<?php p($user->institution) ?>"> <?php p($teacheronly) ?>
222 </td>
223 </tr>
224 <tr valign=top>
225 <td><p><?php print_string("department") ?>:</td>
226 <td><input type="text" name="department" size=25 value="<?php p($user->department) ?>"> <?php p($teacheronly) ?>
227 </td>
228 </tr>
229 <?php } ?>
230 <tr valign=top>
231 <td><p><?php print_string("phone") ?> 1:</td>
232 <td><input type="text" name="phone1" size=25 value="<?php p($user->phone1) ?>"> <?php p($teacheronly) ?>
233 <?php if (isset($err["phone1"])) formerr($err["phone1"]); ?>
234 </td>
235 </tr>
236 <tr valign=top>
237 <td><p><?php print_string("phone") ?> 2:</td>
238 <td><input type="text" name="phone2" size=25 value="<?php p($user->phone2) ?>"> <?php p($teacheronly) ?>
239 <?php if (isset($err["phone2"])) formerr($err["phone2"]); ?>
240 </td>
241 </tr>
242 <tr valign=top>
243 <td><p><?php print_string("address") ?>:</td>
244 <td><input type="text" name="address" size=25 value="<?php p($user->address) ?>"> <?php p($teacheronly) ?>
245 <?php if (isset($err["address"])) formerr($err["address"]); ?>
246 </td>
247 </tr>
248 <tr>
249 <td></td>
250 <td align=right><input type="submit" value="<?php print_string("updatemyprofile") ?>"></td>
251 </table>
252 <input type="hidden" name="course" value="<?php p($course->id) ?>">
253 <input type="hidden" name="id" value="<?php p($user->id) ?>">
254 </form>