Projet

Général

Profil

Paste
Télécharger (8,28 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / libraries / iCalcreator-2.22.1 / lib / vjournal.class.php @ bad93dab

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 VJOURNAL
31
 *
32
 * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
33
 * @since 2.5.1 - 2008-10-12
34
 */
35
class vjournal extends calendarComponent {
36
/**
37
 * @var array $attach         component property value
38
 * @var array $attendee       component property value
39
 * @var array $categories     component property value
40
 * @var array $comment        component property value
41
 * @var array $contact        component property value
42
 * @var array $class          component property value
43
 * @var array $created        component property value
44
 * @var array $description    component property value
45
 * @var array $dtstart        component property value
46
 * @var array $exdate         component property value
47
 * @var array $exrule         component property value
48
 * @var array $lastmodified   component property value
49
 * @var array $organizer      component property value
50
 * @var array $rdate          component property value
51
 * @var array $recurrenceid   component property value
52
 * @var array $relatedto      component property value
53
 * @var array $requeststatus  component property value
54
 * @var array $rrule          component property value
55
 * @var array $sequence       component property value
56
 * @var array $status         component property value
57
 * @var array $summary        component property value
58
 * @var array $url            component property value
59
 * @access protected
60
 */
61
  protected $attach;
62
  protected $attendee;
63
  protected $categories;
64
  protected $comment;
65
  protected $contact;
66
  protected $class;
67
  protected $created;
68
  protected $description;
69
  protected $dtstart;
70
  protected $exdate;
71
  protected $exrule;
72
  protected $lastmodified;
73
  protected $organizer;
74
  protected $rdate;
75
  protected $recurrenceid;
76
  protected $relatedto;
77
  protected $requeststatus;
78
  protected $rrule;
79
  protected $sequence;
80
  protected $status;
81
  protected $summary;
82
  protected $url;
83
/**
84
 * constructor for calendar component VJOURNAL object
85
 *
86
 * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
87
 * @since 2.8.2 - 2011-05-01
88
 * @param array $config
89
 * @uses vjournal::calendarComponent()
90
 * @uses vjournal::$attach
91
 * @uses vjournal::$attendee
92
 * @uses vjournal::$categories
93
 * @uses vjournal::$class
94
 * @uses vjournal::$comment
95
 * @uses vjournal::$contact
96
 * @uses vjournal::$created
97
 * @uses vjournal::$description
98
 * @uses vjournal::$dtstart
99
 * @uses vjournal::$exdate
100
 * @uses vjournal::$exrule
101
 * @uses vjournal::$lastmodified
102
 * @uses vjournal::$organizer
103
 * @uses vjournal::$rdate
104
 * @uses vjournal::$recurrenceid
105
 * @uses vjournal::$relatedto
106
 * @uses vjournal::$requeststatus
107
 * @uses vjournal::$rrule
108
 * @uses vjournal::$sequence
109
 * @uses vjournal::$status
110
 * @uses vjournal::$summary
111
 * @uses vjournal::$url
112
 * @uses vjournal::$xprop
113
 * @uses calendarComponent::setConfig()
114
 */
115
  function vjournal( $config = array()) {
116
    $this->calendarComponent();
117
    $this->attach          = '';
118
    $this->attendee        = '';
119
    $this->categories      = '';
120
    $this->class           = '';
121
    $this->comment         = '';
122
    $this->contact         = '';
123
    $this->created         = '';
124
    $this->description     = '';
125
    $this->dtstart         = '';
126
    $this->exdate          = '';
127
    $this->exrule          = '';
128
    $this->lastmodified    = '';
129
    $this->organizer       = '';
130
    $this->rdate           = '';
131
    $this->recurrenceid    = '';
132
    $this->relatedto       = '';
133
    $this->requeststatus   = '';
134
    $this->rrule           = '';
135
    $this->sequence        = '';
136
    $this->status          = '';
137
    $this->summary         = '';
138
    $this->url             = '';
139
    $this->xprop           = '';
140
    if( defined( 'ICAL_LANG' ) && !isset( $config['language'] ))
141
                                          $config['language']   = ICAL_LANG;
142
    if( !isset( $config['allowEmpty'] ))  $config['allowEmpty'] = TRUE;
143
    if( !isset( $config['nl'] ))          $config['nl']         = "\r\n";
144
    if( !isset( $config['format'] ))      $config['format']     = 'iCal';
145
    if( !isset( $config['delimiter'] ))   $config['delimiter']  = DIRECTORY_SEPARATOR;
146
    $this->setConfig( $config );
147
  }
148
/**
149
 * create formatted output for calendar component VJOURNAL object instance
150
 *
151
 * @author Kjell-Inge Gustafsson, kigkonsult <ical@kigkonsult.se>
152
 * @since 2.5.1 - 2008-10-12
153
 * @param array $xcaldecl
154
 * @uses calendarComponent::_createFormat()
155
 * @uses calendarComponent::$componentStart1
156
 * @uses calendarComponent::$componentStart2
157
 * @uses calendarComponent::$nl
158
 * @uses calendarComponent::createUid()
159
 * @uses calendarComponent::createDtstamp()
160
 * @uses calendarComponent::createAttach()
161
 * @uses calendarComponent::createAttendee()
162
 * @uses calendarComponent::createCategories()
163
 * @uses calendarComponent::createClass()
164
 * @uses calendarComponent::createComment()
165
 * @uses calendarComponent::createContact()
166
 * @uses calendarComponent::createDescription()
167
 * @uses calendarComponent::createDtstart()
168
 * @uses calendarComponent::createExdate()
169
 * @uses calendarComponent::createExrule()
170
 * @uses calendarComponent::createLastModified()
171
 * @uses calendarComponent::createOrganizer()
172
 * @uses calendarComponent::createRdate()
173
 * @uses calendarComponent::createRelatedTo()
174
 * @uses calendarComponent::createRequestStatus()
175
 * @uses calendarComponent::createRecurrenceid()
176
 * @uses calendarComponent::createRrule()
177
 * @uses calendarComponent::createSequence()
178
 * @uses calendarComponent::createStatus()
179
 * @uses calendarComponent::createSummary()
180
 * @uses calendarComponent::createUrl()
181
 * @uses calendarComponent::createXprop()
182
 * @uses calendarComponent::$componentEnd1
183
 * @uses calendarComponent::$componentEnd2
184
 * @uses calendarComponent::$xcaldecl
185
 * @return string
186
 */
187
  function createComponent( &$xcaldecl ) {
188
    $objectname = $this->_createFormat();
189
    $component  = $this->componentStart1.$objectname.$this->componentStart2.$this->nl;
190
    $component .= $this->createUid();
191
    $component .= $this->createDtstamp();
192
    $component .= $this->createAttach();
193
    $component .= $this->createAttendee();
194
    $component .= $this->createCategories();
195
    $component .= $this->createClass();
196
    $component .= $this->createComment();
197
    $component .= $this->createContact();
198
    $component .= $this->createCreated();
199
    $component .= $this->createDescription();
200
    $component .= $this->createDtstart();
201
    $component .= $this->createExdate();
202
    $component .= $this->createExrule();
203
    $component .= $this->createLastModified();
204
    $component .= $this->createOrganizer();
205
    $component .= $this->createRdate();
206
    $component .= $this->createRequestStatus();
207
    $component .= $this->createRecurrenceid();
208
    $component .= $this->createRelatedTo();
209
    $component .= $this->createRrule();
210
    $component .= $this->createSequence();
211
    $component .= $this->createStatus();
212
    $component .= $this->createSummary();
213
    $component .= $this->createUrl();
214
    $component .= $this->createXprop();
215
    $component .= $this->componentEnd1.$objectname.$this->componentEnd2;
216
    if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) {
217
      foreach( $this->xcaldecl as $localxcaldecl )
218
        $xcaldecl[] = $localxcaldecl;
219
    }
220
    return $component;
221
  }
222
}