From 798444f40bbc0344568e9744abf7034b9a59febd Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Tue, 9 Jun 2009 19:45:15 -0700
Subject: Replace login_page.html.php with the form, wrapped in our default
page type.
---
modules/gallery/controllers/albums.php | 4 ++-
themes/default/views/login_page.html.php | 61 --------------------------------
2 files changed, 3 insertions(+), 62 deletions(-)
delete mode 100644 themes/default/views/login_page.html.php
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index f37609e6..34fee917 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -26,7 +26,9 @@ class Albums_Controller extends Items_Controller {
$page_size = module::get_var("gallery", "page_size", 9);
if (!access::can("view", $album)) {
if ($album->id == 1) {
- print new Theme_View("login_page.html");
+ $view = new Theme_View("page.html", "page");
+ $view->content = user::get_login_form("login/auth_html");
+ print $view;
return;
} else {
access::forbidden();
diff --git a/themes/default/views/login_page.html.php b/themes/default/views/login_page.html.php
deleted file mode 100644
index c4880727..00000000
--- a/themes/default/views/login_page.html.php
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
- = t("Please Login to Gallery") ?>
-
- " type="image/x-icon" />
- "
- media="screen,print,projection" />
- "
- media="screen" />
- "
- media="screen,print,projection" />
- "
- media="screen,print,projection" />
-
-
-
-
-
-
-
-
-
-
-
- = $theme->head() ?>
-
-
- main_element_attributes() ?>>
- = $theme->page_top() ?>
-
- = $theme->site_status() ?>
-
-
-
-
-
- = $theme->messages() ?>
- = user::get_login_form("login/auth_html") ?>
-
-
-
-
-
-
-
- = $theme->page_bottom() ?>
-
-
--
cgit v1.2.3
From 7ccb65ea9ebf10e35c09bbebf8ffe1118d3fb0fb Mon Sep 17 00:00:00 2001
From: Andy Staudacher
Date: Tue, 9 Jun 2009 19:49:06 -0700
Subject: Fix for fetching l10n plural messages. Need to cast from stdclass to
array(), as I18n expects all messages to be either string or array.
---
modules/gallery/helpers/l10n_client.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php
index 33f23857..20f81ecc 100644
--- a/modules/gallery/helpers/l10n_client.php
+++ b/modules/gallery/helpers/l10n_client.php
@@ -123,7 +123,12 @@ class l10n_client_Core {
$key = $message_data->key;
$locale = $message_data->locale;
$revision = $message_data->rev;
- $translation = serialize(json_decode($message_data->translation));
+ $translation = json_decode($message_data->translation);
+ if (!is_string($translation)) {
+ // Normalize stdclass to array
+ $translation = (array) $translation;
+ }
+ $translation = serialize($translation);
// @todo Should we normalize the incoming_translations table into messages(id, key, message)
// and incoming_translations(id, translation, locale, revision)? Or just allow
--
cgit v1.2.3
From 5e6c8894e23239f2f34f3fb99ab76f43cbabe838 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Tue, 9 Jun 2009 20:08:48 -0700
Subject: Use a reference in available() to avoid crappy looking dereferencing.
---
modules/gallery/helpers/module.php | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index 2fd5be6c..0559ff04 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -78,10 +78,11 @@ class module_Core {
foreach (glob(MODPATH . "*/module.info") as $file) {
$module_name = basename(dirname($file));
$modules->$module_name = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
- $modules->$module_name->installed = self::is_installed($module_name);
- $modules->$module_name->active = self::is_active($module_name);
- $modules->$module_name->version = self::get_version($module_name);
- $modules->$module_name->locked = false;
+ $m =& $modules->$module_name;
+ $m->installed = self::is_installed($module_name);
+ $m->active = self::is_active($module_name);
+ $m->version = self::get_version($module_name);
+ $m->locked = false;
}
// Lock certain modules
--
cgit v1.2.3
From 7e4fcb97cb4a575811c1e84ced07fbaf4d7ed7ba Mon Sep 17 00:00:00 2001
From: Andy Staudacher
Date: Tue, 9 Jun 2009 20:10:34 -0700
Subject: Fix HTML bug in l10n message
---
modules/gallery/views/admin_advanced_settings.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php
index 34abadea..b4dedaef 100644
--- a/modules/gallery/views/admin_advanced_settings.html.php
+++ b/modules/gallery/views/admin_advanced_settings.html.php
@@ -6,7 +6,7 @@
-
- = t("Change these values at your own risk!") ?>
+ = t("Change these values at your own risk!") ?>
--
cgit v1.2.3
From 00b528afac33cd4e99fd3e5e648288a9d646eb38 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Tue, 9 Jun 2009 20:32:37 -0700
Subject: Cache the available module list in module::$available.
---
modules/gallery/helpers/module.php | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index 0559ff04..58f9b20d 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -27,6 +27,7 @@ class module_Core {
public static $active = array();
public static $modules = array();
public static $var_cache = null;
+ public static $available = array();
/**
* Set the version of the corresponding Module_Model
@@ -74,23 +75,27 @@ class module_Core {
* Return the list of available modules, including uninstalled modules.
*/
static function available() {
- $modules = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
- foreach (glob(MODPATH . "*/module.info") as $file) {
- $module_name = basename(dirname($file));
- $modules->$module_name = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
- $m =& $modules->$module_name;
- $m->installed = self::is_installed($module_name);
- $m->active = self::is_active($module_name);
- $m->version = self::get_version($module_name);
- $m->locked = false;
- }
+ if (empty(self::$available)) {
+ $modules = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
+ foreach (glob(MODPATH . "*/module.info") as $file) {
+ $module_name = basename(dirname($file));
+ $modules->$module_name = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
+ $m =& $modules->$module_name;
+ $m->installed = self::is_installed($module_name);
+ $m->active = self::is_active($module_name);
+ $m->code_version = $m->version;
+ $m->version = self::get_version($module_name);
+ $m->locked = false;
+ }
- // Lock certain modules
- $modules->gallery->locked = true;
- $modules->user->locked = true;
- $modules->ksort();
+ // Lock certain modules
+ $modules->gallery->locked = true;
+ $modules->user->locked = true;
+ $modules->ksort();
+ self::$available = $modules;
+ }
- return $modules;
+ return self::$available;
}
/**
--
cgit v1.2.3
From a20246b7382ea828157e358dd5ed62ed05db5193 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Tue, 9 Jun 2009 20:33:06 -0700
Subject: Say hello to the new upgrader UI.
---
modules/gallery/controllers/upgrader.php | 25 ++++++
modules/gallery/views/upgrader.html.php | 135 +++++++++++++++++++++++++++++++
2 files changed, 160 insertions(+)
create mode 100644 modules/gallery/controllers/upgrader.php
create mode 100644 modules/gallery/views/upgrader.html.php
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php
new file mode 100644
index 00000000..e8798de5
--- /dev/null
+++ b/modules/gallery/controllers/upgrader.php
@@ -0,0 +1,25 @@
+
+
+
+ = t("Gallery3 Upgrader") ?>
+
+
+
+
+

" />
+
+
+ = t("Welcome to the Gallery upgrader. One click and you're done!") ?>
+
+
+
+ = t("Module name") ?> |
+ = t("Installed version") ?> |
+ = t("Available version") ?> |
+
+
+ foreach (module::available() as $module): ?>
+ if ($module->active): ?>
+ " >
+
+ = $module->name ?>
+ |
+
+ = $module->version ?>
+ |
+
+ = $module->code_version ?>
+ |
+
+ else: ?>
+ @$inactive++ ?>
+ endif ?>
+ endforeach ?>
+
+
+
+
+ if (@$inactive): ?>
+
+ = t("The following modules are inactive and don't require an upgrade.") ?>
+
+
+ foreach (module::available() as $module): ?>
+ if (!$module->active): ?>
+ -
+ = $module->name ?>
+
+ endif ?>
+ endforeach ?>
+
+ endif ?>
+
+
+
+
+
--
cgit v1.2.3