Commit 90a1c429 authored by Sylvi Low's avatar Sylvi Low Committed by Gerrit Code Review
Browse files

Upload no 'institution' site logo through admin -> institution

(Bug #1408473)

Change-Id: Ic290e4b9a17ff192334cbd6bef3b9f3b433ec702
parent 93cf7071
......@@ -378,25 +378,27 @@ if ($institution || $add) {
'options' => array_merge(array('sitedefault' => get_string('sitedefault', 'admin') . ' (' . $languages[get_config('lang')] . ')'), $languages),
'ignore' => (count($languages) < 2),
);
}
$elements['logo'] = array(
'type' => 'file',
'title' => get_string('Logo', 'admin'),
'description' => get_string('logodescription', 'admin'),
'maxfilesize' => get_max_upload_size(false),
$elements['logo'] = array(
'type' => 'file',
'title' => get_string('Logo', 'admin'),
'description' => get_string('logodescription', 'admin'),
'maxfilesize' => get_max_upload_size(false),
);
if (!empty($data->logo)) {
$logourl = get_config('wwwroot') . 'thumb.php?type=logobyid&id=' . $data->logo;
$elements['logohtml'] = array(
'type' => 'html',
'value' => '<img src="' . $logourl . '" alt="' . get_string('Logo', 'admin') . '">',
);
if (!empty($data->logo)) {
$logourl = get_config('wwwroot') . 'thumb.php?type=logobyid&id=' . $data->logo;
$elements['logohtml'] = array(
'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'),
);
}
$elements['deletelogo'] = array(
'type' => 'checkbox',
'title' => get_string('deletelogo', 'admin'),
'description' => get_string('deletelogodescription', 'admin'),
);
}
if (empty($data->name) || $data->name != 'mahara') {
if (!empty($data->style)) {
$customtheme = get_records_menu('style_property', 'style', $data->style, '', 'field,value');
}
......
......@@ -1040,8 +1040,9 @@ class Theme {
}
/**
* Displaying of the header logo
* Displaying of the header logo of an institution
* If $name is specified the site-logo-[$name].png will be returned
* The site logo will be returned if no institution logo is found and $name is not specified
*/
public function header_logo($name = false) {
if (!empty($this->headerlogo)) {
......@@ -1050,6 +1051,11 @@ class Theme {
else if ($name) {
return $this->get_url('images/site-logo-' . $name . '.png');
}
else {
if (get_config('installed') && $sitelogoid = get_field('institution', 'logo', 'name', 'mahara')) {
return get_config('wwwroot') . 'thumb.php?type=logobyid&id=' . $sitelogoid;
}
}
return $this->get_url('images/site-logo.png');
}
......
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