diff --git a/README.md b/README.md index a5a0c1b..6418110 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,18 @@ This module acompanies and is required by the Archive omeka theme ``` cd ./modules -https://git.hangar.org/arcHIVE-tech/ArchiveSiteMeta/archive/main.zip +get https://git.hangar.org/arcHIVE-tech/arc-hive-site-omeka-module/archive/main.zip unzip main.zip -mv imageviewer/ ArchiveSiteMeta +mv arc-hive-site-omeka-module/ ArchiveSiteMeta rm main.zip ``` +## Configure +``` +Collection One = collection1 +Collection Two = collection2 +Collection Three = collection3 +``` ## LISENCE The module is released under the [MIT] License. diff --git a/config/module.ini b/config/module.ini index 459e265..1570c27 100644 --- a/config/module.ini +++ b/config/module.ini @@ -1,6 +1,6 @@ [info] -name = "Archive site meta" -description = "arcHIVE theme helper. Adds some meta vaule to pages and maps routes" +name = "Arc-hive site" +description = "arc-hIVE theme helper. Adds some meta vaule to pages and maps routes" tags = "" license = "MIT" author = "Hangar.org" diff --git a/src/Form/ConfigForm.php b/src/Form/ConfigForm.php index 2a01550..b370363 100644 --- a/src/Form/ConfigForm.php +++ b/src/Form/ConfigForm.php @@ -39,157 +39,4 @@ class ConfigForm extends Form implements TranslatorAwareInterface ]); } - - - - /* - $this->add([ - 'name' => 'archiverepertory_item_set_folder', - 'type' => PropertySelect::class, - 'options' => [ - 'label' => 'Item set folder', // @translate - 'empty_option' => 'Don’t add folder', // @translate - 'prepend_value_options' => [ - 'id' => 'Internal numeric id of the resource', // @translate - ], - ], - 'attributes' => [ - 'class' => 'chosen-select', - 'data-placeholder' => 'Select a property', // @translate - ], - ]); - */ - /* - $this->add([ - 'name' => 'archiverepertory_item_set_prefix', - 'type' => Text::class, - 'options' => [ - 'label' => 'Prefix for item sets', // @translate - 'info' => $this->translate('Choose a prefix, for example "item:", "record:" or "doc:", to select the appropriate metadata when they are multiple.') // @translate - . ' ' . $this->translate('Let empty to use simply the first one.'), // @translate - ], - ]); - */ - /* - $this->add( - $this->getRadioForConversion('archiverepertory_item_set_convert', - $this->translate('Convert item set names')) // @translate - ); - */ - /* - $this->add([ - 'name' => 'archiverepertory_item_folder', - 'type' => PropertySelect::class, - 'options' => [ - 'label' => 'Item folder', // @translate - 'empty_option' => 'Don’t add folder', // @translate - 'prepend_value_options' => [ - 'id' => 'Internal numeric id of the resource', // @translate - ], - ], - 'attributes' => [ - 'class' => 'chosen-select', - 'data-placeholder' => 'Select a property', // @translate - ], - ]); - */ - /* - $this->add([ - 'name' => 'archiverepertory_item_prefix', - 'type' => Text::class, - 'options' => [ - 'label' => 'Prefix for items', - 'info' => $this->translate('Choose a prefix, for example "item:", "record:" or "doc:", to select the appropriate metadata when they are multiple.') // @translate - . ' ' . $this->translate('Let empty to use simply the first one.'), // @translate - ], - ]); - */ - /* - $this->add( - $this->getRadioForConversion('archiverepertory_item_convert', - $this->translate('Convert item names')) // @translate - ); - */ - /* - $radios = $this->getRadioForConversion('archiverepertory_media_convert', - $this->translate('Convert file names')); // @translate - $valueOptions = $radios->getValueOptions(); - $valueOptions['hash'] = $this->translate('Hash filename (default Omeka)'); // @translate - $radios->setValueOptions($valueOptions); - $this->add($radios); - */ - /* - $inputFilter = $this->getInputFilter(); - $inputFilter->add([ - 'name' => 'archiverepertory_item_set_folder', - 'required' => false, - ]); - $inputFilter->add([ - 'name' => 'archiverepertory_item_set_prefix', - 'required' => false, - ]); - $inputFilter->add([ - 'name' => 'archiverepertory_item_set_convert', - 'required' => false, - ]); - $inputFilter->add([ - 'name' => 'archiverepertory_item_folder', - 'required' => false, - ]); - $inputFilter->add([ - 'name' => 'archiverepertory_item_prefix', - 'required' => false, - ]); - $inputFilter->add([ - 'name' => 'archiverepertory_item_convert', - 'required' => false, - ]); - $inputFilter->add([ - 'name' => 'archiverepertory_media_convert', - 'required' => false, - ]); - } - - protected function getSetting($name) - { - return $this->settings->get($name); - } - /* - protected function translate($args) - { - $translator = $this->getTranslator(); - return $translator->translate($args); - } - */ - /* - protected function getRadioForConversion($name, $label) - { - $allow_unicode = Helpers::checkUnicodeInstallation(); - - $info = $this->translate('Depending on your server and your needs, to avoid some potential issues, you can choose or not to rename every folder to its Ascii equivalent (or only the first letter).') // @translate - . ' ' . $this->translate('In all cases, names are sanitized: "/", "\", "|" and other special characters are removed.'); // @translate - $radio = new Element\Radio($name); - $radio->setLabel($label); - $radio->setOptions(['info' => $info]); - $radio->setValue($this->getSetting($name)); - - $not_recommended = isset($allow_unicode['ascii']) - ? ' ' . $this->translate('(not recommended because your server is not fully compatible with Unicode)') // @translate - : ''; - $recommended = (isset($allow_unicode['cli']) || isset($allow_unicode['fs'])) - ? ' ' . $this->translate('(recommended because your server is not fully compatible with Unicode)') // @translate - : ''; - - $radio->setValueOptions([ - 'keep' => $this->translate('Keep name as it') . $not_recommended, // @translate - 'spaces' => $this->translate('Convert spaces to underscores'), // @translate - 'first letter' => $this->translate('Convert first letter only'), // @translate - 'first and spaces' => $this->translate('Convert first letter and spaces'), // @translate - 'full' => $this->translate('Full conversion to Ascii.') . $recommended, // @translate - ]); - - return $radio; - - } - */ } diff --git a/src/Site/BlockLayout/ArchiveSiteMeta.php b/src/Site/BlockLayout/ArchiveSiteMeta.php index fcdf20b..9c12fcf 100644 --- a/src/Site/BlockLayout/ArchiveSiteMeta.php +++ b/src/Site/BlockLayout/ArchiveSiteMeta.php @@ -49,7 +49,7 @@ class ArchiveSiteMeta extends AbstractBlockLayout } public function getLabel() { - return 'Archive site meta'; + return 'Arc-hive site'; } public function form(PhpRenderer $view, @@ -107,10 +107,12 @@ class ArchiveSiteMeta extends AbstractBlockLayout } //$this->storage_dir = $storage_dir; //$mpdf->Output($this->storage_dir.'/asset/'.$site_title.'.pdf', \Mpdf\Output\Destination::FILE); + $archiveSiteHelper = $view->getHelperPluginManager()->get('archiveSiteMeta'); + $collections = $archiveSiteHelper->getCollections(); return $view->partial('common/block-layout/site-meta', [ 'artist' =>$block->dataValue('currator'), 'project_date' => $block->dataValue('project_date'), - 'collection' => $block->dataValue('collection'), + 'collection' => $collections[$block->dataValue('collection')], 'site' => $site, 'tech_document_link' => $tech_document_link ]); diff --git a/src/View/Helper/ArchiveSiteMetaViewHelper.php b/src/View/Helper/ArchiveSiteMetaViewHelper.php index 37abbf7..c4ba4e1 100644 --- a/src/View/Helper/ArchiveSiteMetaViewHelper.php +++ b/src/View/Helper/ArchiveSiteMetaViewHelper.php @@ -77,8 +77,8 @@ class ArchiveSiteMetaViewHelper extends AbstractHelper */ public function getSiteImage($site) { - foreach ($site->pages() as $page) { - foreach ($page->blocks() as $block) { + foreach ($site->pages() as $page) { + foreach ($page->blocks() as $block) { if ($block->layout() === 'archiveSiteMeta') { $attachments = $block->attachments(); if ($attachments) { @@ -86,9 +86,9 @@ class ArchiveSiteMetaViewHelper extends AbstractHelper return $media->primaryMedia()->thumbnailUrl('large'); } } + } } - } - return null; + return null; } /**