-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Released version 3.4.3.8-beta for Omeka S v3 and v4.
- Loading branch information
Daniel Berthereau
authored and
Daniel Berthereau
committed
Feb 6, 2023
1 parent
096489f
commit ece87d3
Showing
5 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |