|
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 module for xoops |
|
14
|
|
|
* |
|
15
|
|
|
* @copyright 2020 XOOPS Project (https://xooops.org) |
|
16
|
|
|
* @license GPL 2.0 or later |
|
17
|
|
|
* @package mymodule |
|
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\Mymodule; |
|
25
|
|
|
use XoopsModules\Mymodule\Constants; |
|
26
|
|
|
|
|
27
|
|
|
require __DIR__ . '/header.php'; |
|
28
|
|
|
$artId = Request::getInt('art_id'); |
|
29
|
|
|
// Define Stylesheet |
|
30
|
|
|
$GLOBALS['xoTheme']->addStylesheet( $style, null ); |
|
31
|
|
|
if(empty($artId)) { |
|
32
|
|
|
redirect_header(MYMODULE_URL . '/index.php', 2, _MA_MYMODULE_NOARTID); |
|
|
|
|
|
|
33
|
|
|
} |
|
34
|
|
|
// Get Instance of Handler |
|
35
|
|
|
$articlesHandler = $helper->getHandler('articles'); |
|
36
|
|
|
// Verify that the article is published |
|
37
|
|
|
$articles = $articlesHandler->get($artId); |
|
38
|
|
|
// Verify permissions |
|
39
|
|
|
if(!$gpermHandler->checkRight('mymodule_view', $artId->getVar('art_id'), $groups, $GLOBALS['xoopsModule']->getVar('mid'))) { |
|
|
|
|
|
|
40
|
|
|
redirect_header(MYMODULE_URL . '/index.php', 3, _NOPERM); |
|
41
|
|
|
exit(); |
|
42
|
|
|
} |
|
43
|
|
|
$article = $articles->getValuesArticles(); |
|
44
|
|
|
foreach($article 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($article->getVar('art_title') - _MA_MYMODULE_PRINT - $GLOBALS['xoopsModule']->name())); |
|
|
|
|
|
|
49
|
|
|
$GLOBALS['xoopsTpl']->display('db:articles_print.tpl'); |
|
50
|
|
|
|