diff options
| author | 2013-12-15 03:30:24 +0100 | |
|---|---|---|
| committer | 2013-12-15 03:30:24 +0100 | |
| commit | 878e96202e8a22e4857b98e29b0a1fce68eccbc9 (patch) | |
| tree | f9233c3b48a0cd6e0ac2536ddcc1897201595ad4 /app/views/helpers | |
| parent | 4af233e1f736eb2256e5e1696418635165467855 (diff) | |
Grosse refactorisation pour permettre le chargement automatique des classes
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.
Diffstat (limited to 'app/views/helpers')
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 20 | ||||
| -rwxr-xr-x | app/views/helpers/logs_pagination.phtml | 16 | ||||
| -rwxr-xr-x | app/views/helpers/pagination.phtml | 18 | ||||
| -rw-r--r-- | app/views/helpers/view/global_view.phtml | 2 | ||||
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 53 | ||||
| -rw-r--r-- | app/views/helpers/view/reader_view.phtml | 4 | ||||
| -rwxr-xr-x | app/views/helpers/view/rss_view.phtml | 6 |
7 files changed, 59 insertions, 60 deletions
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 @@ <?php - $c = Request::controllerName (); - $a = Request::actionName (); - $params = Request::params (); + $c = Minz_Request::controllerName (); + $a = Minz_Request::actionName (); + $params = Minz_Request::params (); ?> <?php if ($this->nbPage > 1) { ?> @@ -9,14 +9,14 @@ <?php $params[$getteur] = 1; ?> <li class="item pager-first"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Translate::t('first'); ?></a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Minz_Translate::t('first'); ?></a> <?php } ?> </li> <?php $params[$getteur] = $this->currentPage - 1; ?> <li class="item pager-previous"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Translate::t('previous'); ?></a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Minz_Translate::t('previous'); ?></a> <?php } ?> </li> @@ -24,7 +24,7 @@ <?php if($i > 0 && $i <= $this->nbPage) { ?> <?php if ($i != $this->currentPage) { ?> <?php $params[$getteur] = $i; ?> - <li class="item pager-item"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> + <li class="item pager-item"><a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> <?php } else { ?> <li class="item pager-current"><?php echo $i; ?></li> <?php } ?> @@ -34,13 +34,13 @@ <?php $params[$getteur] = $this->currentPage + 1; ?> <li class="item pager-next"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t('next'); ?> ›</a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('next'); ?> ›</a> <?php } ?> </li> <?php $params[$getteur] = $this->nbPage; ?> <li class="item pager-last"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t('last'); ?> »</a> + <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('last'); ?> »</a> <?php } ?> </li> </ul> 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 @@ <?php - $c = Request::controllerName (); - $a = Request::actionName (); - $params = Request::params (); - $markReadUrl = Session::param ('markReadUrl'); - Session::_param ('markReadUrl', false); + $c = Minz_Request::controllerName (); + $a = Minz_Request::actionName (); + $params = Minz_Request::params (); + $markReadUrl = Minz_Session::param ('markReadUrl'); + Minz_Session::_param ('markReadUrl', false); ?> <ul class="pagination"> <li class="item pager-next"> <?php if (!empty($this->nextId)) { ?> <?php $params['next'] = $this->nextId; ?> - <a id="load_more" href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a> + <a id="load_more" href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t ('load_more'); ?></a> <?php } elseif ($markReadUrl) { ?> <a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>"> - <?php echo Translate::t ('nothing_to_load'); ?><br /> + <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> <span class="bigTick">✔</span><br /> - <?php echo Translate::t ('mark_all_read'); ?> + <?php echo Minz_Translate::t ('mark_all_read'); ?> </a> <?php } else { ?> <a id="bigMarkAsRead" href="."> - <?php echo Translate::t ('nothing_to_load'); ?><br /> + <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> </a> <?php } ?> </li> 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 @@ <div id="overlay"></div> <div id="panel"<?php echo $this->conf->displayPosts () === 'no' ? ' class="hide_posts"' : ''; ?>> - <a class="close" href="#"><?php echo RSSThemes::icon('close'); ?></a> + <a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a> </div>
\ 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)) { ?> <?php foreach ($this->entries as $item) { ?> - <?php if ($display_today && $item->isDay (Days::TODAY)) { ?> + <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY)) { ?> <div class="day" id="day_today"> - <?php echo Translate::t ('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 (Days::YESTERDAY)) { ?> + <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY)) { ?> <div class="day" id="day_yesterday"> - <?php echo Translate::t ('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 (Days::BEFORE_YESTERDAY)) { ?> + <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY)) { ?> <div class="day" id="day_before_yesterday"> - <?php echo Translate::t ('before_yesterday'); ?> + <?php echo Minz_Translate::t ('before_yesterday'); ?> <span class="name"><?php echo $this->currentName; ?></span> </div> <?php $display_others = false; } ?> @@ -51,13 +51,13 @@ if (!empty($this->entries)) { if ($this->conf->toplineRead ()) { ?><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 RSSThemes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php + echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } if ($this->conf->toplineFavorite ()) { ?><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 RSSThemes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php + echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } } @@ -67,7 +67,7 @@ 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->toplineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($this->conf->toplineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo RSSThemes::icon('link'); ?></a></li><?php } ?> + <?php if ($this->conf->toplineLink ()) { ?><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"> @@ -75,7 +75,7 @@ if (!empty($this->entries)) { <h1 class="title"><?php echo $item->title (); ?></h1> <?php $author = $item->author (); - echo $author != '' ? '<div class="author">' . Translate::t ('by_author', $author) . '</div>' : ''; + echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : ''; if($this->conf->lazyload() == 'yes') { echo lazyimg($item->content ()); } else { @@ -83,19 +83,18 @@ if (!empty($this->entries)) { } ?> </div> - <ul class="horizontal-list bottom"><?php if (!login_is_conf ($this->conf) || is_logged ()) { if ($this->conf->bottomlineRead ()) { ?><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 RSSThemes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php + echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php ?></li><?php } if ($this->conf->bottomlineFavorite ()) { ?><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 RSSThemes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php + echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } } ?> @@ -111,8 +110,8 @@ if (!empty($this->entries)) { <div class="dropdown"> <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"> - <?php echo RSSThemes::icon('share'); ?> - <?php echo Translate::t ('share'); ?> + <?php echo FreshRSS_Themes::icon('share'); ?> + <?php echo Minz_Translate::t ('share'); ?> </a> <ul class="dropdown-menu"> @@ -120,49 +119,49 @@ if (!empty($this->entries)) { <?php if ($logged && $shaarli) { ?> <li class="item"> <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=FreshRSS'; ?>"> - <?php echo Translate::t ('shaarli'); ?> + <?php echo Minz_Translate::t ('shaarli'); ?> </a> </li> <?php } if ($logged && $poche) { ?> <li class="item"> <a target="_blank" href="<?php echo $poche . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> - <?php echo Translate::t ('poche'); ?> + <?php echo Minz_Translate::t ('poche'); ?> </a> </li> <?php } if ($logged && $diaspora) { ?> <li class="item"> <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&title=' . $title; ?>"> - <?php echo Translate::t ('diaspora'); ?> + <?php echo Minz_Translate::t ('diaspora'); ?> </a> </li> <?php } if ($twitter) { ?> <li class="item"> <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> - <?php echo Translate::t ('twitter'); ?> + <?php echo Minz_Translate::t ('twitter'); ?> </a> </li> <?php } if ($google_plus) { ?> <li class="item"> <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> - <?php echo Translate::t ('g+'); ?> + <?php echo Minz_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; ?>"> - <?php echo Translate::t ('facebook'); ?> + <?php echo Minz_Translate::t ('facebook'); ?> </a> </li> <?php } if ($email) { ?> <li class="item"> <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> - <?php echo Translate::t ('by_email'); ?> + <?php echo Minz_Translate::t ('by_email'); ?> </a> </li> <?php } if ($print) { ?> <li class="item"> <a href="#" class="print-article"> - <?php echo Translate::t ('print'); ?> + <?php echo Minz_Translate::t ('print'); ?> </a> </li> <?php } ?> @@ -178,8 +177,8 @@ if (!empty($this->entries)) { <div class="dropdown"> <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"> - <?php echo RSSThemes::icon('tag'); ?> - <?php echo Translate::t ('related_tags'); ?> + <?php echo FreshRSS_Themes::icon('tag'); ?> + <?php echo Minz_Translate::t ('related_tags'); ?> </a> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> @@ -191,7 +190,7 @@ if (!empty($this->entries)) { </li> <?php } ?> <?php if ($this->conf->bottomlineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($this->conf->bottomlineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo RSSThemes::icon('link'); ?></a></li><?php } ?> + <?php if ($this->conf->bottomlineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> </ul> </div> </div> @@ -204,6 +203,6 @@ if (!empty($this->entries)) { <?php } else { ?> <div id="stream" class="alert alert-warn normal"> - <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> + <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> </div> <?php } ?>
\ 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)) { <div class="author"> <?php $author = $item->author (); ?> - <?php echo $author != '' ? Translate::t ('by_author', $author) . ' - ' : ''; ?> + <?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' - ' : ''; ?> <?php echo $item->date (); ?> </div> @@ -42,6 +42,6 @@ if (!empty($this->entries)) { <?php } else { ?> <div id="stream" class="alert alert-warn reader"> - <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> + <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> </div> <?php } ?>
\ 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 @@ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title><?php echo $this->rss_title; ?></title> - <link><?php echo Url::display(null, 'html', true); ?></link> - <description><?php echo Translate::t ('rss_feeds_of', $this->rss_title); ?></description> + <link><?php echo Minz_Url::display(null, 'html', true); ?></link> + <description><?php echo Minz_Translate::t ('rss_feeds_of', $this->rss_title); ?></description> <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate> <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate> - <atom:link href="<?php echo Url::display ($this->rss_url, 'html', true); ?>" rel="self" type="application/rss+xml" /> + <atom:link href="<?php echo Minz_Url::display ($this->rss_url, 'html', true); ?>" rel="self" type="application/rss+xml" /> <?php foreach ($this->entries as $item) { ?> |
