getFeedXsl() public static method

As of now, this file MUST live in horde/themes/default/feed-rss.xsl.
public static getFeedXsl ( ) : string
return string Path to the feed file.
Exemplo n.º 1
0
 if (!isset($imgs)) {
     $imgs = array();
     $cnt = count($images);
     for ($i = 0; $i < $cnt; ++$i) {
         $imgs[$i]['link'] = Ansel::getUrlFor('view', array('view' => 'Image', 'gallery' => $images[$i]->gallery, 'image' => $images[$i]->id), true);
         $imgs[$i]['filename'] = $images[$i]->filename;
         $imgs[$i]['caption'] = $images[$i]->caption;
         $imgs[$i]['url'] = htmlspecialchars(Ansel::getImageUrl($images[$i]->id, 'screen', true));
         $imgs[$i]['type'] = $images[$i]->getType('screen');
         $imgs[$i]['author'] = $author;
         $imgs[$i]['thumb'] = htmlspecialchars(Ansel::getImageUrl($images[$i]->id, 'thumb', true));
         $imgs[$i]['latitude'] = $images[$i]->lat;
         $imgs[$i]['longitude'] = $images[$i]->lng;
     }
 }
 $xsl = Horde_Themes::getFeedXsl();
 $stream_name = htmlspecialchars($params['name']);
 $stream_desc = htmlspecialchars($params['desc']);
 $stream_updated = htmlspecialchars(date('r', $params['last_modified']));
 $stream_official = htmlspecialchars($params['link']);
 $image_url = htmlspecialchars($params['image_url']);
 $image_link = htmlspecialchars($params['image_link']);
 $image_alt = htmlspecialchars($params['image_alt']);
 $ansel = 'Ansel ' . $registry->getVersion('ansel') . ' (http://www.horde.org/)';
 if ($stream_type != 'all' && $type != 'rss2') {
     $getparams = array('stream_type' => $stream_type, 'type' => $type);
     if (isset($id)) {
         $getparams['id'] = $id;
     }
 } else {
     $getparams = array();
Exemplo n.º 2
0
if (isset($conf['urls']['pretty']) && $conf['urls']['pretty'] == 'rewrite') {
    $self_url = Horde::url('feed/' . $calendar, true, -1);
} else {
    $self_url = Horde::url('feed/index.php', true, -1)->add('c', $calendar);
}
$owner = $share->get('owner');
$identity = $injector->getInstance('Horde_Core_Factory_Identity')->create($owner);
$history = $injector->getInstance('Horde_History');
$now = new Horde_Date(time());
$template = $injector->createInstance('Horde_Template');
$template->set('updated', $now->format(DATE_ATOM));
$template->set('kronolith_name', 'Kronolith');
$template->set('kronolith_version', $registry->getVersion());
$template->set('kronolith_uri', 'http://www.horde.org/kronolith/');
$template->set('kronolith_icon', Horde::url(Horde_Themes::img('kronolith.png'), true, -1));
$template->set('xsl', Horde_Themes::getFeedXsl());
$template->set('calendar_name', htmlspecialchars($share->get('name')));
$template->set('calendar_desc', htmlspecialchars($share->get('desc')), true);
$template->set('calendar_owner', htmlspecialchars($identity->getValue('fullname')));
$template->set('calendar_email', htmlspecialchars($identity->getValue('from_addr')), true);
$template->set('self_url', $self_url);
$twentyFour = $prefs->getValue('twentyFor');
$entries = array();
foreach ($events as $day_events) {
    foreach ($day_events as $id => $event) {
        /* Modification date. */
        $modified = $history->getActionTimestamp('kronolith:' . $calendar . ':' . $event->uid, 'modify');
        if (!$modified) {
            $modified = $history->getActionTimestamp('kronolith:' . $calendar . ':' . $event->uid, 'add');
        }
        $modified = new Horde_Date($modified);
Exemplo n.º 3
0
    $new_mail = isset($request_parts[1]) && $request_parts[1] === 'new';
}
$imp_mailbox = $mailbox->list_ob;
/* Obtain some information describing the mailbox state. */
$total_num = count($imp_mailbox);
$unseen_num = $mailbox->vinbox ? $total_num : $imp_mailbox->unseenMessages(Horde_Imap_Client::SEARCH_RESULTS_COUNT);
$query = new Horde_Imap_Client_Search_Query();
if ($new_mail) {
    $query->flag(Horde_Imap_Client::FLAG_SEEN, false);
}
$ids = $mailbox->runSearchQuery($query, Horde_Imap_Client::SORT_ARRIVAL, 1);
if (count($ids)) {
    $imp_ui = new IMP_Mailbox_Ui($mailbox);
    $overview = $imp_mailbox->getMailboxArray(array_slice($ids[strval($mailbox)], 0, 20), array('preview' => $prefs->getValue('preview_enabled')));
    foreach ($overview['overview'] as $ob) {
        $from_addr = $imp_ui->getFrom($ob['envelope']);
        $items[] = array_map('htmlspecialchars', array('title' => $imp_ui->getSubject($ob['envelope']->subject), 'pubDate' => $ob['envelope']->date->format('r'), 'description' => isset($ob['preview']) ? $ob['preview'] : '', 'url' => Horde::url($mailbox->url('message', $imp_mailbox->getBuid($mailbox, $ob['uid'])), true, array('append_session' => -1)), 'fromAddr' => strval($from_addr['from_list']), 'toAddr' => strval($ob['envelope']->to)));
    }
}
$description = $total_num === 0 ? _("No Messages") : sprintf(_("%u of %u messages in %s unread."), $unseen_num, $total_num, $mailbox->label);
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/rss'));
$view->addHelper('Text');
$view->desc = $description;
$view->items = $items;
$view->pubDate = date('r');
$view->rss_url = Horde::url('rss.php', true, array('append_session' => -1));
$view->title = $registry->get('name') . ' - ' . $mailbox->label;
$view->url = Horde::url($mailbox->url('message'), true, array('append_session' => -1));
$view->xsl = Horde_Themes::getFeedXsl();
$browser->downloadHeaders('mailbox.rss', 'text/xml', true);
echo $view->render('mailbox.rss.php');