Esempio n. 1
0
 /**
  * The default constructor
  *
  * @return	void
  * @param	string $title			The title off the feed.
  * @param	string $link			The link of the feed.
  * @param	string $description		The description of the feed.
  * @param	array[optional] $items	An array with SpoonRSSItems.
  */
 public function __construct($title, $link, $description, array $items = array())
 {
     // decode
     $title = SpoonFilter::htmlspecialcharsDecode($title);
     $description = SpoonFilter::htmlspecialcharsDecode($description);
     // call the parent
     parent::__construct($title, FrontendModel::addURLParameters($link, array('utm_source' => 'feed', 'utm_medium' => 'rss', 'utm_campaign' => SpoonFilter::urlise($title))), $description, $items);
     // set feed properties
     $this->setLanguage(FRONTEND_LANGUAGE);
     $this->setCopyright(SpoonDate::getDate('Y') . ' ' . SpoonFilter::htmlspecialcharsDecode(FrontendModel::getModuleSetting('core', 'site_title_' . FRONTEND_LANGUAGE)));
     $this->setGenerator(SITE_RSS_GENERATOR);
     $this->setImage(SITE_URL . FRONTEND_CORE_URL . '/layout/images/rss_image.png', $title, $link);
     // theme was set
     if (FrontendModel::getModuleSetting('core', 'theme', null) != null) {
         // theme name
         $theme = FrontendModel::getModuleSetting('core', 'theme', null);
         // theme rss image exists
         if (SpoonFile::exists(PATH_WWW . '/frontend/themes/' . $theme . '/core/images/rss_image.png')) {
             // set rss image
             $this->setImage(SITE_URL . '/frontend/themes/' . $theme . '/core/images/rss_image.png', $title, $link);
         }
     }
 }
Esempio n. 2
0
 /**
  * The default constructor
  *
  * @param string $title       The title off the feed.
  * @param string $link        The link of the feed.
  * @param string $description The description of the feed.
  * @param array  $items       An array with SpoonRSSItems.
  */
 public function __construct($title, $link, $description, array $items = array())
 {
     // decode
     $title = \SpoonFilter::htmlspecialcharsDecode($title);
     $description = \SpoonFilter::htmlspecialcharsDecode($description);
     // call the parent
     parent::__construct($title, Model::addURLParameters($link, array('utm_source' => 'feed', 'utm_medium' => 'rss', 'utm_campaign' => CommonUri::getUrl($title))), $description, $items);
     $siteTitle = \SpoonFilter::htmlspecialcharsDecode(Model::get('fork.settings')->get('Core', 'site_title_' . LANGUAGE));
     // set feed properties
     $this->setLanguage(LANGUAGE);
     $this->setCopyright(\SpoonDate::getDate('Y') . ' ' . $siteTitle);
     $this->setGenerator($siteTitle);
     $this->setImage(SITE_URL . FRONTEND_CORE_URL . '/Layout/images/rss_image.png', $title, $link);
     // theme was set
     if (Model::get('fork.settings')->get('Core', 'theme', null) != null) {
         // theme name
         $theme = Model::get('fork.settings')->get('Core', 'theme', null);
         // theme rss image exists
         if (is_file(PATH_WWW . '/src/Frontend/Themes/' . $theme . '/Core/images/rss_image.png')) {
             // set rss image
             $this->setImage(SITE_URL . '/src/Frontend/Themes/' . $theme . '/Core/images/rss_image.png', $title, $link);
         }
     }
 }