summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/gallery_theme.php6
-rw-r--r--modules/gallery/libraries/Admin_View.php1
-rw-r--r--modules/gallery/libraries/MY_View.php7
-rw-r--r--modules/gallery/libraries/Theme_View.php1
-rw-r--r--modules/gallery/models/item.php16
5 files changed, 12 insertions, 19 deletions
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php
index 998eb289..81b22b74 100644
--- a/modules/gallery/helpers/gallery_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -127,4 +127,10 @@ class gallery_theme_Core {
static function admin_credits() {
return gallery_theme::credits();
}
+
+ public function body_attributes() {
+ if (locales::is_rtl()) {
+ return 'class="rtl"';
+ }
+ }
} \ No newline at end of file
diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php
index 5c3fe081..21b70df6 100644
--- a/modules/gallery/libraries/Admin_View.php
+++ b/modules/gallery/libraries/Admin_View.php
@@ -78,6 +78,7 @@ class Admin_View_Core extends Gallery_View {
case "admin_page_bottom":
case "admin_page_top":
case "admin_head":
+ case "body_attributes":
$blocks = array();
foreach (module::active() as $module) {
$helper_class = "{$module->name}_theme";
diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php
index 43783158..eb55aca6 100644
--- a/modules/gallery/libraries/MY_View.php
+++ b/modules/gallery/libraries/MY_View.php
@@ -42,11 +42,4 @@ class View extends View_Core {
return "";
}
}
-
- public function body_attributes() {
- if (locales::is_rtl()) {
- return 'class="rtl"';
- }
- return '';
- }
}
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 786ed1ce..360e5e46 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -156,6 +156,7 @@ class Theme_View_Core extends Gallery_View {
case "album_blocks":
case "album_bottom":
case "album_top":
+ case "body_attributes":
case "credits";
case "dynamic_bottom":
case "dynamic_top":
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 481b22bc..1ce4d340 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -352,19 +352,11 @@ class Item_Model extends ORM_MPTT {
if (!$this->loaded) {
try {
$this->created = $this->updated;
- Kohana::log("error", "get Weight");
- $weight = ORM::factory("item")
- ->select("weight")
- ->orderby("weight", "DESC")
- ->limit(1)
- ->find_all()
- ->current()->weight;
- Kohana::log("error", "Weight: $weight");
+ $weight = Database::instance()
+ ->select("weight")->from("items")
+ ->orderby("weight", "desc")->limit(1)
+ ->get()->current()->weight;
$this->weight = $weight + 1;
- } catch (Exception $e) {
- Kohana::log("error", $e->__toString());
- throw $e;
- }
} else {
$send_event = 1;
}