summaryrefslogtreecommitdiffstats
path: root/templates/part.shared.php
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-10-28 10:57:35 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-10-28 10:57:35 -0400
commita7f7f04052ded38c94e15a4e94645f6ab2b39941 (patch)
tree0a2c06adb471d5c18535c308f7991b4c9675f876 /templates/part.shared.php
parentff6bee25f0468d291616be9235ae556457d7fc0d (diff)
sharing items in the News app
Diffstat (limited to 'templates/part.shared.php')
-rw-r--r--templates/part.shared.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/templates/part.shared.php b/templates/part.shared.php
new file mode 100644
index 000000000..5e29d8c92
--- /dev/null
+++ b/templates/part.shared.php
@@ -0,0 +1,68 @@
+<?php
+
+$items = OCP\Share::getItemsSharedWith('news_item', 1);
+
+//print_r($items);
+
+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 = $l->t('from') . ' ' . '<a href="#" class="from_feed"> ' . $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><a class="share" data-item-type="news_item" data-item="' . $item->getId() . '" title="' . $l->t('Share') .
+ '" data-possible-permissions="' . (OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_SHARE) . '"/></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>';