2 /* +-----------------------------------------------------------------------------+
3 * OpenEMR - Open Source Electronic Medical Record
4 * Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * @author Jacob T.Paul <jacob@zhservices.com>
19 * @author Basil PT <basil@zhservices.com>
21 * +------------------------------------------------------------------------------+
26 use Acl\Model\AclTable
;
27 use Zend\ModuleManager\ModuleManager
;
31 public function getAutoloaderConfig()
34 'Zend\Loader\ClassMapAutoloader' => array(
35 __DIR__
. '/autoload_classmap.php',
37 'Zend\Loader\StandardAutoloader' => array(
38 'namespaces' => array(
39 __NAMESPACE__
=> __DIR__
. '/src/' . __NAMESPACE__
,
45 public function getServiceConfig()
49 'Acl\Model\AclTable' => function ($sm) {
50 $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
51 $table = new AclTable($dbAdapter);
58 public function getConfig()
60 return include __DIR__
. '/config/module.config.php';
63 public function init(ModuleManager
$moduleManager)
65 $sharedEvents = $moduleManager->getEventManager()->getSharedManager();
66 $sharedEvents->attach(__NAMESPACE__
, 'dispatch', function ($e) {
67 $controller = $e->getTarget();
68 $controller->layout('acl/layout/layout');
69 $route = $controller->getEvent()->getRouteMatch();
70 $controller->getEvent()->getViewModel()->setVariables(array(
71 'current_controller' => $route->getParam('controller'),
72 'current_action' => $route->getParam('action'),