diff --git a/Dockerfile b/Dockerfile index 569f0a9..3d563cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM php:8-apache # Install the codebase from its GitHub release. -ARG OHMS_VIEWER_VERSION=v3.9.1 +ARG OHMS_VIEWER_VERSION=v3.10.16 ENV OHMS_VIEWER_SOURCE_URL=https://github.com/uklibraries/ohms-viewer/archive/refs/tags/${OHMS_VIEWER_VERSION}.tar.gz RUN curl -L $OHMS_VIEWER_SOURCE_URL | tar zx --strip-components=1 diff --git a/html/tmpl/viewer.tmpl.php b/html/tmpl/viewer.tmpl.php index ac6a0d1..cbfbec6 100644 --- a/html/tmpl/viewer.tmpl.php +++ b/html/tmpl/viewer.tmpl.php @@ -2,10 +2,10 @@ date_default_timezone_set($config['timezone']); $audioFormats = array('.mp3', '.wav', '.ogg', '.flac', '.m4a'); $filepath = $interview->media_url; -$mediaFormat = (strtolower($interview->clipsource) == "aviary")? $interview->aviaryMediaFormat :substr($filepath,-4, 4); -$rights = (string)$interview->rights; -$usage = (string)$interview->usage; -$acknowledgment = (string)$interview->funding; +$mediaFormat = (strtolower($interview->clipsource) == "aviary") ? $interview->aviaryMediaFormat : substr($filepath, -4, 4); +$rights = (string) $interview->rights; +$usage = (string) $interview->usage; +$acknowledgment = (string) $interview->funding; $contactemail = ''; $contactlink = ''; $copyrightholder = ''; @@ -22,17 +22,29 @@ $printMode = 0; if (isset($config['exhibit_mode']) && $config['exhibit_mode'] <> '') { $exhibitMode = $config['exhibit_mode']; -}else { +} else { $exhibitMode = 0; } if (isset($config['print_mode']) && $config['print_mode'] <> '') { $printMode = $config['print_mode']; -}else { +} else { $printMode = 0; } if (isset($config[$interview->repository])) { $repoConfig = $config[$interview->repository]; +} else { + // Fallback: Find the first nested array + foreach ($config as $key => $value) { + if (is_array($value)) { + $repoConfig = $value; + break; + } + } +} + + +if (isset($repoConfig)) { $contactemail = $repoConfig['contactemail']; $contactlink = $repoConfig['contactlink']; $copyrightholder = $repoConfig['copyrightholder']; @@ -45,476 +57,463 @@ if (isset($repoConfig['css']) && strlen($repoConfig['css']) > 0) { $extraCss = $repoConfig['css']; } - - } -$seriesLink = (string)$interview->series_link; -$collectionLink = (string)$interview->collection_link; -$lang = (string)$interview->translate; -$gaScript = null; +$seriesLink = (string) $interview->series_link; +$collectionLink = (string) $interview->collection_link; +$lang = (string) $interview->translate; + $userNotes = trim($interview->user_notes); -$heightAdjustmentClass= ""; +$heightAdjustmentClass = ""; if (!empty($userNotes)): - $heightAdjustmentClass= "adjust_height"; + $heightAdjustmentClass = "adjust_height"; endif; -if (isset($repoConfig['ga_tracking_id'])) { - $gaScript = << -(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ -(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), -m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) -})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); -ga('create', '{$repoConfig['ga_tracking_id']}', '{$repoConfig['ga_host']}'); -ga('send', 'pageview'); - -GASCRIPT; -} ?> - - - <?php echo $interview->title; ?> - - - - - - - - - - - - - - - - - - - - - "> - - - "> - - - - - - - -