From 878e96202e8a22e4857b98e29b0a1fce68eccbc9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 15 Dec 2013 03:30:24 +0100 Subject: Grosse refactorisation pour permettre le chargement automatique des classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C'est parti de changements pour https://github.com/marienfressinaud/FreshRSS/issues/255 et finalement j'ai continué la refactorisation... Ajout de préfixes FreshRSS_ et Minz_ sur le modèle de SimplePie_. Toutes les classes sont maintenant en chargement automatique (devrait améliorer les performances en évitant de charger plein de classes inutilisées, et faciliter la maintenance). Suppression de set_include_path(). Si souhaité, certaines classes de Minz pourraient être déplacées dans un sous-répertoire, par exemple les exceptions. Tests et relecture nécessaires. --- app/views/configure/categorize.phtml | 22 +++---- app/views/configure/display.phtml | 106 +++++++++++++++---------------- app/views/configure/feed.phtml | 54 ++++++++-------- app/views/configure/importExport.phtml | 18 +++--- app/views/configure/sharing.phtml | 30 ++++----- app/views/configure/shortcut.phtml | 30 ++++----- app/views/entry/bookmark.phtml | 16 ++--- app/views/entry/read.phtml | 16 ++--- app/views/error/index.phtml | 4 +- app/views/helpers/javascript_vars.phtml | 20 +++--- app/views/helpers/logs_pagination.phtml | 16 ++--- app/views/helpers/pagination.phtml | 18 +++--- app/views/helpers/view/global_view.phtml | 2 +- app/views/helpers/view/normal_view.phtml | 53 ++++++++-------- app/views/helpers/view/reader_view.phtml | 4 +- app/views/helpers/view/rss_view.phtml | 6 +- app/views/index/about.phtml | 24 +++---- app/views/index/index.phtml | 10 +-- app/views/index/logs.phtml | 8 +-- app/views/javascript/actualize.phtml | 4 +- 20 files changed, 230 insertions(+), 231 deletions(-) (limited to 'app/views') diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml index d40f43411..a564e8cdd 100644 --- a/app/views/configure/categorize.phtml +++ b/app/views/configure/categorize.phtml @@ -1,28 +1,28 @@ partial ('aside_feed'); ?>
- +
- + -

defaultCategory->name ()); ?>

+

defaultCategory->name ()); ?>

categories as $cat) { $i++; ?>
nbFeed () > 0) { ?> - + - (nbFeed ()); ?>) + (nbFeed ()); ?>) id () == $this->defaultCategory->id ()) { ?> - + @@ -31,16 +31,16 @@
- +
- +
- - + +
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 6ddd99ba0..ad35d7c71 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -1,13 +1,13 @@ partial ('aside_configure'); ?>
- +
- +
- +
themes as $theme) { ?> @@ -32,68 +32,68 @@
- +
- +
- + conf->mailLogin (); ?>
- - + +
- + conf->token (); ?>
- - + +
- +
- +
- +
- +
@@ -102,8 +102,8 @@
@@ -112,8 +112,8 @@
@@ -122,61 +122,61 @@
- +
- +
- +
- - - - - - + + + + + + - + @@ -184,7 +184,7 @@ - + @@ -196,22 +196,22 @@
 
conf->toplineRead () ? ' checked="checked"' : ''; ?> /> conf->toplineFavorite () ? ' checked="checked"' : ''; ?> /> conf->toplineDate () ? ' checked="checked"' : ''; ?> /> conf->toplineLink () ? ' checked="checked"' : ''; ?> />
conf->bottomlineRead () ? ' checked="checked"' : ''; ?> /> conf->bottomlineFavorite () ? ' checked="checked"' : ''; ?> /> conf->bottomlineSharing () ? ' checked="checked"' : ''; ?> />
- +
-

nb_total; ?> , size_total); ?>.

+

nb_total; ?> , size_total); ?>.

- +

- +
- - + +
diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index d714a597b..191e44b9b 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -2,46 +2,46 @@ flux) { ?>
- +

flux->name (); ?>

flux->description (); ?> flux->inError ()) { ?> -

+

- +
- +
- +
- +
- +
- +
- -   + +  
- +
flux->keepHistory () == 'yes' ? ' checked="checked"' : ''; ?> /> - +
- +
- +
- +
- +
- - + +
flux->httpAuth (false); ?>
- +
- +
- +
@@ -112,13 +112,13 @@
- - + +
-
+
diff --git a/app/views/configure/importExport.phtml b/app/views/configure/importExport.phtml index 4cc575356..29a0a682b 100644 --- a/app/views/configure/importExport.phtml +++ b/app/views/configure/importExport.phtml @@ -1,9 +1,9 @@ req == 'export') { ?> '; // résout bug sur certain serveur ?> - + - <?php echo Configuration::title (); ?> OPML Feed + <?php echo Minz_Configuration::title (); ?> OPML Feed @@ -14,12 +14,12 @@ partial ('aside_feed'); ?>
- + -
- + +
- +
@@ -27,9 +27,9 @@
- - - + + +
diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index 311910297..825537fc9 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -1,45 +1,45 @@ partial ('aside_configure'); ?>
- +
- +
- + - +
- + - +
- + - +
- +
@@ -56,8 +56,8 @@
- - + +
diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index ac33a869a..e78d91820 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -1,7 +1,7 @@ partial ('aside_configure'); ?>
- + list_keys as $key) { ?> @@ -12,57 +12,57 @@ conf->shortcuts (); ?>
- + - +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -70,8 +70,8 @@
- - + +
diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml index 1c8214bc4..55b2d3d3d 100755 --- a/app/views/entry/bookmark.phtml +++ b/app/views/entry/bookmark.phtml @@ -1,16 +1,16 @@ Request::controllerName (), - 'a' => Request::actionName (), - 'params' => 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' => RSSThemes::icon(Request::param ('is_favorite') ? 'non-starred' : 'starred'))); +echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred'))); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index af360ed0c..d063ba3d5 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -1,16 +1,16 @@ Request::controllerName (), - 'a' => Request::actionName (), - 'params' => 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' => RSSThemes::icon(Request::param ('is_read') ? 'unread' : 'read'))); +echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_read') ? 'unread' : 'read'))); diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml index d5d090c72..36fcb56f9 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -3,8 +3,8 @@

code; ?>

-
- +
+

diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index d6c2550f5..0c1af45fc 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -2,12 +2,12 @@ echo '"use strict";', "\n"; $mark = $this->conf->markWhen (); echo 'var ', - 'hide_posts=', ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'false' : 'true', + 'hide_posts=', ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'false' : 'true', ',auto_mark_article=', $mark['article'] === 'yes' ? 'true' : 'false', ',auto_mark_site=', $mark['site'] === 'yes' ? 'true' : 'false', ',auto_mark_scroll=', $mark['scroll'] === 'yes' ? 'true' : 'false', ',auto_load_more=', $this->conf->autoLoadMore () === 'yes' ? 'true' : 'false', - ',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'true' : 'false', + ',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'true' : 'false', ',does_lazyload=', $this->conf->lazyload() === 'yes' ? 'true' : 'false'; $s = $this->conf->shortcuts (); @@ -21,11 +21,11 @@ 'load_more:"', $s['load_more'], '"', "},\n"; - if (Request::param ('output') === 'global') { - echo "iconClose='", RSSThemes::icon('close'), "',\n"; + if (Minz_Request::param ('output') === 'global') { + echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; } - $mail = Session::param ('mail', 'null'); + $mail = Minz_Session::param ('mail', 'null'); if ($mail != 'null') { $mail = '"' . $mail . '"'; } @@ -35,11 +35,11 @@ 'url_logout="', _url ('index', 'logout'), '",', 'current_user_mail=', $mail, ",\n"; - echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ",\n"; + echo 'load_shortcuts=', Minz_Request::controllerName () === 'index' && Minz_Request::actionName () === 'index' ? 'true' : 'false', ",\n"; - echo 'str_confirmation="', Translate::t('confirm_action'), '"', ",\n"; + echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; - echo 'auto_actualize_feeds=', Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n"; - if (Session::param('actualize_feeds', false)) { - Session::_param('actualize_feeds'); + echo 'auto_actualize_feeds=', Minz_Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n"; + if (Minz_Session::param('actualize_feeds', false)) { + Minz_Session::_param('actualize_feeds'); } diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index 9f1d6cb23..e3d14810e 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/pagination.phtml b/app/views/helpers/pagination.phtml index 408cfca1b..d4983a32e 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -1,25 +1,25 @@
    • nextId)) { ?> nextId; ?> - + -
      +

      - +
      -
      +
    • diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml index ac17d608a..bc6e24e37 100644 --- a/app/views/helpers/view/global_view.phtml +++ b/app/views/helpers/view/global_view.phtml @@ -32,5 +32,5 @@
      conf->displayPosts () === 'no' ? ' class="hide_posts"' : ''; ?>> - +
      \ No newline at end of file diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 1a7efa58f..094017957 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -24,23 +24,23 @@ if (!empty($this->entries)) { ?> entries as $item) { ?> - isDay (Days::TODAY)) { ?> + isDay (FreshRSS_Days::TODAY)) { ?>
      - + - currentName; ?>
      - isDay (Days::YESTERDAY)) { ?> + isDay (FreshRSS_Days::YESTERDAY)) { ?>
      - + - currentName; ?>
      - isDay (Days::BEFORE_YESTERDAY)) { ?> + isDay (FreshRSS_Days::BEFORE_YESTERDAY)) { ?>
      - + currentName; ?>
      @@ -51,13 +51,13 @@ if (!empty($this->entries)) { if ($this->conf->toplineRead ()) { ?>
    • isRead () ? 'read' : 'unread'); ?>isRead () ? 'read' : 'unread'); ?>
    • conf->toplineFavorite ()) { ?>
    • isFavorite () ? 'starred' : 'non-starred'); ?>isFavorite () ? 'starred' : 'non-starred'); ?>
    • entries)) {
    • ✇ name(); ?>
    • title (); ?>
    • conf->toplineDate ()) { ?>
    • date (); ?> 
    • - conf->toplineLink ()) { ?> + conf->toplineLink ()) { ?>
    @@ -75,7 +75,7 @@ if (!empty($this->entries)) {

    title (); ?>

    author (); - echo $author != '' ? '
    ' . Translate::t ('by_author', $author) . '
    ' : ''; + echo $author != '' ? '
    ' . Minz_Translate::t ('by_author', $author) . '
    ' : ''; if($this->conf->lazyload() == 'yes') { echo lazyimg($item->content ()); } else { @@ -83,19 +83,18 @@ if (!empty($this->entries)) { } ?>
    -
      conf) || is_logged ()) { if ($this->conf->bottomlineRead ()) { ?>
    • isRead () ? 'read' : 'unread'); ?>isRead () ? 'read' : 'unread'); ?>
    • conf->bottomlineFavorite ()) { ?>
    • isFavorite () ? 'starred' : 'non-starred'); ?>isFavorite () ? 'starred' : 'non-starred'); ?>
    • @@ -111,8 +110,8 @@ if (!empty($this->entries)) { @@ -204,6 +203,6 @@ if (!empty($this->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 index 30226af42..29b2be04c 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -21,7 +21,7 @@ if (!empty($this->entries)) {
      author (); ?> - + date (); ?>
      @@ -42,6 +42,6 @@ if (!empty($this->entries)) {
      - +
      \ No newline at end of file diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml index 460146dc0..620bf1388 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/helpers/view/rss_view.phtml @@ -2,11 +2,11 @@ <?php echo $this->rss_title; ?> - - rss_title); ?> + + rss_title); ?> GMT - + entries as $item) { ?> diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index fa799154b..b5c00a1ed 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -1,24 +1,24 @@
      - + -

      +

      -
      +
      -
      -
      Marien Fressinaud -
      +
      +
      Marien Fressinaud -
      -
      -
      +
      +
      -
      -
      +
      +
      -

      +

      -

      -

      +

      +

      diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index bd18d2d77..cf98060c4 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,8 +1,8 @@ conf->token(); -$token_param = Request::param ('token', ''); +$token_param = Minz_Request::param ('token', ''); $token_is_ok = ($token != '' && $token == $token_param); if(!login_is_conf ($this->conf) || @@ -21,9 +21,9 @@ if(!login_is_conf ($this->conf) || } else { ?>
      -

      -

      -

      +

      +

      +

      - + -

      +

      - +

      logsPaginator->items (); ?> @@ -20,6 +20,6 @@ logsPaginator->render ('logs_pagination.phtml','page'); ?>
    -

    +

    diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index f39540a9a..69689133c 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,12 +1,12 @@ var feeds = new Array (); feeds as $feed) { ?> -feeds.push (" 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>"); +feeds.push (" 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>"); function initProgressBar (init) { if (init) { $("body").after ("\
    \ - 0 / " + feeds.length + "
    \ + 0 / " + feeds.length + "
    \ \
    "); } else { -- cgit v1.2.3