diff options
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/authController.php | 36 | ||||
| -rw-r--r-- | app/Controllers/categoryController.php | 34 | ||||
| -rwxr-xr-x | app/Controllers/configureController.php | 32 | ||||
| -rwxr-xr-x | app/Controllers/entryController.php | 6 | ||||
| -rw-r--r-- | app/Controllers/errorController.php | 4 | ||||
| -rwxr-xr-x | app/Controllers/feedController.php | 40 | ||||
| -rw-r--r-- | app/Controllers/importExportController.php | 24 | ||||
| -rwxr-xr-x | app/Controllers/indexController.php | 6 | ||||
| -rwxr-xr-x | app/Controllers/javascriptController.php | 2 | ||||
| -rw-r--r-- | app/Controllers/statsController.php | 3 | ||||
| -rw-r--r-- | app/Controllers/subscriptionController.php | 8 | ||||
| -rw-r--r-- | app/Controllers/updateController.php | 30 | ||||
| -rw-r--r-- | app/Controllers/userController.php | 12 |
13 files changed, 123 insertions, 114 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index 44496cd3e..ccc32ec0d 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -22,7 +22,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { Minz_Error::error(403); } - Minz_View::prependTitle(_t('gen.title.authentication') . ' · '); + Minz_View::prependTitle(_t('admin.auth.title') . ' · '); if (Minz_Request::isPost()) { $ok = true; @@ -56,10 +56,10 @@ class FreshRSS_auth_Controller extends Minz_ActionController { invalidateHttpCache(); if ($ok) { - Minz_Request::good(_t('configuration_updated'), + Minz_Request::good(_t('feedback.conf.updated'), array('c' => 'auth', 'a' => 'index')); } else { - Minz_Request::bad(_t('error_occurred'), + Minz_Request::bad(_t('feedback.conf.error'), array('c' => 'auth', 'a' => 'index')); } } @@ -123,7 +123,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { } catch(Minz_Exception $e) { // $username is not a valid user, nor the configuration file! Minz_Log::warning('Login failure: ' . $e->getMessage()); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'login')); } @@ -144,14 +144,14 @@ class FreshRSS_auth_Controller extends Minz_ActionController { } // All is good, go back to the index. - Minz_Request::good(_t('feedback.login.success'), + Minz_Request::good(_t('feedback.auth.login.success'), array('c' => 'index', 'a' => 'index')); } else { Minz_Log::warning('Password mismatch for' . ' user=' . $username . ', nonce=' . $nonce . ', c=' . $challenge); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'login')); } } elseif (Minz_Configuration::unsafeAutologinEnabled()) { @@ -183,11 +183,11 @@ class FreshRSS_auth_Controller extends Minz_ActionController { Minz_Session::_param('passwordHash', $s); FreshRSS_Auth::giveAccess(); - Minz_Request::good(_t('feedback.login.success'), + Minz_Request::good(_t('feedback.auth.login.success'), array('c' => 'index', 'a' => 'index')); } else { Minz_Log::warning('Unsafe password mismatch for user ' . $username); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'login')); } } @@ -261,7 +261,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { $res = array(); $res['status'] = 'failure'; - $res['reason'] = _t('invalid_login'); + $res['reason'] = _t('feedback.auth.login.invalid'); } header('Content-Type: application/json; charset=UTF-8'); @@ -275,7 +275,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { public function logoutAction() { invalidateHttpCache(); FreshRSS_Auth::removeAccess(); - Minz_Request::good(_t('feedback.logout.success'), + Minz_Request::good(_t('feedback.auth.logout.success'), array('c' => 'index', 'a' => 'index')); } @@ -285,7 +285,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { * After reseting, form auth is set by default. */ public function resetAction() { - Minz_View::prependTitle(_t('auth_reset') . ' · '); + Minz_View::prependTitle(_t('admin.auth.title_reset') . ' · '); Minz_View::appendScript(Minz_Url::display( '/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js') @@ -296,8 +296,8 @@ class FreshRSS_auth_Controller extends Minz_ActionController { if (Minz_Configuration::authType() != 'persona') { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('auth_not_persona') + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.auth.not_persona') ); $this->view->no_form = true; return; @@ -308,8 +308,8 @@ class FreshRSS_auth_Controller extends Minz_ActionController { if (!$conf->passwordHash) { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('auth_no_password_set') + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.auth.no_password_set') ); $this->view->no_form = true; return; @@ -331,9 +331,9 @@ class FreshRSS_auth_Controller extends Minz_ActionController { $ok = Minz_Configuration::writeFile(); if ($ok) { - Minz_Request::good(_t('auth_form_set')); + Minz_Request::good(_t('feedback.auth.form.set')); } else { - Minz_Request::bad(_t('auth_form_not_set'), + Minz_Request::bad(_t('feedback.auth.form.not_set'), array('c' => 'auth', 'a' => 'reset')); } } else { @@ -341,7 +341,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { ' user=' . $username . ', nonce=' . $nonce . ', c=' . $challenge); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'reset')); } } diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 50b1d841a..5f1beae90 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -34,7 +34,7 @@ class FreshRSS_category_Controller extends Minz_ActionController { $this->view->categories = $catDAO->listCategories(false); if (count($this->view->categories) >= $limits['max_categories']) { - Minz_Request::bad(_t('sub.categories.over_max', $limits['max_categories']), + Minz_Request::bad(_t('feedback.sub.category.over_max', $limits['max_categories']), $url_redirect); } @@ -43,13 +43,13 @@ class FreshRSS_category_Controller extends Minz_ActionController { $cat_name = Minz_Request::param('new-category'); if (!$cat_name) { - Minz_Request::bad(_t('category_no_name'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); } $cat = new FreshRSS_Category($cat_name); if ($catDAO->searchByName($cat->name()) != null) { - Minz_Request::bad(_t('category_name_exists'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.name_exists'), $url_redirect); } $values = array( @@ -58,9 +58,9 @@ class FreshRSS_category_Controller extends Minz_ActionController { ); if ($catDAO->addCategory($values)) { - Minz_Request::good(_t('category_created', $cat->name()), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.created', $cat->name()), $url_redirect); } else { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } } @@ -84,11 +84,11 @@ class FreshRSS_category_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); $name = Minz_Request::param('name', ''); if (strlen($name) <= 0) { - Minz_Request::bad(_t('category_no_name'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); } if ($catDAO->searchById($id) == null) { - Minz_Request::bad(_t('category_not_exist'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.not_exist'), $url_redirect); } $cat = new FreshRSS_Category($name); @@ -97,9 +97,9 @@ class FreshRSS_category_Controller extends Minz_ActionController { ); if ($catDAO->updateCategory($id, $values)) { - Minz_Request::good(_t('category_updated'), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); } else { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } } @@ -125,26 +125,26 @@ class FreshRSS_category_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); if (!$id) { - Minz_Request::bad(_t('category_no_id'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_id'), $url_redirect); } if ($id === $default_category->id()) { - Minz_Request::bad(_t('category_not_delete_default'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.not_delete_default'), $url_redirect); } if ($feedDAO->changeCategory($id, $default_category->id()) === false) { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } if ($catDAO->deleteCategory($id) === false) { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } // Remove related queries. FreshRSS_Context::$conf->remove_query_by_get('c_' . $id); FreshRSS_Context::$conf->save(); - Minz_Request::good(_t('category_deleted'), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.deleted'), $url_redirect); } Minz_Request::forward($url_redirect, true); @@ -166,7 +166,7 @@ class FreshRSS_category_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); if (!$id) { - Minz_Request::bad(_t('category_no_id'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_id'), $url_redirect); } // List feeds to remove then related user queries. @@ -181,9 +181,9 @@ class FreshRSS_category_Controller extends Minz_ActionController { } FreshRSS_Context::$conf->save(); - Minz_Request::good(_t('category_emptied'), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.emptied'), $url_redirect); } else { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } } diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index f8d9b47c3..feb5483fb 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -61,13 +61,13 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Translate::reset(); invalidateHttpCache(); - Minz_Request::good(_t('configuration_updated'), + Minz_Request::good(_t('feedback.conf.updated'), array('c' => 'configure', 'a' => 'display')); } $this->view->themes = FreshRSS_Themes::get(); - Minz_View::prependTitle(_t('display_configuration') . ' · '); + Minz_View::prependTitle(_t('conf.display.title') . ' · '); } /** @@ -89,6 +89,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * - image lazy loading * - stick open articles to the top * - display a confirmation when reading all articles + * - auto remove article after reading * - article order (default: DESC) * - mark articles as read when: * - displayed @@ -110,6 +111,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { FreshRSS_Context::$conf->_lazyload(Minz_Request::param('lazyload', false)); FreshRSS_Context::$conf->_sticky_post(Minz_Request::param('sticky_post', false)); FreshRSS_Context::$conf->_reading_confirm(Minz_Request::param('reading_confirm', false)); + FreshRSS_Context::$conf->_auto_remove_article(Minz_Request::param('auto_remove_article', false)); FreshRSS_Context::$conf->_sort_order(Minz_Request::param('sort_order', 'DESC')); FreshRSS_Context::$conf->_mark_when(array( 'article' => Minz_Request::param('mark_open_article', false), @@ -123,11 +125,11 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Translate::reset(); invalidateHttpCache(); - Minz_Request::good(_t('configuration_updated'), + Minz_Request::good(_t('feedback.conf.updated'), array('c' => 'configure', 'a' => 'reading')); } - Minz_View::prependTitle(_t('reading_configuration') . ' · '); + Minz_View::prependTitle(_t('conf.reading.title') . ' · '); } /** @@ -144,11 +146,11 @@ class FreshRSS_configure_Controller extends Minz_ActionController { FreshRSS_Context::$conf->save(); invalidateHttpCache(); - Minz_Request::good(_t('configuration_updated'), + Minz_Request::good(_t('feedback.conf.updated'), array('c' => 'configure', 'a' => 'sharing')); } - Minz_View::prependTitle(_t('sharing') . ' · '); + Minz_View::prependTitle(_t('conf.sharing.title') . ' · '); } /** @@ -186,11 +188,11 @@ class FreshRSS_configure_Controller extends Minz_ActionController { FreshRSS_Context::$conf->save(); invalidateHttpCache(); - Minz_Request::good(_t('shortcuts_updated'), + Minz_Request::good(_t('feedback.conf.shortcuts_updated'), array('c' => 'configure', 'a' => 'shortcut')); } - Minz_View::prependTitle(_t('shortcuts') . ' · '); + Minz_View::prependTitle(_t('conf.shortcut.title') . ' · '); } /** @@ -216,11 +218,11 @@ class FreshRSS_configure_Controller extends Minz_ActionController { FreshRSS_Context::$conf->save(); invalidateHttpCache(); - Minz_Request::good(_t('configuration_updated'), + Minz_Request::good(_t('feedback.conf.updated'), array('c' => 'configure', 'a' => 'archiving')); } - Minz_View::prependTitle(_t('archiving_configuration') . ' · '); + Minz_View::prependTitle(_t('conf.archiving.title') . ' · '); $entryDAO = FreshRSS_Factory::createEntryDao(); $this->view->nb_total = $entryDAO->count(); @@ -247,13 +249,13 @@ class FreshRSS_configure_Controller extends Minz_ActionController { foreach ($queries as $key => $query) { if (!$query['name']) { - $query['name'] = _t('query_number', $key + 1); + $query['name'] = _t('conf.query.number', $key + 1); } } FreshRSS_Context::$conf->_queries($queries); FreshRSS_Context::$conf->save(); - Minz_Request::good(_t('configuration_updated'), + Minz_Request::good(_t('feedback.conf.updated'), array('c' => 'configure', 'a' => 'queries')); } else { $this->view->query_get = array(); @@ -315,7 +317,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { } } - Minz_View::prependTitle(_t('queries') . ' · '); + Minz_View::prependTitle(_t('conf.query.title') . ' · '); } /** @@ -329,7 +331,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $whitelist = array('get', 'order', 'name', 'search', 'state'); $queries = FreshRSS_Context::$conf->queries; $query = Minz_Request::params(); - $query['name'] = _t('query_number', count($queries) + 1); + $query['name'] = _t('conf.query.number', count($queries) + 1); foreach ($query as $key => $value) { if (!in_array($key, $whitelist)) { unset($query[$key]); @@ -339,7 +341,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { FreshRSS_Context::$conf->_queries($queries); FreshRSS_Context::$conf->save(); - Minz_Request::good(_t('query_created', $query['name']), + Minz_Request::good(_t('feedback.conf.query_created', $query['name']), array('c' => 'configure', 'a' => 'queries')); } } diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index b4beed619..c894ae9aa 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -85,7 +85,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController { } if (!$this->ajax) { - Minz_Request::good(_t('feeds_marked_read'), array( + Minz_Request::good(_t('feedback.sub.feed.marked_read'), array( 'c' => 'index', 'a' => 'index', 'params' => $params, @@ -144,7 +144,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController { $feedDAO->updateCachedValues(); invalidateHttpCache(); - Minz_Request::good(_t('optimization_complete'), $url_redirect); + Minz_Request::good(_t('feedback.admin.optimization_complete'), $url_redirect); } /** @@ -185,7 +185,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController { $feedDAO->updateCachedValues(); invalidateHttpCache(); - Minz_Request::good(_t('purge_completed', $nb_total), array( + Minz_Request::good(_t('feedback.sub.purge_completed', $nb_total), array( 'c' => 'configure', 'a' => 'archiving' )); diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php index 6c080bea8..06fa186cf 100644 --- a/app/Controllers/errorController.php +++ b/app/Controllers/errorController.php @@ -37,11 +37,11 @@ class FreshRSS_error_Controller extends Minz_ActionController { if ($this->view->errorMessage == '') { switch($code_int) { case 403: - $this->view->errorMessage = _t('access_denied'); + $this->view->errorMessage = _t('feedback.access.denied'); break; case 404: default: - $this->view->errorMessage = _t('page_not_found'); + $this->view->errorMessage = _t('feedback.access.not_found'); break; } } diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 9990a852c..121cb8921 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -68,7 +68,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $limits = Minz_Configuration::limits(); $this->view->feeds = $feedDAO->listFeeds(); if (count($this->view->feeds) >= $limits['max_feeds']) { - Minz_Request::bad(_t('sub.feeds.over_max', $limits['max_feeds']), + Minz_Request::bad(_t('feedback.sub.feed.over_max', $limits['max_feeds']), $url_redirect); } @@ -110,7 +110,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } catch (FreshRSS_BadUrl_Exception $e) { // Given url was not a valid url! Minz_Log::warning($e->getMessage()); - Minz_Request::bad(_t('invalid_url', $url), $url_redirect); + Minz_Request::bad(_t('feedback.sub.feed.invalid_url', $url), $url_redirect); } try { @@ -119,20 +119,23 @@ class FreshRSS_feed_Controller extends Minz_ActionController { // Something went bad (timeout, server not found, etc.) Minz_Log::warning($e->getMessage()); Minz_Request::bad( - _t('internal_problem_feed', _url('index', 'logs')), + _t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect ); } catch (Minz_FileNotExistException $e) { // Cache directory doesn't exist! Minz_Log::error($e->getMessage()); Minz_Request::bad( - _t('internal_problem_feed', _url('index', 'logs')), + _t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect ); } if ($feedDAO->searchByUrl($feed->url())) { - Minz_Request::bad(_t('already_subscribed', $feed->name()), $url_redirect); + Minz_Request::bad( + _t('feedback.sub.feed.already_subscribed', $feed->name()), + $url_redirect + ); } $feed->_category($cat); @@ -151,7 +154,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $id = $feedDAO->addFeed($values); if (!$id) { // There was an error in database... we cannot say what here. - Minz_Request::bad(_t('feed_not_added', $feed->name()), $url_redirect); + Minz_Request::bad(_t('feedback.sub.feed.not_added', $feed->name()), $url_redirect); } // Ok, feed has been added in database. Now we have to refresh entries. @@ -185,10 +188,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController { // Entries are in DB, we redirect to feed configuration page. $url_redirect['params']['id'] = $feed->id(); - Minz_Request::good(_t('feed_added', $feed->name()), $url_redirect); + Minz_Request::good(_t('feedback.sub.feed.added', $feed->name()), $url_redirect); } else { // GET request: we must ask confirmation to user before adding feed. - Minz_View::prependTitle(_t('add_rss_feed') . ' · '); + Minz_View::prependTitle(_t('sub.feed.title_add') . ' · '); $this->view->categories = $this->catDAO->listCategories(false); $this->view->feed = new FreshRSS_Feed($url); @@ -204,7 +207,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { if ($feed) { // Already subscribe so we redirect to the feed configuration page. $url_redirect['params']['id'] = $feed->id(); - Minz_Request::good(_t('already_subscribed', $feed->name()), $url_redirect); + Minz_Request::good(_t('feedback.sub.feed.already_subscribed', $feed->name()), $url_redirect); } } } @@ -234,9 +237,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController { invalidateHttpCache(); if ($n === false) { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect); } else { - Minz_Request::good(_t('n_entries_deleted', $n), $url_redirect); + Minz_Request::good(_t('feedback.sub.feed.n_entries_deleted', $n), $url_redirect); } } @@ -381,7 +384,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { // are several updated feeds. $notif = array( 'type' => 'good', - 'content' => _t('feeds_actualized') + 'content' => _t('feedback.sub.feed.actualizeds') ); Minz_Session::_param('notification', $notif); // No layout in ajax request. @@ -392,12 +395,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { // Redirect to the main page with correct notification. if ($updated_feeds === 1) { $feed = reset($feeds); - Minz_Request::good(_t('feed_actualized', $feed->name()), - array('get' => 'f_' . $feed->id())); + Minz_Request::good(_t('feedback.sub.feed.actualized', $feed->name()), array( + 'params' => array('get' => 'f_' . $feed->id()) + )); } elseif ($updated_feeds > 1) { - Minz_Request::good(_t('n_feeds_actualized', $updated_feeds), array()); + Minz_Request::good(_t('feedback.sub.feed.n_actualized', $updated_feeds), array()); } else { - Minz_Request::good(_t('no_feed_to_refresh'), array()); + Minz_Request::good(_t('feedback.sub.feed.no_refresh'), array()); } } @@ -475,9 +479,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController { FreshRSS_Context::$conf->remove_query_by_get('f_' . $id); FreshRSS_Context::$conf->save(); - Minz_Request::good(_t('feed_deleted'), $redirect_url); + Minz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url); } else { - Minz_Request::bad(_t('error_occurred'), $redirect_url); + Minz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url); } } } diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 4e2dbd157..f29051f34 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -26,7 +26,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { */ public function indexAction() { $this->view->feeds = $this->feedDAO->listFeeds(); - Minz_View::prependTitle(_t('import_export') . ' · '); + Minz_View::prependTitle(_t('sub.import_export.title') . ' · '); } /** @@ -48,7 +48,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { if ($status_file !== 0) { Minz_Log::error('File cannot be uploaded. Error code: ' . $status_file); - Minz_Request::bad(_t('file_cannot_be_uploaded'), + Minz_Request::bad(_t('feedback.import_export.file_cannot_be_uploaded'), array('c' => 'importExport', 'a' => 'index')); } @@ -70,7 +70,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { if (!is_resource($zip)) { // zip_open cannot open file: something is wrong Minz_Log::error('Zip archive cannot be imported. Error code: ' . $zip); - Minz_Request::bad(_t('zip_error'), + Minz_Request::bad(_t('feedback.import_export.zip_error'), array('c' => 'importExport', 'a' => 'index')); } @@ -92,7 +92,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { zip_close($zip); } elseif ($type_file === 'zip') { // Zip extension is not loaded - Minz_Request::bad(_t('no_zip_extension'), + Minz_Request::bad(_t('feedback.import_export.no_zip_extension'), array('c' => 'importExport', 'a' => 'index')); } elseif ($type_file !== 'unknown') { $list_files[$type_file][] = file_get_contents($file['tmp_name']); @@ -115,8 +115,8 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // And finally, we get import status and redirect to the home page Minz_Session::_param('actualize_feeds', true); - $content_notif = $error === true ? _t('feeds_imported_with_errors') : - _t('feeds_imported'); + $content_notif = $error === true ? _t('feedback.import_export.feeds_imported_with_errors') : + _t('feedback.import_export.feeds_imported'); Minz_Request::good($content_notif); } @@ -183,7 +183,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { if (isset($elt['xmlUrl'])) { // If xmlUrl exists, it means it is a feed if ($nb_feeds >= $limits['max_feeds']) { - Minz_Log::warning(_t('sub.feeds.over_max', + Minz_Log::warning(_t('feedback.sub.feed.over_max', $limits['max_feeds'])); $is_error = true; continue; @@ -197,7 +197,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // No xmlUrl? It should be a category! $limit_reached = ($nb_cats >= $limits['max_categories']); if ($limit_reached) { - Minz_Log::warning(_t('sub.categories.over_max', + Minz_Log::warning(_t('feedback.sub.category.over_max', $limits['max_categories'])); } @@ -337,7 +337,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // Feed does not exist in DB,we should to try to add it. if ($nb_feeds >= $limits['max_feeds']) { // Oops, no more place! - Minz_Log::warning(_t('sub.feeds.over_max', $limits['max_feeds'])); + Minz_Log::warning(_t('feedback.sub.feed.over_max', $limits['max_feeds'])); } else { $feed = $this->addFeedJson($item['origin'], $google_compliant); } @@ -482,7 +482,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $this->exportZip($export_files); } catch (Exception $e) { # Oops, there is no Zip extension! - Minz_Request::bad(_t('export_no_zip_extension'), + Minz_Request::bad(_t('feedback.import_export.export_no_zip_extension'), array('c' => 'importExport', 'a' => 'index')); } } elseif ($nb_files === 1) { @@ -523,14 +523,14 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $this->view->categories = $this->catDAO->listCategories(); if ($type == 'starred') { - $this->view->list_title = _t('starred_list'); + $this->view->list_title = _t('sub.import_export.starred_list'); $this->view->type = 'starred'; $unread_fav = $this->entryDAO->countUnreadReadFavorites(); $this->view->entries = $this->entryDAO->listWhere( 's', '', FreshRSS_Entry::STATE_ALL, 'ASC', $unread_fav['all'] ); } elseif ($type == 'feed' && !is_null($feed)) { - $this->view->list_title = _t('feed_list', $feed->name()); + $this->view->list_title = _t('sub.import_export.feed_list', $feed->name()); $this->view->type = 'feed/' . $feed->id(); $this->view->entries = $this->entryDAO->listWhere( 'f', $feed->id(), FreshRSS_Entry::STATE_ALL, 'ASC', diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 1cf618f7f..33cd2843c 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -98,7 +98,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { $this->view->categories = FreshRSS_Context::$categories; $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title(); - $title = _t('gen.title.global_view'); + $title = _t('index.feed.title_global'); if (FreshRSS_Context::$get_unread > 0) { $title = '(' . FreshRSS_Context::$get_unread . ') ' . $title; } @@ -206,7 +206,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { * This action displays the about page of FreshRSS. */ public function aboutAction() { - Minz_View::prependTitle(_t('about') . ' · '); + Minz_View::prependTitle(_t('index.about.title') . ' · '); } /** @@ -217,7 +217,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { Minz_Error::error(403); } - Minz_View::prependTitle(_t('logs') . ' · '); + Minz_View::prependTitle(_t('index.log.title') . ' · '); if (Minz_Request::isPost()) { FreshRSS_LogDAO::truncate(); diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php index 62f413989..113f58ea9 100755 --- a/app/Controllers/javascriptController.php +++ b/app/Controllers/javascriptController.php @@ -39,6 +39,8 @@ class FreshRSS_javascript_Controller extends Minz_ActionController { } catch (Minz_Exception $me) { Minz_Log::warning('Nonce failure: ' . $me->getMessage()); } + } else { + Minz_Log::notice('Nonce failure due to invalid username!'); } $this->view->nonce = ''; //Failure $this->view->salt1 = ''; diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 18fbca6df..4a597ae7d 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -15,7 +15,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController { Minz_Error::error(403); } - Minz_View::prependTitle(_t('stats') . ' · '); + Minz_View::prependTitle(_t('admin.stats.title') . ' · '); } /** @@ -117,6 +117,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController { $this->view->feed = $feedDAO->searchById($id); $this->view->days = $statsDAO->getDays(); $this->view->months = $statsDAO->getMonths(); + $this->view->repartition = $statsDAO->calculateEntryRepartitionPerFeed($id); $this->view->repartitionHour = $statsDAO->calculateEntryRepartitionPerFeedPerHour($id); $this->view->averageHour = $statsDAO->calculateEntryAveragePerFeedPerHour($id); $this->view->repartitionDayOfWeek = $statsDAO->calculateEntryRepartitionPerFeedPerDayOfWeek($id); diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 67b95eba6..6152b7252 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -29,7 +29,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { public function indexAction() { Minz_View::appendScript(Minz_Url::display('/scripts/category.js?' . @filemtime(PUBLIC_PATH . '/scripts/category.js'))); - Minz_View::prependTitle(_t('subscription_management') . ' · '); + Minz_View::prependTitle(_t('sub.title') . ' · '); $id = Minz_Request::param('id'); if ($id !== false) { @@ -74,7 +74,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $this->view->feed = $this->view->feeds[$id]; - Minz_View::prependTitle(_t('rss_feed_management') . ' · ' . $this->view->feed->name() . ' · '); + Minz_View::prependTitle(_t('sub.title.feed_management') . ' · ' . $this->view->feed->name() . ' · '); if (Minz_Request::isPost()) { $user = Minz_Request::param('http_user', ''); @@ -106,9 +106,9 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $this->view->feed->_category($cat); $this->view->feed->faviconPrepare(); - Minz_Request::good(_t('feed_updated'), array('c' => 'subscription', 'params' => array('id' => $id))); + Minz_Request::good(_t('feedback.sub.feed.updated'), array('c' => 'subscription', 'params' => array('id' => $id))); } else { - Minz_Request::bad(_t('error_occurred_update'), array('c' => 'subscription')); + Minz_Request::bad(_t('feedback.sub.error'), array('c' => 'subscription')); } } } diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 0896b13ac..1b44a739c 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -20,21 +20,21 @@ class FreshRSS_update_Controller extends Minz_ActionController { } public function indexAction() { - Minz_View::prependTitle(_t('update_system') . ' · '); + Minz_View::prependTitle(_t('admin.update.title') . ' · '); if (file_exists(UPDATE_FILENAME) && !is_writable(FRESHRSS_PATH)) { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('file_is_nok', FRESHRSS_PATH) + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.file_is_nok', FRESHRSS_PATH) ); } elseif (file_exists(UPDATE_FILENAME)) { // There is an update file to apply! $this->view->update_to_apply = true; $this->view->message = array( 'status' => 'good', - 'title' => _t('ok'), - 'body' => _t('update_can_apply') + 'title' => _t('gen.short.ok'), + 'body' => _t('feedback.update.can_apply') ); } } @@ -67,8 +67,8 @@ class FreshRSS_update_Controller extends Minz_ActionController { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('update_server_not_found', FRESHRSS_UPDATE_WEBSITE) + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.server_not_found', FRESHRSS_UPDATE_WEBSITE) ); return; } @@ -78,8 +78,8 @@ class FreshRSS_update_Controller extends Minz_ActionController { if (strpos($status, 'UPDATE') !== 0) { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('no_update') + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.none') ); @file_put_contents(DATA_PATH . '/last_update.txt', time()); @@ -93,8 +93,8 @@ class FreshRSS_update_Controller extends Minz_ActionController { } else { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('update_problem', 'Cannot save the update script') + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.error', 'Cannot save the update script') ); } } @@ -112,9 +112,9 @@ class FreshRSS_update_Controller extends Minz_ActionController { if ($res === true) { @unlink(UPDATE_FILENAME); @file_put_contents(DATA_PATH . '/last_update.txt', time()); - Minz_Request::good(_t('update_finished')); + Minz_Request::good(_t('feedback.update.finished')); } else { - Minz_Request::bad(_t('update_problem', $res), + Minz_Request::bad(_t('feedback.update.error', $res), array('c' => 'update', 'a' => 'index')); } } @@ -133,7 +133,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { 'params' => array('post_conf' => true) ), true); } else { - Minz_Request::bad(_t('update_problem', $res), + Minz_Request::bad(_t('feedback.update.error', $res), array('c' => 'update', 'a' => 'index')); } } @@ -143,7 +143,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { * This action displays information about installation. */ public function checkInstallAction() { - Minz_View::prependTitle(_t('gen.title.check_install') . ' · '); + Minz_View::prependTitle(_t('admin.check_install.title') . ' · '); $this->view->status_php = check_install_php(); $this->view->status_files = check_install_files(); diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 5050571a9..3b40e42dc 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -23,7 +23,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { * This action displays the user profile page. */ public function profileAction() { - Minz_View::prependTitle(_t('gen.title.user_profile') . ' · '); + Minz_View::prependTitle(_t('conf.profile.title') . ' · '); if (Minz_Request::isPost()) { $ok = true; @@ -71,10 +71,10 @@ class FreshRSS_user_Controller extends Minz_ActionController { } if ($ok) { - Minz_Request::good(_t('feedback.user_profile.updated'), + Minz_Request::good(_t('feedback.profile.updated'), array('c' => 'user', 'a' => 'profile')); } else { - Minz_Request::bad(_t('error_occurred'), + Minz_Request::bad(_t('feedback.profile.error'), array('c' => 'user', 'a' => 'profile')); } } @@ -88,7 +88,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Error::error(403); } - Minz_View::prependTitle(_t('gen.title.user_management') . ' · '); + Minz_View::prependTitle(_t('admin.user.title') . ' · '); // Get the correct current user. $username = Minz_Request::param('u', Minz_Session::param('currentUser')); @@ -168,7 +168,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { $notif = array( 'type' => $ok ? 'good' : 'bad', - 'content' => _t($ok ? 'user_created' : 'error_occurred', $new_user_name) + 'content' => _t('feedback.user.created' . (!$ok ? '.error' : ''), $new_user_name) ); Minz_Session::_param('notification', $notif); } @@ -201,7 +201,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { $notif = array( 'type' => $ok ? 'good' : 'bad', - 'content' => _t($ok ? 'user_deleted' : 'error_occurred', $username) + 'content' => _t('feedback.user.deleted' . (!$ok ? '.error' : ''), $username) ); Minz_Session::_param('notification', $notif); } |
