/**
  * onBrowse.
  *
  * @param   string  $tpl  Param
  *
  * @return	void
  */
 protected function onBrowse($tpl = null)
 {
     FeedImporterHelper::loadAjaxImporter($this);
     Extly::loadAwesome();
     return parent::onBrowse($tpl);
 }
 /**
  * importFeed
  *
  * @param   object  &$feed  Params
  *
  * @return	array
  */
 public function importFeed(&$feed)
 {
     $noresult = new StdClass();
     $noresult->added_items = 0;
     $feedImporterHelper = new FeedImporterHelper();
     $feedProcessorHelper = new FeedProcessorHelper();
     $feedGeneratorHelper = new FeedGeneratorHelper();
     $loadResult = $feedImporterHelper->import($feed);
     if (!isset($loadResult->items) || count($loadResult->items) == 0) {
         return $noresult;
     }
     $contents = $feedProcessorHelper->process($feed, $loadResult);
     if (count($contents) == 0) {
         return $noresult;
     }
     // Simple check for duplicates in feed contents
     $feedGeneratorHelper->removeDuplicates($contents);
     if (count($contents) == 0) {
         return $noresult;
     }
     $feedGeneratorHelper->execute($contents, $feed->xtform);
     $loadResult->added_items = $feedGeneratorHelper->save($contents, $feed->xtform);
     return $loadResult;
 }