diff options
| author | 2013-04-13 15:27:36 +0200 | |
|---|---|---|
| committer | 2013-04-13 15:27:36 +0200 | |
| commit | 9b9543109e36a5409fe71eb084cfac680dfc7cbd (patch) | |
| tree | 0876746883cd90d5f1e9a63e208342699e427690 /app/controllers | |
| parent | a4beb7b772fdc3c8c894b93611bfb030c9456f07 (diff) | |
Fix issue #39 : actualisation de tous les flux grâce à Ajax
Diffstat (limited to 'app/controllers')
| -rwxr-xr-x | app/controllers/feedController.php | 8 | ||||
| -rwxr-xr-x | app/controllers/indexController.php | 1 | ||||
| -rwxr-xr-x | app/controllers/javascriptController.php | 9 |
3 files changed, 13 insertions, 5 deletions
diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index d2a2184eb..83fc19e20 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -156,9 +156,13 @@ class feedController extends ActionController { 'content' => 'Aucun flux n\'a pu être mis à jour' ); } - Session::_param ('notification', $notif); - Request::forward (array (), true); + if (Request::param ('ajax', 0) == 0) { + Session::_param ('notification', $notif); + Request::forward (array (), true); + } else { + $this->view->_useLayout (false); + } } public function massiveImportAction () { diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index a11c26044..8fa911631 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -8,6 +8,7 @@ class indexController extends ActionController { public function indexAction () { View::appendScript (Url::display ('/scripts/shortcut.js')); View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main'))); + View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'actualize'))); $entryDAO = new EntryDAO (); $feedDAO = new FeedDAO (); diff --git a/app/controllers/javascriptController.php b/app/controllers/javascriptController.php index 8060f560c..071cf65a4 100755 --- a/app/controllers/javascriptController.php +++ b/app/controllers/javascriptController.php @@ -5,8 +5,11 @@ class javascriptController extends ActionController { $this->view->_useLayout (false); header('Content-type: text/javascript'); } - - public function mainAction () { - + + public function mainAction () {} + + public function actualizeAction () { + $feedDAO = new FeedDAO (); + $this->view->feeds = $feedDAO->listFeeds (); } } |
