Kronolith_Calendar::_caldavUrl PHP Метод

_caldavUrl() защищенный Метод

Returns the CalDAV URL for a calendar or task list.
protected _caldavUrl ( string $id, string $interface ) : string
$id string A collection ID.
$interface string The collection's application.
Результат string The collection's CalDAV URL.
    protected function _caldavUrl($id, $interface)
    {
        global $conf, $injector, $registry;
        $user = $registry->convertUsername($registry->getAuth(), false);
        try {
            $user = $injector->getInstance('Horde_Core_Hooks')->callHook('davusername', 'horde', array($user, false));
        } catch (Horde_Exception_HookNotSet $e) {
        }
        try {
            $url = Horde::url($registry->get('webroot', 'horde') . ($conf['urls']['pretty'] == 'rewrite' ? '/rpc/calendars/' : '/rpc.php/calendars/'), true, -1);
            $url .= $user . '/';
            $url .= $injector->getInstance('Horde_Dav_Storage')->getExternalCollectionId($id, $interface) . '/';
        } catch (Horde_Exception $e) {
            return null;
        }
        return $url;
    }