Commit 6e68097c authored by Aaron Wells's avatar Aaron Wells

No need to show a different message when setting profile icon to the default

Bug 1311940: Also, a pieform button-level submit function is meant to redirect
at the end every time. And this one was not.

Change-Id: I7b71311df9aa29db9b5d7c892a0ee8b13442f7b3
parent 8c19958a
......@@ -264,7 +264,6 @@ $string['Title'] = 'Title';
$string['imagetitle'] = 'Image title';
$string['standardavatartitle'] = 'Standard or external avatar';
$string['standardavatarnote'] = 'Standard or external profile picture';
$string['usingnodefaultprofileicon'] = 'Now using no default profile picture';
$string['wrongfiletypeforblock'] = 'The file you uploaded was not the correct type for this block.';
// Unzip
......
......@@ -29,7 +29,7 @@ $settingsform = new Pieform(array(
'value' => get_string('Default', 'artefact.file'),
),
'delete' => array(
'type' => 'submit',
'type' => 'submit',
'value' => get_string('Delete', 'artefact.file'),
),
)
......@@ -292,15 +292,14 @@ function settings_submit_default(Pieform $form, $values) {
}
$USER->profileicon = $default;
$USER->commit();
$SESSION->add_ok_msg(get_string('profileiconsdefaultsetsuccessfully', 'artefact.file'));
redirect('/artefact/file/profileicons.php');
}
else {
$USER->profileicon = null;
$USER->commit();
$SESSION->add_info_msg(get_string('usingnodefaultprofileicon', 'artefact.file'));
}
$USER->commit();
$SESSION->add_ok_msg(get_string('profileiconsdefaultsetsuccessfully', 'artefact.file'));
redirect('/artefact/file/profileicons.php');
}
function settings_submit_delete(Pieform $form, $values) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment