Skip to content

Commit

Permalink
Use double @ for Finna components
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksip committed Aug 1, 2023
1 parent ef1ac9b commit c78ebb8
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions module/Finna/src/Finna/View/Helper/Root/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class Component extends \VuFind\View\Helper\Root\Component
*/
public function __invoke(string $name, $params = []): string
{
if ($name[0] !== '@') {
if (!str_starts_with($name, '@@')) {
return parent::__invoke($name, $params);
}

$parts = explode('/', $name);
$path = substr(array_shift($parts), 1);
$path = substr(array_shift($parts), 2);
$name = implode('/', $parts);

return $this->view->render("components/$path/" . $name, $params);
Expand Down
2 changes: 1 addition & 1 deletion themes/finna2/templates/Helpers/bazaar-browse-bar.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- START of: finna - Helpers/bazaar-browse-bar.phtml -->
<?= $this->component('@organisms/navigation/finna-bazaar-browse-bar', [
<?= $this->component('@@organisms/navigation/finna-bazaar-browse-bar', [
'addResourceCallbackPayload' => $this->bazaarSession()->getAddResourceCallbackPayload(),
'addResourceCallbackUrl' => $this->bazaarSession()->getAddResourceCallbackUrl(),
'cancelUrl' => $this->bazaarSession()->getCancelUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
<div class="note-info <?= $notes ? '' : ' hide' ?>"><strong><?=$this->transEsc('Note')?>:</strong></div>
<?php if ($list_id): ?>
<?php $markdown = $notes ? $this->markdown()->replaceDeprecatedTags($notes) : ''; ?>
<?= $this->component('@organisms/widgets/finna-md-editable', [
<?= $this->component('@@organisms/widgets/finna-md-editable', [
'attributes' => ['class' => 'resource-note'],
'markdown' => $markdown,
'html' => $markdown ? $this->markdown()->toHtml($markdown, false) : '',
Expand Down
2 changes: 1 addition & 1 deletion themes/finna2/templates/RecordDriver/EDS/list-entry.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<div class="note-info <?= $notes ? '' : ' hide' ?>"><strong><?=$this->transEsc('Note')?>:</strong></div>
<?php if ($list_id): ?>
<?php $markdown = $notes ? $this->markdown()->replaceDeprecatedTags($notes) : ''; ?>
<?= $this->component('@organisms/widgets/finna-md-editable', [
<?= $this->component('@@organisms/widgets/finna-md-editable', [
'attributes' => ['class' => 'resource-note'],
'markdown' => $markdown,
'html' => $markdown ? $this->markdown()->toHtml($markdown, false) : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<div class="note-info <?= $notes ? '' : ' hide' ?>"><strong><?=$this->transEsc('Note')?>:</strong></div>
<?php if ($list_id): ?>
<?php $markdown = $notes ? $this->markdown()->replaceDeprecatedTags($notes) : ''; ?>
<?= $this->component('@organisms/widgets/finna-md-editable', [
<?= $this->component('@@organisms/widgets/finna-md-editable', [
'attributes' => ['class' => 'resource-note'],
'markdown' => $markdown,
'html' => $markdown ? $this->markdown()->toHtml($markdown, false) : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<div class="note-info <?= $notes ? '' : ' hide' ?>"><strong><?=$this->transEsc('Note')?>:</strong></div>
<?php if ($list_id): ?>
<?php $markdown = $notes ? $this->markdown()->replaceDeprecatedTags($notes) : ''; ?>
<?= $this->component('@organisms/widgets/finna-md-editable', [
<?= $this->component('@@organisms/widgets/finna-md-editable', [
'attributes' => ['class' => 'resource-note'],
'markdown' => $markdown,
'html' => $markdown ? $this->markdown()->toHtml($markdown, false) : '',
Expand Down
2 changes: 1 addition & 1 deletion themes/finna2/templates/myresearch/mylist.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</div>
<?php endif; ?>
<?php $markdown = $list ? $this->markdown()->replaceDeprecatedTags($list->description ?? '') : ''; ?>
<?= $this->component('@organisms/widgets/finna-md-editable', [
<?= $this->component('@@organisms/widgets/finna-md-editable', [
'attributes' => ['class' => 'list-description'],
'markdown' => $markdown,
'html' => $markdown ? $this->markdown()->toHtml($markdown, false) : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</div>
</div>
<?php $content = ob_get_clean(); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-default', 'organisation-info-panel']],
'heading' => $this->transEsc('organisation_info_navi_usage'),
'headingLevel' => 4,
Expand All @@ -57,7 +57,7 @@
</ul>
</div>
<?php $content = ob_get_clean(); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-default', 'organisation-info-panel', 'links-panel', 'hide']],
'heading' => $this->transEsc('Links'),
'headingLevel' => 4,
Expand Down
18 changes: 9 additions & 9 deletions themes/finna2/templates/organisationinfo/map-information.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<p class="building-year info-element"><?=$this->transEsc('organisation_info_building_year')?>: <span></span></p>
<p class="office-description description-long info-element" data-truncate="<?=$this->htmlSafeJsonEncode(['rows' => 5])?>"></p>
<?php $content = ob_get_clean(); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'introduction']],
'heading' => $this->transEsc('organisation_info_general'),
'headingLevel' => 4,
Expand All @@ -100,7 +100,7 @@
]); ?>
</div>
<div class="office-col opening-times-widget">
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'opening-times-library-information']],
'heading' => $this->transEsc('organisation_info_schedules'),
'headingLevel' => 4,
Expand All @@ -111,7 +111,7 @@
]); ?>
</div>
<div class="office-col">
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'contact-details', 'contact-details-rss', 'info-element']],
'heading' => $this->transEsc('organisation_info_contact'),
'headingLevel' => 4,
Expand All @@ -120,7 +120,7 @@
'collapseId' => 'collapse3',
'collapsed' => false,
]); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'contact-details', 'contact-details-no-rss', 'info-element']],
'heading' => $this->transEsc('organisation_info_contact'),
'headingLevel' => 4,
Expand All @@ -142,7 +142,7 @@
<h5 class="service-header collection hidden"><?= $this->transEsc('Collections') ?></h5>
<div class="service-list collection"></div>
<?php $content = ob_get_clean(); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'services', 'info-element']],
'heading' => $this->transEsc('organisation_info_services'),
'headingLevel' => 4,
Expand All @@ -152,7 +152,7 @@
'collapsed' => false,
]); ?>
<?php // Accessibility information ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'accessibility-details', 'info-element']],
'heading' => $this->transEsc('organisation_info_accessibility'),
'headingLevel' => 4,
Expand All @@ -179,7 +179,7 @@
</table>
</div>
<?php $content = ob_get_clean(); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'personnel', 'info-element']],
'heading' => $this->transEsc('organisation_info_staff'),
'headingLevel' => 4,
Expand All @@ -192,7 +192,7 @@
<?php ob_start(); ?>
<div class="feed-container news-feed info-element" data-init="0"></div>
<?php $content = ob_get_clean(); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'news-feed-container', 'rss-container', 'info-element']],
'heading' => $this->transEsc('organisation_info_rss_news'),
'headingLevel' => 4,
Expand All @@ -203,7 +203,7 @@
<?php ob_start(); ?>
<div class="feed-container events-feed info-element" data-init="0"></div>
<?php $content = ob_get_clean(); ?>
<?= $this->component('@molecules/containers/finna-panel', [
<?= $this->component('@@molecules/containers/finna-panel', [
'attributes' => ['class' => ['finna-panel-borderless', 'events-feed-container', 'rss-container', 'info-element']],
'heading' => $this->transEsc('organisation_info_rss_events'),
'headingLevel' => 4,
Expand Down

0 comments on commit c78ebb8

Please sign in to comment.