Don't pass image directories.
authorJan Schneider <jan@horde.org>
Wed, 16 Jun 2010 11:16:44 +0000 (13:16 +0200)
committerJan Schneider <jan@horde.org>
Wed, 16 Jun 2010 11:17:14 +0000 (13:17 +0200)
kronolith/js/kronolith.js
kronolith/lib/Kronolith.php

index 21784df..e71a9a2 100644 (file)
@@ -1045,7 +1045,7 @@ KronolithCore = {
                 if (perm.key != 'type' &&
                     ((Object.isArray(perm.value) && perm.value.size()) ||
                      (!Object.isArray(perm.value) && perm.value))) {
-                    element.insert(' ').insert(new Element('img', { src: Kronolith.conf.URI_IMG + 'attendees-' + cal.fg.substring(1) + '.png', title: Kronolith.text.shared }));
+                    element.insert(' ').insert(new Element('img', { src: Kronolith.conf.images.attendees.replace(/fff/, cal.fg.substring(1)), title: Kronolith.text.shared }));
                     throw $break;
                 }
             });
@@ -2046,14 +2046,14 @@ KronolithCore = {
         div.insert((length ? event.t.truncate(length) : event.t).escapeHTML());
         if (event.a) {
             div.insert(' ')
-                .insert(new Element('img', { src: Kronolith.conf.URI_IMG + 'alarm-' + Kronolith.conf.calendars[calendar[0]][calendar[1]].fg.substr(1) + '.png', title: Kronolith.text.alarm + ' ' + event.a }));
+                .insert(new Element('img', { src: Kronolith.conf.images.alarm.replace(/fff/, Kronolith.conf.calendars[calendar[0]][calendar[1]].fg.substr(1)), title: Kronolith.text.alarm + ' ' + event.a }));
         }
         if (event.r) {
             div.insert(' ')
-                .insert(new Element('img', { src: Kronolith.conf.URI_IMG + 'recur-' + Kronolith.conf.calendars[calendar[0]][calendar[1]].fg.substr(1) + '.png', title: Kronolith.text.recur[event.r] }));
+                .insert(new Element('img', { src: Kronolith.conf.images.recur.replace(/fff/, Kronolith.conf.calendars[calendar[0]][calendar[1]].fg.substr(1)), title: Kronolith.text.recur[event.r] }));
         } else if (event.bid) {
             div.insert(' ')
-                .insert(new Element('img', { src: Kronolith.conf.URI_IMG + 'exception-' + Kronolith.conf.calendars[calendar[0]][calendar[1]].fg.substr(1) + '.png', title: Kronolith.text.recur['Exception'] }));
+                .insert(new Element('img', { src: Kronolith.conf.images.exception.replace(/fff/, Kronolith.conf.calendars[calendar[0]][calendar[1]].fg.substr(1)), title: Kronolith.text.recur['Exception'] }));
         }
         return div;
     },
index 1952e4d..dc52d00 100644 (file)
@@ -187,12 +187,16 @@ class Kronolith
         /* Variables used in core javascript files. */
         $code['conf'] = array(
             'URI_AJAX' => (string)Horde::getServiceLink('ajax', 'kronolith'),
-            'URI_IMG' => (string)Horde_Themes::img() . '/',
             'URI_SNOOZE' => (string)Horde::url($registry->get('webroot', 'horde') . '/services/snooze.php', true, -1),
             'URI_CALENDAR_EXPORT' => (string)Horde::url('data.php', true)->add(array('actionID' => 'export', 'all_events' => 1, 'exportID' => Horde_Data::EXPORT_ICALENDAR, 'exportCal' => '')),
             'URI_EVENT_EXPORT' => str_replace(array('%23', '%7B', '%7D'), array('#', '{', '}'), Horde::url('event.php', true)->add(array('view' => 'ExportEvent', 'eventID' => '#{id}', 'calendar' => '#{calendar}', 'type' => '#{type}'))),
             'SESSION_ID' => defined('SID') ? SID : '',
-
+            'images' => array(
+                'attendees' => (string)Horde_Themes::img('attendees-fff.png'),
+                'alarm'     => (string)Horde_Themes::img('alarm-fff.png'),
+                'recur'     => (string)Horde_Themes::img('recur-fff.png'),
+                'exception' => (string)Horde_Themes::img('exception-fff.png'),
+            ),
             'user' => $GLOBALS['registry']->convertUsername($GLOBALS['registry']->getAuth(), false),
             'prefs_url' => str_replace('&amp;', '&', Horde::getServiceLink('options', 'kronolith')),
             'app_urls' => $app_urls,