diff options
| author | 2013-11-28 15:30:24 +0100 | |
|---|---|---|
| committer | 2013-11-28 15:30:24 +0100 | |
| commit | 1e9ccb1da9f38ca983258b983e156d56a2887bc9 (patch) | |
| tree | 590ea31462ab43a1ae44d786fbe57ca334dbf1f7 /app/views/helpers/view/normal_view.phtml | |
| parent | 3e1fa880c261cacaa2ff83863a29fc7556540969 (diff) | |
Ajoute options pour désactiver partage
Possibilité de désactiver le partage Twitter, G+, FB et email
Refactorisation de certaines parties du code
Diffstat (limited to 'app/views/helpers/view/normal_view.phtml')
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index d4343eb13..41b5d4176 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -12,7 +12,17 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { $display_today = true; $display_yesterday = true; $display_others = true; + + $logged = !login_is_conf ($this->conf) || is_logged (); + $shaarli = $logged && $this->conf->sharing ('shaarli'); + $poche = $logged && $this->conf->sharing ('poche'); + $diaspora = $logged && $this->conf->sharing ('diaspora'); + $twitter = $this->conf->sharing ('twitter'); + $google_plus = $this->conf->sharing ('g+'); + $facebook = $this->conf->sharing ('facebook'); + $email = $this->conf->sharing ('email'); ?> + <?php foreach ($items as $item) { ?> <?php if ($display_today && $item->isDay (Days::TODAY)) { ?> @@ -91,68 +101,65 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { } ?> <li class="item"> <?php - if ($this->conf->bottomlineSharing ()) { + if ($this->conf->bottomlineSharing () && ( + $shaarli || $poche || $diaspora || $twitter || + $google_plus || $facebook || $email + )) { $link = urlencode ($item->link ()); $title = urlencode ($item->title () . ' - ' . $feed->name ()); ?> - <div class="dropdown"> + <div class="dropdown"> <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> <?php echo RSSThemes::icon('share'); ?> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"><?php echo Translate::t ('share'); ?></a> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <?php - $shaarli = $this->conf->urlShaarli (); - if ((!login_is_conf ($this->conf) || is_logged ()) && $shaarli) { - ?> + <?php if ($shaarli) { ?> <li class="item"> <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=FreshRSS'; ?>"> - Shaarli + <?php echo Translate::t ('shaarli'); ?> </a> </li> - <?php } ?> - <?php - $poche = $this->conf->urlPoche (); - if ((!login_is_conf ($this->conf) || is_logged ()) && $poche) { - ?> + <?php } if ($poche) { ?> <li class="item"> <a target="_blank" href="<?php echo $poche . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> - Poche + <?php echo Translate::t ('poche'); ?> </a> </li> - <?php } ?> - <?php - $diaspora = $this->conf->urlDiaspora (); - if ((!login_is_conf ($this->conf) || is_logged ()) && $diaspora) { - ?> + <?php } if ($diaspora) { ?> <li class="item"> <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&title=' . $title; ?>"> - Diaspora* + <?php echo Translate::t ('diaspora'); ?> </a> </li> - <?php } ?> + <?php } if ($twitter) { ?> <li class="item"> - <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> - <?php echo Translate::t ('by_email'); ?> + <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> + <?php echo Translate::t ('twitter'); ?> </a> </li> + <?php } if ($google_plus) { ?> <li class="item"> - <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> - Twitter + <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> + <?php echo Translate::t ('g+'); ?> </a> </li> + <?php } if ($facebook) { ?> <li class="item"> <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&t=<?php echo $title; ?>"> - Facebook + <?php echo Translate::t ('facebook'); ?> </a> </li> + <?php } if ($email) { ?> <li class="item"> - <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> - Google+ + <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> + <?php echo Translate::t ('by_email'); ?> </a> </li> + <?php } ?> </ul> - </div><?php } ?> + </div> + <?php } ?> </li> <?php $tags = $this->conf->bottomlineTags () ? $item->tags() : null; |
