summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-07-08 00:29:37 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-07-08 00:29:37 +0000
commitc83650d83ad8b1f4bda30cac2ae8efa6e1c97287 (patch)
tree482cf980e87cd7c80c28a89bb9395eba6b53026f /modules/gallery/libraries
parenta0b0b415515bff5f9edd43d373e8e78f3b3f8e4d (diff)
parent9d66783f47636153bf3661d1d89e694dd5188c36 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/libraries')
-rw-r--r--modules/gallery/libraries/MY_Kohana_Exception.php64
-rw-r--r--modules/gallery/libraries/Theme_View.php4
2 files changed, 2 insertions, 66 deletions
diff --git a/modules/gallery/libraries/MY_Kohana_Exception.php b/modules/gallery/libraries/MY_Kohana_Exception.php
index e7ebdb1f..72cb2ac0 100644
--- a/modules/gallery/libraries/MY_Kohana_Exception.php
+++ b/modules/gallery/libraries/MY_Kohana_Exception.php
@@ -29,70 +29,6 @@ class Kohana_Exception extends Kohana_Exception_Core {
$e->getTraceAsString());
}
- public static function handle(Exception $e) {
- if ($e instanceof ORM_Validation_Exception) {
- Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1));
- }
- try {
- $user = identity::active_user();
- $try_themed_view = $user && !$user->admin;
- } catch (Exception $e2) {
- $try_themed_view = false;
- }
-
- if ($try_themed_view) {
- try {
- return self::_show_themed_error_page($e);
- } catch (Exception $e3) {
- Kohana_Log::add("error", "Exception in exception handling code: " . self::text($e3));
- return parent::handle($e);
- }
- } else {
- return parent::handle($e);
- }
- }
-
- /**
- * Shows a themed error page.
- * @see Kohana_Exception::handle
- */
- private static function _show_themed_error_page(Exception $e) {
- // Create a text version of the exception
- $error = Kohana_Exception::text($e);
-
- // Add this exception to the log
- Kohana_Log::add('error', $error);
-
- // Manually save logs after exceptions
- Kohana_Log::save();
-
- if (!headers_sent()) {
- if ($e instanceof Kohana_Exception) {
- $e->sendHeaders();
- } else {
- header("HTTP/1.1 500 Internal Server Error");
- }
- }
-
- $view = new Theme_View("page.html", "other", "error");
- if ($e instanceof Kohana_404_Exception) {
- $view->page_title = t("Dang... Page not found!");
- $view->content = new View("error_404.html");
- $user = identity::active_user();
- $view->content->is_guest = $user && $user->guest;
- if ($view->content->is_guest) {
- $view->content->login_form = new View("login_ajax.html");
- $view->content->login_form->form = auth::get_login_form("login/auth_html");
- // Avoid anti-phishing protection by passing the url as session variable.
- Session::instance()->set("continue_url", url::current(true));
- }
- } else {
- $view->page_title = t("Dang... Something went wrong!");
- $view->content = new View("error.html");
- }
- print $view;
- }
-
/**
* @see Kohana_Exception::dump()
*/
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 8b432fb6..6246c6f1 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -86,9 +86,9 @@ class Theme_View_Core extends Gallery_View {
return $menu->render();
}
- public function site_menu() {
+ public function site_menu($item_css_selector) {
$menu = Menu::factory("root");
- module::event("site_menu", $menu, $this);
+ module::event("site_menu", $menu, $this, $item_css_selector);
return $menu->render();
}