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