|
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
|
|
|
* My Module 2 module for xoops |
|
14
|
|
|
* |
|
15
|
|
|
* @copyright 2020 XOOPS Project (https://xooops.org) |
|
16
|
|
|
* @license GPL 2.0 or later |
|
17
|
|
|
* @package mymodule2 |
|
18
|
|
|
* @since 1.0 |
|
19
|
|
|
* @min_xoops 2.5.9 |
|
20
|
|
|
* @author TDM XOOPS - Email:<[email protected]> - Website:<http://xoops.org> |
|
21
|
|
|
*/ |
|
22
|
|
|
|
|
23
|
|
|
use Xmf\Request; |
|
24
|
|
|
use XoopsModules\Mymodule2; |
|
25
|
|
|
use XoopsModules\Mymodule2\Constants; |
|
26
|
|
|
|
|
27
|
|
|
require __DIR__ . '/header.php'; |
|
28
|
|
|
$tfId = Request::getInt('tf_id'); |
|
29
|
|
|
// Define Stylesheet |
|
30
|
|
|
$GLOBALS['xoTheme']->addStylesheet( $style, null ); |
|
31
|
|
|
if (empty($tfId)) { |
|
32
|
|
|
redirect_header(MYMODULE2_URL . '/index.php', 2, _MA_MYMODULE2_NOTFID); |
|
|
|
|
|
|
33
|
|
|
} |
|
34
|
|
|
// Get Instance of Handler |
|
35
|
|
|
$testfieldsHandler = $helper->getHandler('testfields'); |
|
36
|
|
|
// Verify that the article is published |
|
37
|
|
|
$testfields = $testfieldsHandler->get($tfId); |
|
38
|
|
|
// Verify permissions |
|
39
|
|
|
if (!$grouppermHandler->checkRight('mymodule2_view', $tfId->getVar('tf_id'), $groups, $GLOBALS['xoopsModule']->getVar('mid'))) { |
|
|
|
|
|
|
40
|
|
|
redirect_header(MYMODULE2_URL . '/index.php', 3, _NOPERM); |
|
41
|
|
|
exit(); |
|
42
|
|
|
} |
|
43
|
|
|
$testfield = $testfields->getValuesTestfields(); |
|
44
|
|
|
foreach($testfield as $k => $v) { |
|
45
|
|
|
$GLOBALS['xoopsTpl']->append('"{$k}"', $v); |
|
46
|
|
|
} |
|
47
|
|
|
$GLOBALS['xoopsTpl']->assign('xoops_sitename', $GLOBALS['xoopsConfig']['sitename']); |
|
48
|
|
|
$GLOBALS['xoopsTpl']->assign('xoops_pagetitle', strip_tags($testfield->getVar('tf_text') - _MA_MYMODULE2_PRINT - $GLOBALS['xoopsModule']->name())); |
|
|
|
|
|
|
49
|
|
|
$GLOBALS['xoopsTpl']->display('db:testfields_print.tpl'); |
|
50
|
|
|
|