diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2011-04-24 11:56:12 -0400 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2011-04-24 11:56:12 -0400 |
commit | 90458673f41ede656b6e2ad07c8545b2450c8e41 (patch) | |
tree | 187668d2d7990d9e7d9621f7c5c3bd231165056d | |
parent | b4cdd016dc97f2df608bb14d2088cb4ddbd32c35 (diff) | |
parent | bbd5417fef9c3ad28c6e57cb787e86684f49a71b (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
-rw-r--r-- | .build_number | 2 | ||||
-rw-r--r-- | modules/g2_import/helpers/g2_import_event.php | 2 | ||||
-rw-r--r-- | modules/tag/controllers/admin_tags.php | 25 |
3 files changed, 23 insertions, 6 deletions
diff --git a/.build_number b/.build_number index f5cd72a8..befc7f03 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=126 +build_number=130 diff --git a/modules/g2_import/helpers/g2_import_event.php b/modules/g2_import/helpers/g2_import_event.php index 0e078d08..0afa62d8 100644 --- a/modules/g2_import/helpers/g2_import_event.php +++ b/modules/g2_import/helpers/g2_import_event.php @@ -34,7 +34,7 @@ class g2_import_event_Core { ->get("settings_menu") ->append(Menu::factory("link") ->id("g2_import") - ->label(t("Gallery 2 Import")) + ->label(t("Gallery 2 import")) ->url(url::site("admin/g2_import"))); } } diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php index fd82bc92..7a64f7ab 100644 --- a/modules/tag/controllers/admin_tags.php +++ b/modules/tag/controllers/admin_tags.php @@ -85,11 +85,22 @@ class Admin_Tags_Controller extends Admin_Controller { if ($in_place_edit->validate()) { $old_name = $tag->name; - $tag->name = $in_place_edit->value(); + $new_name_or_list = $in_place_edit->value(); + $tag_list = explode(",", $new_name_or_list); + $tag_count = count($tag_list); + + $tag->name = array_shift($tag_list); $tag->save(); - $message = t("Renamed tag <b>%old_name</b> to <b>%new_name</b>", - array("old_name" => $old_name, "new_name" => $tag->name)); + if (!empty($tag_list)) { + $this->_copy_items_for_tags($tag, $tag_list); + $message = t("Split tag <i>%old_name</i> into <i>%tag_list</i>", + array("old_name" => $old_name, "tag_list" => $new_name_or_list)); + } else { + $message = t("Renamed tag <i>%old_name</i> to <i>%new_name</i>", + array("old_name" => $old_name, "new_name" => $tag->name)); + } + message::success($message); log::success("tags", $message); @@ -99,5 +110,11 @@ class Admin_Tags_Controller extends Admin_Controller { } } + private function _copy_items_for_tags($tag, $tag_list) { + foreach ($tag->items() as $item) { + foreach ($tag_list as $new_tag_name) { + tag::add($item, trim($new_tag_name)); + } + } + } } - |