diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-30 05:15:24 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-30 05:15:24 -0700 |
commit | 29f5a231c710dc1fb63a1ae06bbc985b9c459711 (patch) | |
tree | c208f238ffb63a32dab7ca9c27a5e2ab805ce75b | |
parent | 6f1da3aba426329eef312831365de29f89529d9f (diff) | |
parent | 67d4ae21d5f7363f54782c23d2a7ff1d9e9f0505 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Conflicts:
modules/gallery/models/item.php
-rw-r--r-- | modules/comment/models/comment.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_theme.php | 6 | ||||
-rw-r--r-- | modules/gallery/libraries/Admin_View.php | 1 | ||||
-rw-r--r-- | modules/gallery/libraries/MY_View.php | 7 | ||||
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 1 | ||||
-rw-r--r-- | modules/gallery/models/item.php | 16 | ||||
-rw-r--r-- | modules/user/controllers/admin_users.php | 2 | ||||
-rw-r--r-- | modules/user/helpers/user.php | 11 |
8 files changed, 20 insertions, 26 deletions
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php index 551fb245..d052a39c 100644 --- a/modules/comment/models/comment.php +++ b/modules/comment/models/comment.php @@ -31,7 +31,7 @@ class Comment_Model extends ORM { if ($author->guest) { return $this->guest_name; } else { - return $author->full_name; + return $author->display_name(); } } 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; } diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 043a4ee5..f87602b8 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -49,7 +49,6 @@ class Admin_Users_Controller extends Controller { $user->locale = $desired_locale == "none" ? null : $desired_locale; } $user->save(); - module::event("user_add_form_admin_completed", $user, $form); message::success(t("Created user %user_name", array("user_name" => p::clean($user->name)))); @@ -141,6 +140,7 @@ class Admin_Users_Controller extends Controller { $user->admin = $form->edit_user->admin->checked; } $user->save(); + module::event("user_edit_form_admin_completed", $user, $form); message::success(t("Changed user %user_name", array("user_name" => p::clean($user->name)))); print json_encode(array("result" => "success")); diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index b1722a1e..69a6ecb3 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -34,15 +34,16 @@ class user_Core { ->matches($group->password); $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email); $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); - $group->submit("")->value(t("Save")); $form->add_rules_from($user); module::event("user_edit_form", $user, $form); + $group->submit("")->value(t("Save")); return $form; } static function get_edit_form_admin($user) { - $form = new Forge("admin/users/edit_user/$user->id", "", "post", array("id" => "gEditUserForm")); + $form = new Forge( + "admin/users/edit_user/$user->id", "", "post", array("id" => "gEditUserForm")); $group = $form->group("edit_user")->label(t("Edit User")); $group->input("name")->label(t("Username"))->id("gUsername")->value($user->name); $group->inputs["name"]->error_messages( @@ -55,11 +56,11 @@ class user_Core { $group->input("email")->label(t("Email"))->id("gEmail")->value($user->email); $group->input("url")->label(t("URL"))->id("gUrl")->value($user->url); $group->checkbox("admin")->label(t("Admin"))->id("gAdmin")->checked($user->admin); - $group->submit("")->value(t("Modify User")); $form->add_rules_from($user); $form->edit_user->password->rules("-required"); module::event("user_edit_form_admin", $user, $form); + $group->submit("")->value(t("Modify User")); return $form; } @@ -76,11 +77,11 @@ class user_Core { $group->input("url")->label(t("URL"))->id("gUrl"); self::_add_locale_dropdown($group); $group->checkbox("admin")->label(t("Admin"))->id("gAdmin"); - $group->submit("")->value(t("Add User")); $user = ORM::factory("user"); $form->add_rules_from($user); - module::event("user_add_form_admin", $user); + module::event("user_add_form_admin", $user, $form); + $group->submit("")->value(t("Add User")); return $form; } |