From 22febc135134511b43a8543ea45c49c7aeec6f84 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 27 Jul 2013 13:58:58 +0200 Subject: Fix issue #101 : option interdiction anonymes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout d'une option pour interdire la lecture anonyme (interdit par défaut) Correction de l'internationalisation pour la pagination des logs --- app/views/configure/display.phtml | 4 + app/views/helpers/global_view.phtml | 37 --------- app/views/helpers/logs_pagination.phtml | 8 +- app/views/helpers/normal_view.phtml | 131 ------------------------------- app/views/helpers/reader_view.phtml | 45 ----------- app/views/helpers/rss_view.phtml | 30 ------- app/views/helpers/view/global_view.phtml | 37 +++++++++ app/views/helpers/view/normal_view.phtml | 131 +++++++++++++++++++++++++++++++ app/views/helpers/view/reader_view.phtml | 45 +++++++++++ app/views/helpers/view/rss_view.phtml | 30 +++++++ app/views/index/index.phtml | 25 ++++-- 11 files changed, 269 insertions(+), 254 deletions(-) delete mode 100644 app/views/helpers/global_view.phtml delete mode 100644 app/views/helpers/normal_view.phtml delete mode 100644 app/views/helpers/reader_view.phtml delete mode 100755 app/views/helpers/rss_view.phtml create mode 100644 app/views/helpers/view/global_view.phtml create mode 100644 app/views/helpers/view/normal_view.phtml create mode 100644 app/views/helpers/view/reader_view.phtml create mode 100755 app/views/helpers/view/rss_view.phtml (limited to 'app/views') diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 7ed5989e2..f8e94c0f2 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -31,6 +31,10 @@
+
diff --git a/app/views/helpers/global_view.phtml b/app/views/helpers/global_view.phtml deleted file mode 100644 index fff391cba..000000000 --- a/app/views/helpers/global_view.phtml +++ /dev/null @@ -1,37 +0,0 @@ -partial ('nav_menu'); ?> - -
-cat_aside as $cat) { - $feeds = $cat->feeds (); - $catNotRead = $cat->nbNotRead (); - if (!empty ($feeds)) { -?> - - -
\ No newline at end of file diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index 0088dabc6..9f1d6cb23 100755 --- a/app/views/helpers/logs_pagination.phtml +++ b/app/views/helpers/logs_pagination.phtml @@ -9,14 +9,14 @@
  • currentPage > 1) { ?> - « Début + «
  • currentPage - 1; ?>
  • currentPage > 1) { ?> - ‹ Précédent +
  • @@ -34,13 +34,13 @@ currentPage + 1; ?>
  • currentPage < $this->nbPage) { ?> - Suivant › +
  • nbPage; ?>
  • currentPage < $this->nbPage) { ?> - Fin » + »
  • diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml deleted file mode 100644 index 4f08bea7f..000000000 --- a/app/views/helpers/normal_view.phtml +++ /dev/null @@ -1,131 +0,0 @@ -partial ('aside_flux'); -$this->partial ('nav_menu'); - -if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); -?> - -
    - - - - isDay (Days::TODAY)) { ?> -
    -
    - - isDay (Days::YESTERDAY)) { ?> -
    -
    - - isDay (Days::BEFORE_YESTERDAY)) { ?> -
    - - -
    -
      - conf) || is_logged ()) { ?> -
    • - isRead ()) { ?> -   - -   - - - isFavorite ()) { ?> -   - -   - -
    • - - feed (true); ?> -
    • name (); ?>
    • -
    • title (); ?>
    • -
    • date (); ?>
    • - -
    - -
    -
    -

    title (); ?>

    - author (); ?> - ' . Translate::t ('by_author', $author) . '
    ' : ''; ?> - conf->lazyload() == 'yes') { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> -
    - -
      - conf) || is_logged ()) { ?> -
    • - isRead ()) { ?> -   - -   - - - isFavorite ()) { ?> -   - -   - -
    • - -
    • - -
    • - tags(); ?> - -
    • - -
    • - -
    -
    -
    - - - entryPaginator->render ('pagination.phtml', 'next'); ?> - - -partial ('nav_entries'); ?> - - -
    - -
    - \ No newline at end of file diff --git a/app/views/helpers/reader_view.phtml b/app/views/helpers/reader_view.phtml deleted file mode 100644 index 46a65a4e3..000000000 --- a/app/views/helpers/reader_view.phtml +++ /dev/null @@ -1,45 +0,0 @@ -partial ('nav_menu'); - -if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); -?> - -
    - - -
    -
    -
    - feed (true); ?> - - name (); ?> - -

    title (); ?>

    - -
    - author (); ?> - - date (); ?> -
    - - conf->lazyload() == 'yes') { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> -
    -
    -
    - - - entryPaginator->render ('pagination.phtml', 'next'); ?> -
    - - -
    - -
    - \ No newline at end of file diff --git a/app/views/helpers/rss_view.phtml b/app/views/helpers/rss_view.phtml deleted file mode 100755 index 83de6de2e..000000000 --- a/app/views/helpers/rss_view.phtml +++ /dev/null @@ -1,30 +0,0 @@ -'; ?> - - - <?php echo View::title(); ?> - - - - GMT - -entryPaginator->items (); -foreach ($items as $item) { -?> - - <?php echo htmlspecialchars(html_entity_decode($item->title ())); ?> - link (); ?> - author (); ?> - - - - content (); -?>]]> - date (true)); ?> - id (); ?> - - - - - diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml new file mode 100644 index 000000000..fff391cba --- /dev/null +++ b/app/views/helpers/view/global_view.phtml @@ -0,0 +1,37 @@ +partial ('nav_menu'); ?> + +
    +cat_aside as $cat) { + $feeds = $cat->feeds (); + $catNotRead = $cat->nbNotRead (); + if (!empty ($feeds)) { +?> + + +
    \ No newline at end of file diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml new file mode 100644 index 000000000..4f08bea7f --- /dev/null +++ b/app/views/helpers/view/normal_view.phtml @@ -0,0 +1,131 @@ +partial ('aside_flux'); +$this->partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); +?> + +
    + + + + isDay (Days::TODAY)) { ?> +
    -
    + + isDay (Days::YESTERDAY)) { ?> +
    -
    + + isDay (Days::BEFORE_YESTERDAY)) { ?> +
    + + +
    +
      + conf) || is_logged ()) { ?> +
    • + isRead ()) { ?> +   + +   + + + isFavorite ()) { ?> +   + +   + +
    • + + feed (true); ?> +
    • name (); ?>
    • +
    • title (); ?>
    • +
    • date (); ?>
    • + +
    + +
    +
    +

    title (); ?>

    + author (); ?> + ' . Translate::t ('by_author', $author) . '
    ' : ''; ?> + conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> +
    + +
      + conf) || is_logged ()) { ?> +
    • + isRead ()) { ?> +   + +   + + + isFavorite ()) { ?> +   + +   + +
    • + +
    • + +
    • + tags(); ?> + +
    • + +
    • + +
    +
    +
    + + + entryPaginator->render ('pagination.phtml', 'next'); ?> + + +partial ('nav_entries'); ?> + + +
    + +
    + \ No newline at end of file diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml new file mode 100644 index 000000000..46a65a4e3 --- /dev/null +++ b/app/views/helpers/view/reader_view.phtml @@ -0,0 +1,45 @@ +partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); +?> + +
    + + +
    +
    +
    + feed (true); ?> + + name (); ?> + +

    title (); ?>

    + +
    + author (); ?> + + date (); ?> +
    + + conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> +
    +
    +
    + + + entryPaginator->render ('pagination.phtml', 'next'); ?> +
    + + +
    + +
    + \ No newline at end of file diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml new file mode 100755 index 000000000..83de6de2e --- /dev/null +++ b/app/views/helpers/view/rss_view.phtml @@ -0,0 +1,30 @@ +'; ?> + + + <?php echo View::title(); ?> + + + + GMT + +entryPaginator->items (); +foreach ($items as $item) { +?> + + <?php echo htmlspecialchars(html_entity_decode($item->title ())); ?> + link (); ?> + author (); ?> + + + + content (); +?>]]> + date (true)); ?> + id (); ?> + + + + + diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 46ff33b3a..4bf82f9b4 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -2,12 +2,23 @@ $output = Request::param ('output', 'normal'); -if ($output == 'rss') { - $this->renderHelper ('rss_view'); -} elseif($output == 'reader') { - $this->renderHelper ('reader_view'); -} elseif($output == 'global') { - $this->renderHelper ('global_view'); +if(!login_is_conf ($this->conf) || + is_logged() || + $this->conf->anonAccess() == 'yes') { + if($output == 'rss') { + $this->renderHelper ('view/rss_view'); + } elseif($output == 'reader') { + $this->renderHelper ('view/reader_view'); + } elseif($output == 'global') { + $this->renderHelper ('view/global_view'); + } else { + $this->renderHelper ('view/normal_view'); + } } else { - $this->renderHelper ('normal_view'); +?> +
    +

    +

    +
    +