[dev] Custom colors and subscribe-options for calendars provided by Api

Jan Schneider jan at horde.org
Mon Mar 25 10:55:04 UTC 2013


Zitat von Ralf Lang <lang at b1-systems.de>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 25.03.2013 09:41, Karim Geiger wrote:
>> Hi guys,
>>
>> I just wanted to add a custom color and the possibility to
>> subscribe to an calendar provided by my horde application.
>>
>> The app itself returns an array in the listTimeObjectCategories
>> function provided in the Api.php-file.
>>
>> Now I tried to follow the steps kronolith does when fetching these
>> calendars. I found this snippet at line 911 in lib/Kronolith.php:
>> ---8<--- try { $categories = $GLOBALS['registry']->call($api .
>> '/listTimeObjectCategories'); } catch (Horde_Exception $e) {
>> Horde::logMessage($e, 'DEBUG'); continue; }
>>
>> foreach ($categories as $name => $description) {
>> $GLOBALS['all_external_calendars'][$api . '/' . $name] = new
>> Kronolith_Calendar_External(array('api' => $api, 'name' =>
>> $description['title'], 'id' => $name, 'type' =>
>> $description['type'])); $ext_cals[] = array( 'a' => $api, 'n' =>
>> $name, 'd' => $description['title'], 't' => $description['type']
>> ); } --->8---
>>
>> Here it looks like it only handles title, id and type. Is there a
>> way to give the calendar a custom color and a subscribe-link?
>
> Hi Karim,
>
> Colors:
>
> Seems like the Kronolith_Calendar_External class does not implement
> background() so it is inherited from Kronolith_Calendar (which
> defaults to gray).
>
> You would need to implement a patch that allows an optional color in
> the Calendar_External constructor and uses that for background() calls.
>
> Subscribe:
>
> Haven't seen that yet, maybe the list knows. Otherwise I'd need to dig
> deeper how subscribe links are done for internal calendars.

Subscribe links are only supported for internal calendars at the moment.
-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the dev mailing list