Completed
Push — master ( 657fa6...d0a38a )
by Iurii
02:08
created

Gmap::info()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
/**
4
 * @package Google Map
5
 * @author Iurii Makukh
6
 * @copyright Copyright (c) 2017, Iurii Makukh
7
 * @license https://www.gnu.org/licenses/gpl-3.0.en.html GPL-3.0+
8
 */
9
10
namespace gplcart\modules\gmap;
11
12
use gplcart\core\Module;
13
14
/**
15
 * Main class for Google Map module
16
 */
17
class Gmap extends Module
18
{
19
20
    /**
21
     * Constructor
22
     */
23
    public function __construct()
24
    {
25
        parent::__construct();
26
    }
27
28
    /**
29
     * Implements hook "route.list"
30
     * @param array $routes
31
     */
32
    public function hookRouteList(array &$routes)
33
    {
34
        // Module settings page
35
        $routes['admin/module/settings/gmap'] = array(
36
            'access' => 'module_edit',
37
            'handlers' => array(
38
                'controller' => array('gplcart\\modules\\gmap\\controllers\\Settings', 'editSettings')
39
            )
40
        );
41
    }
42
43
    /**
44
     * Implements hook "construct.controller"
45
     * @param \gplcart\core\Controller $controller
46
     */
47
    public function hookConstructController($controller)
48
    {
49
        $controller->setJsSettings('gmap', array('key' => $this->config->module('gmap', 'key')));
50
        $controller->setJs('system/modules/gmap/js/common.js');
51
    }
52
53
}
54