$string['currentcoursedeleting'] = 'Current course, deleting it first';
$string['currentlanguage'] = 'Current language';
$string['currentlocaltime'] = 'your current local time';
+$string['currentpicture'] = 'Current picture';
$string['currentrelease'] = 'Current release information';
$string['currentversion'] = 'Current version';
$string['databasechecking'] = 'Upgrading Moodle database from version $a->oldversion to $a->newversion...';
</td>
</tr>
<tr>
- <td colspan=2><br /><b><?php print_string("followingoptional") ?>:</b>
- <?php print_user_picture($user->id, $course->id, $user->picture, false, false, false); ?>
- </td>
+ <td colspan=2><br /><b><?php print_string("followingoptional") ?>:</b></td>
</tr>
$maxbytes = get_max_upload_file_size($CFG->maxbytes, $course->maxbytes);
if (!empty($CFG->gdversion) and $maxbytes and empty($CFG->disableuserimages)) {
?>
+<tr valign=top>
+ <td><p><?php print_string("currentpicture") ?>:</td>
+ <td>
+ <?php print_user_picture($user->id, $course->id, $user->picture, false, false, false);
+ if ($user->picture) {
+ echo ' <input type="checkbox" name="deletepicture" value="1">';
+ print_string("delete");
+ }
+ ?>
+ </td>
+</tr>
<tr valign=top>
<td><p><?php print_string("newpicture") ?>:</td>
<td>
if ($filename = valid_uploaded_file($_FILES['imagefile'])) {
$usernew->picture = save_profile_image($user->id, $filename);
set_field('user', 'picture', $usernew->picture, 'id', $user->id); /// Note picture in DB
+ } else {
+ if (!empty($usernew->deletepicture)) {
+ set_field('user', 'picture', 0, 'id', $user->id); /// Delete picture
+ $usernew->picture = 0;
+ }
}
$user = $usernew;
if ($filename = valid_uploaded_file($_FILES['imagefile'])) {
$usernew->picture = save_profile_image($user->id, $filename);
} else {
- $usernew->picture = $user->picture;
+ if (!empty($usernew->deletepicture)) {
+ set_field('user', 'picture', 0, 'id', $user->id); /// Delete picture
+ $usernew->picture = 0;
+ } else {
+ $usernew->picture = $user->picture;
+ }
}
$usernew->timemodified = time();