mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-24 05:19:11 -04:00
Rework our exception framework to fit into Kohana's model better.
Instead of overwriting Kohana_Exception::handle() (which we were doing in MY_Kohana_Exception) we instead use their existing template system. gallery/views/kohana/error.php overrides system/views/kohana/error.php and is the standard error template for all exceptions. Our version of error.php figures out the appropriate view based on context (cli, authenticated admin, guest viewing a 404, guest viewing a system error) and delegates appropriately. Each delegated view has a narrow responsibility. This paves the way for us to add new error views per module. For example, the rest module will define its own template in Rest_Exception and then its exceptions can be rendered the way that it wants (json encoded, in that case).
This commit is contained in:
42
modules/gallery/views/error_user.html.php
Normal file
42
modules/gallery/views/error_user.html.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<? if (!function_exists("t")) { function t($msg) { return $msg; } } ?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: #fff;
|
||||
font-size: 14px;
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
div.big_box {
|
||||
padding: 10px;
|
||||
background: #eee;
|
||||
border: solid 1px #ccc;
|
||||
font-family: sans-serif;
|
||||
color: #111;
|
||||
width: 60em;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
div#framework_error {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title><?= t("Something went wrong!") ?></title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="big_box" id="framework_error">
|
||||
<h1>
|
||||
<?= t("Dang... Something went wrong!") ?>
|
||||
</h1>
|
||||
<h2>
|
||||
<?= t("We tried really hard, but it's broken.") ?>
|
||||
</h2>
|
||||
<p>
|
||||
<?= t("Talk to your Gallery administrator for help fixing this!") ?>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user