PageRenderTime 29ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/Gallary/modules/gallery/views/error_admin.html.php

https://bitbucket.org/JakePratt/kupcakz.com
PHP | 307 lines | 277 code | 21 blank | 9 comment | 8 complexity | ba1178a47bfe918eb8a1d0d02514f3d8 MD5 | raw file
  1. <?php defined("SYSPATH") or die("No direct script access.") ?>
  2. <? $error_id = uniqid("error") ?>
  3. <? if (!function_exists("t")) { function t($msg) { return $msg; } } ?>
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <head>
  6. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  7. <style type="text/css">
  8. body {
  9. background: #fff;
  10. font-size: 14px;
  11. line-height: 130%;
  12. }
  13. div.big_box {
  14. padding: 10px;
  15. background: #eee;
  16. border: solid 1px #ccc;
  17. font-family: sans-serif;
  18. color: #111;
  19. width: 60em;
  20. margin: 20px auto;
  21. }
  22. #framework_error {
  23. height: 6em;
  24. }
  25. #framework_error .crashlogo {
  26. position: relative;
  27. top: .3em;
  28. font-size: 6.0em;
  29. }
  30. #framework_error .title {
  31. position: relative;
  32. top: -2.5em;
  33. padding: 0px;
  34. text-align: center;
  35. }
  36. div#error_details {
  37. text-align: left;
  38. }
  39. code {
  40. font-family: monospace;
  41. font-size: 12px;
  42. margin: 20px 20px 20px 0px;
  43. color: #333;
  44. white-space: pre-wrap;
  45. white-space: -moz-pre-wrap;
  46. word-wrap: break-word;
  47. }
  48. code .line {
  49. padding-left: 10px;
  50. }
  51. h3 {
  52. font-family: sans-serif;
  53. margin: 2px 0px 0px 0px;
  54. padding: 8px 0px 0px 0px;
  55. border-top: 1px solid #ddd;
  56. }
  57. p {
  58. padding: 0px;
  59. margin: 0px 0px 10px 0px;
  60. }
  61. li, pre {
  62. padding: 0px;
  63. margin: 0px;
  64. }
  65. .collapsed {
  66. display: none;
  67. }
  68. .highlight {
  69. font-weight: bold;
  70. color: darkred;
  71. }
  72. #kohana_error .message {
  73. display: block;
  74. padding-bottom: 10px;
  75. }
  76. .source {
  77. border: solid 1px #ccc;
  78. background: #efe;
  79. margin-bottom: 5px;
  80. }
  81. table {
  82. width: 100%;
  83. display: block;
  84. margin: 0 0 0.4em;
  85. padding: 0;
  86. border-collapse: collapse;
  87. background: #efe;
  88. }
  89. table td {
  90. border: solid 1px #ddd;
  91. text-align: left;
  92. vertical-align: top;
  93. padding: 0.4em;
  94. }
  95. .args table td.key {
  96. width: 200px;
  97. }
  98. .number {
  99. padding-right: 1em;
  100. }
  101. #g-platform h2, #g-stats h2 {
  102. font-size: 1.1em;
  103. }
  104. </style>
  105. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  106. <title><?= t("Something went wrong!") ?></title>
  107. <script type="text/javascript">
  108. function koggle(elem) {
  109. elem = document.getElementById(elem);
  110. if (elem.style && elem.style["display"]) {
  111. // Only works with the "style" attr
  112. var disp = elem.style["display"];
  113. } else {
  114. if (elem.currentStyle) {
  115. // For MSIE, naturally
  116. var disp = elem.currentStyle["display"];
  117. } else {
  118. if (window.getComputedStyle) {
  119. // For most other browsers
  120. var disp = document.defaultView.getComputedStyle(elem, null).getPropertyValue('display');
  121. }
  122. }
  123. }
  124. // Toggle the state of the "display" style
  125. elem.style.display = disp == 'block' ? 'none' : 'block';
  126. return false;
  127. }
  128. </script>
  129. </head>
  130. <body>
  131. <? try { $user = identity::active_user(); } catch (Exception $e) { } ?>
  132. <div class="big_box" id="framework_error">
  133. <div class="crashlogo">
  134. :-(
  135. </div>
  136. <div class="title">
  137. <h1>
  138. <?= t("Dang... Something went wrong!") ?>
  139. </h1>
  140. <h2>
  141. <?= t("We tried really hard, but it's broken.") ?>
  142. </h2>
  143. </div>
  144. </div>
  145. <div class="big_box" id="error_details">
  146. <h2>
  147. <?= t("Hey wait, you're an admin! We can tell you stuff.") ?>
  148. </h2>
  149. <p>
  150. There's an error message below and you can find more details
  151. in gallery3/var/logs (look for the file with the most recent
  152. date on it). Stuck? Stop by the <a href="http://galleryproject.org/forum/96">Gallery 3
  153. Forums</a> and ask for help. You can also look at our list
  154. of <a href="http://sourceforge.net/apps/trac/gallery/roadmap">open
  155. tickets</a> to see if the problem you're seeing has been
  156. reported. If you post a request, here's some useful
  157. information to include:
  158. <?= @gallery_block::get("platform_info") ?>
  159. <?= @gallery_block::get("stats") ?>
  160. </p>
  161. <div id="kohana_error">
  162. <h3>
  163. <span class="type">
  164. <?= $type?> [ <?= $code ?> ]:
  165. </span>
  166. <span class="message">
  167. <?= html::purify($message) ?>
  168. </span>
  169. </h3>
  170. <div id="<?= $error_id ?>" class="content">
  171. <ol class="trace">
  172. <li class="snippet">
  173. <p>
  174. <span class="file">
  175. <?= Kohana_Exception::debug_path($file)?>[ <?= $line?> ]
  176. </span>
  177. </p>
  178. <div class="source">
  179. <? if (Kohana_Exception::$source_output and $source_code = Kohana_Exception::debug_source($file, $line)): ?><code><? foreach ($source_code as $num => $row): ?><span class="line <?= ($num == $line) ? "highlight" : ""?>"><span class="number"><?= $num ?></span><?= htmlspecialchars($row, ENT_NOQUOTES, Kohana::CHARSET) ?></span><? endforeach ?></code>
  180. <? endif ?>
  181. </div>
  182. </li>
  183. <? if (Kohana_Exception::$trace_output): ?>
  184. <? foreach (Kohana_Exception::trace($trace) as $i => $step): ?>
  185. <li class="snippet">
  186. <p>
  187. <span class="file">
  188. <? if ($step["file"]): $source_id = "$error_id.source.$i" ?>
  189. <? if (Kohana_Exception::$source_output and $step["source"]): ?>
  190. <a href="#<?= $source_id ?>" onclick="return koggle('<?= $source_id ?>')"><?= Kohana_Exception::debug_path($step["file"])?>[ <?= $step["line"]?> ]</a>
  191. <? else: ?>
  192. <span class="file"><?= Kohana_Exception::debug_path($step["file"])?>[ <?= $step["line"]?> ]</span>
  193. <? endif ?>
  194. <? else: ?>
  195. {<?= t("PHP internal call")?>}
  196. <? endif?>
  197. </span>
  198. &raquo;
  199. <?= $step["function"]?>(<? if ($step["args"]): $args_id = "$error_id.args.$i" ?>
  200. <a href="#<?= $args_id ?>" onclick="return koggle('<?= $args_id ?>')"><?= t("arguments")?></a>
  201. <? endif?>)
  202. </p>
  203. <? if (isset($args_id)): ?>
  204. <div id="<?= $args_id ?>" class="args collapsed">
  205. <table cellspacing="0">
  206. <? foreach ($step["args"] as $name => $arg): ?>
  207. <tr>
  208. <td class="key">
  209. <pre><?= $name?></pre>
  210. </td>
  211. <td class="value">
  212. <pre><?= Kohana_Exception::safe_dump($arg, $name) ?></pre>
  213. </td>
  214. </tr>
  215. <? endforeach?>
  216. </table>
  217. </div>
  218. <? endif?>
  219. <? if (Kohana_Exception::$source_output and $step["source"] and isset($source_id)): ?>
  220. <pre id="<?= $source_id ?>" class="source collapsed"><code><? foreach ($step["source"] as $num => $row): ?><span class="line <?= ($num == $step["line"]) ? "highlight" : "" ?>"><span class="number"><?= $num ?></span><?= htmlspecialchars($row, ENT_NOQUOTES, Kohana::CHARSET) ?></span><? endforeach ?></code></pre>
  221. <? endif?>
  222. </li>
  223. <? unset($args_id, $source_id) ?>
  224. <? endforeach?>
  225. </ol>
  226. <? endif ?>
  227. </div>
  228. <h2>
  229. <a href="#<?= $env_id = $error_id."environment" ?>" onclick="return koggle('<?= $env_id ?>')"><?= t("Environment")?></a>
  230. </h2>
  231. <div id="<?= $env_id ?>" class="content collapsed">
  232. <? $included = get_included_files()?>
  233. <h3><a href="#<?= $env_id = $error_id."environment_included" ?>" onclick="return koggle('<?= $env_id ?>')"><?= t("Included files")?></a>(<?= count($included)?>)</h3>
  234. <div id="<?= $env_id ?>" class="collapsed">
  235. <table cellspacing="0">
  236. <? foreach ($included as $file): ?>
  237. <tr>
  238. <td>
  239. <pre><?= Kohana_Exception::debug_path($file)?></pre>
  240. </td>
  241. </tr>
  242. <? endforeach?>
  243. </table>
  244. </div>
  245. <? $included = get_loaded_extensions()?>
  246. <h3><a href="#<?= $env_id = $error_id."environment_loaded" ?>" onclick="return koggle('<?= $env_id ?>')"><?= t("Loaded extensions")?></a>(<?= count($included)?>)</h3>
  247. <div id="<?= $env_id ?>" class="collapsed">
  248. <table cellspacing="0">
  249. <? foreach ($included as $file): ?>
  250. <tr>
  251. <td>
  252. <pre><?= Kohana_Exception::debug_path($file)?></pre>
  253. </td>
  254. </tr>
  255. <? endforeach?>
  256. </table>
  257. </div>
  258. <? foreach (array("_SESSION", "_GET", "_POST", "_FILES", "_COOKIE", "_SERVER") as $var): ?>
  259. <? if ( empty($GLOBALS[$var]) OR ! is_array($GLOBALS[$var])) continue ?>
  260. <h3><a href="#<?= $env_id = "$error_id.environment" . strtolower($var) ?>"
  261. onclick="return koggle('<?= $env_id ?>')">$<?= $var?></a></h3>
  262. <div id="<?= $env_id ?>" class="collapsed">
  263. <table cellspacing="0">
  264. <? foreach ($GLOBALS[$var] as $key => $value): ?>
  265. <tr>
  266. <td class="key">
  267. <code>
  268. <?= $key?>
  269. </code>
  270. </td>
  271. <td class="value">
  272. <pre><?= Kohana_Exception::safe_dump($value, $key) ?></pre>
  273. </td>
  274. </tr>
  275. <? endforeach?>
  276. </table>
  277. </div>
  278. <? endforeach?>
  279. </div>
  280. </div>
  281. </div>
  282. </body>
  283. </html>