示例#1
0
文件: rss.php 项目: Jobava/narro
                 $objItem->PubDate = new QDateTime($objNarroContextInfo->Context->Text->Created);
                 if ($objNarroContextInfo->Context->Text->HasComments) {
                     $objItem->Comments = __HTTP_URL__ . __VIRTUAL_DIRECTORY__ . __SUBDIRECTORY__ . sprintf('/translate.php?l=%s&p=%d&c=%d#textcomments', QApplication::$TargetLanguage->LanguageCode, $objNarroContextInfo->Context->ProjectId, $objNarroContextInfo->ContextId);
                 }
             }
             $intOldTextId = $objNarroContextInfo->Context->TextId;
             if ($intOldProjectId != $objNarroContextInfo->Context->ProjectId) {
                 $strProjectLink = sprintf(__HTTP_URL__ . __VIRTUAL_DIRECTORY__ . __SUBDIRECTORY__ . '/' . NarroLink::ProjectTextList($objNarroContextInfo->Context->ProjectId, NarroTranslatePanel::SHOW_ALL, ''));
                 if (isset($objProject)) {
                     $strDescription .= sprintf(t('Used in the following contexts:') . '<ul>', $strProjectLink, $objNarroContextInfo->Context->Project->ProjectName, t('Contexts'));
                 } else {
                     $strDescription .= sprintf(t('Used in the project <a href="%s">%s</a>, in the following contexts:') . '<ul>', $strProjectLink, $objNarroContextInfo->Context->Project->ProjectName, t('Contexts'));
                 }
             }
             $intOldProjectId = $objNarroContextInfo->Context->ProjectId;
             $strFileLink = sprintf(__HTTP_URL__ . __VIRTUAL_DIRECTORY__ . __SUBDIRECTORY__ . '/' . NarroLink::FileTextList($objNarroContextInfo->Context->ProjectId, $objNarroContextInfo->Context->FileId, 2, 1, ''));
             $strDescription .= sprintf('<li>' . t('<a href="%s">%s</a> from the file <a href="%s">%s</a>') . '</li>', $strContextLink, NarroString::HtmlEntities($objNarroContextInfo->Context->Context), $strFileLink, $objNarroContextInfo->Context->File->FileName);
         }
         $objRssFeed->Language = strtolower(QApplication::$TargetLanguage->LanguageCode);
         $objRssFeed->Image = new QRssImage(__HTTP_URL__ . __VIRTUAL_DIRECTORY__ . __SUBDIRECTORY__ . '/assets/images/narro.png', t('Narro - Translate, we\'re open!'), __HTTP_URL__ . __VIRTUAL_DIRECTORY__ . __SUBDIRECTORY__ . '/index.php');
         QApplication::$Cache->save($objRssFeed, $strCacheId, array(), 3600);
     }
     $objRssFeed->Run();
     break;
 case 'context_info_changes':
     if (isset($objProject) && $objProject instanceof NarroProject) {
         $strCacheId = sprintf('rssfeed_context_info_changes_%d_%d', $objProject->ProjectId, QApplication::QueryString('l'));
     } else {
         $strCacheId = sprintf('rssfeed_context_info_changes_%d', QApplication::QueryString('l'));
     }
     if (!($objRssFeed = QApplication::$Cache->load($strCacheId))) {