summaryrefslogtreecommitdiff
path: root/modules/gallery/views
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/views')
-rw-r--r--modules/gallery/views/error.html.php12
-rw-r--r--modules/gallery/views/error_404.html.php21
-rw-r--r--modules/gallery/views/kohana_error_page.php127
-rw-r--r--modules/gallery/views/menu.html.php4
-rw-r--r--modules/gallery/views/menu_ajax_link.html.php2
-rw-r--r--modules/gallery/views/menu_dialog.html.php2
-rw-r--r--modules/gallery/views/menu_link.html.php2
7 files changed, 38 insertions, 132 deletions
diff --git a/modules/gallery/views/error.html.php b/modules/gallery/views/error.html.php
new file mode 100644
index 00000000..5d81b651
--- /dev/null
+++ b/modules/gallery/views/error.html.php
@@ -0,0 +1,12 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<div id="g-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> \ No newline at end of file
diff --git a/modules/gallery/views/error_404.html.php b/modules/gallery/views/error_404.html.php
new file mode 100644
index 00000000..4b037a79
--- /dev/null
+++ b/modules/gallery/views/error_404.html.php
@@ -0,0 +1,21 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<div id="g-error">
+ <h1>
+ <?= t("Dang... Page not found!") ?>
+ </h1>
+ <? if ($is_guest): ?>
+ <h2>
+ <?= t("Hey wait, you're not signed in yet!") ?>
+ </h2>
+ <p>
+ <?= t("Maybe the page exists, but is only visible to authorized users.") ?>
+ <?= t("Please sign in to find out.") ?>
+ </p>
+ <?= $login_form ?>
+ <? else: ?>
+ <p>
+ <?= t("Maybe the page exists, but is only visible to authorized users.") ?>
+ <?= t("If you think this is an error, talk to your Gallery administrator!") ?>
+ </p>
+ <? endif; ?>
+</div> \ No newline at end of file
diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php
deleted file mode 100644
index b9fdcc19..00000000
--- a/modules/gallery/views/kohana_error_page.php
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.") ?>
-<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: 42em;
- margin: 20px auto;
- }
-
- div#framework_error {
- text-align: center;
- }
-
- div#error_details {
- text-align: left;
- }
-
- code {
- font-family: monospace;
- font-size: 12px;
- margin: 20px;
- color: #333;
- white-space: pre-wrap;
- white-space: -moz-pre-wrap;
- word-wrap: break-word;
- }
-
- h3 {
- font-family: sans-serif;
- margin: 2px 0px 0px 0px;
- padding: 8px 0px 0px 0px;
- border-top: 1px solid #ddd;
- }
-
- p {
- padding: 0px;
- margin: 0px 0px 10px 0px;
- }
-
- li, pre {
- padding: 0px;
- margin: 0px;
- }
- </style>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title><?= t("Something went wrong!") ?></title>
- </head>
- <body>
- <? try { $user = identity::active_user(); } catch (Exception $e) { } ?>
- <? $admin = php_sapi_name() == "cli" || isset($user) && $user->admin ?>
- <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>
- <? if (!$admin): ?>
- <p>
- <?= t("Talk to your Gallery administrator for help fixing this!") ?>
- </p>
- <? endif ?>
- </div>
- <? if ($admin): ?>
- <div class="big_box" id="error_details">
- <h2>
- <?= t("Hey wait, you're an admin! We can tell you stuff.") ?>
- </h2>
- <script type="text/javascript">
- var show_details = function() {
- document.getElementById("stuff").style.display = "block";
- document.getElementById("toggle").style.display = "none";
- }
- </script>
- <a id="toggle" href="#" onclick="javascript:show_details(); return false;">
- <b><?= t("Ok.. tell me stuff!") ?></b>
- </a>
- <div id="stuff" style="display: none">
- <? if (!empty($line) and !empty($file)): ?>
- <div id="summary">
- <h3>
- <?= t("Help!") ?>
- </h3>
- <p>
- <?= t("If this stuff doesn't make any sense to you, <a href=\"%url\">ask for help in the Gallery forums</a>!", array("url" => "http://gallery.menalto.com/forum/96")) ?>
- </p>
- <h3>
- <?= t("So here's the error:") ?>
- </h3>
-
- <code class="block"><?= $message ?></code>
- <p>
- <?= t("File: <b>%file</b>, line: <b>%line</b>", array("file" => $file, "line" => $line)) ?>
- </p>
- </div>
- <? endif ?>
-
- <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTrace(); ?>
- <? $trace = Kohana::backtrace($trace); ?>
- <? if (!empty($trace)): ?>
- <div id="stack_trace">
- <h3>
- <?= t("And here's how we got there:") ?>
- </h3>
- <?= $trace ?>
- <? endif ?>
- </div>
- </div>
- <? else: ?>
- <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTraceAsString(); ?>
- <? if (!empty($trace)): ?>
- <? Kohana_Log::add("error", print_r($trace, 1)); ?>
- <? endif ?>
- <? endif ?>
- </body>
-</html>
diff --git a/modules/gallery/views/menu.html.php b/modules/gallery/views/menu.html.php
index cb49bcdf..17a249dd 100644
--- a/modules/gallery/views/menu.html.php
+++ b/modules/gallery/views/menu.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<? if ($menu->elements): // Don't show the menu if it has no choices ?>
+<? if (!$menu->is_empty()): // Don't show the menu if it has no choices ?>
<? if ($menu->is_root): ?>
-<ul <?= isset($menu->css_id) ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>">
+<ul <?= $menu->css_id ? "id='$menu->css_id'" : "" ?> class="<?= $menu->css_class ?>">
<? foreach ($menu->elements as $element): ?>
<?= $element->render() ?>
<? endforeach ?>
diff --git a/modules/gallery/views/menu_ajax_link.html.php b/modules/gallery/views/menu_ajax_link.html.php
index 00a394bc..06cd6f92 100644
--- a/modules/gallery/views/menu_ajax_link.html.php
+++ b/modules/gallery/views/menu_ajax_link.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li>
- <a id="<?= $menu->css_id ?>"
+ <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?>
class="g-ajax-link <?= $menu->css_class ?>"
href="<?= $menu->url ?>"
title="<?= $menu->label->for_html_attr() ?>"
diff --git a/modules/gallery/views/menu_dialog.html.php b/modules/gallery/views/menu_dialog.html.php
index 99b1b013..b44080c3 100644
--- a/modules/gallery/views/menu_dialog.html.php
+++ b/modules/gallery/views/menu_dialog.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li>
- <a id="<?= $menu->css_id ?>"
+ <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?>
class="g-dialog-link <?= $menu->css_class ?>"
href="<?= $menu->url ?>"
title="<?= $menu->label->for_html_attr() ?>">
diff --git a/modules/gallery/views/menu_link.html.php b/modules/gallery/views/menu_link.html.php
index 8e4cdb95..a36d2754 100644
--- a/modules/gallery/views/menu_link.html.php
+++ b/modules/gallery/views/menu_link.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<li>
- <a id="<?= $menu->css_id ?>"
+ <a <?= $menu->css_id ? "id='{$menu->css_id}'" : "" ?>
class="g-menu-link <?= $menu->css_class ?>"
href="<?= $menu->url ?>"
title="<?= $menu->label->for_html_attr() ?>">