From: Michael J. Rubinsky Date: Tue, 9 Mar 2010 18:11:21 +0000 (-0500) Subject: update the toptags for the calendar form X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2590d8732670ec4b05bf4e459b747931a31ba954;p=horde.git update the toptags for the calendar form --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 2b0f988e8..b91bf485e 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2150,7 +2150,7 @@ KronolithCore = { calendar = calendar.split('|'); var type = calendar[0]; calendar = calendar.length == 1 ? null : calendar[1]; - + this.doAction('listTopTags', {update: 'kronolithCalendarinternalTopTags'}, this.topTagsCallback); var form = $('kronolithCalendarForm' + type), firstTab = form.down('.tabset a.kronolithTabLink'), info; @@ -3791,7 +3791,7 @@ KronolithCore = { $('kronolithEventSave').show(); $('kronolithEventDelete').show(); $('kronolithEventForm').down('.kronolithFormActions .kronolithSeparator').show(); - this.doAction('listTopTags', {}, this.topTags); + this.doAction('listTopTags', {update: 'kronolithEventTopTags'}, this.topTagsCallback); if (id) { RedBox.loading(); this.doAction('getEvent', { cal: calendar, id: id, date: date }, this.editEventCallback.bind(this)); @@ -3880,17 +3880,17 @@ KronolithCore = { }.bind(this)); }, - topTags: function(r) + topTagsCallback: function(r) { if (!r.response.tags) { - $('kronolithEventTopTags').update(); + $(r.response.update).update(); return; } t = new Element('div'); r.response.tags.each(function(tag) { t.insert(new Element('span', { className: 'kronolithEventTag' }).update(tag.escapeHTML())); }); - $('kronolithEventTopTags').update(t); + $(r.response.update).update(t); return; }, diff --git a/kronolith/lib/Ajax/Application.php b/kronolith/lib/Ajax/Application.php index 1d7700c77..1be5c052b 100644 --- a/kronolith/lib/Ajax/Application.php +++ b/kronolith/lib/Ajax/Application.php @@ -411,7 +411,9 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base } /** - * TODO + * Generate a list of most frequently used tags for the current user. + * Takes a 'update' parameter that gets passed back to indicate what element + * to update. */ public function listTopTags() { @@ -419,6 +421,7 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base $tagger = new Kronolith_Tagger(); $result = new stdClass; $result->tags = array(); + $result->update = $this->_vars->update; $tags = $tagger->getCloud(Horde_Auth::getAuth(), 10); foreach ($tags as $tag) { $result->tags[] = $tag['tag_name'];