<?php defined('SYSPATH') or die('No direct access allowed.');

/**
 * This class overrides Kohana's HTTP Exception
 *
 * @package    lnApp
 * @category   Modifications
 * @author     Deon George
 * @copyright  (c) 2009-2013 Deon George
 * @license    http://dev.leenooks.net/license.html
 */
abstract class lnApp_HTTP_Exception extends Kohana_HTTP_Exception {
	public function get_response() {
		Style::factory()
			->type('file')
			->data('media/css/pages/error.css');

		$output = '<div class="container"><div class="row"><div class="error-container">';
		$output .= View::factory('errors/'.$this->_code)
			->set('message',$this->getMessage());

		$output .= '<div class="error-actions">';
		$output .= HTML::anchor(((array_key_exists('auth',Kohana::modules()) AND URL::admin_url()) ? 'u/' : '').'welcome','<i class="fa fa-chevron-left"></i> Back to Home',array('class'=>'btn btn-large btn-primary'));
		$output .= '</div>';
		$output .= '</div></div></div>';

		$view = View::factory(Site::Theme().'/page')
			->set('meta',new Meta)
			->set('navbar','')
			->set('content',$output);

		return Response::factory()
			->status($this->_code)
			->body($view);

		return $response;
	}
}
?>