@link http://blog.idleman.fr @licence CC by nc sa @version 1.0.0 @description Plugin intégrant un serveur caldav et un calendrier mois/semaine/jour */ function caldav_menu(&$menuItems){ global $_; $menuItems[] = array('sort'=>10,'content'=>' Calendrier'); } function caldav_home($_){ if(!isset($_['module']) || $_['module']!='caldav') return; global $myUser; try{ $dbmanager = new Configuration(); $calendarsQuery = $dbmanager->customQuery("SELECT * FROM ".ENTITY_PREFIX."plugin_caldav_calendars WHERE principaluri ='principals/".$myUser->getLogin()."'"); $calendars =array(); while($calendar = $calendarsQuery->fetchArray()): $calendars[] = $calendar; endwhile; if(count($calendars)==0) throw new Exception('Aucun calendrier créé pour votre compte, veuillez créer un calendrier avant de le consulter.'); $_['calendar'] = isset($_['calendar']) ? $_['calendar']: $calendars[0]['uri']; $url = YANA_URL.'/plugins/caldav/calendars.php/calendars/'.$myUser->getLogin() .'/'.$_['calendar']; ?>