diff options
Diffstat (limited to 'app/views/helpers/view/normal_view.phtml')
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 104 |
1 files changed, 27 insertions, 77 deletions
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index ae93b627c..1dbf14f4c 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -8,19 +8,10 @@ if (!empty($this->entries)) { $display_yesterday = true; $display_others = true; if ($this->loginOk) { - $shaarli = $this->conf->sharing ('shaarli'); - $wallabag = $this->conf->sharing ('wallabag'); - $diaspora = $this->conf->sharing ('diaspora'); + $sharing = $this->conf->sharing; } else { - $shaarli = ''; - $wallabag = ''; - $diaspora = ''; + $sharing = array(); } - $twitter = $this->conf->sharing ('twitter'); - $google_plus = $this->conf->sharing ('g+'); - $facebook = $this->conf->sharing ('facebook'); - $email = $this->conf->sharing ('email'); - $print = $this->conf->sharing ('print'); $hidePosts = !$this->conf->display_posts; $lazyload = $this->conf->lazyload; $topline_read = $this->conf->topline_read; @@ -29,17 +20,17 @@ if (!empty($this->entries)) { $topline_link = $this->conf->topline_link; $bottomline_read = $this->conf->bottomline_read; $bottomline_favorite = $this->conf->bottomline_favorite; - $bottomline_sharing = $this->conf->bottomline_sharing && ( - $shaarli || $wallabag || $diaspora || $twitter || - $google_plus || $facebook || $email || $print); + $bottomline_sharing = $this->conf->bottomline_sharing && (count($sharing)); $bottomline_tags = $this->conf->bottomline_tags; $bottomline_date = $this->conf->bottomline_date; $bottomline_link = $this->conf->bottomline_link; + + $content_width = $this->conf->content_width; ?> <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php ?><div id="new-article"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a> + <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a> </div><?php foreach ($this->entries as $item) { if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { @@ -90,7 +81,12 @@ if (!empty($this->entries)) { } } $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed (true); + if ($feed == null) { + $feed = $item->feed(true); + if ($feed == null) { + $feed = FreshRSS_Feed::example(); + } + } ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li> <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> @@ -98,16 +94,12 @@ if (!empty($this->entries)) { </ul> <div class="flux_content"> - <div class="content"> - <h1 class="title"><?php echo $item->title (); ?></h1> + <div class="content <?php echo $content_width; ?>"> + <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1> <?php - $author = $item->author (); - echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : ''; - if ($lazyload) { - echo $hidePosts ? lazyIframe(lazyimg($item->content())) : lazyimg($item->content()); - } else { - echo $item->content(); - } + $author = $item->author(); + echo $author != '' ? '<div class="author">' . Minz_Translate::t('by_author', $author) . '</div>' : '', + $lazyload && $hidePosts ? lazyimg($item->content()) : $item->content(); ?> </div> <ul class="horizontal-list bottom"><?php @@ -146,55 +138,13 @@ if (!empty($this->entries)) { <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <?php if ($shaarli) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=FreshRSS'; ?>"> - <?php echo Minz_Translate::t ('shaarli'); ?> - </a> - </li> - <?php } if ($wallabag) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $wallabag . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> - <?php echo Minz_Translate::t ('wallabag'); ?> - </a> - </li> - <?php } if ($diaspora) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&title=' . $title; ?>"> - <?php echo Minz_Translate::t ('diaspora'); ?> - </a> - </li> - <?php } if ($twitter) { ?> - <li class="item share"> - <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('twitter'); ?> - </a> - </li> - <?php } if ($google_plus) { ?> - <li class="item share"> - <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('g+'); ?> - </a> - </li> - <?php } if ($facebook) { ?> - <li class="item share"> - <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&t=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('facebook'); ?> - </a> - </li> - <?php } if ($email) { ?> - <li class="item share"> - <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('by_email'); ?> - </a> - </li> - <?php } if ($print) { ?> - <li class="item share"> - <a href="#" class="print-article"> - <?php echo Minz_Translate::t ('print'); ?> - </a> - </li> - <?php } ?> + <?php foreach ($sharing as $share) :?> + <li class="item share"> + <a target="_blank" href="<?php echo FreshRSS_Share::generateUrl($this->conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>"> + <?php echo Minz_Translate::t ($share['name']);?> + </a> + </li> + <?php endforeach;?> </ul> </div> <?php } ?> @@ -233,8 +183,8 @@ if (!empty($this->entries)) { <?php $this->partial ('nav_entries'); ?> <?php } else { ?> -<div id="stream" class="alert alert-warn normal"> - <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> - <?php echo Minz_Translate::t ('think_to_add'); ?> +<div id="stream" class="prompt alert alert-warn normal"> + <h2><?php echo _t('no_feed_to_display'); ?></h2> + <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> </div> <?php } ?> |
