Ejemplo n.º 1
0
 public function readAction()
 {
     $this->redirect = true;
     $id = Minz_Request::param('id');
     $get = Minz_Request::param('get');
     $nextGet = Minz_Request::param('nextGet', $get);
     $idMax = Minz_Request::param('idMax', 0);
     $entryDAO = new FreshRSS_EntryDAO();
     if ($id == false) {
         if (!$get) {
             $entryDAO->markReadEntries($idMax);
         } else {
             $typeGet = $get[0];
             $get = substr($get, 2);
             switch ($typeGet) {
                 case 'c':
                     $entryDAO->markReadCat($get, $idMax);
                     break;
                 case 'f':
                     $entryDAO->markReadFeed($get, $idMax);
                     break;
                 case 's':
                     $entryDAO->markReadEntries($idMax, true);
                     break;
                 case 'a':
                     $entryDAO->markReadEntries($idMax);
                     break;
             }
             if ($nextGet !== 'a') {
                 $this->params['get'] = $nextGet;
             }
         }
         $notif = array('type' => 'good', 'content' => Minz_Translate::t('feeds_marked_read'));
         Minz_Session::_param('notification', $notif);
     } else {
         $is_read = (bool) Minz_Request::param('is_read', true);
         $entryDAO->markRead($id, $is_read);
     }
 }