Commit 2ba26ce9 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols
Browse files

change get_institution_themes to use an array of institutions



At the request of Richard Mansfield, I've changed the institution search to
support a theme accessible to multiple institutions.
Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent c340aa22
...@@ -523,7 +523,7 @@ function get_language_root($language=null) { ...@@ -523,7 +523,7 @@ function get_language_root($language=null) {
} }
/** /**
* Return a list of available themes. * Return a list of all available themes.
* @return array subdir => name * @return array subdir => name
*/ */
function get_all_themes() { function get_all_themes() {
...@@ -564,7 +564,7 @@ function get_available_themes() { ...@@ -564,7 +564,7 @@ function get_available_themes() {
else { else {
$themelist = get_all_theme_objects(); $themelist = get_all_theme_objects();
foreach ($themelist AS $subdir => $theme) { foreach ($themelist AS $subdir => $theme) {
if (empty($theme->institution)) { if (!is_array($theme->institutions)) {
$themes[$subdir] = isset($theme->displayname) ? $theme->displayname : $subdir; $themes[$subdir] = isset($theme->displayname) ? $theme->displayname : $subdir;
} }
} }
...@@ -585,7 +585,7 @@ function get_institution_themes($institution) { ...@@ -585,7 +585,7 @@ function get_institution_themes($institution) {
$themes = get_all_theme_objects(); $themes = get_all_theme_objects();
$r = array(); $r = array();
foreach ($themes AS $subdir => $theme) { foreach ($themes AS $subdir => $theme) {
if (empty($theme->institution) || $theme->institution == $institution) { if (empty($theme->institutions) || !is_array($theme->institutions) || in_array($institution, $theme->institutions)) {
$r[$subdir] = isset($theme->displayname) ? $theme->displayname : $subdir; $r[$subdir] = isset($theme->displayname) ? $theme->displayname : $subdir;
} }
} }
......
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