Exemplo n.º 1
0
 function showFeed($aoPages)
 {
     $sFeedTitle = $this->t_("title") . " - " . self::globalCfgWebsiteName();
     $oFeed = new AnwFeed(AnwEnv::_GET("feed"), $sFeedTitle, AnwUtils::aLinkAbsolute("untranslated"));
     foreach ($aoPages as $oPage) {
         //add to feed
         $sUserDisplayName = "";
         $sItemTitle = '[' . $oPage->getLang() . '] ' . $oPage->getName() . ' (' . $oPage->getTranslatedPercent() . '%) - ' . Anwi18n::dateTime($oPage->getTime());
         $sPageLink = AnwUtils::linkAbsolute($oPage);
         $oFeedItem = new AnwFeedItem($sItemTitle, $sPageLink);
         $oFeedItem->setDate($oPage->getTime());
         $oFeedItem->setAuthor($sUserDisplayName);
         $oFeed->addItem($oFeedItem);
     }
     $oFeed->output();
 }
Exemplo n.º 2
0
 function showFeed($aoChanges)
 {
     $sFeedTitle = $this->t_("title") . " - " . self::globalCfgWebsiteName();
     $oFeed = new AnwFeed(AnwEnv::_GET("feed"), $sFeedTitle, AnwUtils::aLinkAbsolute("lastchanges"));
     foreach ($aoChanges as $oChange) {
         $sType = AnwChange::changeTypei18n($oChange->getType());
         $sPageLink = "";
         if ($oChange->activePageExists()) {
             $oActivePage = $oChange->getActivePage();
             $sPageLink = AnwUtils::linkAbsolute($oActivePage);
             //active link, if it exists
             $sPageTitle = $oActivePage->getName() . ' (' . $oActivePage->getLang() . ')';
             //show old name from the change
         } else {
             $sPageTitle = '(DEL)' . $oChange->getPageName() . ' (' . $oChange->getPageLang() . ')';
         }
         //add to feed
         $sUserDisplayName = $oChange->getUser()->getDisplayName();
         $sItemTitle = $sPageTitle . ' - ' . $sType . ' - ' . $sUserDisplayName;
         $oFeedItem = new AnwFeedItem($sItemTitle, $sPageLink);
         $oFeedItem->setDate($oChange->getTime());
         $oFeedItem->setAuthor($sUserDisplayName);
         $oFeed->addItem($oFeedItem);
     }
     $oFeed->output();
 }
Exemplo n.º 3
0
 function toFeedItem($oContent, $oPage)
 {
     $oFeedItem = new AnwFeedItem($oContent->getContentFieldValue(self::FIELD_TITLE, 0, true), AnwUtils::linkAbsolute($oPage), "...");
     return $oFeedItem;
 }