https://github.com/marienfressinaud/FreshRSS/issues/554 Also edited the error controler to use the log message passed in Minz_Error::error().pull/562/head
parent
aafcd3a879
commit
35be1769de
4 changed files with 45 additions and 33 deletions
@ -1,26 +1,38 @@ |
||||
<?php |
||||
|
||||
class FreshRSS_error_Controller extends Minz_ActionController { |
||||
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'; |
||||
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'; |
||||
} |
||||
|
||||
$this->view->logs = Minz_Request::param ('logs'); |
||||
|
||||
Minz_View::prependTitle ($this->view->code . ' · '); |
||||
|
||||
$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; |
||||
} |
||||
} |
||||
|
||||
Minz_View::prependTitle($this->view->code . ' · '); |
||||
} |
||||
} |
||||
|
@ -1,18 +1,9 @@ |
||||
<div class="post"> |
||||
<div class="alert alert-error"> |
||||
<h1 class="alert-head"><?php echo $this->code; ?></h1>
|
||||
|
||||
<p> |
||||
<?php |
||||
switch(Minz_Request::param ('code')) { |
||||
case 403: |
||||
echo Minz_Translate::t ('forbidden_access'); |
||||
break; |
||||
case 404: |
||||
default: |
||||
echo Minz_Translate::t ('page_not_found'); |
||||
} ?><br /> |
||||
<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
|
||||
<?php echo $this->errorMessage; ?><br />
|
||||
<a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a>
|
||||
</p> |
||||
</div> |
||||
</div> |
||||
|
Loading…
Reference in new issue