From 198297e0d465de8d479db93cf17d08b5b5e1016e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 9 Mar 2009 00:03:04 +0000 Subject: Instead of putting after_install in the url, put it in the session. This helps us to make sure that we only see the welcome message once. --- core/controllers/albums.php | 2 +- core/helpers/core_theme.php | 23 ++++++++++++++--------- installer/installer.php | 1 + installer/views/success.html.php | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/core/controllers/albums.php b/core/controllers/albums.php index 2c7ea83b..96a6f401 100644 --- a/core/controllers/albums.php +++ b/core/controllers/albums.php @@ -52,7 +52,7 @@ class Albums_Controller extends Items_Controller { $sort_order = $album->sort_column; $sort_order = !empty($sort_order) ? unserialize($sort_order) : $sort_order; - + $template = new Theme_View("page.html", "album"); $template->set_global("page_size", $page_size); $template->set_global("item", $album); diff --git a/core/helpers/core_theme.php b/core/helpers/core_theme.php index eed64ded..fbb8aef3 100644 --- a/core/helpers/core_theme.php +++ b/core/helpers/core_theme.php @@ -19,8 +19,9 @@ */ class core_theme_Core { static function head($theme) { + $session = Session::instance(); $buf = ""; - if (Session::instance()->get("debug")) { + if ($session->get("debug")) { $buf .= ""; } @@ -40,7 +41,7 @@ class core_theme_Core { $buf .= html::script("core/js/fullsize.js"); } - if (Session::instance()->get("l10n_mode", false)) { + if ($session->get("l10n_mode", false)) { $buf .= ""; $buf .= html::script("lib/jquery.cookie.js"); @@ -64,13 +65,14 @@ class core_theme_Core { } static function admin_head($theme) { + $session = Session::instance(); $buf = ""; - if (Session::instance()->get("debug")) { + if ($session->get("debug")) { $buf .= ""; } - if (Session::instance()->get("l10n_mode", false)) { + if ($session->get("l10n_mode", false)) { $buf .= ""; $buf .= html::script("lib/jquery.cookie.js"); @@ -81,25 +83,28 @@ class core_theme_Core { } static function page_bottom($theme) { - if (Session::instance()->get("profiler", false)) { + $session = Session::instance(); + if ($session->get("profiler", false)) { $profiler = new Profiler(); $profiler->render(); } - if (Session::instance()->get("l10n_mode", false)) { + if ($session->get("l10n_mode", false)) { return L10n_Client_Controller::l10n_form(); } - if (Input::instance()->get("after_install")) { + if ($session->get("after_install")) { + $session->delete("after_install"); return new View("after_install_loader.html"); } } static function admin_page_bottom($theme) { - if (Session::instance()->get("profiler", false)) { + $session = Session::instance(); + if ($session->get("profiler", false)) { $profiler = new Profiler(); $profiler->render(); } - if (Session::instance()->get("l10n_mode", false)) { + if ($session->get("l10n_mode", false)) { return L10n_Client_Controller::l10n_form(); } } diff --git a/installer/installer.php b/installer/installer.php index ff727340..2a8b6219 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -106,6 +106,7 @@ class installer { $data = "session_id|s:32:\"$session_id\""; $data .= ";user_agent|s:{$user_agent_len}:\"$user_agent\""; $data .= ";user|i:2"; + $data .= ";after_install|i:1"; $data .= ";last_activity|i:$now"; $data = base64_encode($data); $sql = "INSERT INTO {sessions} VALUES('$session_id', $now, '$data')"; diff --git a/installer/views/success.html.php b/installer/views/success.html.php index d7dbc4d1..4bca2fb1 100644 --- a/installer/views/success.html.php +++ b/installer/views/success.html.php @@ -19,5 +19,5 @@

-

Start using Gallery

+

Start using Gallery

-- cgit v1.2.3