Skip to content

Commit

Permalink
Les appels AJAX sur 'readAll' et 'readFolder' ne redirigent plus vers…
Browse files Browse the repository at this point in the history
… l'index
  • Loading branch information
Simounet committed Feb 16, 2016
1 parent f1b3fb2 commit 5aac283
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

///@TODO: déplacer dans common.php?
$commandLine = 'cli'==php_sapi_name();
$ajaxCall = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';

if ($commandLine) {
$action = 'commandLine';
Expand Down Expand Up @@ -75,7 +76,9 @@
$whereClause['unread'] = '1';
if(isset($_['feed']))$whereClause['feed'] = $_['feed'];
$eventManager->change(array('unread'=>'0'),$whereClause);
header('location: ./index.php');
if(!$ajaxCall){
header('location: ./index.php');
}
break;

case 'readFolder':
Expand All @@ -87,7 +90,9 @@
$eventManager->change(array('unread'=>'0'),array('feed'=>$feed->getId()));
}

header('location: ./index.php');
if (!$ajaxCall){
header('location: ./index.php');
}

break;

Expand Down

0 comments on commit 5aac283

Please sign in to comment.