Consistent filter hash keys
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 8 Mar 2010 16:33:51 +0000 (11:33 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 8 Mar 2010 18:00:23 +0000 (13:00 -0500)
kronolith/lib/Tagger.php

index 39b9092..3907d43 100644 (file)
@@ -172,13 +172,13 @@ class Kronolith_Tagger
      */
     public function search($tags, $filter = array())
     {
-        if (!empty($filter['calendar'])) {
+        if (!empty($filter['calendarId'])) {
             // At least filter by ownerId to ease the post-filtering query.
             $owners = array();
-            if (!is_array($filter['calendar'])) {
-                $filter['calendar'] = array($filter['calendar']);
+            if (!is_array($filter['calendarId'])) {
+                $filter['calendarId'] = array($filter['calendarId']);
             }
-            foreach ($filter['calendar'] as $calendar) {
+            foreach ($filter['calendarId'] as $calendar) {
                 if ($GLOBALS['all_calendars'][$calendar]->get('owner')) {
                     $owners[] = $GLOBALS['all_calendars'][$calendar]->get('owner');
                 }
@@ -192,7 +192,7 @@ class Kronolith_Tagger
 
             //TODO: Are there any cases where we can shortcut the postFilter?
             $results = array('calendar' => array(),
-                             'event' => Kronolith::getDriver()->filterEventsByCalendar($results, $filter['calendar']));
+                             'event' => Kronolith::getDriver()->filterEventsByCalendar($results, $filter['calendarId']));
         } else {
             $args = array('tagId' => $this->_tagger->ensureTags($tags));
             if (!empty($filter['userId'])) {