Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
90a1c429
Commit
90a1c429
authored
Jan 15, 2015
by
Sylvi Low
Committed by
Gerrit Code Review
Feb 16, 2015
Browse files
Upload no 'institution' site logo through admin -> institution
(Bug #1408473) Change-Id: Ic290e4b9a17ff192334cbd6bef3b9f3b433ec702
parent
93cf7071
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/institutions.php
View file @
90a1c429
...
...
@@ -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'
);
}
...
...
htdocs/lib/web.php
View file @
90a1c429
...
...
@@ -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'
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment