summaryrefslogtreecommitdiff
path: root/modules/gallery/views/error_user.html.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-19 13:52:48 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-19 14:07:32 -0700
commit41ca2b0195bf6a29429dfc5405f3c2073b1c3aba (patch)
treeea39d3cc440a6aa1ba05ea84e2e15be007a105ae /modules/gallery/views/error_user.html.php
parent5736698b4ba17e382468ed9fdfed4b46e37f763e (diff)
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).
Diffstat (limited to 'modules/gallery/views/error_user.html.php')
-rw-r--r--modules/gallery/views/error_user.html.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/modules/gallery/views/error_user.html.php b/modules/gallery/views/error_user.html.php
new file mode 100644
index 00000000..74c6a8fb
--- /dev/null
+++ b/modules/gallery/views/error_user.html.php
@@ -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>