Skip to content

Commit

Permalink
Released version 3.4.3.8-beta for Omeka S v3 and v4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Feb 6, 2023
1 parent 096489f commit ece87d3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Module.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php declare(strict_types=1);

/*
* Copyright Daniel Berthereau, 2017-2021
* Copyright Daniel Berthereau, 2017-2023
*
* This software is governed by the CeCILL license under French law and abiding
* by the rules of distribution of free software. You can use, modify and/ or
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ of the CeCILL license and that you accept its terms.
Copyright
---------

* Copyright Daniel Berthereau, 2017-2021 (see [Daniel-KM] on GitLab)
* Copyright Daniel Berthereau, 2017-2023 (see [Daniel-KM] on GitLab)

* Library [webui-popover]: Sandy Walker

Expand All @@ -303,7 +303,7 @@ sociales [EHESS]. It was upgraded and improved for [Enssib].
[Omeka S]: https://omeka.org/s
[Web Annotation Ontology]: https://www.w3.org/annotation/
[W3C]: https://www.w3.org
[installing a module]: http://dev.omeka.org/docs/s/user-manual/modules/#installing-modules
[Installing a module]: https://omeka.org/s/docs/user-manual/modules/#installing-modules
[Annotate.zip]: https://gitlab.com/Daniel-KM/Omeka-S-module-Annotate/-/releases
[Annotation data model]: https://www.w3.org/TR/annotation-model/
[Annotation vocabulary]: https://www.w3.org/TR/annotation-vocab/
Expand Down
4 changes: 2 additions & 2 deletions config/module.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ author_link = "https://gitlab.com/Daniel-KM"
module_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-Annotate"
support_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-Annotate/-/issues"
configurable = false
version = "3.3.3.7.5"
omeka_version_constraint = "^3.1.0"
version = "3.4.3.8-beta"
omeka_version_constraint = "^3.1.0 || ^4.0.0"
dependencies = "CustomVocab"
4 changes: 4 additions & 0 deletions data/scripts/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,7 @@

$messenger->addWarning($message);
}

if (version_compare($oldVersion, '3.4.3.8', '<')) {
require_once __DIR__ . '/upgrade_vocabulary.php';
}
34 changes: 34 additions & 0 deletions data/scripts/upgrade_vocabulary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php declare(strict_types=1);

namespace Annotate;

use Omeka\Module\Exception\ModuleCannotInstallException;
use Omeka\Stdlib\Message;

/**
* @var Module $this
* @var \Laminas\ServiceManager\ServiceLocatorInterface $services
*/

if (!method_exists($this, 'getInstallResources')) {
throw new ModuleCannotInstallException((string) new Message(
'This module requires module %s version %s or greater.', // @translate
'Generic',
'3.4.41'
));
}

$installResources = $this->getInstallResources();

$module = __NAMESPACE__;
$filepath = dirname(__DIR__, 2) . '/data/vocabularies/oa.json';
$data = file_get_contents($filepath);
$data = json_decode($data, true);
$installResources->createOrUpdateVocabulary($data, $module);

$messenger = $services->get('ControllerPluginManager')->get('messenger');
$message = new Message(
'The vocabulary "%s" was updated successfully.', // @translate
pathinfo($filepath, PATHINFO_FILENAME)
);
$messenger->addSuccess($message);

0 comments on commit ece87d3

Please sign in to comment.