Exemple #1
0
 /**
  * Provides a way for modules to easily add to an RSS feed
  * by using this module, and the RSS lib.
  *
  * @param array $feeds
  * @param array $item
  * @return bool
  */
 public function hookRssmodEdit(array $feeds, array $item)
 {
     try {
         foreach ($feeds as $feedName => $fDetails) {
             $rss = new Rss(is_array($fDetails) ? $feedName : $fDetails);
             if (is_array($fDetails)) {
                 $rss->setFeedInfo($fDetails['title'], $fDetails['desc'], $fDetails['url']);
             }
             $rss->edit($item['id'], $item['title'], $item['url'], $item['desc']);
             $rss->save();
         }
         return true;
     } catch (Exception $e) {
         $this->_log->message('rss unable to edit item "' . $e->getMessage() . '", attempting to add', Log::L_DEBUG);
         return $this->hookRssmodAdd($feeds, $item);
     }
 }