Issues (525)

index.php (6 issues)

Labels
Severity
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
 * wgSitenotice module for xoops
13
 *
14
 * @copyright       XOOPS Project (https://xoops.org)
15
 * @license         GPL 2.0 or later
16
 * @package         wgsitenotice
17
 * @since           1.0
18
 * @min_xoops       2.5.11
19
 * @author          Goffy (xoops.wedega.com) - Email:<[email protected]> - Website:<https://xoops.wedega.com>
20
 */
21
22
use Xmf\Request;
0 ignored issues
show
The type Xmf\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
use XoopsModules\Wgsitenotice\Helper;
24
25
include_once __DIR__ . '/header.php';
26
27
$helper = Helper::getInstance();
28
29
$GLOBALS['xoopsOption']['template_main'] = 'user/' . $helper->getConfig('wgsitenotice_template') . '/wgsitenotice_index_'
30
                                           . $helper->getConfig('wgsitenotice_template') . '.tpl';
31
include_once \XOOPS_ROOT_PATH.'/header.php';
0 ignored issues
show
The constant XOOPS_ROOT_PATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
32
33
// Define Stylesheet
34
$xoTheme->addStylesheet( $style );
35
36
$breadcrumb ='<a href="' . \XOOPS_URL . '">' . \_YOURHOME . '</a>  &raquo; ' . $xoopsModule->name();
0 ignored issues
show
The constant XOOPS_URL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant _YOURHOME was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
37
38
$version_id = Request::getInt('version_id');
39
40
$criteriaVersions = new \CriteriaCompo();
0 ignored issues
show
The type CriteriaCompo was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
41
$criteriaVersions->setSort('version_weight');
42
$criteriaVersions->setOrder('ASC');
43
if ($version_id > 0) $criteriaVersions->add(new \Criteria('version_id', $version_id));
0 ignored issues
show
The type Criteria was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
44
$criteriaVersions->add(new \Criteria('version_current', '1'));
45
$versions_count = $versionsHandler->getCount($criteriaVersions);
46
$versions_arr = $versionsHandler->getAll($criteriaVersions);
47
unset($criteriaVersions);
48
49
$keywords = [];
50
$breadcrumb_subdir = '';
51
52
if ($versions_count > 0) {
53
    foreach (\array_keys($versions_arr) as $v) {
54
55
        if ($version_id > 0) $breadcrumb_subdir = $versions_arr[$v]->getVar('version_name');
56
        $criteriaContents = new \CriteriaCompo();
57
        $criteriaContents->add(new \Criteria('cont_version_id', $versions_arr[$v]->getVar('version_id')));
58
        $contents_count = $contentsHandler->getCount($criteriaContents);
59
        $contents_arr = $contentsHandler->getAll($criteriaContents);
60
        unset($criteriaContents);
61
62
        if ($contents_count > 0) {
63
            foreach (\array_keys($contents_arr) as $i) {
64
                // Get Var cont_id
65
                $cont['id'] = $contents_arr[$i]->getVar('cont_id');
66
                // Get Var cont_version_id
67
                $cont['version_id'] = $contents_arr[$i]->getVar('cont_version_id');
68
                // Get Var cont_header
69
                $cont['header'] = $contents_arr[$i]->getVar('cont_header');
70
                // Get Var cont_text
71
                $cont['text'] = $contents_arr[$i]->getVar('cont_text', 'show');
72
                // Get Var cont_weight
73
                $cont['weight'] = $contents_arr[$i]->getVar('cont_weight');
74
                $GLOBALS['xoopsTpl']->append('contents', $cont);
75
                $keywords[] = $contents_arr[$i]->getVar('cont_header', 'n');
76
                unset($cont);
77
            }
78
        }
79
    }
80
} else {
81
    echo \_MA_WGSITENOTICE_THEREARENT_VERSIONS;
82
    $GLOBALS['xoopsTpl']->append('contents', []);
83
}
84
85
/* create breadcrumb */
86
if ('' == $breadcrumb_subdir) {
87
    $xoBreadcrumbs[] = ['title' => $xoopsModule->name()];
88
} else {
89
    $xoBreadcrumbs[] = ['title' => $GLOBALS['xoopsModule']->getVar('name'), 'link' => \WGSITENOTICE_URL . '/'];
90
    $xoBreadcrumbs[] = ['title' => $breadcrumb_subdir];
91
}
92
$GLOBALS['xoopsTpl']->assign('xoBreadcrumbs', $xoBreadcrumbs);
93
94
95
// keywords
96
wgsitenotice_meta_keywords($helper->getConfig('keywords').', '. \implode(', ', $keywords));
97
unset($keywords);
98
// description
99
wgsitenotice_meta_description(\_MA_WGSITENOTICE_DESC);
100
//
101
$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', \WGSITENOTICE_URL.'/contents.php');
102
//
103
include_once __DIR__ . '/footer.php';
104