diff options
| author | 2013-12-30 01:03:32 +0100 | |
|---|---|---|
| committer | 2013-12-30 01:03:32 +0100 | |
| commit | 92efd68a3a13e49fe7bbfb8441611c0dcd639415 (patch) | |
| tree | e6228848744b9369ad4e4e52c541075f5c723b6d /app/views/helpers/view | |
| parent | 220341b40642771f9b5db97296edfb1913182464 (diff) | |
Début de mode multi-utilisateur avec http_auth
+ Légère optimisation de Minz_View.
+ Encore plus de tests de bibliothèques dans install.php
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126 et
https://github.com/marienfressinaud/FreshRSS/issues/303
Diffstat (limited to 'app/views/helpers/view')
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index f59cae2b8..1b4388796 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -7,39 +7,48 @@ if (!empty($this->entries)) { $display_today = true; $display_yesterday = true; $display_others = true; - - $logged = !login_is_conf ($this->conf) || is_logged (); - $shaarli = $this->conf->sharing ('shaarli'); - $poche = $this->conf->sharing ('poche'); - $diaspora = $this->conf->sharing ('diaspora'); + $shaarli = $this->loginOk && $this->conf->sharing ('shaarli'); + $poche = $this->loginOk && $this->conf->sharing ('poche'); + $diaspora = $this->loginOk && $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'); $print = $this->conf->sharing ('print'); - $today = $this->today; $hidePosts = !$this->conf->display_posts; $lazyload = $this->conf->lazyload; + $topline_read = $this->conf->topline_read; + $topline_favorite = $this->conf->topline_favorite; + $topline_date = $this->conf->topline_date; + $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 || $poche || $diaspora || $twitter || + $google_plus || $facebook || $email); + $bottomline_tags = $this->conf->bottomline_tags; + $bottomline_date = $this->conf->bottomline_date; + $bottomline_link = $this->conf->bottomline_link; ?> <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"> <?php foreach ($this->entries as $item) { ?> - <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $today)) { ?> + <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { ?> <div class="day" id="day_today"> <?php echo Minz_Translate::t ('today'); ?> <span class="date"> - <?php echo timestamptodate (time (), false); ?></span> <span class="name"><?php echo $this->currentName; ?></span> </div> <?php $display_today = false; } ?> - <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $today)) { ?> + <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { ?> <div class="day" id="day_yesterday"> <?php echo Minz_Translate::t ('yesterday'); ?> <span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span> <span class="name"><?php echo $this->currentName; ?></span> </div> <?php $display_yesterday = false; } ?> - <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $today)) { ?> + <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { ?> <div class="day" id="day_before_yesterday"> <?php echo Minz_Translate::t ('before_yesterday'); ?> <span class="name"><?php echo $this->currentName; ?></span> @@ -48,14 +57,14 @@ if (!empty($this->entries)) { <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> <ul class="horizontal-list flux_header"><?php - if ($logged) { - if ($this->conf->topline_read) { + if ($this->loginOk) { + if ($topline_read) { ?><li class="item manage"><?php ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } - if ($this->conf->topline_favorite) { + if ($topline_favorite) { ?><li class="item manage"><?php ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php @@ -67,8 +76,8 @@ if (!empty($this->entries)) { ?> <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 ($this->conf->topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($this->conf->topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> + <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> + <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> </ul> <div class="flux_content"> @@ -85,14 +94,14 @@ if (!empty($this->entries)) { ?> </div> <ul class="horizontal-list bottom"><?php - if ($logged) { - if ($this->conf->bottomline_read) { + if ($this->loginOk) { + if ($bottomline_read) { ?><li class="item manage"><?php ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } - if ($this->conf->bottomline_favorite) { + if ($bottomline_favorite) { ?><li class="item manage"><?php ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php @@ -101,10 +110,7 @@ if (!empty($this->entries)) { } ?> <li class="item"> <?php - if ($this->conf->bottomline_sharing && ( - $shaarli || $poche || $diaspora || $twitter || - $google_plus || $facebook || $email - )) { + if ($bottomline_sharing) { $link = urlencode ($item->link ()); $title = urlencode ($item->title () . ' - ' . $feed->name ()); ?> @@ -117,19 +123,19 @@ if (!empty($this->entries)) { <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <?php if ($logged && $shaarli) { ?> + <?php if ($shaarli) { ?> <li class="item"> <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=FreshRSS'; ?>"> <?php echo Minz_Translate::t ('shaarli'); ?> </a> </li> - <?php } if ($logged && $poche) { ?> + <?php } if ($poche) { ?> <li class="item"> <a target="_blank" href="<?php echo $poche . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> <?php echo Minz_Translate::t ('poche'); ?> </a> </li> - <?php } if ($logged && $diaspora) { ?> + <?php } if ($diaspora) { ?> <li class="item"> <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&title=' . $title; ?>"> <?php echo Minz_Translate::t ('diaspora'); ?> @@ -171,7 +177,7 @@ if (!empty($this->entries)) { <?php } ?> </li> <?php - $tags = $this->conf->bottomline_tags ? $item->tags() : null; + $tags = $bottomline_tags ? $item->tags() : null; if (!empty($tags)) { ?> <li class="item"> @@ -190,8 +196,8 @@ if (!empty($this->entries)) { </div> </li> <?php } ?> - <?php if ($this->conf->bottomline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($this->conf->bottomline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> + <?php if ($bottomline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> + <?php if ($bottomline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> </ul> </div> </div> |
