root / drupal7 / sites / all / libraries / iCalcreator-2.22.1 / lib / vfreebusy.class.php @ 0f8e34f8
1 |
<?php
|
---|---|
2 |
/*********************************************************************************/
|
3 |
/**
|
4 |
*
|
5 |
* iCalcreator, a PHP rfc2445/rfc5545 solution.
|
6 |
*
|
7 |
* @copyright Copyright (c) 2007-2015 Kjell-Inge Gustafsson, kigkonsult, All rights reserved
|
8 |
* @link http://kigkonsult.se/iCalcreator/index.php
|
9 |
* @license http://kigkonsult.se/downloads/dl.php?f=LGPL
|
10 |
* @package iCalcreator
|
11 |
* @version 2.22
|
12 |
*/
|
13 |
/**
|
14 |
* This library is free software; you can redistribute it and/or
|
15 |
* modify it under the terms of the GNU Lesser General Public
|
16 |
* License as published by the Free Software Foundation; either
|
17 |
* version 2.1 of the License, or (at your option) any later version.
|
18 |
*
|
19 |
* This library is distributed in the hope that it will be useful,
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
22 |
* Lesser General Public License for more details.
|
23 |
*
|
24 |
* You should have received a copy of the GNU Lesser General Public
|
25 |
* License along with this library; if not, write to the Free Software
|
26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
*/
|
28 |
/*********************************************************************************/
|
29 |
/**
|
30 |
* class for calendar component VFREEBUSY
|
31 |
*
|
32 |
* @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
|
33 |
* @since 2.5.1 - 2008-10-12
|
34 |
*/
|
35 |
class vfreebusy extends calendarComponent { |
36 |
/**
|
37 |
* @var array $attendee component property value
|
38 |
* @var array $comment component property value
|
39 |
* @var array $contact component property value
|
40 |
* @var array $dtend component property value
|
41 |
* @var array $dtstart component property value
|
42 |
* @var array $duration component property value
|
43 |
* @var array $freebusy component property value
|
44 |
* @var array $organizer component property value
|
45 |
* @var array $requeststatus component property value
|
46 |
* @var array $url component property value
|
47 |
* @access protected
|
48 |
*/
|
49 |
protected $attendee; |
50 |
protected $comment; |
51 |
protected $contact; |
52 |
protected $dtend; |
53 |
protected $dtstart; |
54 |
protected $duration; |
55 |
protected $freebusy; |
56 |
protected $organizer; |
57 |
protected $requeststatus; |
58 |
protected $url; |
59 |
/**
|
60 |
* constructor for calendar component VFREEBUSY object
|
61 |
*
|
62 |
* @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
|
63 |
* @since 2.8.2 - 2011-05-01
|
64 |
* @param array $config
|
65 |
* @uses vjournal::calendarComponent()
|
66 |
* @uses vjournal::$attendee
|
67 |
* @uses vjournal::$comment
|
68 |
* @uses vjournal::$contact
|
69 |
* @uses vjournal::$dtend
|
70 |
* @uses vjournal::$dtstart
|
71 |
* @uses vjournal::$dtduration
|
72 |
* @uses vjournal::$organizer
|
73 |
* @uses vjournal::$requeststatus
|
74 |
* @uses vjournal::$url
|
75 |
* @uses vjournal::$xprop
|
76 |
* @uses calendarComponent::setConfig()
|
77 |
*/
|
78 |
function vfreebusy( $config = array()) { |
79 |
$this->calendarComponent();
|
80 |
$this->attendee = ''; |
81 |
$this->comment = ''; |
82 |
$this->contact = ''; |
83 |
$this->dtend = ''; |
84 |
$this->dtstart = ''; |
85 |
$this->duration = ''; |
86 |
$this->freebusy = ''; |
87 |
$this->organizer = ''; |
88 |
$this->requeststatus = ''; |
89 |
$this->url = ''; |
90 |
$this->xprop = ''; |
91 |
if( defined( 'ICAL_LANG' ) && !isset( $config['language'] )) |
92 |
$config['language'] = ICAL_LANG; |
93 |
if( !isset( $config['allowEmpty'] )) $config['allowEmpty'] = TRUE; |
94 |
if( !isset( $config['nl'] )) $config['nl'] = "\r\n"; |
95 |
if( !isset( $config['format'] )) $config['format'] = 'iCal'; |
96 |
if( !isset( $config['delimiter'] )) $config['delimiter'] = DIRECTORY_SEPARATOR; |
97 |
$this->setConfig( $config ); |
98 |
} |
99 |
/**
|
100 |
* create formatted output for calendar component VFREEBUSY object instance
|
101 |
*
|
102 |
* @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
|
103 |
* @since 2.3.1 - 2007-11-19
|
104 |
* @param array $xcaldecl
|
105 |
* @uses calendarComponent::_createFormat()
|
106 |
* @uses calendarComponent::createUid()
|
107 |
* @uses calendarComponent::createDtstamp()
|
108 |
* @uses calendarComponent::createAttendee()
|
109 |
* @uses calendarComponent::createComment()
|
110 |
* @uses calendarComponent::createContact()
|
111 |
* @uses calendarComponent::createDtstart()
|
112 |
* @uses calendarComponent::createDtend()
|
113 |
* @uses calendarComponent::createDuration()
|
114 |
* @uses calendarComponent::createFreebusy()
|
115 |
* @uses calendarComponent::createOrganizer()
|
116 |
* @uses calendarComponent::createRequestStatus()
|
117 |
* @uses calendarComponent::createUrl()
|
118 |
* @uses calendarComponent::createXprop()
|
119 |
* @uses calendarComponent::createUrl()
|
120 |
* @uses calendarComponent::createXprop()
|
121 |
* @uses calendarComponent::$componentEnd1
|
122 |
* @uses calendarComponent::$componentEnd2
|
123 |
* @uses calendarComponent::$xcaldecl
|
124 |
* @return string
|
125 |
*/
|
126 |
function createComponent( &$xcaldecl ) { |
127 |
$objectname = $this->_createFormat(); |
128 |
$component = $this->componentStart1.$objectname.$this->componentStart2.$this->nl; |
129 |
$component .= $this->createUid(); |
130 |
$component .= $this->createDtstamp(); |
131 |
$component .= $this->createAttendee(); |
132 |
$component .= $this->createComment(); |
133 |
$component .= $this->createContact(); |
134 |
$component .= $this->createDtstart(); |
135 |
$component .= $this->createDtend(); |
136 |
$component .= $this->createDuration(); |
137 |
$component .= $this->createFreebusy(); |
138 |
$component .= $this->createOrganizer(); |
139 |
$component .= $this->createRequestStatus(); |
140 |
$component .= $this->createUrl(); |
141 |
$component .= $this->createXprop(); |
142 |
$component .= $this->componentEnd1.$objectname.$this->componentEnd2; |
143 |
if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) { |
144 |
foreach( $this->xcaldecl as $localxcaldecl ) |
145 |
$xcaldecl[] = $localxcaldecl; |
146 |
} |
147 |
return $component; |
148 |
} |
149 |
} |