Skip to content

Commit

Permalink
Released version 3.6.9 for Omeka S v4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Jan 29, 2024
1 parent b319a4e commit 7570944
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ public function onBootstrap(MvcEvent $event): void

protected function preInstall(): void
{
$services = $this->getServiceLocator();
$translate = $services->get('ControllerPluginManager')->get('translate');

if (!method_exists($this, 'checkModuleActiveVersion') || !$this->checkModuleActiveVersion('Common', '3.4.49')) {
$message = new \Omeka\Stdlib\Message(
$translate('The module %1$s should be upgraded to version %2$s or later.'), // @translate
'Common', '3.4.49'
);
throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message);
}

$js = __DIR__ . '/asset/vendor/uv/umd/UV.js';
if (!file_exists($js)) {
$services = $this->getServiceLocator();
Expand Down
4 changes: 2 additions & 2 deletions config/module.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ author_link = "https://gitlab.com/Daniel-KM"
module_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-UniversalViewer"
support_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-UniversalViewer/-/issues"
configurable = true
version = "3.6.8"
omeka_version_constraint = "^3.0.0 || ^4.0.0"
version = "3.6.9"
omeka_version_constraint = "^4.0.0"
31 changes: 30 additions & 1 deletion data/scripts/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,35 @@
}

if (version_compare($oldVersion, '3.6.5.4', '<')) {
$message = new Message('Last version of Universal Viewer (v4) has been integrated. Check if it works fine with your documents.'); // @translate
$message = new Message(
'Last version of Universal Viewer (v4) has been integrated. Check if it works fine with your documents.' // @translate
);
$messenger->addSuccess($message);
}

if (version_compare($oldVersion, '3.6.9', '<')) {
if (!method_exists($this, 'checkModuleActiveVersion') || !$this->checkModuleActiveVersion('Common', '3.4.49')) {
$message = new Message(
'The module %1$s should be upgraded to version %2$s or later.', // @translate
'Common', '3.4.49'
);
throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message);
}

/** @var \Omeka\Settings\SiteSettings $siteSettings */
$siteSettings = $services->get('Omeka\Settings\Site');
$sites = $api->search('sites')->getContent();
foreach ($sites as $site) {
$siteSettings->setTargetId($site->id());
if ((string) $siteSettings->get('universalviewer_version', '4') === '4') {
$siteSettings->set('universalviewer_config_theme', true);
}
}

$message = new Message(
'A param in settings (default) and in site settings allows to set the config of Universal Viewer version 4. See %1$sdocumentation%2$s.', // @translate
'<a href="https://gitlab.com/Daniel-KM/Omeka-S-module-UniversalViewer#exemple-of-full-config-for-version-4" target="_blank" rel="noopener">', '</a>'
);
$message->setEscapeHtml(false);
$messenger->addSuccess($message);
}

0 comments on commit 7570944

Please sign in to comment.