1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: namespace Xmf\Template;
13:
14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
27: class Feed extends AbstractTemplate
28: {
29: 30: 31:
32: private $_title = '';
33:
34: 35: 36:
37: private $_url = '';
38:
39: 40: 41:
42: private $_description = '';
43:
44: 45: 46:
47: private $_language = '';
48:
49: 50: 51:
52: private $_charset = '';
53:
54: 55: 56:
57: private $_category = '';
58:
59: 60: 61:
62: private $_pubdate = '';
63:
64: 65: 66:
67: private $_webmaster = '';
68:
69: 70: 71:
72: private $_generator = '';
73:
74: 75: 76:
77: private $_copyright = '';
78:
79: 80: 81:
82: private $_lastbuild = '';
83:
84: 85: 86:
87: private $_editor = '';
88:
89: 90: 91:
92: private $_ttl = 60;
93:
94: 95: 96:
97: private $_image_title = '';
98:
99: 100: 101:
102: private $_image_url = '';
103:
104: 105: 106:
107: private $_image_link = '';
108:
109: 110: 111:
112: private $_image_width = 200;
113:
114: 115: 116:
117: private $_image_height = 50;
118:
119: 120: 121:
122: private $_items = array();
123:
124: 125: 126: 127: 128:
129: protected function init()
130: {
131: $this->setTemplate('module:xmf/xmf_feed.tpl');
132:
133:
134: global $xoopsConfig;
135: $this->_title = $xoopsConfig['sitename'];
136: $this->_url = \XoopsBaseConfig::get('url');
137: $this->_description = $xoopsConfig['slogan'];
138: $this->_language = \XoopsLocale::getLangCode();
139: $this->_charset = \XoopsLocale::getCharset();
140: $this->_pubdate = \XoopsLocale::formatTimestamp(time(), 'short');
141: $this->_lastbuild = \XoopsLocale::formatTimestamp(time(), 'D, d M Y H:i:s');
142: $this->_webmaster = $xoopsConfig['adminmail'];
143: $this->_editor = $xoopsConfig['adminmail'];
144: $this->_generator = \Xoops::VERSION;
145: $this->_copyright = 'Copyright ' . \XoopsLocale::formatTimestamp(time(), 'Y') . ' ' . $xoopsConfig['sitename'];
146: $this->_image_title = $this->_title;
147: $this->_image_url = \XoopsBaseConfig::get('url') . '/images/logo.gif';
148: $this->_image_link = $this->_url;
149: }
150:
151: 152: 153: 154: 155:
156: protected function render()
157: {
158: $this->tpl->assign('channel_charset', $this->_charset);
159: $this->tpl->assign('channel_title', $this->_title);
160: $this->tpl->assign('channel_link', $this->_url);
161: $this->tpl->assign('channel_desc', $this->_description);
162: $this->tpl->assign('channel_webmaster', $this->_webmaster);
163: $this->tpl->assign('channel_editor', $this->_editor);
164: $this->tpl->assign('channel_category', $this->_category);
165: $this->tpl->assign('channel_generator', $this->_generator);
166: $this->tpl->assign('channel_language', $this->_language);
167: $this->tpl->assign('channel_lastbuild', $this->_lastbuild);
168: $this->tpl->assign('channel_copyright', $this->_copyright);
169: $this->tpl->assign('channel_ttl', $this->_ttl);
170: $this->tpl->assign('channel_image_url', $this->_image_url);
171: $this->tpl->assign('channel_image_title', $this->_image_title);
172: $this->tpl->assign('channel_image_url', $this->_image_url);
173: $this->tpl->assign('channel_image_link', $this->_image_link);
174: $this->tpl->assign('channel_image_width', $this->_image_width);
175: $this->tpl->assign('channel_image_height', $this->_image_height);
176: $this->tpl->assign('channel_items', $this->_items);
177: }
178:
179: 180: 181: 182: 183: 184: 185:
186: public function setCategory($category)
187: {
188: $this->_category = $category;
189: }
190:
191: 192: 193: 194: 195:
196: public function getCategory()
197: {
198: return $this->_category;
199: }
200:
201: 202: 203: 204: 205: 206: 207:
208: public function setCharset($charset)
209: {
210: $this->_charset = $charset;
211: }
212:
213: 214: 215: 216: 217:
218: public function getCharset()
219: {
220: return $this->_charset;
221: }
222:
223: 224: 225: 226: 227: 228: 229:
230: public function setCopyright($copyright)
231: {
232: $this->_copyright = $copyright;
233: }
234:
235: 236: 237: 238: 239:
240: public function getCopyright()
241: {
242: return $this->_copyright;
243: }
244:
245: 246: 247: 248: 249: 250: 251:
252: public function setDescription($description)
253: {
254: $this->_description = $description;
255: }
256:
257: 258: 259: 260: 261:
262: public function getDescription()
263: {
264: return $this->_description;
265: }
266:
267: 268: 269: 270: 271: 272: 273:
274: public function setEditor($editor)
275: {
276: $this->_editor = $editor;
277: }
278:
279: 280: 281: 282: 283:
284: public function getEditor()
285: {
286: return $this->_editor;
287: }
288:
289: 290: 291: 292: 293: 294: 295:
296: public function setGenerator($generator)
297: {
298: $this->_generator = $generator;
299: }
300:
301: 302: 303: 304: 305:
306: public function getGenerator()
307: {
308: return $this->_generator;
309: }
310:
311: 312: 313: 314: 315: 316: 317:
318: public function setImageHeight($image_height)
319: {
320: $this->_image_height = $image_height;
321: }
322:
323: 324: 325: 326: 327:
328: public function getImageHeight()
329: {
330: return $this->_image_height;
331: }
332:
333: 334: 335: 336: 337: 338: 339:
340: public function setImageLink($image_link)
341: {
342: $this->_image_link = $image_link;
343: }
344:
345: 346: 347: 348: 349:
350: public function getImageLink()
351: {
352: return $this->_image_link;
353: }
354:
355: 356: 357: 358: 359: 360: 361:
362: public function setImageTitle($image_title)
363: {
364: $this->_image_title = $image_title;
365: }
366:
367: 368: 369: 370: 371:
372: public function getImageTitle()
373: {
374: return $this->_image_title;
375: }
376:
377: 378: 379: 380: 381: 382: 383:
384: public function setImageUrl($image_url)
385: {
386: $this->_image_url = $image_url;
387: }
388:
389: 390: 391: 392: 393:
394: public function getImageUrl()
395: {
396: return $this->_image_url;
397: }
398:
399: 400: 401: 402: 403: 404: 405:
406: public function setImageWidth($image_width)
407: {
408: $this->_image_width = $image_width;
409: }
410:
411: 412: 413: 414: 415:
416: public function getImageWidth()
417: {
418: return $this->_image_width;
419: }
420:
421: 422: 423: 424: 425: 426: 427:
428: public function setItems($items)
429: {
430: $this->_items = $items;
431: }
432:
433: 434: 435: 436: 437:
438: public function getItems()
439: {
440: return $this->_items;
441: }
442:
443: 444: 445: 446: 447: 448: 449:
450: public function setLanguage($language)
451: {
452: $this->_language = $language;
453: }
454:
455: 456: 457: 458: 459:
460: public function getLanguage()
461: {
462: return $this->_language;
463: }
464:
465: 466: 467: 468: 469: 470: 471:
472: public function setLastbuild($lastbuild)
473: {
474: $this->_lastbuild = $lastbuild;
475: }
476:
477: 478: 479: 480: 481:
482: public function getLastbuild()
483: {
484: return $this->_lastbuild;
485: }
486:
487: 488: 489: 490: 491: 492: 493:
494: public function setPubdate($pubdate)
495: {
496: $this->_pubdate = $pubdate;
497: }
498:
499: 500: 501: 502: 503:
504: public function getPubdate()
505: {
506: return $this->_pubdate;
507: }
508:
509: 510: 511: 512: 513: 514: 515:
516: public function setTitle($title)
517: {
518: $this->_title = $title;
519: }
520:
521: 522: 523: 524: 525:
526: public function getTitle()
527: {
528: return $this->_title;
529: }
530:
531: 532: 533: 534: 535: 536: 537:
538: public function setTtl($ttl)
539: {
540: $this->_ttl = $ttl;
541: }
542:
543: 544: 545: 546: 547:
548: public function getTtl()
549: {
550: return $this->_ttl;
551: }
552:
553: 554: 555: 556: 557: 558: 559:
560: public function setUrl($url)
561: {
562: $this->_url = $url;
563: }
564:
565: 566: 567: 568: 569:
570: public function getUrl()
571: {
572: return $this->_url;
573: }
574:
575: 576: 577: 578: 579: 580: 581:
582: public function setWebmaster($webmaster)
583: {
584: $this->_webmaster = $webmaster;
585: }
586:
587: 588: 589: 590: 591:
592: public function getWebmaster()
593: {
594: return $this->_webmaster;
595: }
596: }
597: