summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/libraries')
-rw-r--r--modules/gallery/libraries/Admin_View.php6
-rw-r--r--modules/gallery/libraries/Form_Uploadify.php1
-rw-r--r--modules/gallery/libraries/ORM_MPTT.php4
-rw-r--r--modules/gallery/libraries/Theme_View.php13
4 files changed, 12 insertions, 12 deletions
diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php
index cbb781a1..a990e4ca 100644
--- a/modules/gallery/libraries/Admin_View.php
+++ b/modules/gallery/libraries/Admin_View.php
@@ -27,12 +27,6 @@ class Admin_View_Core extends Gallery_View {
* @return void
*/
public function __construct($name) {
- $theme_name = module::get_var("gallery", "active_admin_theme");
- if (!file_exists(THEMEPATH . $theme_name)) {
- module::set_var("gallery", "active_admin_theme", "admin_wind");
- theme::load_themes();
- Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
- }
parent::__construct($name);
$this->theme_name = module::get_var("gallery", "active_admin_theme");
diff --git a/modules/gallery/libraries/Form_Uploadify.php b/modules/gallery/libraries/Form_Uploadify.php
index b1d9fa74..9d76153d 100644
--- a/modules/gallery/libraries/Form_Uploadify.php
+++ b/modules/gallery/libraries/Form_Uploadify.php
@@ -45,6 +45,7 @@ class Form_Uploadify_Core extends Form_Input {
$v = new View("form_uploadify.html");
$v->album = $this->data["album"];
$v->script_data = $this->data["script_data"];
+ $v->simultaneous_upload_limit = module::get_var("gallery", "simultaneous_upload_limit");
return $v;
}
diff --git a/modules/gallery/libraries/ORM_MPTT.php b/modules/gallery/libraries/ORM_MPTT.php
index 83d2445c..ebd7abc2 100644
--- a/modules/gallery/libraries/ORM_MPTT.php
+++ b/modules/gallery/libraries/ORM_MPTT.php
@@ -48,6 +48,7 @@ class ORM_MPTT_Core extends ORM {
*/
function add_to_parent($parent) {
$this->lock();
+ $parent->reload(); // Assume that the prior lock holder may have changed the parent
try {
// Make a hole in the parent for this new item
@@ -91,6 +92,7 @@ class ORM_MPTT_Core extends ORM {
}
$this->lock();
+ $this->reload(); // Assume that the prior lock holder may have changed this entry
try {
$this->db->query(
"UPDATE {{$this->table_name}} SET `left_ptr` = `left_ptr` - 2 WHERE `left_ptr` > {$this->right_ptr}");
@@ -224,6 +226,8 @@ class ORM_MPTT_Core extends ORM {
$level_delta = ($target->level + 1) - $this->level;
$this->lock();
+ $this->reload(); // Assume that the prior lock holder may have changed this entry
+ $target->reload();
try {
if ($level_delta) {
// Update the levels for the to-be-moved items
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index b64deab9..f78a7018 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -29,12 +29,6 @@ class Theme_View_Core extends Gallery_View {
* @return void
*/
public function __construct($name, $page_type, $page_subtype) {
- $theme_name = module::get_var("gallery", "active_site_theme");
- if (!file_exists(THEMEPATH . $theme_name)) {
- module::set_var("gallery", "active_site_theme", "wind");
- theme::load_themes();
- Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
- }
parent::__construct($name);
$this->theme_name = module::get_var("gallery", "active_site_theme");
@@ -271,6 +265,13 @@ class Theme_View_Core extends Gallery_View {
}
}
+ $helper_class = theme::$site_theme_name . "_theme";
+ if (method_exists($helper_class, $function)) {
+ $blocks[] = call_user_func_array(
+ array($helper_class, $function),
+ array_merge(array($this), $args));
+ }
+
if ($function == "head") {
array_unshift($blocks, $this->combine_files($this->css, "css"));
array_unshift($blocks, $this->combine_files($this->scripts, "javascript"));