Passed
Push — master ( b847d6...d6d54c )
by Michael
09:34 queued 05:00
created

welcome.php (1 issue)

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
 * pedigree module for XOOPS
13
 *
14
 * @copyright   {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
15
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
16
 * @package     pedigree
17
 * @author      XOOPS Module Dev Team
18
 * @todo  Move this file to the ./include directory
19
 */
20
21
use XoopsModules\Pedigree;
22
23
if (count(debug_backtrace(FALSE, 1)) !== 0) {
0 ignored issues
show
FALSE of type false is incompatible with the type integer expected by parameter $options of debug_backtrace(). ( Ignorable by Annotation )

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

23
if (count(debug_backtrace(/** @scrutinizer ignore-type */ FALSE, 1)) !== 0) {
Loading history...
24
    // Fail if file was called directly - it should only be accessed by being included
25
    exit('Restricted access');
26
}
27
28
//require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
29
//require_once __DIR__ . '/header.php';
30
31
//$moduleDirName = basename(__DIR__);
32
//xoops_loadLanguage('main', $moduleDirName);
33
$helper->loadLanguage('main');
34
35
// Include any common code for this module.
36
require_once $helper->path('include/common.php');
37
38
//$GLOBALS['xoopsOption']['template_main'] = 'pedigree_welcome.tpl';
39
//include $GLOBALS['xoops']->path('/header.php');
40
41
$myts = \MyTextSanitizer::getInstance(); // MyTextSanitizer object
42
43
//query to count dogs
44
/** @var XoopsModules\Pedigree\TreeHandler $treeHandler */
45
$treeHandler = $helper->getHandler('Tree');
46
$numdogs     = $treeHandler->getCount();
47
/*
48
$result = $GLOBALS['xoopsDB']->query("select count(*) from " . $GLOBALS['xoopsDB']->prefix("pedigree_tree"));
49
list($numdogs) = $GLOBALS['xoopsDB']->fetchRow($result);
50
*/
51
/*
52
//get module configuration
53
$moduleHandler = xoops_getHandler('module');
54
$module        = $moduleHandler->getByDirname($moduleDirName);
55
$configHandler = xoops_getHandler('config');
56
$moduleConfig  = $configHandler->getConfigsByCat(0, $module->getVar('mid'));
57
*/
58
$word = $myts->displayTarea(strtr($helper->getConfig('welcome'), [
59
    '[numanimals]'  => '[b]' . $numdogs . ' [/b]',
60
    '[animalType]'  => '[b]' . $helper->getConfig('animalType') . '[/b]',
61
    '[animalTypes]' => $helper->getConfig('animalTypes')
62
]));
63
64
$GLOBALS['xoopsTpl']->assign('welcome', _MA_PEDIGREE_WELCOME);
65
$GLOBALS['xoopsTpl']->assign('word', $word);
66
67
//include $GLOBALS['xoops']->path('/footer.php');
68