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: namespace Xmf\Template;
13:
14: /**
15: * PrintContent implements a simple page layout suited to printing
16: *
17: * @category Xmf\Template\Breadcrumb
18: * @package Xmf
19: * @author trabis <lusopoemas@gmail.com>
20: * @author The SmartFactory <www.smartfactory.ca>
21: * @copyright 2011-2013 XOOPS Project (http://xoops.org)
22: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
23: * @version Release: 1.0
24: * @link http://xoops.org
25: * @since 1.0
26: */
27: class PrintContent extends AbstractTemplate
28: {
29: /**
30: * @var string
31: */
32: private $title = '';
33:
34: /**
35: * @var string
36: */
37: private $description = '';
38:
39: /**
40: * @var string
41: */
42: private $content = '';
43:
44: /**
45: * @var bool
46: */
47: private $pagetitle = false;
48:
49: /**
50: * @var int
51: */
52: private $width = 680;
53:
54: /**
55: * init - called by parent::_construct
56: *
57: * @return void
58: */
59: protected function init()
60: {
61: $this->setTemplate('module:xmf/xmf_print.tpl');
62: }
63:
64: /**
65: * Render the print template
66: *
67: * @return void
68: */
69: protected function render()
70: {
71: $this->tpl->assign('xmf_print_pageTitle', $this->pagetitle ? $this->pagetitle : $this->title);
72: $this->tpl->assign('xmf_print_title', $this->title);
73: $this->tpl->assign('xmf_print_description', $this->description);
74: $this->tpl->assign('xmf_print_content', $this->content);
75: $this->tpl->assign('xmf_print_width', $this->width);
76: }
77:
78: /**
79: * setContent
80: *
81: * @param string $content page content
82: *
83: * @return void
84: */
85: public function setContent($content)
86: {
87: $this->content = $content;
88: }
89:
90: /**
91: * getContent
92: *
93: * @return string page content
94: */
95: public function getContent()
96: {
97: return $this->content;
98: }
99:
100: /**
101: * setDescription
102: *
103: * @param string $description page description
104: *
105: * @return void
106: */
107: public function setDescription($description)
108: {
109: $this->description = $description;
110: }
111:
112: /**
113: * getDescription
114: *
115: * @return string page description
116: */
117: public function getDescription()
118: {
119: return $this->description;
120: }
121:
122: /**
123: * setPagetitle
124: *
125: * @param boolean $pagetitle use page title
126: *
127: * @return void
128: */
129: public function setPagetitle($pagetitle)
130: {
131: $this->pagetitle = $pagetitle;
132: }
133:
134: /**
135: * getPagetitle
136: *
137: * @return boolean use page title
138: */
139: public function getPagetitle()
140: {
141: return $this->pagetitle;
142: }
143:
144: /**
145: * setTitle
146: *
147: * @param string $title page title
148: *
149: * @return void
150: */
151: public function setTitle($title)
152: {
153: $this->title = $title;
154: }
155:
156: /**
157: * getTitle
158: *
159: * @return string page title
160: */
161: public function getTitle()
162: {
163: return $this->title;
164: }
165:
166: /**
167: * setWidth
168: *
169: * @param int $width page width in pixels
170: *
171: * @return void
172: */
173: public function setWidth($width)
174: {
175: $this->width = $width;
176: }
177:
178: /**
179: * getWidth
180: *
181: * @return int page width in pixels
182: */
183: public function getWidth()
184: {
185: return $this->width;
186: }
187: }
188: