|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Xooghost module |
|
4
|
|
|
* |
|
5
|
|
|
* You may not change or alter any portion of this comment or credits |
|
6
|
|
|
* of supporting developers from this source code or any supporting source code |
|
7
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
|
8
|
|
|
* This program is distributed in the hope that it will be useful, |
|
9
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
11
|
|
|
* |
|
12
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
13
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
|
14
|
|
|
* @package Xooghost |
|
15
|
|
|
* @since 2.6.0 |
|
16
|
|
|
* @author Laurent JEN (Aka DuGris) |
|
17
|
|
|
*/ |
|
18
|
|
|
use Xoops\Core\Request; |
|
19
|
|
|
|
|
20
|
|
|
include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
21
|
|
|
|
|
22
|
|
|
$helper = \XoopsModules\Xooghost\Helper::getInstance(); |
|
23
|
|
|
$ghostConfig = $helper->loadConfig(); |
|
|
|
|
|
|
24
|
|
|
$pageHandler = $helper->getHandler('Page'); |
|
25
|
|
|
|
|
26
|
|
|
\XoopsLoad::load('system', 'system'); |
|
27
|
|
|
$system = \System::getInstance(); |
|
28
|
|
|
|
|
29
|
|
|
$xoops = \Xoops::getInstance(); |
|
30
|
|
|
$xoops->disableErrorReporting(); |
|
31
|
|
|
|
|
32
|
|
|
$page_id = Request::getInt('page_id', 0); //$system->cleanVars($_REQUEST, 'page_id', 0, 'int'); |
|
33
|
|
|
$page = $pageHandler->get($page_id); |
|
34
|
|
|
|
|
35
|
|
|
$output = Request::getString('output', 'print'); //$system->cleanVars($_REQUEST, 'output', 'print', 'string'); |
|
36
|
|
|
|
|
37
|
|
|
if (is_object($page) && 0 != count($page) && $page->getVar('xooghost_online')) { |
|
|
|
|
|
|
38
|
|
|
$tpl = new \XoopsTpl(); |
|
39
|
|
|
|
|
40
|
|
|
$tpl->assign('page', $page->getValues()); |
|
41
|
|
|
|
|
42
|
|
|
$tpl->assign('width', $ghostConfig['xooghost_image_width']); |
|
43
|
|
|
$tpl->assign('height', $ghostConfig['xooghost_image_height']); |
|
44
|
|
|
$tpl->assign('xooghost_qrcode', $ghostConfig['xooghost_qrcode']); |
|
45
|
|
|
|
|
46
|
|
|
$tpl->assign('print', true); |
|
47
|
|
|
$tpl->assign('output', true); |
|
48
|
|
|
$tpl->assign('xoops_sitename', $xoops->getConfig('sitename')); |
|
49
|
|
|
$tpl->assign('xoops_pagetitle', $page->getVar('xooghost_title') . ' - ' . $xoops->module->getVar('name')); |
|
|
|
|
|
|
50
|
|
|
$tpl->assign('xoops_slogan', htmlspecialchars($xoops->getConfig('slogan'), ENT_QUOTES)); |
|
51
|
|
|
|
|
52
|
|
|
if ($xoops->isActiveModule('pdf') && 'pdf' === $output) { |
|
53
|
|
|
/* |
|
54
|
|
|
$content = $tpl->fetch('module:xooghost/xooghost_page_pdf.tpl'); |
|
55
|
|
|
$pdf = new Pdf('P', 'A4', _LANGCODE, true, _CHARSET, array(10, 10, 10, 10)); |
|
56
|
|
|
$pdf->setDefaultFont('Helvetica'); |
|
57
|
|
|
$pdf->writeHtml($content, false); |
|
58
|
|
|
$pdf->Output(); |
|
59
|
|
|
*/ |
|
60
|
|
|
} else { |
|
61
|
|
|
$tpl->display('module:xooghost/xooghost_page_print.tpl'); |
|
62
|
|
|
} |
|
63
|
|
|
} else { |
|
64
|
|
|
$tpl = new \XoopsTpl(); |
|
65
|
|
|
$tpl->assign('xoops_sitename', $xoops->getConfig('sitename')); |
|
66
|
|
|
$tpl->assign('xoops_slogan', htmlspecialchars($xoops->getConfig('slogan'), ENT_QUOTES)); |
|
67
|
|
|
$tpl->assign('not_found', true); |
|
68
|
|
|
$tpl->display('module:xooghost/xooghost_page_print.tpl'); |
|
69
|
|
|
} |
|
70
|
|
|
|