Passed
Push — master ( 81ba93...c6c854 )
by Michael
03:30
created

footer.php (1 issue)

1
<?php
2
3
/**
4
 * Module: SmartFAQ
5
 * Author: The SmartFactory <www.smartfactory.ca>
6
 * Licence: GNU
7
 */
8
9
use XoopsModules\Smartfaq;
10
/** @var Smartfaq\Helper $helper */
11
$helper = Smartfaq\Helper::getInstance();
12
13
global $xoopsTpl, $xoopsModule;
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...
14
15
$uid     = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
16
$isAdmin = (Smartfaq\Utility::userIsAdmin() || Smartfaq\Utility::hasModerator());
17
18
$xoopsTpl->assign('sf_adminpage', "<a href='" . XOOPS_URL . "/modules/smartfaq/admin/index.php'>" . _MD_SF_ADMIN_PAGE . '</a>');
19
$xoopsTpl->assign('isAdmin', $isAdmin);
20
21
$xoopsTpl->assign([
22
                      'lang_on'       => _MD_SF_ON,
23
                      'lang_postedby' => _MD_SF_POSTEDBY,
24
                      'lang_faq'      => _MD_SF_QUESTION,
25
                      'lang_datesub'  => _MD_SF_DATESUB,
26
                      'lang_hits'     => _MD_SF_HITS
27
                  ]);
28
$xoopsTpl->assign('sectionname', $myts->displayTarea($xoopsModule->getVar('name')));
29
30
$xoopsTpl->assign('modulename', $xoopsModule->dirname());
31
$xoopsTpl->assign('displaylastfaq', $helper->getConfig('displaylastfaq'));
32
$xoopsTpl->assign('displaysubcatdsc', $helper->getConfig('displaysubcatdsc'));
33
$xoopsTpl->assign('displaycollaps', $helper->getConfig('displaycollaps'));
34
$xoopsTpl->assign('display_date_col', $helper->getConfig('display_date_col'));
35
$xoopsTpl->assign('display_hits_col', $helper->getConfig('display_hits_col'));
36
37
$xoopsTpl->assign('displaytopcatdsc', $helper->getConfig('displaytopcatdsc'));
38
39
$xoopsTpl->assign('ref_smartfaq', 'SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)');
40
41
$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/smartfaq/assets/css/smartfaq.css'>");
42