summaryrefslogtreecommitdiff
path: root/app/controllers/entryController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-15 03:30:24 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-15 03:30:24 +0100
commit878e96202e8a22e4857b98e29b0a1fce68eccbc9 (patch)
treef9233c3b48a0cd6e0ac2536ddcc1897201595ad4 /app/controllers/entryController.php
parent4af233e1f736eb2256e5e1696418635165467855 (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/controllers/entryController.php')
-rwxr-xr-xapp/controllers/entryController.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php
index c01139ba4..a332ca8a9 100755
--- a/app/controllers/entryController.php
+++ b/app/controllers/entryController.php
@@ -1,46 +1,46 @@
<?php
-class entryController extends ActionController {
+class FreshRSS_entry_Controller extends Minz_ActionController {
public function firstAction () {
if (login_is_conf ($this->view->conf) && !is_logged ()) {
- Error::error (
+ Minz_Error::error (
403,
- array ('error' => array (Translate::t ('access_denied')))
+ array ('error' => array (Minz_Translate::t ('access_denied')))
);
}
$this->params = array ();
$this->redirect = false;
- $ajax = Request::param ('ajax');
+ $ajax = Minz_Request::param ('ajax');
if ($ajax) {
$this->view->_useLayout (false);
}
}
public function lastAction () {
- $ajax = Request::param ('ajax');
+ $ajax = Minz_Request::param ('ajax');
if (!$ajax && $this->redirect) {
- Request::forward (array (
+ Minz_Request::forward (array (
'c' => 'index',
'a' => 'index',
'params' => $this->params
), true);
} else {
- Request::_param ('ajax');
+ Minz_Request::_param ('ajax');
}
}
public function readAction () {
$this->redirect = true;
- $id = Request::param ('id');
- $is_read = Request::param ('is_read');
- $get = Request::param ('get');
- $nextGet = Request::param ('nextGet', $get);
- $idMax = Request::param ('idMax', 0);
+ $id = Minz_Request::param ('id');
+ $is_read = Minz_Request::param ('is_read');
+ $get = Minz_Request::param ('get');
+ $nextGet = Minz_Request::param ('nextGet', $get);
+ $idMax = Minz_Request::param ('idMax', 0);
$is_read = !!$is_read;
- $entryDAO = new EntryDAO ();
+ $entryDAO = new FreshRSS_EntryDAO ();
if ($id == false) {
if (!$get) {
$entryDAO->markReadEntries ($idMax);
@@ -68,9 +68,9 @@ class entryController extends ActionController {
$notif = array (
'type' => 'good',
- 'content' => Translate::t ('feeds_marked_read')
+ 'content' => Minz_Translate::t ('feeds_marked_read')
);
- Session::_param ('notification', $notif);
+ Minz_Session::_param ('notification', $notif);
} else {
$entryDAO->markRead ($id, $is_read);
}
@@ -79,10 +79,10 @@ class entryController extends ActionController {
public function bookmarkAction () {
$this->redirect = true;
- $id = Request::param ('id');
+ $id = Minz_Request::param ('id');
if ($id) {
- $entryDAO = new EntryDAO ();
- $entryDAO->markFavorite ($id, Request::param ('is_favorite'));
+ $entryDAO = new FreshRSS_EntryDAO ();
+ $entryDAO->markFavorite ($id, Minz_Request::param ('is_favorite'));
}
}
@@ -93,18 +93,18 @@ class entryController extends ActionController {
// La table des entrées a tendance à grossir énormément
// Cette action permet d'optimiser cette table permettant de grapiller un peu de place
// Cette fonctionnalité n'est à appeler qu'occasionnellement
- $entryDAO = new EntryDAO();
+ $entryDAO = new FreshRSS_EntryDAO();
$entryDAO->optimizeTable();
invalidateHttpCache();
$notif = array (
'type' => 'good',
- 'content' => Translate::t ('optimization_complete')
+ 'content' => Minz_Translate::t ('optimization_complete')
);
- Session::_param ('notification', $notif);
+ Minz_Session::_param ('notification', $notif);
- Request::forward(array(
+ Minz_Request::forward(array(
'c' => 'configure',
'a' => 'display'
), true);