aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 15:55:20 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 15:55:20 +0200
commit6c8b36f04ea1bc2c022c331bb0980b6c9dccb83c (patch)
tree61a6b28b6041642faa32d04b4869afa774bda72d /app/Controllers
parent5a9b08e084b376af9b65699f9868d66a46f8c170 (diff)
Let's begin the big refactoring!
Minz_Translate::t\s? replaces by _t See https://github.com/marienfressinaud/FreshRSS/issues/655
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/entryController.php8
-rw-r--r--app/Controllers/errorController.php4
-rwxr-xr-xapp/Controllers/feedController.php30
-rwxr-xr-xapp/Controllers/indexController.php22
-rw-r--r--app/Controllers/statsController.php4
-rw-r--r--app/Controllers/usersController.php8
6 files changed, 37 insertions, 39 deletions
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index ab66d9198..048ac1c69 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -5,7 +5,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
if (!$this->view->loginOk) {
Minz_Error::error (
403,
- array ('error' => array (Minz_Translate::t ('access_denied')))
+ array ('error' => array (_t('access_denied')))
);
}
@@ -75,7 +75,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
$notif = array (
'type' => 'good',
- 'content' => Minz_Translate::t ('feeds_marked_read')
+ 'content' => _t('feeds_marked_read')
);
Minz_Session::_param ('notification', $notif);
} else {
@@ -111,7 +111,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
$notif = array (
'type' => 'good',
- 'content' => Minz_Translate::t ('optimization_complete')
+ 'content' => _t('optimization_complete')
);
Minz_Session::_param ('notification', $notif);
}
@@ -155,7 +155,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
$notif = array(
'type' => 'good',
- 'content' => Minz_Translate::t('purge_completed', $nbTotal)
+ 'content' => _t('purge_completed', $nbTotal)
);
Minz_Session::_param('notification', $notif);
diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php
index 922650b3d..64a5c06fd 100644
--- a/app/Controllers/errorController.php
+++ b/app/Controllers/errorController.php
@@ -24,11 +24,11 @@ class FreshRSS_error_Controller extends Minz_ActionController {
if ($this->view->errorMessage == '') {
switch(Minz_Request::param('code')) {
case 403:
- $this->view->errorMessage = Minz_Translate::t('forbidden_access');
+ $this->view->errorMessage = _t('forbidden_access');
break;
case 404:
default:
- $this->view->errorMessage = Minz_Translate::t('page_not_found');
+ $this->view->errorMessage = _t('page_not_found');
break;
}
}
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 92ce40634..029f9fa68 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -15,7 +15,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
) {
Minz_Error::error (
403,
- array ('error' => array (Minz_Translate::t ('access_denied')))
+ array ('error' => array (_t('access_denied')))
);
}
}
@@ -84,7 +84,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
// on est déjà abonné à ce flux
$notif = array (
'type' => 'bad',
- 'content' => Minz_Translate::t ('already_subscribed', $feed->name ())
+ 'content' => _t('already_subscribed', $feed->name ())
);
Minz_Session::_param ('notification', $notif);
} else {
@@ -93,7 +93,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
// problème au niveau de la base de données
$notif = array (
'type' => 'bad',
- 'content' => Minz_Translate::t ('feed_not_added', $feed->name ())
+ 'content' => _t('feed_not_added', $feed->name ())
);
Minz_Session::_param ('notification', $notif);
} else {
@@ -131,7 +131,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
// ok, ajout terminé
$notif = array (
'type' => 'good',
- 'content' => Minz_Translate::t ('feed_added', $feed->name ())
+ 'content' => _t('feed_added', $feed->name ())
);
Minz_Session::_param ('notification', $notif);
@@ -143,14 +143,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
$notif = array (
'type' => 'bad',
- 'content' => Minz_Translate::t ('invalid_url', $url)
+ 'content' => _t('invalid_url', $url)
);
Minz_Session::_param ('notification', $notif);
} catch (FreshRSS_Feed_Exception $e) {
Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
$notif = array (
'type' => 'bad',
- 'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
+ 'content' => _t('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
);
Minz_Session::_param ('notification', $notif);
} catch (Minz_FileNotExistException $e) {
@@ -158,7 +158,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
$notif = array (
'type' => 'bad',
- 'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
+ 'content' => _t('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
);
Minz_Session::_param ('notification', $notif);
}
@@ -170,7 +170,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
} else {
// GET request so we must ask confirmation to user
- Minz_View::prependTitle(Minz_Translate::t('add_rss_feed') . ' · ');
+ Minz_View::prependTitle(_t('add_rss_feed') . ' · ');
$this->view->categories = $this->catDAO->listCategories(false);
$this->view->feed = new FreshRSS_Feed($url);
try {
@@ -186,9 +186,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
// Already subscribe so we redirect to the feed configuration page
$notif = array(
'type' => 'bad',
- 'content' => Minz_Translate::t(
- 'already_subscribed', $feed->name()
- )
+ 'content' => _t('already_subscribed', $feed->name())
);
Minz_Session::_param('notification', $notif);
@@ -210,7 +208,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$n = $feedDAO->truncate($id);
$notif = array(
'type' => $n === false ? 'bad' : 'good',
- 'content' => Minz_Translate::t ('n_entries_deleted', $n)
+ 'content' => _t('n_entries_deleted', $n)
);
Minz_Session::_param ('notification', $notif);
invalidateHttpCache();
@@ -336,19 +334,19 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$feed = reset ($feeds);
$notif = array (
'type' => 'good',
- 'content' => Minz_Translate::t ('feed_actualized', $feed->name ())
+ 'content' => _t('feed_actualized', $feed->name ())
);
} elseif ($flux_update > 1) {
// plusieurs flux on été mis à jour
$notif = array (
'type' => 'good',
- 'content' => Minz_Translate::t ('n_feeds_actualized', $flux_update)
+ 'content' => _t('n_feeds_actualized', $flux_update)
);
} else {
// aucun flux n'a été mis à jour, oups
$notif = array (
'type' => 'good',
- 'content' => Minz_Translate::t ('no_feed_to_refresh')
+ 'content' => _t('no_feed_to_refresh')
);
}
@@ -370,7 +368,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
// ressenti utilisateur
$notif = array (
'type' => 'good',
- 'content' => Minz_Translate::t ('feeds_actualized')
+ 'content' => _t('feeds_actualized')
);
Minz_Session::_param ('notification', $notif);
// et on désactive le layout car ne sert à rien
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 1b6563bb3..346739523 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -14,7 +14,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
if ($output === 'rss' && !$token_is_ok) {
Minz_Error::error (
403,
- array ('error' => array (Minz_Translate::t ('access_denied')))
+ array ('error' => array (_t('access_denied')))
);
return;
} elseif ($output !== 'rss') {
@@ -62,7 +62,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
Minz_Log::record ('Not found [' . $getType . '][' . $getId . ']', Minz_Log::DEBUG);
Minz_Error::error (
404,
- array ('error' => array (Minz_Translate::t ('page_not_found')))
+ array ('error' => array (_t('page_not_found')))
);
return;
}
@@ -145,7 +145,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE);
Minz_Error::error (
404,
- array ('error' => array (Minz_Translate::t ('page_not_found')))
+ array ('error' => array (_t('page_not_found')))
);
}
}
@@ -158,12 +158,12 @@ class FreshRSS_index_Controller extends Minz_ActionController {
private function checkAndProcessType ($getType, $getId) {
switch ($getType) {
case 'a':
- $this->view->currentName = Minz_Translate::t ('your_rss_feeds');
+ $this->view->currentName = _t('your_rss_feeds');
$this->nb_not_read_cat = $this->view->nb_not_read;
$this->view->get_c = $getType;
return true;
case 's':
- $this->view->currentName = Minz_Translate::t ('your_favorites');
+ $this->view->currentName = _t('your_favorites');
$this->nb_not_read_cat = $this->view->nb_favorites['unread'];
$this->view->get_c = $getType;
return true;
@@ -202,18 +202,18 @@ class FreshRSS_index_Controller extends Minz_ActionController {
}
public function aboutAction () {
- Minz_View::prependTitle (Minz_Translate::t ('about') . ' · ');
+ Minz_View::prependTitle (_t('about') . ' · ');
}
public function logsAction () {
if (!$this->view->loginOk) {
Minz_Error::error (
403,
- array ('error' => array (Minz_Translate::t ('access_denied')))
+ array ('error' => array (_t('access_denied')))
);
}
- Minz_View::prependTitle (Minz_Translate::t ('logs') . ' · ');
+ Minz_View::prependTitle (_t('logs') . ' · ');
if (Minz_Request::isPost ()) {
FreshRSS_LogDAO::truncate();
@@ -279,7 +279,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
} else {
$res = array ();
$res['status'] = 'failure';
- $res['reason'] = $reason == '' ? Minz_Translate::t ('invalid_login') : $reason;
+ $res['reason'] = $reason == '' ? _t('invalid_login') : $reason;
Minz_Log::record ('Persona: ' . $res['reason'], Minz_Log::WARNING);
}
@@ -368,7 +368,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
if (!$ok) {
$notif = array(
'type' => 'bad',
- 'content' => Minz_Translate::t('invalid_login')
+ 'content' => _t('invalid_login')
);
Minz_Session::_param('notification', $notif);
}
@@ -403,7 +403,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
} elseif (!Minz_Configuration::canLogIn()) {
Minz_Error::error (
403,
- array ('error' => array (Minz_Translate::t ('access_denied')))
+ array ('error' => array (_t('access_denied')))
);
}
invalidateHttpCache();
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index 3069be34d..4adb5e75d 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -120,11 +120,11 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
public function firstAction() {
if (!$this->view->loginOk) {
Minz_Error::error(
- 403, array('error' => array(Minz_Translate::t('access_denied')))
+ 403, array('error' => array(_t('access_denied')))
);
}
- Minz_View::prependTitle(Minz_Translate::t('stats') . ' · ');
+ Minz_View::prependTitle(_t('stats') . ' · ');
}
}
diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php
index a9e6c32bc..8eb82f5d5 100644
--- a/app/Controllers/usersController.php
+++ b/app/Controllers/usersController.php
@@ -8,7 +8,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
if (!$this->view->loginOk) {
Minz_Error::error(
403,
- array('error' => array(Minz_Translate::t('access_denied')))
+ array('error' => array(_t('access_denied')))
);
}
}
@@ -90,7 +90,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
$notif = array(
'type' => $ok ? 'good' : 'bad',
- 'content' => Minz_Translate::t($ok ? 'configuration_updated' : 'error_occurred')
+ 'content' => _t($ok ? 'configuration_updated' : 'error_occurred')
);
Minz_Session::_param('notification', $notif);
}
@@ -162,7 +162,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
$notif = array(
'type' => $ok ? 'good' : 'bad',
- 'content' => Minz_Translate::t($ok ? 'user_created' : 'error_occurred', $new_user_name)
+ 'content' => _t($ok ? 'user_created' : 'error_occurred', $new_user_name)
);
Minz_Session::_param('notification', $notif);
}
@@ -194,7 +194,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
$notif = array(
'type' => $ok ? 'good' : 'bad',
- 'content' => Minz_Translate::t($ok ? 'user_deleted' : 'error_occurred', $username)
+ 'content' => _t($ok ? 'user_deleted' : 'error_occurred', $username)
);
Minz_Session::_param('notification', $notif);
}