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
|
|
|
/** |
13
|
|
|
* pedigree module for XOOPS |
14
|
|
|
* |
15
|
|
|
* @package XoopsModules\Pedigree |
16
|
|
|
* @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} |
17
|
|
|
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
18
|
|
|
* @author XOOPS Module Dev Team |
19
|
|
|
* @todo Move this file to the ./include directory |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
use XoopsModules\Pedigree; |
23
|
|
|
|
24
|
|
|
if (0 !== count(debug_backtrace(false, 1))) { |
|
|
|
|
25
|
|
|
// Fail if file was called directly - it should only be accessed by being included |
26
|
|
|
exit('Restricted access'); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
//require_once \dirname(__DIR__, 2) . '/mainfile.php'; |
30
|
|
|
//require_once __DIR__ . '/header.php'; |
31
|
|
|
|
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
|
|
|
$numAnimals = $treeHandler->getCount(); |
46
|
|
|
/* |
47
|
|
|
$result = $GLOBALS['xoopsDB']->query("select COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("pedigree_tree")); |
48
|
|
|
list($numAnimals) = $GLOBALS['xoopsDB']->fetchRow($result); |
49
|
|
|
*/ |
50
|
|
|
|
51
|
|
|
$word = $myts->displayTarea( |
52
|
|
|
strtr($helper->getConfig('welcome'), [ |
53
|
|
|
'[numanimals]' => '[b]' . $numAnimals . ' [/b]', |
54
|
|
|
'[animalType]' => '[b]' . $helper->getConfig('animalType') . '[/b]', |
55
|
|
|
'[animalTypes]' => $helper->getConfig('animalTypes'), |
56
|
|
|
]) |
57
|
|
|
); |
58
|
|
|
|
59
|
|
|
$GLOBALS['xoopsTpl']->assign([ |
60
|
|
|
'welcome' => _MA_PEDIGREE_WELCOME, |
61
|
|
|
'word' => $word, |
62
|
|
|
]); |
63
|
|
|
|
64
|
|
|
//include $GLOBALS['xoops']->path('/footer.php'); |
65
|
|
|
|