XOOPS  2.6.0
Feed.php
Go to the documentation of this file.
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 
27 class Feed extends AbstractTemplate
28 {
32  private $_title = '';
33 
37  private $_url = '';
38 
42  private $_description = '';
43 
47  private $_language = '';
48 
52  private $_charset = '';
53 
57  private $_category = '';
58 
62  private $_pubdate = '';
63 
67  private $_webmaster = '';
68 
72  private $_generator = '';
73 
77  private $_copyright = '';
78 
82  private $_lastbuild = '';
83 
87  private $_editor = '';
88 
92  private $_ttl = 60;
93 
97  private $_image_title = '';
98 
102  private $_image_url = '';
103 
107  private $_image_link = '';
108 
112  private $_image_width = 200;
113 
117  private $_image_height = 50;
118 
122  private $_items = array();
123 
129  protected function init()
130  {
131  $this->setTemplate('module:xmf/xmf_feed.tpl');
132  //$this->disableLogger();
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 = date(\XoopsLocale::getFormatShortDate(), time());
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 
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 
186  public function setCategory($category)
187  {
188  $this->_category = $category;
189  }
190 
196  public function getCategory()
197  {
198  return $this->_category;
199  }
200 
208  public function setCharset($charset)
209  {
210  $this->_charset = $charset;
211  }
212 
218  public function getCharset()
219  {
220  return $this->_charset;
221  }
222 
230  public function setCopyright($copyright)
231  {
232  $this->_copyright = $copyright;
233  }
234 
240  public function getCopyright()
241  {
242  return $this->_copyright;
243  }
244 
252  public function setDescription($description)
253  {
254  $this->_description = $description;
255  }
256 
262  public function getDescription()
263  {
264  return $this->_description;
265  }
266 
274  public function setEditor($editor)
275  {
276  $this->_editor = $editor;
277  }
278 
284  public function getEditor()
285  {
286  return $this->_editor;
287  }
288 
296  public function setGenerator($generator)
297  {
298  $this->_generator = $generator;
299  }
300 
306  public function getGenerator()
307  {
308  return $this->_generator;
309  }
310 
318  public function setImageHeight($image_height)
319  {
320  $this->_image_height = $image_height;
321  }
322 
328  public function getImageHeight()
329  {
330  return $this->_image_height;
331  }
332 
340  public function setImageLink($image_link)
341  {
342  $this->_image_link = $image_link;
343  }
344 
350  public function getImageLink()
351  {
352  return $this->_image_link;
353  }
354 
362  public function setImageTitle($image_title)
363  {
364  $this->_image_title = $image_title;
365  }
366 
372  public function getImageTitle()
373  {
374  return $this->_image_title;
375  }
376 
384  public function setImageUrl($image_url)
385  {
386  $this->_image_url = $image_url;
387  }
388 
394  public function getImageUrl()
395  {
396  return $this->_image_url;
397  }
398 
406  public function setImageWidth($image_width)
407  {
408  $this->_image_width = $image_width;
409  }
410 
416  public function getImageWidth()
417  {
418  return $this->_image_width;
419  }
420 
428  public function setItems($items)
429  {
430  $this->_items = $items;
431  }
432 
438  public function getItems()
439  {
440  return $this->_items;
441  }
442 
450  public function setLanguage($language)
451  {
452  $this->_language = $language;
453  }
454 
460  public function getLanguage()
461  {
462  return $this->_language;
463  }
464 
472  public function setLastbuild($lastbuild)
473  {
474  $this->_lastbuild = $lastbuild;
475  }
476 
482  public function getLastbuild()
483  {
484  return $this->_lastbuild;
485  }
486 
494  public function setPubdate($pubdate)
495  {
496  $this->_pubdate = $pubdate;
497  }
498 
504  public function getPubdate()
505  {
506  return $this->_pubdate;
507  }
508 
516  public function setTitle($title)
517  {
518  $this->_title = $title;
519  }
520 
526  public function getTitle()
527  {
528  return $this->_title;
529  }
530 
538  public function setTtl($ttl)
539  {
540  $this->_ttl = $ttl;
541  }
542 
548  public function getTtl()
549  {
550  return $this->_ttl;
551  }
552 
560  public function setUrl($url)
561  {
562  $this->_url = $url;
563  }
564 
570  public function getUrl()
571  {
572  return $this->_url;
573  }
574 
582  public function setWebmaster($webmaster)
583  {
584  $this->_webmaster = $webmaster;
585  }
586 
592  public function getWebmaster()
593  {
594  return $this->_webmaster;
595  }
596 }
setGenerator($generator)
Definition: Feed.php:296
setEditor($editor)
Definition: Feed.php:274
static formatTimestamp($time, $format= 'l', $timeoffset=null)
Definition: Abstract.php:289
setDescription($description)
Definition: Feed.php:252
setImageWidth($image_width)
Definition: Feed.php:406
setImageUrl($image_url)
Definition: Feed.php:384
setImageTitle($image_title)
Definition: Feed.php:362
setUrl($url)
Definition: Feed.php:560
const VERSION
Definition: Xoops.php:28
setLanguage($language)
Definition: Feed.php:450
setTitle($title)
Definition: Feed.php:516
setPubdate($pubdate)
Definition: Feed.php:494
setImageHeight($image_height)
Definition: Feed.php:318
setCharset($charset)
Definition: Feed.php:208
setWebmaster($webmaster)
Definition: Feed.php:582
setCopyright($copyright)
Definition: Feed.php:230
setCategory($category)
Definition: Feed.php:186
setImageLink($image_link)
Definition: Feed.php:340
static get($name)
setLastbuild($lastbuild)
Definition: Feed.php:472
static getLangCode()
Definition: Abstract.php:68
static getFormatShortDate()
Definition: Abstract.php:181
$url
Definition: register.php:72
setItems($items)
Definition: Feed.php:428
$language
setTtl($ttl)
Definition: Feed.php:538
$xoopsConfig
Definition: common.php:130
$editor