| @@ -27,10 +27,10 @@ discard block | ||
| 27 | 27 |  	{ | 
| 28 | 28 | parent::__construct([ | 
| 29 | 29 |  				'title' => config('epesi.app.title', 'EPESI'), | 
| 30 | -		        'cdn' => array_merge($this->cdn, (array) config('epesi.app.cdn')), | |
| 30 | +				'cdn' => array_merge($this->cdn, (array) config('epesi.app.cdn')), | |
| 31 | 31 | //TODO: set the skin from admin / user selection | 
| 32 | -		        'skin' => config('epesi.app.skin', $this->skin), | |
| 33 | -		        'template_dir' => array_merge(ModuleManager::collect('templates', $this->skin), (array) $this->template_dir) | |
| 32 | +				'skin' => config('epesi.app.skin', $this->skin), | |
| 33 | +				'template_dir' => array_merge(ModuleManager::collect('templates', $this->skin), (array) $this->template_dir) | |
| 34 | 34 | ]); | 
| 35 | 35 | } | 
| 36 | 36 | |
| @@ -72,43 +72,43 @@ discard block | ||
| 72 | 72 | |
| 73 | 73 | public function renderException($exception) | 
| 74 | 74 |  	{ | 
| 75 | - ob_start(); | |
| 76 | -	    if ($exception instanceof TokenMismatchException) { | |
| 77 | -	        $this->jsRedirectHomepage(__('Session expired! Redirecting to your home page ...')); | |
| 78 | - } | |
| 79 | -	    elseif ($exception instanceof NotFoundHttpException) { | |
| 80 | -	        $this->jsRedirectHomepage(__('Requested page not found! Redirecting to your home page ...')); | |
| 81 | - } | |
| 82 | -	    else { | |
| 83 | - $this->caughtException($exception); | |
| 84 | - } | |
| 75 | + ob_start(); | |
| 76 | +		if ($exception instanceof TokenMismatchException) { | |
| 77 | +			$this->jsRedirectHomepage(__('Session expired! Redirecting to your home page ...')); | |
| 78 | + } | |
| 79 | +		elseif ($exception instanceof NotFoundHttpException) { | |
| 80 | +			$this->jsRedirectHomepage(__('Requested page not found! Redirecting to your home page ...')); | |
| 81 | + } | |
| 82 | +		else { | |
| 83 | + $this->caughtException($exception); | |
| 84 | + } | |
| 85 | 85 | |
| 86 | - return ob_get_clean(); | |
| 86 | + return ob_get_clean(); | |
| 87 | 87 | } | 
| 88 | 88 | |
| 89 | 89 | public function jsRedirectHomepage($message) | 
| 90 | 90 |  	{ | 
| 91 | - $homepageUrl = url(HomePage\Models\HomePage::pathOfUser()); | |
| 91 | + $homepageUrl = url(HomePage\Models\HomePage::pathOfUser()); | |
| 92 | 92 | |
| 93 | - $redirectJs = $this->jsRedirectConfirm($homepageUrl, $message)->jsRender(); | |
| 93 | + $redirectJs = $this->jsRedirectConfirm($homepageUrl, $message)->jsRender(); | |
| 94 | 94 | |
| 95 | -	    if ($this->isJsonRequest()) { | |
| 96 | - $this->outputResponseJSON([ | |
| 97 | - 'success' => true, | |
| 98 | - 'message' => $message, | |
| 99 | - 'atkjs' => $redirectJs | |
| 100 | - ]); | |
| 101 | - } | |
| 102 | -	    else { | |
| 103 | -	        $this->outputResponseHTML('<script>' . $redirectJs . '</script>'); | |
| 104 | - } | |
| 95 | +		if ($this->isJsonRequest()) { | |
| 96 | + $this->outputResponseJSON([ | |
| 97 | + 'success' => true, | |
| 98 | + 'message' => $message, | |
| 99 | + 'atkjs' => $redirectJs | |
| 100 | + ]); | |
| 101 | + } | |
| 102 | +		else { | |
| 103 | +			$this->outputResponseHTML('<script>' . $redirectJs . '</script>'); | |
| 104 | + } | |
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | 107 | public function jsRedirectConfirm($page, $message) | 
| 108 | 108 |  	{ | 
| 109 | - $redirectJs = $this->jsRedirect($page)->jsRender(); | |
| 109 | + $redirectJs = $this->jsRedirect($page)->jsRender(); | |
| 110 | 110 | |
| 111 | -	    return new jsExpression("if (confirm([])) { $redirectJs }", [$message]); | |
| 111 | +		return new jsExpression("if (confirm([])) { $redirectJs }", [$message]); | |
| 112 | 112 | } | 
| 113 | 113 | |
| 114 | 114 | /** |