From 9d32d7fe1932504a042fd8b146cdf560be11350b Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 8 Nov 2013 23:31:38 +0100 Subject: Déplace le fichier main.phtml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit app/views/javascript/main.phtml est déplacé vers app/views/helpers/javascript_vars.phtml Il reste à déplacer le fichier actualize.phtml pour se débarrasser de javascriptController --- app/controllers/javascriptController.php | 2 -- app/layout/layout.phtml | 2 +- app/views/helpers/javascript_vars.phtml | 32 ++++++++++++++++++++++++++++++++ app/views/javascript/main.phtml | 32 -------------------------------- 4 files changed, 33 insertions(+), 35 deletions(-) create mode 100644 app/views/helpers/javascript_vars.phtml delete mode 100644 app/views/javascript/main.phtml (limited to 'app') diff --git a/app/controllers/javascriptController.php b/app/controllers/javascriptController.php index 071cf65a4..291474130 100755 --- a/app/controllers/javascriptController.php +++ b/app/controllers/javascriptController.php @@ -6,8 +6,6 @@ class javascriptController extends ActionController { header('Content-type: text/javascript'); } - public function mainAction () {} - public function actualizeAction () { $feedDAO = new FeedDAO (); $this->view->feeds = $feedDAO->listFeeds (); diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 192a6d73f..3f427a501 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -12,7 +12,7 @@ entryPaginator) ? $this->entryPaginator->next() : ''; diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml new file mode 100644 index 000000000..df552527f --- /dev/null +++ b/app/views/helpers/javascript_vars.phtml @@ -0,0 +1,32 @@ +conf->markWhen (); + echo 'var ', + 'hide_posts=', ($this->conf->displayPosts () === 'yes' || 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', + ',does_lazyload=', $this->conf->lazyload() === 'yes' ? 'true' : 'false'; + + $s = $this->conf->shortcuts (); + echo ',shortcuts={', + 'mark_read:"', $s['mark_read'], '",', + 'mark_favorite:"', $s['mark_favorite'], '",', + 'go_website:"', $s['go_website'], '",', + 'prev_entry:"', $s['prev_entry'], '",', + 'next_entry:"', $s['next_entry'], '"', + "},"; + + $mail = Session::param ('mail', 'null'); + if ($mail != 'null') { + $mail = '"' . $mail . '"'; + } + echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false', + ',url_freshrss="', _url ('index', 'index'), '",', + 'url_login="', _url ('index', 'login'), '",', + 'url_logout="', _url ('index', 'logout'), '",', + 'current_user_mail=', $mail, ",\n"; + + echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ";\n"; diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml deleted file mode 100644 index df552527f..000000000 --- a/app/views/javascript/main.phtml +++ /dev/null @@ -1,32 +0,0 @@ -conf->markWhen (); - echo 'var ', - 'hide_posts=', ($this->conf->displayPosts () === 'yes' || 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', - ',does_lazyload=', $this->conf->lazyload() === 'yes' ? 'true' : 'false'; - - $s = $this->conf->shortcuts (); - echo ',shortcuts={', - 'mark_read:"', $s['mark_read'], '",', - 'mark_favorite:"', $s['mark_favorite'], '",', - 'go_website:"', $s['go_website'], '",', - 'prev_entry:"', $s['prev_entry'], '",', - 'next_entry:"', $s['next_entry'], '"', - "},"; - - $mail = Session::param ('mail', 'null'); - if ($mail != 'null') { - $mail = '"' . $mail . '"'; - } - echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false', - ',url_freshrss="', _url ('index', 'index'), '",', - 'url_login="', _url ('index', 'login'), '",', - 'url_logout="', _url ('index', 'logout'), '",', - 'current_user_mail=', $mail, ",\n"; - - echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ";\n"; -- cgit v1.2.3