CssHolmesCorePreload   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 22
rs 10
c 2
b 0
f 0
wmc 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A eventCoreHeaderAddmeta() 0 10 4
A eventCoreIncludeCommonEnd() 0 3 1
1
<?php
2
3
/**
4
 * Cssholmes module
5
 *
6
 * You may not change or alter any portion of this comment or credits
7
 * of supporting developers from this source code or any supporting source code
8
 * which is considered copyrighted (c) material of the original comment or credit authors.
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
 *
13
 * @copyright           XOOPS Project (https://xoops.org)
14
 * @license             http://www.fsf.org/copyleft/gpl.html GNU public license
15
 * @package             Cssholmes
16
 * @since               2.5.x
17
 * @author              kris <http://www.xoofoo.org>
18
 **/
19
class CssHolmesCorePreload extends \XoopsPreloadItem
20
{
21
    // to add PSR-4 autoloader
22
23
    /**
24
     * @param $args
25
     */
26
    public static function eventCoreIncludeCommonEnd($args)
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public static function eventCoreIncludeCommonEnd(/** @scrutinizer ignore-unused */ $args)

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

Loading history...
27
    {
28
        require_once __DIR__ . '/autoloader.php';
29
    }
30
31
    public static function eventCoreHeaderAddmeta()
32
    {
33
        global $xoTheme, $xoopsUser;
34
        $xoopsModule = XoopsModule::getByDirname('cssholmes');
35
        // Add scripts and Css if only User is xoopsAdmin
36
        if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
37
            $xoTheme->addStylesheet(XOOPS_URL . '/modules/cssholmes/assets/css/style.css');
38
        } else {
39
            $xoTheme->addStylesheet(XOOPS_URL . '/modules/cssholmes/assets/css/holmes.css');
40
            $xoTheme->addScript(XOOPS_URL . '/modules/cssholmes/assets/js/holmes.js');
41
        }
42
    }
43
}
44