From 67789dc24434f8e8b0ff2fe58db20e475f06f9c8 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 30 Jan 2026 14:14:34 -0500 Subject: [PATCH 1/8] add header component --- app/views/layouts/application.mustache | 1 + app/views/layouts/header.mustache | 54 ++++++++++++++++++++++++++ app/views/layouts/nav.mustache | 2 +- app/views/layouts/repo.mustache | 2 +- 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 app/views/layouts/header.mustache diff --git a/app/views/layouts/application.mustache b/app/views/layouts/application.mustache index 66196ee..a232787 100644 --- a/app/views/layouts/application.mustache +++ b/app/views/layouts/application.mustache @@ -8,6 +8,7 @@ {{#js}} {{/js}} + + + + + diff --git a/app/views/shared/limestone-resources.mustache b/app/views/shared/limestone-resources.mustache new file mode 100644 index 0000000..a455310 --- /dev/null +++ b/app/views/shared/limestone-resources.mustache @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/app/views/shared/search-brief.mustache b/app/views/shared/search-brief.mustache new file mode 100644 index 0000000..34ec51f --- /dev/null +++ b/app/views/shared/search-brief.mustache @@ -0,0 +1,21 @@ +
+
+ +
+
diff --git a/app/views/shared/universal-footer.mustache b/app/views/shared/universal-footer.mustache new file mode 100644 index 0000000..6969cb7 --- /dev/null +++ b/app/views/shared/universal-footer.mustache @@ -0,0 +1,53 @@ + + + diff --git a/app/views/layouts/header.mustache b/app/views/shared/universal-header.mustache similarity index 100% rename from app/views/layouts/header.mustache rename to app/views/shared/universal-header.mustache From d68a71fd4c306aa53999b905754fbd09d5858bf2 Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 13 Apr 2026 15:27:54 -0400 Subject: [PATCH 3/8] add components and remove unused js --- app/assets/css/extra.css | 78 +++++++++++++------ app/assets/js/manifest.txt | 2 - app/assets/js/ui.js | 5 +- app/controllers/findingaid.php | 54 ++++++------- app/controllers/overview.php | 20 +++-- app/views/findingaid/component.mustache | 51 ++++++------ .../harmful_language_statement.mustache | 2 +- app/views/findingaid/panel.mustache | 8 +- app/views/findingaid/show.mustache | 4 +- app/views/findingaid/toc.mustache | 44 ++--------- app/views/layouts/application.mustache | 68 ++++++++++++---- app/views/layouts/nav.mustache | 17 +--- 12 files changed, 189 insertions(+), 164 deletions(-) diff --git a/app/assets/css/extra.css b/app/assets/css/extra.css index 2837285..486f86e 100644 --- a/app/assets/css/extra.css +++ b/app/assets/css/extra.css @@ -1,3 +1,10 @@ +:root { + /* Limestone brand colors (names mirror Limestone's modifier classes) */ + --color-wildcat-blue: #0033a0; + --color-blue-gray: #eff4fd; + --color-cool-neutral: #dcddde; +} + .fa-request.fa-requestable-toc { display: block; margin: 0 auto; @@ -33,7 +40,6 @@ overflow-x: hidden; overflow-y: scroll; margin: 1em; - height: 10em; } .fa-options { @@ -73,29 +79,48 @@ label { float: right; } -.container-fluid { - width: 80% !important; - background-color: #ffffff !important; + + +.fa-section { + margin-bottom: 2rem; } -.panel-heading[data-toggle="collapse"] .panel-title:after { - font-family: "Glyphicons Halflings"; - color: #666; - float: right; - content: "\e114"; +.editorial .fa-section h3 { + font-size: 1.5rem; } -.panel-heading[data-toggle="collapse"].collapsed .panel-title:after { - content: "\e080"; +/* .fa-component { */ +/* background-color: #eff4fd; */ +/* padding: 1rem; */ +/* margin-bottom: 0.5rem; */ +/* } */ + +.editorial .fa-component h4 { + font-size: 1.15rem; + font-weight: 400; } -.panel-title a { - color: #337ab7 !important; +.fa-component .list-unstyled { + list-style: none; + padding-left: 0; } -.toplink { - padding: 1em; - float: right; +.fa-component .list-unstyled li { + font-size: 0.9rem; + color: #555; + padding: 0.5rem 0.75rem; + margin-bottom: 0.25rem; +} + +.fa-component img { + max-width: 150px; + max-height: 150px; +} + +.fa-component .fa-request.fa-requestable-contents { + font-size: 0.75rem; + padding: 0.15rem 0.5rem; + margin-left: 0.5rem; } .click-to-load-images, .image-overflow { @@ -153,13 +178,13 @@ a.underline-link { } a:hover.underline-link { - color:#0033A0; + color: var(--color-wildcat-blue); background-position: 0 0, 1000px 2px; } /* styling to match central webcom's in-page alert*/ .in-page-alert { - background-color: #EFF4FD; + background-color: var(--color-blue-gray); border-left: 7px solid #1E8AFF; padding: 1rem; align-items: center; @@ -170,7 +195,7 @@ a:hover.underline-link { font-size: 1.75rem; font-weight: 900; margin-top: 0; - color: #0033A0; + color: var(--color-wildcat-blue); line-height: 1.2; } .in-page-alert h3 { @@ -179,7 +204,16 @@ a:hover.underline-link { font-weight: 500; margin-bottom: 5px; margin-top: 10px; - color: #0033A0; + color: var(--color-wildcat-blue); line-height: 1.2; - -} \ No newline at end of file +} + +.heading-section { + margin: 1rem 0; +} + +@scope(.heading-section){ + .heading--display { + margin: 2rem 0; + } +} diff --git a/app/assets/js/manifest.txt b/app/assets/js/manifest.txt index 6766e6f..c57faf4 100644 --- a/app/assets/js/manifest.txt +++ b/app/assets/js/manifest.txt @@ -1,8 +1,6 @@ # List required files in the desired order mousetrap.min.js -jquery.min.js jquery-ui.min.js -bootstrap.min.js lity.min.js jquery.unveil.js reveal.js diff --git a/app/assets/js/ui.js b/app/assets/js/ui.js index 982b38d..bc8bfbe 100644 --- a/app/assets/js/ui.js +++ b/app/assets/js/ui.js @@ -4,10 +4,7 @@ var lity_open = false; var lightbox = lity(); $(document).ready(function () { - $('.toplink').click(function (e) { - $('.fa-long').animate({ scrollTop: 0 }, 'fast'); - }); - $('.click-to-play-audio').click(function () { + $('.click-to-play-audio').click(function () { var href_id = $(this).attr('data-id'); var href = $(this).attr('data-href'); $(this).after(''); diff --git a/app/controllers/findingaid.php b/app/controllers/findingaid.php index f843921..0015f8d 100644 --- a/app/controllers/findingaid.php +++ b/app/controllers/findingaid.php @@ -96,14 +96,14 @@ public function show() 'entries' => $metadata, ]; $skip = false; - } - if (array_key_exists('in_toc', $entry)) { - if ($entry['in_toc']) { - $toc_entry = [ - 'label' => fa_brevity($entry['label']), - 'id' => "fa-fields-{$panel['body_id']}-{$entry['id']}", - ]; - $toc_entries_unsorted[$entry['id']] = $toc_entry; + if (array_key_exists('in_toc', $entry)) { + if ($entry['in_toc']) { + $toc_entry = [ + 'label' => fa_brevity($entry['label']), + 'id' => "fa-fields-{$panel['body_id']}-{$entry['id']}", + ]; + $toc_entries_unsorted[$entry['id']] = $toc_entry; + } } } } @@ -281,7 +281,7 @@ public function show() } $css_hrefs = [ - "css/bootstrap.min.css", + "css/jquery-ui.min.css", "css/extra.css", "css/footer.css", @@ -295,16 +295,14 @@ public function show() } $layout = new Mustache_Engine([ - 'partials_loader' => new Mustache_Loader_FilesystemLoader( - implode( - DIRECTORY_SEPARATOR, - [ - APP, - 'views', - 'layouts', - ] - ) - ), + 'partials_loader' => new Mustache_Loader_CascadingLoader([ + new Mustache_Loader_FilesystemLoader( + implode(DIRECTORY_SEPARATOR, [APP, 'views', 'layouts']) + ), + new Mustache_Loader_FilesystemLoader( + implode(DIRECTORY_SEPARATOR, [APP, 'views', 'shared']) + ), + ]), ]); $page = $layout->render( load_template('layouts/application'), @@ -334,16 +332,14 @@ public function show() } else { $layout = new Mustache_Engine([ - 'partials_loader' => new Mustache_Loader_FilesystemLoader( - implode( - DIRECTORY_SEPARATOR, - [ - APP, - 'views', - 'layouts', - ] - ) - ), + 'partials_loader' => new Mustache_Loader_CascadingLoader([ + new Mustache_Loader_FilesystemLoader( + implode(DIRECTORY_SEPARATOR, [APP, 'views', 'layouts']) + ), + new Mustache_Loader_FilesystemLoader( + implode(DIRECTORY_SEPARATOR, [APP, 'views', 'shared']) + ), + ]), ]); $meta = $this->config->get_nonuk($id); if ($meta) { diff --git a/app/controllers/overview.php b/app/controllers/overview.php index 1eba540..95e0f8f 100644 --- a/app/controllers/overview.php +++ b/app/controllers/overview.php @@ -35,7 +35,7 @@ public function show() ]; $css_hrefs = [ - "css/bootstrap.min.css", + "css/jquery-ui.min.css", "css/extra.css", "css/footer.css", @@ -49,16 +49,14 @@ public function show() } $layout = new Mustache_Engine([ - 'partials_loader' => new Mustache_Loader_FilesystemLoader( - implode( - DIRECTORY_SEPARATOR, - [ - APP, - 'views', - 'layouts', - ] - ) - ), + 'partials_loader' => new Mustache_Loader_CascadingLoader([ + new Mustache_Loader_FilesystemLoader( + implode(DIRECTORY_SEPARATOR, [APP, 'views', 'layouts']) + ), + new Mustache_Loader_FilesystemLoader( + implode(DIRECTORY_SEPARATOR, [APP, 'views', 'shared']) + ), + ]), ]); $page = $layout->render( load_template('layouts/overview'), diff --git a/app/views/findingaid/component.mustache b/app/views/findingaid/component.mustache index 26c50ef..03a4e87 100644 --- a/app/views/findingaid/component.mustache +++ b/app/views/findingaid/component.mustache @@ -1,37 +1,40 @@ -
-
-

{{{label}}}

-
-
+
+

{{{label}}}

+
    {{#container_lists}} {{{container_list}}} {{/container_lists}}
- {{#bioghist_head}} -
{{{p}}}
- {{/bioghist_head}} - {{#bioghist}} -

{{{p}}}

- {{/bioghist}} - {{#scopecontent_head}} -
{{{p}}}
- {{/scopecontent_head}} - {{#scopecontent}} -

{{{p}}}

- {{/scopecontent}} - {{#processinfo_head}} -
{{{p}}}
- {{/processinfo_head}} - {{#processinfo}} -

{{{p}}}

- {{/processinfo}} +
+ {{#bioghist_head}} +
{{{p}}}
+ {{/bioghist_head}} + {{#bioghist}} +

{{{p}}}

+ {{/bioghist}} +
+
+ {{#scopecontent_head}} +
{{{p}}}
+ {{/scopecontent_head}} + {{#scopecontent}} +

{{{p}}} this is the scope content

+ {{/scopecontent}} +
+
+ {{#processinfo_head}} +
{{{p}}}
+ {{/processinfo_head}} + {{#processinfo}} +

{{{p}}} this is the process info

+ {{/processinfo}} +
{{> media}} {{#subcomponents}} {{{subcomponent}}} {{/subcomponents}} {{^subcomponents}} - To top {{/subcomponents}}
diff --git a/app/views/findingaid/harmful_language_statement.mustache b/app/views/findingaid/harmful_language_statement.mustache index c89dc2a..4b8e63e 100644 --- a/app/views/findingaid/harmful_language_statement.mustache +++ b/app/views/findingaid/harmful_language_statement.mustache @@ -1,4 +1,4 @@ -
+

You may come across language in UK Libraries Special Collections Research Center collections and online resources that you find harmful or offensive. SCRC collects materials from different cultures and time periods to preserve and make available the historical record. These materials document the time period when they were created and the view of their creator. As a result, some may demonstrate racist and offensive views that do not reflect the values of UK Libraries.

diff --git a/app/views/findingaid/panel.mustache b/app/views/findingaid/panel.mustache index f2f21c2..913b3c6 100644 --- a/app/views/findingaid/panel.mustache +++ b/app/views/findingaid/panel.mustache @@ -1,8 +1,6 @@ -
-
-

{{label}}

-
-
+
+

{{{label}}}

+
{{single-field}} {{#multi-field}}
diff --git a/app/views/findingaid/show.mustache b/app/views/findingaid/show.mustache index 3a3d141..5773226 100644 --- a/app/views/findingaid/show.mustache +++ b/app/views/findingaid/show.mustache @@ -1,6 +1,4 @@ -

{{title}}{{^title}}Welcome to ExploreUK{{/title}}

-
- +
{{#panels}} {{>panel}} {{/panels}} diff --git a/app/views/findingaid/toc.mustache b/app/views/findingaid/toc.mustache index 9372ac9..c330313 100644 --- a/app/views/findingaid/toc.mustache +++ b/app/views/findingaid/toc.mustache @@ -1,13 +1,7 @@ -
- {{#requestable}} - {{> advance_note}} - {{/requestable}} -
-
-

{{label}}

-
-
-
    +
    +
    -
+ {{#toc_component}} -
-
    +
    +
    • {{summary}} @@ -39,24 +32,3 @@ {{/toc_component}} {{> harmful_language_statement}}
    - diff --git a/app/views/layouts/application.mustache b/app/views/layouts/application.mustache index a232787..948f497 100644 --- a/app/views/layouts/application.mustache +++ b/app/views/layouts/application.mustache @@ -5,10 +5,7 @@ {{#css}} {{/css}} - {{#js}} - - {{/js}} - + {{> head-common}} + {{/js}} + + + {{#requestable}} + + {{/requestable}} + {{>viewer}} diff --git a/app/views/layouts/nav.mustache b/app/views/layouts/nav.mustache index c375d1e..c8b595f 100644 --- a/app/views/layouts/nav.mustache +++ b/app/views/layouts/nav.mustache @@ -1,14 +1,5 @@
    -
    - {{> header}} -{{#requestable}} - -{{/requestable}} -
    +{{> universal-header}} +{{> global-header}} +{{> search-brief}} +{{> breadcrumbs}} From 63fbd7fe92e5413fc5e6755f360a21a88113aa7c Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 13 Apr 2026 15:39:25 -0400 Subject: [PATCH 4/8] add button and button states for selections --- app/assets/css/extra.css | 14 ++++++++ app/assets/js/requests.js | 18 ++++++---- app/views/findingaid/requests.mustache | 50 +++++++++----------------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/app/assets/css/extra.css b/app/assets/css/extra.css index 486f86e..2ee05b8 100644 --- a/app/assets/css/extra.css +++ b/app/assets/css/extra.css @@ -162,6 +162,20 @@ label { color: #246024; } +.fa-request-summary { + background-color: var(--color-blue-gray); + padding: 1rem 1.5rem; +} +.fa-request-summary .heading--display span { + background-color: var(--color-blue-gray); +} +.fa-request-summary .accordion__header, +.fa-request-summary .accordion__header:hover, +.fa-request-summary .accordion__header:focus, +.fa-request-summary .accordion__header:active { + background-color: var(--color-blue-gray); +} + /* UK LIMESTONE STYLES */ /* styling to match Limestone's Underline Link */ a.underline-link { diff --git a/app/assets/js/requests.js b/app/assets/js/requests.js index ed4a3b3..26adc76 100644 --- a/app/assets/js/requests.js +++ b/app/assets/js/requests.js @@ -23,12 +23,15 @@ var requests = (function() { function update_count() { var count = model.get_count(); + $('.fa-request-count').text(count); if (count > 0) { if (count == 1) { $('.fa-request-summary-note').html('You are requesting 1 item.'); + $('.fa-request-announce').text('1 item selected'); } else { $('.fa-request-summary-note').html('You are requesting ' + count + ' items.'); + $('.fa-request-announce').text(count + ' items selected'); } $('.fa-request-options').removeClass('fa-request-hidden'); $('.fa-extra-options').removeClass('fa-request-hidden'); @@ -36,6 +39,7 @@ var requests = (function() { } else { $('.fa-request-summary-note').html('No items have been requested.'); + $('.fa-request-announce').text('No items selected'); $('.fa-request-options').addClass('fa-request-hidden'); $('.fa-extra-options').addClass('fa-request-hidden'); $('#fa-request-submit').addClass('fa-request-hidden'); @@ -71,8 +75,8 @@ var requests = (function() { } else { request_type = model.get_request_type(); - $('button.fa-request-option').addClass('btn-default').removeClass('btn-primary'); - $('button[data-option="' + request_type + '"]').addClass('btn-primary').removeClass('btn-default'); + $('button.fa-request-option').addClass('button--ghost').removeClass('button--wildcat-blue'); + $('button[data-option="' + request_type + '"]').addClass('button--wildcat-blue').removeClass('button--ghost'); $('div.fa-request-option').addClass('fa-request-hidden'); if (model.get_count() > 0) { $('[data-option="' + request_type + '"]').removeClass('fa-request-hidden'); @@ -91,7 +95,7 @@ var requests = (function() { if (model.has(id)) { item = model.remove(id); jid = '#' + id; - $(jid).addClass('btn-warning').removeClass('btn-success').html($(jid).attr('data-inactive')); + $(jid).addClass('button--ghost').removeClass('button--wildcat-blue').html($(jid).attr('data-inactive')); target = $(jid).attr('data-target') + '-remove'; /* Remove hidden inputs */ @@ -123,7 +127,7 @@ var requests = (function() { pos = model.add(item); if (pos !== false) { count = model.get_count(); - $(jid).addClass('btn-success').removeClass('btn-warning').html($(jid).attr('data-active')); + $(jid).addClass('button--wildcat-blue').removeClass('button--ghost').html($(jid).attr('data-active')); /* Display selected item and add toggle control */ removable_element = requests_view.render({ @@ -585,7 +589,7 @@ var requests = (function() { pieces.push('
  • '); pieces.push('

    '); if (("removable" in item) && item["removable"]) { - pieces.push(' '); + pieces.push(' '); } pieces.push(item["label"]); pieces.push('

  • '); @@ -722,7 +726,7 @@ var requests = (function() { var id = $(this).attr('id'); if ($(this).hasClass('fa-toc')) { $(this).after([ - ' - - + + +

@@ -31,11 +29,11 @@ -->
-
-
- {{> harmful_language_statement}}
- From 6d6d7c058eec915b27ba5a8aa3baff868f716bb6 Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 13 Apr 2026 15:41:12 -0400 Subject: [PATCH 5/8] add empty alt tag for screenreaders to ignore loading image --- app/views/layouts/viewer.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/viewer.mustache b/app/views/layouts/viewer.mustache index 47bd840..131e043 100644 --- a/app/views/layouts/viewer.mustache +++ b/app/views/layouts/viewer.mustache @@ -1,5 +1,5 @@
- +
From 8b4fe73cd9b549a8963f9c6ecd0310e74522c544 Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 13 Apr 2026 15:42:47 -0400 Subject: [PATCH 6/8] add breadcrumbs for referring back to search --- app/assets/css/extra.css | 4 ++++ app/assets/js/ui.js | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/app/assets/css/extra.css b/app/assets/css/extra.css index 2ee05b8..7af5369 100644 --- a/app/assets/css/extra.css +++ b/app/assets/css/extra.css @@ -26,6 +26,10 @@ display: none; } +.breadcrumbs ul li.fa-hidden { + display: none; +} + .fa-request-form { overflow: auto; background: #FDFDF6; diff --git a/app/assets/js/ui.js b/app/assets/js/ui.js index bc8bfbe..1e27e85 100644 --- a/app/assets/js/ui.js +++ b/app/assets/js/ui.js @@ -107,5 +107,17 @@ $('.viewer-next').on('click', function () { next_image(); }); + (function () { + if (!document.referrer) return; + var refUrl; + try { refUrl = new URL(document.referrer); } catch (e) { return; } + if (refUrl.origin !== window.location.origin) return; + if (refUrl.pathname !== '/catalog/' || !refUrl.search) return; + var li = document.querySelector('.breadcrumbs .back-to-search'); + var a = li && li.querySelector('[data-back-to-search]'); + if (!li || !a) return; + a.href = refUrl.href; + li.classList.remove('fa-hidden'); + })(); }); })(); From 7d946c3dfa1b2549759581e3a470b3487678658e Mon Sep 17 00:00:00 2001 From: Neal Date: Tue, 14 Apr 2026 10:37:33 -0400 Subject: [PATCH 7/8] linter fixes --- app/config/config.php | 10 ++- app/controllers/component.php | 1 + app/controllers/findingaid.php | 25 +++----- app/controllers/home.php | 1 + app/controllers/overview.php | 1 + app/core/application.php | 19 +++--- app/core/brevity.php | 6 +- app/core/controller.php | 1 + app/core/minter.php | 1 + app/core/model.php | 7 +- app/core/render.php | 6 +- app/init.php | 4 +- app/models/component_model.php | 110 +++++++++++++++----------------- app/models/findingaid_model.php | 7 +- app/models/overview_model.php | 4 +- 15 files changed, 93 insertions(+), 110 deletions(-) diff --git a/app/config/config.php b/app/config/config.php index cd3f6dc..e5dde7c 100644 --- a/app/config/config.php +++ b/app/config/config.php @@ -1,4 +1,5 @@ config)) { return $this->config[$key]; - } - else { + } else { return null; } } @@ -39,8 +39,7 @@ public function get_repo($key) { if (array_key_exists($key, $this->repo)) { return $this->repo[$key]; - } - else { + } else { return $this->repo['default']; } } @@ -59,8 +58,7 @@ public function get_nonuk($key) } if (array_key_exists($key, $this->nonuk)) { return $this->nonuk[$key]; - } - else { + } else { return false; } } diff --git a/app/controllers/component.php b/app/controllers/component.php index 569ccbb..b8f1207 100644 --- a/app/controllers/component.php +++ b/app/controllers/component.php @@ -1,4 +1,5 @@ xpath("//{$entry['field']}"); @@ -107,8 +107,7 @@ public function show() } } } - } - else { + } else { $component_count = count($model->xpath('contents/c')); if ($component_count > 0) { $skip = false; @@ -199,8 +198,7 @@ public function show() } } $url = '/?' . $search_field . '=' . urlencode($raw_search); - } - else { + } else { $data = $model->xpath("//{$link['field']}"); $url = false; foreach ($data as $datum) { @@ -275,8 +273,7 @@ public function show() 'item_url' => '/catalog/' . $model->id() . '/', ] ); - } - else { + } else { $requests = ''; } @@ -329,8 +326,7 @@ public function show() ] ); set_cache($id, $page); - } - else { + } else { $layout = new Mustache_Engine([ 'partials_loader' => new Mustache_Loader_CascadingLoader([ new Mustache_Loader_FilesystemLoader( @@ -362,8 +358,7 @@ public function show() 'repository' => $meta['repository'], ] ); - } - else { + } else { $page = $layout->render( load_template('layouts/suggest_former_kdl'), [ @@ -373,8 +368,7 @@ public function show() ] ); } - } - else { + } else { # This is probably a deleted ExploreUK finding aid header("Location: /"); die(); @@ -432,8 +426,7 @@ public function render_component($renderer, $component_xml) 'body_id' => $body_id, ] ); - } - else { + } else { error_log("FA: attributes_id not set"); } return [ diff --git a/app/controllers/home.php b/app/controllers/home.php index 23cf688..e3ead46 100644 --- a/app/controllers/home.php +++ b/app/controllers/home.php @@ -1,4 +1,5 @@ url_params['suggest'] = 1; -} + if (isset($_GET['suggest']) and $_GET['suggest'] == 1) { + $this->url_params['suggest'] = 1; + } if (isset($_GET['invalidate_cache']) and $_GET['invalidate_cache'] == 1) { $this->url_params['invalidate_cache'] = 1; } if (preg_match('/^([0-9a-z]+)_([0-9a-z]+)$/', $this->url_params['id'], $matches)) { $this->url_controller = 'component'; - } - else { + } else { $this->url_controller = 'findingaid'; } if (isset($_GET['overview']) and $_GET['overview'] == 1) { $this->url_controller = 'overview'; } - } - else { + } else { $this->url_controller = 'home'; } - } - else { + } else { $this->url_controller = 'home'; } } diff --git a/app/core/brevity.php b/app/core/brevity.php index f314e74..1b714c5 100644 --- a/app/core/brevity.php +++ b/app/core/brevity.php @@ -16,16 +16,14 @@ function fa_brevity($message, $length = 0) if (($current_length == 0) || $current_length + strlen($word) <= $length) { $target_words[] = $word; $current_length += strlen($word); - } - else { + } else { break; } } $count = count($target_words); if ($count == 0) { $message = '…'; - } - else { + } else { $terminal = $target_words[$count - 1]; if (preg_match('/^\W+$/', $terminal)) { array_pop($target_words); diff --git a/app/core/controller.php b/app/core/controller.php index 75c2847..0e134e5 100644 --- a/app/core/controller.php +++ b/app/core/controller.php @@ -1,4 +1,5 @@ id; while (strlen($tree) >= 2) { - $prefix = substr($tree, 0, 2); - $tree = substr($tree, 2); - $array[] = $prefix; + $prefix = substr($tree, 0, 2); + $tree = substr($tree, 2); + $array[] = $prefix; } $array[] = $this->id; return implode(DIRECTORY_SEPARATOR, $array); diff --git a/app/core/render.php b/app/core/render.php index 697ffd3..a775231 100644 --- a/app/core/render.php +++ b/app/core/render.php @@ -35,11 +35,9 @@ function fa_render_extref($node) $render = ''; if ($node->hasAttribute('href')) { $render = fa_render_extref_ns($node, ""); - } - else if ($node->hasAttribute('xlink:href')) { + } elseif ($node->hasAttribute('xlink:href')) { $render = fa_render_extref_ns($node, "xlink"); - } - else { + } else { $render = $node->textContent; } return $render; diff --git a/app/init.php b/app/init.php index dc5fa42..363c49e 100644 --- a/app/init.php +++ b/app/init.php @@ -1,4 +1,5 @@ config = $g_config; $component_file = $this->ppath() . DIRECTORY_SEPARATOR . $this->basename; if (file_exists($component_file)) { - $this->xml = new SimpleXMLElement(file_get_contents($component_file)); + $this->xml = new SimpleXMLElement(file_get_contents($component_file)); } $this->links = $this->links(); $contents_config = $this->config->get('contents'); @@ -51,49 +52,47 @@ public function links() foreach ($link_raw['links'] as $use => $href) { $use = str_replace(' ', '_', $use); switch ($use) { - case 'thumbnail': - $thumb_count++; - if ($thumb_count <= $image_threshold) { - $field = 'image'; - } - else { - $field = 'image_overflow'; - } - if (empty($link[$field])) { - $link[$field] = []; - } - $link[$field]['thumb'] = $href; - break; - case 'reference_image': - $ref_count++; - if ($ref_count <= $image_threshold) { - $field = 'image'; - } - else { - $field = 'image_overflow'; - } - if (empty($link[$field])) { - $link[$field] = []; - } - $link[$field]['full'] = $href; - $link[$field]['href_id'] = $g_minter->mint(); - break; - case 'reference_audio': - if (empty($link['audio'])) { - $link['audio'] = []; - } - $link['audio']['href'] = $href; - $link['audio']['href_id'] = $g_minter->mint(); - break; - case 'reference_video': - if (empty($link['video'])) { - $link['video'] = []; - } - $link['video']['href'] = $href; - $link['video']['href_id'] = $g_minter->mint(); - break; - default: - break; + case 'thumbnail': + $thumb_count++; + if ($thumb_count <= $image_threshold) { + $field = 'image'; + } else { + $field = 'image_overflow'; + } + if (empty($link[$field])) { + $link[$field] = []; + } + $link[$field]['thumb'] = $href; + break; + case 'reference_image': + $ref_count++; + if ($ref_count <= $image_threshold) { + $field = 'image'; + } else { + $field = 'image_overflow'; + } + if (empty($link[$field])) { + $link[$field] = []; + } + $link[$field]['full'] = $href; + $link[$field]['href_id'] = $g_minter->mint(); + break; + case 'reference_audio': + if (empty($link['audio'])) { + $link['audio'] = []; + } + $link['audio']['href'] = $href; + $link['audio']['href_id'] = $g_minter->mint(); + break; + case 'reference_video': + if (empty($link['video'])) { + $link['video'] = []; + } + $link['video']['href'] = $href; + $link['video']['href_id'] = $g_minter->mint(); + break; + default: + break; } } $links[] = $link; @@ -113,8 +112,7 @@ public function title() $this->xpath('did/unittitle'), $this->xpath('did/unitdate') ); - } - else { + } else { $pieces = array_merge($pieces, $this->xpath('did/unittitle')); } $segments = []; @@ -148,8 +146,7 @@ public function container_lists() if (isset($attributes['id'])) { $id = trim($attributes['id']); - } - else { + } else { $id = md5((string) $container->asXML()); } $aspect['id'] = $id; @@ -159,8 +156,7 @@ public function container_lists() $ancestor = $section_id_for[$pid]; $section_id_for[$id] = $ancestor; $section[$ancestor][] = $aspect; - } - else { + } else { $section_id_for[$id] = $id; $section[$id] = [$aspect]; $section_ids[] = $id; @@ -194,7 +190,7 @@ public function container_lists() } $volume = $container_list_pieces[0]; $summary = implode(', ', $container_list_pieces); - $full_container_list = fa_brevity($summary . ': '. $this->title(), FA_AEON_MAX); + $full_container_list = fa_brevity($summary . ': ' . $this->title(), FA_AEON_MAX); array_shift($container_list_pieces); $rest = implode(', ', $container_list_pieces); $container_list = [ @@ -281,19 +277,15 @@ private function container_type($attributes) if ($type === 'othertype') { if (isset($attributes['label'])) { return trim($attributes['label']); - } - else { + } else { return 'container'; } - } - else { + } else { return $type; } - } - else if (isset($attributes['label'])) { + } elseif (isset($attributes['label'])) { return trim($attributes['label']); - } - else { + } else { return 'container'; } } diff --git a/app/models/findingaid_model.php b/app/models/findingaid_model.php index ab6c573..c4ee884 100644 --- a/app/models/findingaid_model.php +++ b/app/models/findingaid_model.php @@ -1,4 +1,5 @@ 0) { $repository = $repositories[0]; return trim(dom_import_simplexml($repository)->textContent); - } - else { + } else { return 'Unknown repository'; } } @@ -50,8 +50,7 @@ public function unitid() $unitid = $this->metadata('//archdesc/did/unitid'); if (count($unitid) > 0) { $unitid = $unitid[0]; - } - else { + } else { return "no unitid"; } return $unitid; diff --git a/app/models/overview_model.php b/app/models/overview_model.php index 4bb4658..80a20ee 100644 --- a/app/models/overview_model.php +++ b/app/models/overview_model.php @@ -1,4 +1,5 @@ xml->collection_overview->scopecontent->p as $p) { $result[] = ['text' => $p]; From 18f8bc7c032c12a39b706077864c103168a44be7 Mon Sep 17 00:00:00 2001 From: Neal Date: Mon, 20 Apr 2026 07:07:14 -0400 Subject: [PATCH 8/8] remove blue background --- app/views/shared/breadcrumbs.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/breadcrumbs.mustache b/app/views/shared/breadcrumbs.mustache index cad1a72..608f6d8 100644 --- a/app/views/shared/breadcrumbs.mustache +++ b/app/views/shared/breadcrumbs.mustache @@ -1,4 +1,4 @@ -
+