-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathModule.php
48 lines (39 loc) · 1.19 KB
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php declare(strict_types=1);
namespace PageBlocks;
require __DIR__ . '/vendor/autoload.php';
use Common\TraitModule;
use Omeka\Module\AbstractModule;
use Laminas\EventManager\SharedEventManagerInterface;
use PageBlocks\Form\TopicsListSidebarForm;
use PageBlocks\Form\CardGridSidebarForm;
use PageBlocks\Form\AccordionGroupSidebarForm;
class Module extends AbstractModule
{
const NAMESPACE = __NAMESPACE__;
use TraitModule;
/**
* Get this module's configuration array.
*
* @return array
*/
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function attachListeners(SharedEventManagerInterface $sharedEventManager)
{
$sharedEventManager->attach(
'Omeka\Controller\SiteAdmin\Page',
'view.edit.before',
[$this, 'addSidebar']
);
}
function addSidebar($event)
{
$view = $event->getTarget();
echo $view->sidebar('topic-sidebar', TopicsListSidebarForm::class);
echo $view->sidebar('card-sidebar', CardGridSidebarForm::class);
echo $view->sidebar('accordion-sidebar', AccordionGroupSidebarForm::class);
}
}
?>