diff options
| author | 2014-10-31 16:57:11 +0100 | |
|---|---|---|
| committer | 2014-10-31 16:57:11 +0100 | |
| commit | 54479a5027d83b5dc8deee5e2795c9d89c732ba0 (patch) | |
| tree | 7ae55930f3ab6d5e2a548784e4d7561809f7c68c /app/Controllers/errorController.php | |
| parent | cff8636e770b2072a41928cd918b37654c0dafbb (diff) | |
| parent | 724e13f0a6419b046b33da71e66058e279551edd (diff) | |
Merge branch 'dev' into beta
Conflicts:
CHANGELOG
README.fr.md
README.md
app/Controllers/feedController.php
app/Controllers/indexController.php
app/i18n/en.php
app/i18n/fr.php
app/views/helpers/view/normal_view.phtml
app/views/stats/index.phtml
app/views/stats/repartition.phtml
constants.php
p/scripts/main.js
Diffstat (limited to 'app/Controllers/errorController.php')
| -rw-r--r-- | app/Controllers/errorController.php | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php index 922650b3d..6c080bea8 100644 --- a/app/Controllers/errorController.php +++ b/app/Controllers/errorController.php @@ -1,35 +1,48 @@ <?php +/** + * Controller to handle error page. + */ class FreshRSS_error_Controller extends Minz_ActionController { + /** + * This action is the default one for the controller. + * + * It is called by Minz_Error::error() method. + * + * Parameters are: + * - code (default: 404) + * - logs (default: array()) + */ public function indexAction() { - switch (Minz_Request::param('code')) { - case 403: - $this->view->code = 'Error 403 - Forbidden'; - break; - case 404: - $this->view->code = 'Error 404 - Not found'; - break; - case 500: - $this->view->code = 'Error 500 - Internal Server Error'; - break; - case 503: - $this->view->code = 'Error 503 - Service Unavailable'; - break; - default: - $this->view->code = 'Error 404 - Not found'; + $code_int = Minz_Request::param('code', 404); + switch ($code_int) { + case 403: + $this->view->code = 'Error 403 - Forbidden'; + break; + case 404: + $this->view->code = 'Error 404 - Not found'; + break; + case 500: + $this->view->code = 'Error 500 - Internal Server Error'; + break; + case 503: + $this->view->code = 'Error 503 - Service Unavailable'; + break; + default: + $this->view->code = 'Error 404 - Not found'; } $errors = Minz_Request::param('logs', array()); $this->view->errorMessage = trim(implode($errors)); if ($this->view->errorMessage == '') { - switch(Minz_Request::param('code')) { - case 403: - $this->view->errorMessage = Minz_Translate::t('forbidden_access'); - break; - case 404: - default: - $this->view->errorMessage = Minz_Translate::t('page_not_found'); - break; + switch($code_int) { + case 403: + $this->view->errorMessage = _t('access_denied'); + break; + case 404: + default: + $this->view->errorMessage = _t('page_not_found'); + break; } } |
