Completed
Pull Request — master (#4)
by Michael
01:27
created

xoops_version.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * ****************************************************************************
4
 * MYIFRAME - MODULE FOR XOOPS
5
 * Copyright (c) Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
6
 * ****************************************************************************
7
 */
8
9
use Xmf\Request;
10
11
if (!defined('XOOPS_ROOT_PATH')) {
12
    die('XOOPS root path not defined');
13
}
14
15
$modversion = array(
16
    'version'             => 1.66,
17
    'module_status'       => 'Beta 1',
18
    'release_date'        => '2017/08/04',
19
    'name'                => _MI_MYIFRAME_NAME,
20
    'description'         => _MI_MYIFRAME_DESC,
21
    'credits'             => '',
22
    'author'              => 'Instant Zero - http://xoops.instant-zero.com',
23
    'help'                => '',
24
    'license'             => 'GPL see LICENSE',
25
    'official'            => 0,
26
    'image'               => 'assets/images/myiframe.png',
27
    'dirname'             => 'myiframe',
28
    'min_php'             => '5.5',
29
    'min_db'              => array('mysql' => '5.5'),
30
    'min_xoops'           => '2.5.8+',
31
    'min_admin'           => '1.2',
32
    'module_website_url'  => 'www.xoops.org',
33
    'module_website_name' => 'XOOPS',
34
    'module_release'      => '05/07/2017',
35
    'system_menu'         => 1,
36
    //sql tables
37
    'sqlfile'             => array('mysql' => 'sql/mysql.sql'),
38
    'tables'              => array(
39
        'myiframe'
40
    ),
41
    // Admin
42
    'hasAdmin'            => 1,
43
    'adminindex'          => 'admin/index.php',
44
    'adminmenu'           => 'admin/menu.php',
45
    // Menu
46
    'hasMain'             => 1
47
);
48
49
// Templates
50
$modversion['templates'] = array(
51
    array(
52
        'file'        => 'myiframe.tpl',
53
        'description' => 'Default template'
54
    ),
55
);
56
57
//Blocks
58
$modversion['blocks'][] = array(
59
    'file'        => 'myiframe_iframe.php',
60
    'name'        => _MI_MYIFAME_BNAME1,
61
    'description' => 'Shows an iframe in a block',
62
    'show_func'   => 'b_myiframe_iframe_show',
63
    'edit_func'   => 'b_myiframe_iframe_edit',
64
    'options'     => '0',
65
    'template'    => 'myiframe_block_show.tpl'
66
);
67
68
global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
69
70
if (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $modversion['dirname'] && $xoopsModule->getVar('isactive')) {
71
    $i = 0;
72
    include_once XOOPS_ROOT_PATH . '/modules/myiframe/include/functions.php';
73
    $myts = MyTextSanitizer::getInstance();
74
    if (myiframe_getmoduleoption('showinmenu')) {
75
        $sql    = 'SELECT * FROM ' . $xoopsDB->prefix('myiframe') . ' ORDER BY frame_description';
76
        $result = $xoopsDB->query($sql);
77
        while ($myrow = $xoopsDB->fetchArray($result)) {
78
            if (xoops_trim($myrow['frame_description']) !== '') {
79
                $modversion['sub'][$i]['name'] = $myts->htmlSpecialChars($myrow['frame_description']);
80
                $modversion['sub'][$i]['url']  = 'index.php?iframeid=' . (int)$myrow['frame_frameid'];
81
                $i++;
82
            }
83
        }
84
    }
85
}
86
87
// Options
88
$modversion['config'][] = [
89
    'name'        => 'showinmenu',
90
    'title'       => '_MI_MYIFRAME_OPT0',
91
    'description' => '_MI_MYIFRAME_OPT0_DSC',
92
    'formtype'    => 'yesno',
93
    'valuetype'   => 'int',
94
    'default'     => 0,
95
];
96
$modversion['config'][] = [
97
    'name'        => 'showlist',
98
    'title'       => '_MI_MYIFRAME_OPT1',
99
    'description' => '_MI_MYIFRAME_OPT1_DSC',
100
    'formtype'    => 'yesno',
101
    'valuetype'   => 'int',
102
    'default'     => 1,
103
];
104
// Search
105
$modversion['hasSearch'] = 0;
106
107
// Comments
108
$modversion['hasComments'] = 0;
109
110
// Notification
111
$modversion['hasNotification'] = 0;
112