Commit 10a46c98 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Provide a way to reset an uploaded institution logo (bug #805780)



The institution logo feature didn't allow institutional admins to
revert to the standard logo, so once they'd uploaded a logo, they
couldn't go back.

This adds a delete logo checkbox on the institution settings page.

Change-Id: I16f0ecc1c0b5629662d2c463778c98799914ec28
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 921930ee
......@@ -325,6 +325,11 @@ if ($institution || $add) {
'type' => 'html',
'value' => '<img src="' . $logourl . '" alt="' . get_string('Logo', 'admin') . '">',
);
$elements['deletelogo'] = array(
'type' => 'checkbox',
'title' => get_string('deletelogo', 'admin'),
'description' => get_string('deletelogodescription', 'admin'),
);
}
if (!empty($data->style)) {
$customtheme = get_records_menu('style_property', 'style', $data->style, '', 'field,value');
......@@ -708,6 +713,10 @@ function institution_submit(Pieform $form, $values) {
set_field('institution', 'logo', $id, 'name', $institution);
}
if (!empty($values['deletelogo'])) {
execute_sql("UPDATE {institution} SET logo = NULL WHERE name = ?", array($institution));
}
delete_records('institution_locked_profile_field', 'name', $institution);
foreach (ArtefactTypeProfile::get_all_fields() as $field => $type) {
if ($values[$field]) {
......
......@@ -674,6 +674,8 @@ $string['showonlineusersdesc'] = 'The online users to show to members of this in
$string['Logo'] = 'Logo';
$string['logodescription'] = 'You can upload an image here that will be displayed to your institution\'s members in place of the standard header logo. For best results this image should have the same dimensions as the site logo in your institution\'s theme.';
$string['deletelogo'] = 'Delete Logo';
$string['deletelogodescription'] = 'Revert to the standard header logo for your institution\'s theme.';
$string['customtheme'] = 'Custom theme configuration';
$string['customtheme.background'] = 'Background';
$string['customtheme.backgroundfg'] = 'Text on Background';
......
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