apcal_map.php ➔ apcal_map_edit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright   {@link http://xoops.org/ XOOPS Project}
14
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
15
 * @package
16
 * @since
17
 * @author       XOOPS Development Team,
18
 * @author       Antiques Promotion (http://www.antiquespromotion.ca)
19
 */
20
21
if (!defined('APCAL_BLOCK_MAP_INCLUDED')) {
22
    define('APCAL_BLOCK_MAP_INCLUDED', 1);
23
24
    /**
25
     * @param $options
26
     * @return array
27
     */
28
    function apcal_map_show($options)
29
    {
30
        global $xoopsConfig, $xoopsDB;
31
32
        $original_level = error_reporting(E_ALL ^ E_NOTICE);
33
34
        $moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];
35
36
        // setting physical & virtual paths
37
        $mod_path = XOOPS_ROOT_PATH . "/modules/$moduleDirName";
38
        $mod_url  = XOOPS_URL . "/modules/$moduleDirName";
39
40
        // defining class of APCal
41
        if (!class_exists('APCal_xoops')) {
42
            require_once "$mod_path/class/APCal.php";
43
            require_once "$mod_path/class/APCal_xoops.php";
44
        }
45
46
        // creating an instance of APCal
47
        $cal = new APCal_xoops('', $xoopsConfig['language'], true);
48
49
        // ignoring cid from GET
50
        $cal->now_cid = 0;
51
52
        // setting properties of APCal
53
        $cal->conn = $GLOBALS['xoopsDB']->conn;
54
        include "$mod_path/include/read_configs.php";
55
        $cal->base_url    = $mod_url;
56
        $cal->base_path   = $mod_path;
57
        $cal->images_url  = "$mod_url/assets/images/$skin_folder";
0 ignored issues
show
Bug introduced by
The variable $skin_folder does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
58
        $cal->images_path = "$mod_path/assets/images/$skin_folder";
59
60
        $cal->get_monthly_html("$mod_url");
61
62
        if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) {
63
        } else {
64
            $moduleHelper = Xmf\Module\Helper::getHelper('system');
65
        }
66
67
        $block = array();
68
        if (is_array($cal->gmPoints) && !empty($cal->gmPoints)) {
69
            $tpl = new XoopsTpl();
70
            $tpl->assign('GMlatitude', $cal->gmlat);
71
            $tpl->assign('GMlongitude', $cal->gmlng);
72
            $tpl->assign('GMzoom', $cal->gmzoom);
73
            $tpl->assign('GMheight', $cal->gmheight . 'px');
74
            $tpl->assign('GMPoints', $cal->gmPoints);
75
            $tpl->assign('api_key', $moduleHelper->getConfig('apcal_mapsapi'));
76
            $block['map'] = $tpl->fetch(XOOPS_ROOT_PATH . '/modules/apcal/templates/apcal_googlemap.tpl');
77
        }
78
79
        error_reporting($original_level);
80
81
        return $block;
82
    }
83
84
    /**
85
     * @param $options
86
     * @return string
87
     */
88
    function apcal_map_edit($options)
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
89
    {
90
        return '';
91
    }
92
}
93