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