blob: eafdf7777922d111fdc4c050658c637a1eeff9e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
<?php
$items = isset($_['items']) ? $_['items'] : '';
$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : '';
echo '<ul>';
foreach($items as $item) {
if($item->isRead()) {
$newsItemClass = "read";
} else {
$newsItemClass = "";
}
if($item->isImportant()) {
$starClass = 'important';
$startTitle = $l->t('Mark as unimportant');
} else {
$starClass = '';
$startTitle = $l->t('Mark as important');
}
echo '<li class="feed_item ' . $newsItemClass .'" data-id="' . $item->getId() . '" data-feedid="' . $item->getFeedId() . '">';
echo '<span class="timestamp">' . $item->getDate() . '</span>';
echo '<h2 class="item_date"><time class="timeago" datetime="' .
date('c', $item->getDate()) . '">' . date('F j, Y, g:i a', $item->getDate()) . '</time>' . '</h2>';
echo '<div class="utils">';
echo '<ul class="primary_item_utils">';
echo '<li class="star ' . $starClass . '" title="' . $startTitle . '"></li>';
echo '</ul>';
echo '</div>';
echo '<h1 class="item_title"><a target="_blank" href="' . $item->getUrl() . '">' . htmlspecialchars($item->getTitle(), ENT_QUOTES, 'UTF-8') . '</a></h1>';
if ((int)$lastViewedFeedType !== OCA\News\FeedType::FEED) {
$feedTitle = '<a href="#" class="from_feed"> ' . $l->t('from') . ' ' . $item->getFeedTitle() . '</a> ';
} else {
$feedTitle = '';
}
if(($item->getAuthor() !== null) && (trim($item->getAuthor()) !== '')) {
$author = $l->t('by') . ' ' . htmlspecialchars($item->getAuthor(), ENT_QUOTES, 'UTF-8');
} else {
$author = '';
}
if(!($feedTitle === '' && $author === '')){
echo '<h2 class="item_author">'. $feedTitle . $author . '</h2>';
}
echo '<div class="body">' . $item->getBody() . '</div>';
echo '<div class="bottom_utils">';
echo '<ul class="secondary_item_utils">';
echo '<li class="keep_unread">' . $l->t('Keep unread') . '<input type="checkbox" /></li>';
echo '</ul>';
echo '</div>';
echo '</li>';
}
echo '</ul>';
|