Esempio n. 1
0
 /**
  * Add an item to the global RSS feed
  *
  * @param string $feed
  * @param string $id
  * @param string $title
  * @param string $link
  * @param string $description
  * @param array $other
  * @return bool
  */
 public function hookRssItemAdd($feed, $id, $title, $link, $description, array $other = array())
 {
     if ($feed != 'global') {
         $rss = new Rss('global');
         if (!$rss->hasFeedInfo()) {
             $st = $this->_config->get('config/title');
             $rss->setFeedInfo(sprintf(t('%s - Global RSS feed', _PROJECT_ID . '-rss'), $st), sprintf(t('Global RSS feed for %s', _PROJECT_ID . '-rss'), $st), $this->_router->makeFullUrl('', '', '', 'main'));
         }
         if (!in_array($id, $rss->getItemIds())) {
             $rss->add($id, $title, $link, $description, $other);
             if ($rss->save()) {
                 return true;
             }
         }
         return false;
     }
     return false;
 }