Passed
Push — master ( 228434...01f0c4 )
by Goffy
05:05
created

readmes.php (5 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
/**
13
 * wgGitHub module for xoops
14
 *
15
 * @copyright      2020 XOOPS Project (https://xooops.org)
16
 * @license        GPL 2.0 or later
17
 * @package        wggithub
18
 * @since          1.0
19
 * @min_xoops      2.5.10
20
 * @author         Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com>
21
 */
22
23
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...
24
use XoopsModules\Wggithub;
25
use XoopsModules\Wggithub\Constants;
26
use XoopsModules\Wggithub\Common;
27
28
require __DIR__ . '/header.php';
29
$GLOBALS['xoopsOption']['template_main'] = 'wggithub_readmes.tpl';
30
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...
31
32
$op    = Request::getCmd('op', 'list');
33
$start = Request::getInt('start', 0);
34
$limit = Request::getInt('limit', $helper->getConfig('userpager'));
35
$rmId = Request::getInt('rm_id', 0);
36
37
// Define Stylesheet
38
$GLOBALS['xoTheme']->addStylesheet($style, null);
39
40
$GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL);
41
$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
42
43
$keywords = [];
44
45
$GLOBALS['xoopsTpl']->assign('showItem', $rmId > 0);
46
47
switch ($op) {
48
    case 'show':
49
    case 'list':
50
    default:
51
        $crReadmes = 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...
52
        if ($rmId > 0) {
53
            $crReadmes->add(new \Criteria('rm_id', $rmId));
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...
54
        }
55
        $readmesCount = $readmesHandler->getCount($crReadmes);
56
        $GLOBALS['xoopsTpl']->assign('readmesCount', $readmesCount);
57
        $crReadmes->setStart($start);
58
        $crReadmes->setLimit($limit);
59
        $readmesAll = $readmesHandler->getAll($crReadmes);
60
        if ($readmesCount > 0) {
61
            $readmes = [];
62
            // Get All Readmes
63
            foreach (\array_keys($readmesAll) as $i) {
64
                $readmes[$i] = $readmesAll[$i]->getValuesReadmes();
65
                $keywords[$i] = $readmesAll[$i]->getVar('rm_name');
66
            }
67
            $GLOBALS['xoopsTpl']->assign('readmes', $readmes);
68
            unset($readmes);
69
            // Display Navigation
70
            if ($readmesCount > $limit) {
71
                include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
72
                $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
0 ignored issues
show
The type XoopsPageNav 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...
73
                $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
74
            }
75
            $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type'));
76
            $GLOBALS['xoopsTpl']->assign('divideby', $helper->getConfig('divideby'));
77
            $GLOBALS['xoopsTpl']->assign('numb_col', $helper->getConfig('numb_col'));
78
        }
79
        break;
80
}
81
82
// Breadcrumbs
83
$xoBreadcrumbs[] = ['title' => _MA_WGGITHUB_READMES];
84
85
// Keywords
86
wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords));
87
unset($keywords);
88
89
// Description
90
wggithubMetaDescription(_MA_WGGITHUB_READMES_DESC);
91
$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/readmes.php');
92
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
93
94
require __DIR__ . '/footer.php';
95