From 65ab90d3c77085abe9eb259bd7780f648051d49d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 5 Oct 2014 19:11:43 +0200 Subject: Coding style (views) See https://github.com/marienfressinaud/FreshRSS/issues/655 --- app/FreshRSS.php | 24 ++++++------- app/views/configure/display.phtml | 8 ++--- app/views/configure/sharing.phtml | 6 ++-- app/views/entry/bookmark.phtml | 16 ++++----- app/views/entry/read.phtml | 16 ++++----- app/views/helpers/feed/update.phtml | 40 ++++++++++----------- app/views/helpers/logs_pagination.phtml | 16 ++++----- app/views/helpers/view/global_view.phtml | 16 ++++----- app/views/helpers/view/normal_view.phtml | 60 ++++++++++++++++---------------- app/views/helpers/view/reader_view.phtml | 14 ++++---- app/views/helpers/view/rss_view.phtml | 14 ++++---- app/views/index/index.phtml | 18 +++++----- app/views/index/login.phtml | 2 +- app/views/index/logs.phtml | 14 ++++---- app/views/stats/index.phtml | 34 +++++++++--------- app/views/users/index.phtml | 2 +- 16 files changed, 150 insertions(+), 150 deletions(-) diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 16f64fd8b..61e8d83f0 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -88,7 +88,7 @@ class FreshRSS extends Minz_FrontController { try { $this->conf = new FreshRSS_Configuration($currentUser); - Minz_View::_param ('conf', $this->conf); + Minz_View::_param('conf', $this->conf); Minz_Session::_param('currentUser', $currentUser); } catch (Minz_Exception $me) { $loginOk = false; @@ -100,8 +100,8 @@ class FreshRSS extends Minz_FrontController { 'type' => 'bad', 'content' => 'Invalid configuration for user [' . $currentUser . ']!', ); - Minz_Session::_param ('notification', $notif); - Minz_Log::record ($notif['content'] . ' ' . $me->getMessage(), Minz_Log::WARNING); + Minz_Session::_param('notification', $notif); + Minz_Log::record($notif['content'] . ' ' . $me->getMessage(), Minz_Log::WARNING); Minz_Session::_param('currentUser', ''); } catch (Exception $e) { die($e->getMessage()); @@ -130,13 +130,13 @@ class FreshRSS extends Minz_FrontController { return $loginOk; } - private function loadParamsView () { - Minz_Session::_param ('language', $this->conf->language); + private function loadParamsView() { + Minz_Session::_param('language', $this->conf->language); Minz_Translate::init(); - $output = Minz_Request::param ('output', ''); + $output = Minz_Request::param('output', ''); if (($output === '') || ($output !== 'normal' && $output !== 'rss' && $output !== 'reader' && $output !== 'global')) { $output = $this->conf->view_mode; - Minz_Request::_param ('output', $output); + Minz_Request::_param('output', $output); } } @@ -161,7 +161,7 @@ class FreshRSS extends Minz_FrontController { switch (Minz_Configuration::authType()) { case 'form': if (!$loginOk) { - Minz_View::appendScript(Minz_Url::display ('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js'))); + Minz_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js'))); } break; case 'persona': @@ -173,11 +173,11 @@ class FreshRSS extends Minz_FrontController { Minz_View::appendScript(Minz_Url::display('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js'))); } - private function loadNotifications () { - $notif = Minz_Session::param ('notification'); + private function loadNotifications() { + $notif = Minz_Session::param('notification'); if ($notif) { - Minz_View::_param ('notification', $notif); - Minz_Session::_param ('notification'); + Minz_View::_param('notification', $notif); + Minz_Session::_param('notification'); } } diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 34239c7b2..1614bd56b 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -1,16 +1,16 @@ -partial ('aside_configure'); ?> +partial('aside_configure'); ?>
- + -
+
' data-advanced='
diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml index ab61fa206..c346d2c4c 100755 --- a/app/views/entry/bookmark.phtml +++ b/app/views/entry/bookmark.phtml @@ -1,16 +1,16 @@ Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), +$url = Minz_Url::display(array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::params(), )); -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => _i(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred'))); +echo json_encode(array('url' => str_ireplace('&', '&', $url), 'icon' => _i(Minz_Request::param('is_favorite') ? 'non-starred' : 'starred'))); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index 0ef9df7eb..fabdec9e0 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -1,16 +1,16 @@ Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), +$url = Minz_Url::display(array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::params(), )); -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => _i(Minz_Request::param ('is_read') ? 'unread' : 'read'))); +echo json_encode(array('url' => str_ireplace('&', '&', $url), 'icon' => _i(Minz_Request::param('is_read') ? 'unread' : 'read'))); diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 9235752c3..d79ef2666 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -1,28 +1,28 @@
-

feed->name (); ?>

+

feed->name(); ?>

- +
-

feed->description (); ?>

+

feed->description(); ?>

- feed->nbEntries (); ?> + feed->nbEntries(); ?> - feed->inError ()) { ?> + feed->inError()) { ?>

- +
- +
@@ -35,8 +35,8 @@
- - + +
@@ -44,11 +44,11 @@
- - + +
- +
@@ -56,8 +56,8 @@
@@ -67,7 +67,7 @@
@@ -78,7 +78,7 @@
@@ -89,7 +89,7 @@
@@ -129,12 +129,12 @@
- +
- feed->httpAuth (false); ?> + feed->httpAuth(false); ?>
@@ -159,7 +159,7 @@
- +
diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index 191cfa8de..ad46279c7 100755 --- a/app/views/helpers/logs_pagination.phtml +++ b/app/views/helpers/logs_pagination.phtml @@ -1,7 +1,7 @@ nbPage > 1) { ?> @@ -9,14 +9,14 @@
  • currentPage > 1) { ?> - « + «
  • currentPage - 1; ?>
  • currentPage > 1) { ?> - +
  • @@ -24,7 +24,7 @@ 0 && $i <= $this->nbPage) { ?> currentPage) { ?> -
  • +
  • @@ -34,13 +34,13 @@ currentPage + 1; ?>
  • currentPage < $this->nbPage) { ?> - +
  • nbPage; ?>
  • currentPage < $this->nbPage) { ?> - » + »
  • diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml index 0e553c957..2bac09d04 100644 --- a/app/views/helpers/view/global_view.phtml +++ b/app/views/helpers/view/global_view.phtml @@ -1,4 +1,4 @@ -partial ('nav_menu'); ?> +partial('nav_menu'); ?> entries)) { ?>
    @@ -13,21 +13,21 @@ } foreach ($this->cat_aside as $cat) { - $feeds = $cat->feeds (); - if (!empty ($feeds)) { + $feeds = $cat->feeds(); + if (!empty($feeds)) { ?>
      - nbNotRead (); ?> -
    • - ✇ - + nbNotRead(); ?> +
    • + ✇ + name(); ?>
    • diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 66b79cd7f..109fad0eb 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -1,7 +1,7 @@ partial ('aside_flux'); -$this->partial ('nav_menu'); +$this->partial('aside_flux'); +$this->partial('nav_menu'); if (!empty($this->entries)) { $display_today = true; @@ -30,72 +30,72 @@ if (!empty($this->entries)) {
      - +
      entries as $item) { - if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { + if ($display_today && $item->isDay(FreshRSS_Days::TODAY, $this->today)) { ?>
      currentName; ?>
      isDay (FreshRSS_Days::YESTERDAY, $this->today)) { + if ($display_yesterday && $item->isDay(FreshRSS_Days::YESTERDAY, $this->today)) { ?>
      currentName; ?>
      isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { + if ($display_others && $item->isDay(FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { ?>
      currentName; ?>
      + ?>
        loginOk) { if ($topline_read) { ?>
      • 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id())); if ($item->isRead()) { $arUrl['params']['is_read'] = 0; } ?>isRead () ? 'read' : 'unread'); ?>isRead() ? 'read' : 'unread'); ?>
      • 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); if ($item->isFavorite()) { $arUrl['params']['is_favorite'] = 0; } ?>isFavorite () ? 'starred' : 'non-starred'); ?>isFavorite() ? 'starred' : 'non-starred'); ?>
      • cat_aside, $item->feed ()); //We most likely already have the feed object in cache + $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed()); //We most likely already have the feed object in cache if ($feed == null) { $feed = $item->feed(true); if ($feed == null) { $feed = FreshRSS_Feed::example(); } } - ?>
      • ✇ name(); ?>
      • -
      • title (); ?>
      • -
      • date (); ?> 
      • - + ?>
      • ✇ name(); ?>
      • +
      • title(); ?>
      • +
      • date(); ?> 
      • +
      -

      title (); ?>

      +

      title(); ?>

      author(); echo $author != '' ? '
      ' . _t('by_author', $author) . '
      ' : '', @@ -106,32 +106,32 @@ if (!empty($this->entries)) { if ($this->loginOk) { if ($bottomline_read) { ?>
    • 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id())); if ($item->isRead()) { $arUrl['params']['is_read'] = 0; } ?>isRead () ? 'read' : 'unread'); ?>isRead() ? 'read' : 'unread'); ?>
    • 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); if ($item->isFavorite()) { $arUrl['params']['is_favorite'] = 0; } ?>isFavorite () ? 'starred' : 'non-starred'); ?>isFavorite() ? 'starred' : 'non-starred'); ?>
    • link ()); - $title = urlencode ($item->title () . ' · ' . $feed->name ()); + $link = urlencode($item->link()); + $title = urlencode($item->title() . ' · ' . $feed->name()); ?>
    • date (); ?>
    • date(); ?>
    @@ -181,7 +181,7 @@ if (!empty($this->entries)) { renderHelper('pagination'); ?>
    -partial ('nav_entries'); ?> +partial('nav_entries'); ?>
    diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index 368bf7fdc..894c71924 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -1,5 +1,5 @@ partial ('nav_menu'); +$this->partial('nav_menu'); if (!empty($this->entries)) { $lazyload = $this->conf->lazyload; @@ -9,17 +9,17 @@ if (!empty($this->entries)) {
    entries as $item) { ?> -
    +
    cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed (true); + $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); ?> - - ✇ name(); ?> + + ✇ name(); ?> -

    title (); ?>

    +

    title(); ?>

    author(); diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml index fd8a8af63..e34b15ab1 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/helpers/view/rss_view.phtml @@ -6,22 +6,22 @@ rss_title); ?> GMT - + entries as $item) { ?> - <?php echo $item->title (); ?> - link (); ?> - author (); ?> + <?php echo $item->title(); ?> + link(); ?> + author(); ?> content (); + echo $item->content(); ?>]]> - date (true)); ?> - id (); ?> + date(true)); ?> + id(); ?> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 1ff36ca8e..5e935b81e 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,25 +1,25 @@ loginOk || Minz_Configuration::allowAnonymous()) { if ($output === 'normal') { - $this->renderHelper ('view/normal_view'); + $this->renderHelper('view/normal_view'); } elseif ($output === 'reader') { - $this->renderHelper ('view/reader_view'); + $this->renderHelper('view/reader_view'); } elseif ($output === 'global') { - $this->renderHelper ('view/global_view'); + $this->renderHelper('view/global_view'); } elseif ($output === 'rss') { - $this->renderHelper ('view/rss_view'); + $this->renderHelper('view/rss_view'); } else { - Minz_Request::_param ('output', 'normal'); + Minz_Request::_param('output', 'normal'); $output = 'normal'; - $this->renderHelper ('view/normal_view'); + $this->renderHelper('view/normal_view'); } } elseif ($output === 'rss') { // token has already been checked in the controller so we can show the view - $this->renderHelper ('view/rss_view'); + $this->renderHelper('view/rss_view'); } else { // Normally, it should not happen, but log it anyway - Minz_Log::record ('Something is wrong in ' . __FILE__ . ' line ' . __LINE__, Minz_Log::ERROR); + Minz_Log::record('Something is wrong in ' . __FILE__ . ' line ' . __LINE__, Minz_Log::ERROR); } diff --git a/app/views/index/login.phtml b/app/views/index/login.phtml index cc814deff..79fbe9d21 100644 --- a/app/views/index/login.phtml +++ b/app/views/index/login.phtml @@ -1 +1 @@ -res); ?> +res); ?> diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml index 18629ed9e..101692daf 100644 --- a/app/views/index/logs.phtml +++ b/app/views/index/logs.phtml @@ -1,23 +1,23 @@
    - +

    -

    +

    - logsPaginator->items (); ?> + logsPaginator->items(); ?> - +
    - logsPaginator->render ('logs_pagination.phtml', 'page'); ?> + logsPaginator->render('logs_pagination.phtml', 'page'); ?> -
    date ())); ?>info (), ENT_NOQUOTES, 'UTF-8'); ?>
    +
    date())); ?>info(), ENT_NOQUOTES, 'UTF-8'); ?>
    - logsPaginator->render ('logs_pagination.phtml','page'); ?> + logsPaginator->render('logs_pagination.phtml','page'); ?>

    diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml index fa57a77c0..ba4258b71 100644 --- a/app/views/stats/index.phtml +++ b/app/views/stats/index.phtml @@ -1,38 +1,38 @@ partial('aside_stats'); ?>
    - + -

    +

    -

    +

    - - + + - + - + - + - + @@ -41,14 +41,14 @@
    -

    +

     
    repartition['main_stream']['total']); ?> repartition['all_feeds']['total']); ?>
    repartition['main_stream']['read']); ?> repartition['all_feeds']['read']); ?>
    repartition['main_stream']['unread']); ?> repartition['all_feeds']['unread']); ?>
    repartition['main_stream']['favorite']); ?> repartition['all_feeds']['favorite']); ?>
    - - - - + + + + @@ -65,18 +65,18 @@
    -

    +

    -

    +

    -

    +

    diff --git a/app/views/users/index.phtml b/app/views/users/index.phtml index 517e302e5..95659f727 100644 --- a/app/views/users/index.phtml +++ b/app/views/users/index.phtml @@ -164,7 +164,7 @@