summaryrefslogtreecommitdiff
path: root/modules/tag
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-20 19:41:45 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-20 19:41:45 -0800
commit5e9bbbe490e40da103e0a7960312ab1c814dafa3 (patch)
tree641678d13204c4817edf5058a34b154becc5376f /modules/tag
parent144c2fb61ee30e1168a6afe3b0332485d748d608 (diff)
Convert the Simple Uploader form over to Forge, and use the event
model to let the Tags module modify it. This brings it inline with our other module-extensible form based interactions.
Diffstat (limited to 'modules/tag')
-rw-r--r--modules/tag/helpers/tag_event.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index 19c917ac..a857a99d 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -98,13 +98,31 @@ class tag_event_Core {
$data[] = join(" ", tag::item_tags($item));
}
- static function add_tags_to_item($item, $tags) {
- foreach (split(",", $tags) as $tag_name) {
+ static function add_photos_form($album, $form) {
+ $group = $form->add_photos;
+ $group->input("tags")
+ ->label(t("Add tags to all uploaded files"))
+ ->value("");
+ $group->uploadify->script_data("tags", "");
+
+ $autocomplete_url = url::site("tags/autocomplete");
+ $group->script("")
+ ->text("$('input[name=tags]')
+ .autocomplete(
+ '$autocomplete_url',
+ {max: 30, multiple: true, multipleSeparator: ',', cacheLength: 1}
+ )
+ .change(function (event) {
+ $('#g-uploadify').uploadifySettings('scriptData', {'tags': $(this).val()});
+ });");
+ }
+
+ static function add_photos_form_completed($album, $form) {
+ foreach (split(",", $form->add_photos->tags->value) as $tag_name) {
$tag_name = trim($tag_name);
if ($tag_name) {
- $tag = tag::add($item, $tag_name);
+ $tag = tag::add($album, $tag_name);
}
}
}
-
}