Passed
Push — master ( 48d769...5ccf6e )
by Michael
07:14
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
 */
19
20
use XoopsModules\Pedigree;
21
22
23
//require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
24
//require_once __DIR__ . '/header.php';
25
26
//$moduleDirName = basename(__DIR__);
27
xoops_loadLanguage('main', $moduleDirName);
28
29
// Include any common code for this module.
30
require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
31
32
//$GLOBALS['xoopsOption']['template_main'] = 'pedigree_welcome.tpl';
33
//include $GLOBALS['xoops']->path('/header.php');
34
35
$myts = \MyTextSanitizer::getInstance(); // MyTextSanitizer object
36
37
//query to count dogs
38
$treeHandler = Pedigree\Helper::getInstance()->getHandler('Tree');
39
$numdogs     = $treeHandler->getCount();
0 ignored issues
show
The method getCount() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of said class. However, the method does not exist in XoopsGroupHandler or XoopsConfigCategoryHandler or XoopsRankHandler or XoopsConfigOptionHandler or XoopsBlockHandler or XoopsImagesetHandler. Are you sure you never get one of those? ( Ignorable by Annotation )

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

39
$numdogs     = $treeHandler->/** @scrutinizer ignore-call */ getCount();
Loading history...
40
/*
41
$result = $GLOBALS['xoopsDB']->query("select count(*) from " . $GLOBALS['xoopsDB']->prefix("pedigree_tree"));
42
list($numdogs) = $GLOBALS['xoopsDB']->fetchRow($result);
43
*/
44
/*
45
//get module configuration
46
$moduleHandler = xoops_getHandler('module');
47
$module        = $moduleHandler->getByDirname($moduleDirName);
48
$configHandler = xoops_getHandler('config');
49
$moduleConfig  = $configHandler->getConfigsByCat(0, $module->getVar('mid'));
50
*/
51
$word = $myts->displayTarea(strtr($helper->getConfig('welcome'), [
52
    '[numanimals]'  => '[b]' . $numdogs . ' [/b]',
53
    '[animalType]'  => '[b]' . $helper->getConfig('animalType') . '[/b]',
54
    '[animalTypes]' => $helper->getConfig('animalTypes')
55
]));
56
57
$GLOBALS['xoopsTpl']->assign('welcome', _MA_PEDIGREE_WELCOME);
58
$GLOBALS['xoopsTpl']->assign('word', $word);
59
//comments and footer
60
61
//include $GLOBALS['xoops']->path('/footer.php');
62