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