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

Ralf Lang lang at b1-systems.de
Mon Mar 25 09:21:13 UTC 2013


-----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.

- -- 
Ralf Lang
Linux Consultant / Developer
Tel.: +49-170-6381563
Mail: lang at b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlFQFwkACgkQCs1dsHJ/X7Dp5wCguKZj4PRQpeN0jxxUm78Hwqcw
vfgAn3SgR7woOszPRMP6xULOoOZ9RS0D
=r5yU
-----END PGP SIGNATURE-----


More information about the dev mailing list