summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-11-09 11:52:43 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-11-09 11:52:43 -0800
commit26f8240e3478802a505f6f5355741d30130c65c5 (patch)
tree601ad14613dc7e63e5f814e636951879c15b16a4 /modules/tag/helpers
parent8b07599ba916ea838c01639be821e91ba4018853 (diff)
Revert "Try an new approach to extending forms. Create an extend_form event. For the first attempt replace the comment_add_form and item_add_form events."
This reverts commit 809e738536b6639bb42ecae8eb1e183543fed93c.
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/tag_event.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index cc134766..57986e40 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -64,20 +64,16 @@ class tag_event_Core {
tag::compact();
}
- static function extend_form($event_data) {
- if (in_array($event_data->id,
- array("g-edit-album-form", "g-edit-movie-form", "g-edit-photo-form"))) {
- $url = url::site("tags/autocomplete");
- $event_data->form->script("")
- ->text("$('form input[id=tags]').ready(function() {
+ static function item_edit_form($item, $form) {
+ $url = url::site("tags/autocomplete");
+ $form->script("")
+ ->text("$('form input[id=tags]').ready(function() {
$('form input[id=tags]').autocomplete(
'$url', {max: 30, multiple: true, multipleSeparator: ',', cacheLength: 1});
});");
- $tag_value = implode(", ", tag::item_tags($event_data->data));
- $input = empty($event_data->append_to) ? $event_data->form : $event_data->append_to;
- $input->input("tags")->label(t("Tags (comma separated)"))
- ->value($tag_value);
- }
+ $tag_value = implode(", ", tag::item_tags($item));
+ $form->edit_item->input("tags")->label(t("Tags (comma separated)"))
+ ->value($tag_value);
}
static function item_edit_form_completed($item, $form) {