public function setRssType($type)
 {
     self::$rssType = $type;
 }
예제 #2
0
<?php

/* @type $Params string[] */

$cluster_identifier = ClusterTool::clusterIdentifier();
$rssGenerator = new MMRssGenerator( $Params, $cluster_identifier );
$outputMode = isset( $Params['outputMode' ]) ? $Params['outputMode'] : NewsletterPresenter::DEFAULT_MODE;

$presenter = NewsletterPresenter::getPresenterForMode($outputMode);
$contentTypeHeader = $presenter->getContentTypeHeader();
$rssGenerator->setConfiguration();
$rssGenerator->getResponseSolr();
$options = $presenter->getOptionsForMode($outputMode);
$presenter->setRssType($rssGenerator->rssType());
$result = $presenter->render($rssGenerator->getLocalApplications(), $rssGenerator->getApplicationData(), $cluster_identifier, $options);
if ($outputMode == 'xml') {
    $rssGenerator->saveForCreatorMail($result);
}

header($contentTypeHeader);
echo $result;

eZExecution::cleanExit();
 public function getOptionsForMode($mode)
 {
     $options = parent::getOptionsForMode($mode);
     switch($mode)
     {
         case 'html':
             $options[self::ENCLOSING_OPTION_KEY] = '<table width="100%%" border="0" cellspacing="0" cellpadding="0">%s</table>';
             break;
         case 'debug':
             $options[self::DEBUG_OPTION_KEY] = true;
             break;
         case 'subject':
             $options[self::SUBJECT_OPTION_KEY] = true;
             break;
         case 'supersubject':
             $options[self::SUPERSUBJECT_OPTION_KEY] = true;
             break;
     }
     return $options;
 }