Projet

Général

Profil

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

root / drupal7 / sites / all / libraries / iCalcreator-version / summary.html @ 41cc1b08

1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
2
<html>
3
<head>
4
<title>iCalcreator 2.18 summary</title>
5
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
6
<meta name="author"      content="Kjell-Inge Gustafsson, kigkonsult, All rights reserved">
7
<meta name="copyright"   content="2007-2013 Kjell-Inge Gustafsson, kigkonsult">
8
<meta name="keywords"    content="ical, calendar, calender, xcal, xml, icalender, rfc2445, rfc5545, vcalender, php, create">
9
<meta name="description" content="iCalcreator summary" />
10
<style type="text/css">
11
body {
12
  FONT-FAMILY     : "Lucida Grande","Lucida Sans Unicode", "Bitstream Vera Sans", Lucida, Arial, Geneva, Helvetica, sans-serif;
13
  FONT-SIZE       : small;
14
  MARGIN          : 10px;
15
  WIDTH           : 800px;
16
}
17
h1 {
18
  FONT-SIZE       : large;
19
  FONT-WEIGHT     : bold;
20
}
21
h2 {
22
  FONT-SIZE       : large;
23
}
24
h3 {
25
  FONT-SIZE       : medium;
26
}
27
h4 {
28
  FONT-SIZE       : small;
29
  FONT-WEIGHT     : bold;
30
}
31
h5 {
32
  FONT-SIZE       : small;
33
  FONT-WEIGHT     : normal;
34
  TEXT-DECORATION : underline;
35
}
36
pre {
37
  BACKGROUND-COLOR: #DCDCDC;
38
  FONT-FAMILY     : monospace;
39
  FONT-SIZE       : medium;
40
  LETTER-SPACING  : 0.1em;
41
  LINE-HEIGHT     : 1.5em;
42
  WHITE-SPACE     : pre-wrap;      /* css-3 */
43
  WHITE-SPACE     : -moz-pre-wrap; /* Mozilla, since 1999 */
44
  WHITE-SPACE     : -pre-wrap;     /* Opera 4-6 */
45
  WHITE-SPACE     : -o-pre-wrap;   /* Opera 7 */
46
  WORD-WRAP       : break-word;    /* Internet Explorer 5.5+ */
47
}
48
.comment {
49
  FONT-FAMILY     : arial;
50
  FONT-SIZE       : small;
51
  FONT-STYLE      : italic;
52
}
53
</style>
54
</head>
55
<body>
56

    
57
<h1>iCalcreator v2.18</h1>
58
<p>
59
iCalcreator v2.18<br>
60
Copyright (c) 2007-2013 Kjell-Inge Gustafsson, kigkonsult, All rights reserved.<br>
61
<a href="http://kigkonsult.se/iCalcreator/index.php" title="kigkonsult.se/iCalcreator" target="_blank">kigkonsult.se iCalcreator</a><br>
62
<a href="http://kigkonsult.se/contact/index.php" title="kigkonsult.se contact" target="_blank">kigkonsult.se contact</a>
63
</p>
64
<h4>Preface</h2>
65
<p>
66
This document is provided by kigkonsult for informational purposes
67
and is provided on an &quot;as is&quot; basis without any warranties expressed or implied.
68
</p>
69
<p>
70
Information in this document is subject to change without notice and does
71
not represent a commitment on the part of kigkonsult.
72
The software described in this document is provided under a license agreement, <a href="http://kigkonsult.se/downloads/dl.php?f=GPL">GNU Lesser General Public License</a>.
73
The software may be used only in accordance with the terms of that license agreement.
74
It is against the law to copy or use the software except as specifically allowed in the license agreement.
75
</p>
76
<p>
77
It is the users responsibility to ensure the suitability of the software before using it.
78
In no circumstances will kigkonsult be responsible for
79
the use of the software's outcomes or results or any loss
80
or damage of data or programs as a result of using the software.
81
The use of the software implies acceptance of these terms.
82
</p>
83
<p>
84
This document makes previous versions obsolete.
85
</p>
86
<h4>The software</h2>
87
<p>
88
This document describes a <b>short summary</b> usage of iCalcreator, a <em>PHP</em> software implementation of standards rfc5545/rfc5546 (rfc2445/rfc2446) to manage iCal formatted files.
89
</p>
90
<p>
91
iCalcreator is a <em>PHP</em> class package managing iCal files, supporting (non-)<strong>calendar</strong>
92
systems and applications to process and communicate <strong>calendar</strong> information like
93
events, agendas, tasks, reports, totos and journaling information.
94
</p>
95
<p>
96
The iCalcreator package, built of a <strong>calendar</strong> class with support of a function class and helper functions, are <strong>calendar</strong>
97
component property oriented. Development environment is <em>PHP</em> version 5.x but coding is done
98
to meet 4.x backward compatibility and may work. Some functions requires <em>PHP</em> >= 5.2.0.
99
</p>
100
<p>
101
The iCalcreator main class, utility class and helper functions are included in the &quot;iCalcreator.class.php&quot; file.
102
</p>
103
<p>
104
More iCalcreator supplementary, usage and &quot;howto&quot; information will be found at kigkonsult.se iCalcreator
105
 <a href="http://kigkonsult.se/test/index.php" title="kigkonsult.se iCalcreator implement and test examples" target="_blank">coding and test</a> pages.
106
 A strong recommendation is to have the document
107
 <a href="http://kigkonsult.se/iCalcreator/docs/using.html" title="iCalcreator user's Manual" target="_blank">user's manual</a>
108
 open in parallel when exploiting the link.
109
</p>
110

    
111
<h4>iCal</h4>
112
<p>
113
A short iCal description is found at <a href="http://en.wikipedia.org/wiki/ICalendar#Core_object" title="iCalendar From Wikipedia, the free encyclopedia" target="_blank">Wikipedia</a>.
114
 If You are not familiar with iCal, read this first!
115
</p>
116
<p>
117
Knowledge of <strong>calendar</strong> protocol rfc5545/rfc5546  is to recommend;
118
</p>
119
<dl>
120
<dt><a href="http://kigkonsult.se/downloads/dl.php?f=rfc5545" title="Download RFC5545 in text format" target="_blank">rfc5545</a>
121
<dd>Internet Calendaring and Scheduling Core Object Specification (iCalendar)
122
<dd>obsoletes <a href="http://kigkonsult.se/downloads/dl.php?f=rfc2445" title="Download RFC2445 in text format">rfc2445</a>
123
<dt><a href="http://kigkonsult.se/downloads/dl.php?f=rfc5546" title="Download RFC5546 in text format" target="_blank">rfc5546</a>
124
<dd>iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries
125
<dd>obsoletes <a href="http://kigkonsult.se/downloads/dl.php?f=rfc2446" title="Download RFC2446 in text format">rfc2446</a>.
126
</dl>
127

    
128
<h4>xCal</h4>
129
<p>
130
iCalcreator also supports xCal (iCal xml).
131
</p>
132
<dl>
133
<dt>
134
<dt><a href="http://kigkonsult.se/downloads/dl.php?f=rfc6321" title="Download RFC6321 in text format" target="_blank">rfc6321</a>
135
<dd>xCal: The XML Format for <strong>iCalendar</strong>
136
</dl>
137

    
138
<h4>SUPPORT</h4>
139
<p>
140
The main support channel is using iCalcreator
141
<a title="Sourceforge" href="http://sourceforge.net/projects/icalcreator/forums/" target="_blank">Sourceforge</a> forum.
142
</p>
143
<p>
144
Support and development is now focused on iCalcreator (Pro) 3.x versions, which, in turn, will affect future releases
145
of iCalcreator 2.x.
146
</p>
147
<p>
148
kigkonsult offer services for software support, design and development of customizations and adaptations of <em>PHP</em>/<em>MySQL</em> solutions
149
with a special focus on software long term utility and reliability,
150
supported through our agile acquire/design/transition process model.
151
</p>
152

    
153
<h4>DONATE</h4>
154
<p>
155
You can show your appreciation for our free software,
156
and can support future development by making a donation to the kigkonsult GPL/LGPL projects.
157
</p>
158
<p>
159
Make a donation of any size by clicking <a href="http://kigkonsult.se/contact/index.php#Donate" title="Donate" target="_blank">here</a>.
160
Thanks in advance!
161
</p>
162

    
163
<h4>Contact</h4>
164
<p>
165
Use the <a href="http://kigkonsult.se/contact/index.php" title="kigkonsult.se/contact" target="_blank">contact page</a>
166
 for queries, improvement/development issues or professional support and development.
167
 Please note that paid support or consulting service has the highest priority.
168
</p>
169

    
170
<h4>Downloads and usage examples</h4>
171
<p>
172
At <a href="http://kigkonsult.se/iCalcreator/index.php" title="kigkonsult iCalcreator" target="_blank">kigkonsult.se</a> you can download the
173
<a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator complete manual" target="_blank">complete manual</a>
174
and review and explore iCalcreator usage at the
175
<a href="http://kigkonsult.se/test/index.php" title="kigkonsult.se iCalcreator implement and test examples" target="_blank">coding and test</a> pages.
176
</p>
177

    
178
<h4>INSTALL</h4>
179
<dl>
180
<dt>Unpack to any folder
181
<dd>add this folder to your include-path
182
<dd>or unpack to your application-(include)-folder<br>
183
</dl>
184
<p>
185
Add
186
</p>
187
<pre>&lt;?php
188
.. .
189
require_once './iCalcreator.class.php';
190
.. .
191
?&gt;
192
</pre>
193
<p>
194
to your php-script.
195
</p>
196
<p>
197
When creating a new calendar(/component) object instance, review config settings.
198
</p>
199
<p>
200
To really boost performance, visit kigkonsult.se contact <a href="http://kigkonsult.se/contact/index.php"><u>page</u></a> for information.
201
</p>
202

    
203

    
204
<h2>CREATE</h2>
205

    
206
<pre>&lt;?php
207
.. .
208
require_once( &quot;iCalcreator.class.php&quot; );
209
$tz = &quot;Europe/Stockholm&quot;;                                  // <span class="comment">define time zone</span>
210
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot;,           // <span class="comment">set Your unique id, </span>
211
                                                           // <span class="comment">required if any component UID is missing</span>
212
                 &quot;TZID&quot;      =&gt; $tz );                     // <span class="comment">opt. set &quot;calendar&quot; timezone</span>
213
$v = new vcalendar( $config );                             // <span class="comment">create a new calendar object instance</span>
214

    
215
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
216
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
217
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
218
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, $tz );                   // <span class="comment">required of some <strong>calendar</strong> software</span>
219
.. .
220
$xprops = array( &quot;X-LIC-LOCATION&quot; => $tz );                // <span class="comment">required of some <strong>calendar</strong> software</span>
221
iCalUtilityFunctions::createTimezone( $v, $tz, $xprops );  // <span class="comment">create timezone component(-s) <b>opt. 1</b></span>
222
.. .                                                       // <span class="comment">based on present date</span>
223
.. .
224
$vevent = &amp; $v->newComponent( &quot;vevent&quot; );                  // <span class="comment">create an event <strong>calendar</strong> component</span>
225
$vevent->setProperty( &quot;dtstart&quot;, array( &quot;year&quot;  =&gt; 2007
226
                                      , &quot;month&quot; =&gt;    4
227
                                      , &quot;day&quot;   =&gt;    1
228
                                      , &quot;hour&quot;  =&gt;   19
229
                                      , &quot;min&quot;   =&gt;    0
230
                                      , &quot;sec&quot;   =&gt;    0 ));
231
$vevent->setProperty( &quot;dtend&quot;,   array( &quot;year&quot;  =&gt; 2007
232
                                      , &quot;month&quot; =&gt;    4
233
                                      , &quot;day&quot;   =&gt;    1
234
                                      , &quot;hour&quot;  =&gt;   22
235
                                      , &quot;min&quot;   =&gt;   30
236
                                      , &quot;sec&quot;   =&gt;    0 ));
237
$vevent->setProperty( &quot;LOCATION&quot;, &quot;Central Placa&quot; );       // <span class="comment">property name - case independent</span>
238
$vevent->setProperty( &quot;summary&quot;, &quot;PHP summit&quot; );
239
$vevent->setProperty( &quot;description&quot;, &quot;This is a description&quot; );
240
$vevent->setProperty( &quot;comment&quot;, &quot;This is a comment&quot; );
241
$vevent->setProperty( &quot;attendee&quot;, &quot;attendee1@icaldomain.net&quot; );
242
.. .
243
$valarm = &amp; $vevent->newComponent( &quot;valarm&quot; );             // <span class="comment">create an event alarm</span>
244
$valarm->setProperty(&quot;action&quot;, &quot;DISPLAY&quot; );
245
$valarm->setProperty(&quot;description&quot;, $vevent->getProperty( &quot;description&quot; );
246
.. .                                                       // <span class="comment">reuse the event description</span>
247
$d = sprintf( '%04d%02d%02d %02d%02d%02d', 2007, 3, 31, 15, 0, 0 );
248
iCalUtilityFunctions::transformDateTime( $d, $tz, &quot;UTC&quot;, &quot;Ymd\THis\Z&quot;);
249
$valarm->setProperty( &quot;trigger&quot;, $d );                     // <span class="comment">create alarm trigger (in UTC datetime)</span>
250
.. .
251
$vevent = &amp; $v->newComponent( &quot;vevent&quot; );                  // <span class="comment">create next event calendar component</span>
252
$vevent->setProperty( &quot;dtstart&quot;, &quot;20070401&quot;, array(&quot;VALUE&quot; =&gt; &quot;DATE&quot;));// <span class="comment">alt. date format,</span>
253
                                                           // <span class="comment"> now for an all-day event</span>
254
$vevent->setProperty( &quot;organizer&quot; , &quot;boss@icaldomain.com&quot; );
255
$vevent->setProperty( &quot;summary&quot;, &quot;ALL-DAY event&quot; );
256
$vevent->setProperty( &quot;description&quot;, &quot;This is a description for an all-day event&quot; );
257
$vevent->setProperty( &quot;resources&quot;, &quot;COMPUTER PROJECTOR&quot; );
258
$vevent->setProperty( &quot;rrule&quot;, array( &quot;FREQ&quot; =&gt; &quot;WEEKLY&quot;, &quot;count&quot; =&gt; 4));// <span class="comment">weekly, four occasions</span>
259
$vevent->parse( &quot;LOCATION:1CP Conference Room 4350&quot; );     // <span class="comment">supporting parse of</span>
260
                                                           // <span class="comment"> strict rfc5545 formatted text</span>
261
.. .
262
.. .// <span class="comment">all calendar components are described in <a href="http://kigkonsult.se/downloads/dl.php?f=rfc5545" title="RFC5545" target="_blank">rfc5545</a></span>
263
.. .// <span class="comment">a complete iCalcreator function list (ex. setProperty) in <a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator complete manual" target="_blank">iCalcreator manual</a></span>
264
.. .
265
iCalUtilityFunctions::createTimezone( $v, $tz, $xprops);   // <span class="comment">create timezone component(-s) <b>opt. 2</b></span>
266
                                                           // <span class="comment">based on all start dates in events</span>
267
                                                           // <span class="comment">(i.e. dtstart)</span>
268
.. .
269
?&gt;
270
</pre>
271

    
272
<h2>PARSE</h2>
273
<h4>iCal, rfc5545 / rfc2445 </h4>
274
<h5>create iCalcreator object instance</h5>
275
<pre>&lt;?php
276
.. .
277
require_once( &quot;iCalcreator.class.php&quot; );
278
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id, </span>
279
.. .                                                       // <span class="comment">required if any component UID is missing</span>
280
$v = new vcalendar( $config );                             // <span class="comment">create a new <strong>calendar</strong> object instance</span>
281
.. .
282
</pre>
283
<h5>when parse a local iCal file</h5>
284
<pre>.. .
285
$config = array( &quot;directory&quot; =&gt; &quot;calendar&quot;, &quot;filename&quot; =&gt; &quot;file.ics&quot; );
286
$v->setConfig( $config );                                  // <span class="comment">set directory and file name</span>
287
$v->parse();
288
.. .                                                       // <span class="comment">continue process (edit, parse,select)</span>
289
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
290
.. .
291
?&gt;
292
</pre>
293
<h5>or parse a remote iCal file (resource)</h5>
294
<pre>.. .
295
$v->setConfig( &quot;url&quot;, &quot;http://www.aDomain.net/file.ics&quot; ); // <span class="comment">supporting parse of remote files</span>
296
$v->parse();
297
.. .
298
$v->sort();                                                // <span class="comment">ensure start date order</span>
299
.. .                                                       // <span class="comment">(opt., <b>NOT</b> required after parse)</span>
300
.. .
301
.. .                                                       // <span class="comment">continue process (edit, parse,select)</span>
302
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
303
.. .
304
?&gt;
305
</pre>
306
<p>
307
On error, the parse method returns FALSE.
308
</p>
309
<h4>xCal, rfc6321 (XML)</h4>
310
<pre>&lt;?php
311
.. .
312
require_once( &quot;iCalcreator.class.php&quot; );
313
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id, </span>
314
.. .                                                       // <span class="comment">required if any component UID is missing</span>
315
.. .
316
$filename = 'xmlfile.xml';                                 // <span class="comment">use a local xCal file</span>
317
// $filename = 'http://kigkonsult.se/xcal.php?a=1&amp;b=2&amp;c=3';// <span class="comment"> or a remote xCal resource</span>
318
if( FALSE === ( $v = XMLfile2iCal(  $filename, $config ))) // <span class="comment">convert the XML resource</span>
319
  exit( &quot;Error when parsing $filename&quot; );                  // <span class="comment"> to an iCalcreator object instance</span>
320
.. .                                                       // <span class="comment">continue process (edit, parse,select)</span>
321
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
322
.. .
323
?&gt;
324
</pre>
325

    
326

    
327
<h2>EDIT</h2>
328
<pre>&lt;?php
329
.. .
330
require_once( &quot;iCalcreator.class.php&quot; );
331
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot;            // <span class="comment">set Your unique id,</span>
332
               , &quot;directory&quot; =&gt; &quot;calendar&quot;                 // <span class="comment">import directory</span>
333
               , &quot;filename&quot; =&gt; &quot;file.ics&quot; );               // <span class="comment"> and file name</span>
334

    
335
$v = new vcalendar( $config );                             // <span class="comment">create a new calendar object instance</span>
336

    
337
$v->parse();
338

    
339
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
340
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
341
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
342
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, &quot;Europe/Stockholm&quot; );    // <span class="comment">required of some <strong>calendar</strong> software</span>
343

    
344
while( $vevent = $v->getComponent( &quot;vevent&quot; )) {           // <span class="comment">read events, one by one</span>
345
  $uid = $vevent->getProperty( &quot;uid&quot; );                    // <span class="comment">uid required, one occurrence</span>
346
  .. .                                                     // <span class="comment">  (unique id/key for component)</span>
347
  $dtstart = $vevent->getProperty( &quot;dtstart&quot; );            // <span class="comment">dtstart required, one occurrence</span>
348
  .. .
349
  if( $description = $vevent->getProperty( &quot;description&quot;, 1 )) { // <span class="comment">opt. description, 1st occurrence</span>
350
    .. .                                                   // <span class="comment">edit the description</span>
351
    $vevent->setProperty( &quot;description&quot;, $description, FALSE, 1 ); // <span class="comment">update/replace the description</span>
352
  }
353
  while( $comment = $vevent->getProperty( &quot;comment&quot; )) {   // <span class="comment">optional comments</span>
354
    .. .                                                   // <span class="comment">manage comments</span>
355
  }
356
  .. .
357
  while( $vevent->deleteProperty( &quot;attendee&quot; ))
358
    continue;                                              // <span class="comment">remove all ATTENDEE properties .. .</span>
359
  .. .
360
  $v->setComponent ( $vevent, $uid );                      // <span class="comment">update/replace event in calendar</span>
361
                                                           // <span class="comment"> with <b>UID</b> as key</span>
362
}
363
.. .
364
.. .// <span class="comment">a complete iCalcreator function list (ex. getProperty, deleteProperty) in <a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator complete manual" target="_blank">iCalcreator manual</a></span>
365
.. .
366
?&gt;
367
</pre>
368
<br>
369
<br>
370

    
371
<h2>SELECT</h2>
372
<pre>&lt;?php
373
.. .
374
require_once( &quot;iCalcreator.class.php&quot; );
375
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id</span>
376
$v = new vcalendar( $config );                             // <span class="comment">create a new <strong>calendar</strong> object instance</span>
377

    
378
$v->setConfig( &quot;url&quot;, &quot;http://www.aDomain.net/file.ics&quot; ); // <span class="comment">iCalcreator also support remote files</span>
379
$v->parse();
380

    
381
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
382
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
383
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
384
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, &quot;Europe/Stockholm&quot; );    // <span class="comment">required of some <strong>calendar</strong> software</span>
385
.. .
386
?&gt;
387
</pre>
388
<h4>Date based select</h4>
389
<pre>&lt;?php
390
.. .
391
$eventArray = $v->selectComponents();                      // <span class="comment">select components occurring <b>today</b></span>
392
                                                           // <span class="comment">(including components</span>
393
                                                           // <span class="comment">with recurrence pattern)</span>
394
foreach( $eventArray as $year =&gt; $yearArray) {
395
 foreach( $yearArray as $month =&gt; $monthArray ) {
396
  foreach( $monthArray as $day =&gt; $dailyEventsArray ) {
397
   foreach( $dailyEventsArray as $vevent ) {
398
    $currddate = $event->getProperty( &quot;x-current-dtstart&quot; );
399
                                                           // <span class="comment">if member of a recurrence set</span>
400
                                                           // <span class="comment">(2nd occurrence etc)</span>
401
                                                           // <span class="comment">returns array( </span>
402
                                                           // <span class="comment">    &quot;x-current-dtstart&quot;</span>
403
                                                           // <span class="comment">  , (string) date(</span>
404
                                                           // <span class="comment">    &quot;Y-m-d [H:i:s][timezone/UTC offset]&quot;))</span>
405
    $dtstart = $vevent->getProperty( &quot;dtstart&quot; );          // <span class="comment">dtstart required, one occurrence,</span>
406
                                                           // <span class="comment"> (orig. start date)</span>
407
    $summary = $vevent->getProperty( &quot;summary&quot; );
408
    $description = $vevent->getProperty( &quot;description&quot; );
409
    .. .
410
    .. .
411
   }
412
  }
413
 }
414
}
415
.. .
416
?&gt;
417
</pre>
418
<h4>Select specific property values</h4>
419
<pre>&lt;?php
420
.. .
421
$valueOccur = $v->getProperty( &quot;RESOURCES&quot; );              // <span class="comment">fetch specific property</span>
422
                                                           // <span class="comment">(unique) values and occurrences</span>
423
                                                           // <span class="comment">ATTENDEE, CATEGORIES, CONTACT,</span>
424
                                                           // <span class="comment">DTSTART, LOCATION, ORGANIZER,</span>
425
                                                           // <span class="comment">PRIORITY, RESOURCES, STATUS,</span>
426
                                                           // <span class="comment">SUMMARY, UID, URL,</span>
427
                                                           // <span class="comment">GEOLOCATION<sup>*</sup></span>
428
foreach( $valueOccur as $uniqueValue =&gt; $occurCnt ) {
429
  echo &quot;The RESOURCES value &lt;b&gt;$uniqueValue&lt;/b&gt; occurs &lt;b&gt;$occurCnt&lt;/b&gt; times&lt;br /&gt;&quot;;
430
  .. .
431
}
432
.. .
433
?&gt;
434
</pre>
435
<p>
436
<sup>*</sup>) Using the non-standard directive "GEOLOCATION", iCalcreator returns output supporting
437
ISO6709 "Standard representation of geographic point location by coordinates",
438
by combining the "LOCATION" and "GEO" property values (only if "GEO" is set).
439
</p>
440
<h4>Select components based on specific property value</h4>
441
<pre>&lt;?php
442
.. .
443
$selectSpec = array( &quot;CATEGORIES&quot; =&gt; &quot;course1&quot; );
444
$specComps = $v->selectComponents( $selectSpec );          // <span class="comment">selects components</span>
445
                                                           // <span class="comment">based on specific property value(-s)</span>
446
                                                           // <span class="comment">ATTENDEE, CATEGORIES, CONTACT,</span>
447
                                                           // <span class="comment">LOCATION, ORGANIZER,</span>
448
                                                           // <span class="comment">PRIORITY, RESOURCES, STATUS,</span>
449
                                                           // <span class="comment">SUMMARY, URL, UID</span>
450
foreach( $specComps as $comp ) {
451
 .. .
452
}
453
.. .
454
?&gt;
455
</pre>
456
<br>
457
<br>
458

    
459
<h2>OUTPUT</h2>
460
<h5>create iCalcreator object instance</h5>
461
<pre>&lt;?php
462
.. .
463
require_once( &quot;iCalcreator.class.php&quot; );
464
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id</span>
465
$v = new vcalendar( $config );                             // <span class="comment">create a new calendar object instance</span>
466

    
467
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
468
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
469
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
470
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, &quot;Europe/Stockholm&quot; );    // <span class="comment">required of some <strong>calendar</strong> software</span>
471
.. .
472
.. .                                                       // <span class="comment">continue process (edit, parse,select)</span>
473
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
474
.. .
475
?&gt;
476
</pre>
477
<h5>opt 1</h5>
478
<pre>&lt;?php
479
.. .
480
$v->returnCalendar();                                      // <span class="comment">redirect calendar file to browser</span>
481
?&gt;
482
</pre>
483

    
484
<h5>opt 2</h5>
485
<pre>&lt;?php
486
.. .
487
$config = array( &quot;directory&quot; =&gt; &quot;depot&quot;, &quot;filename&quot; =&gt; &quot;calendar.ics&quot; );
488
$v->setConfig( $config );                                  // <span class="comment">set output directory and file name</span>
489
$v->saveCalendar();                                        // <span class="comment">save calendar to (local) file</span>
490
.. .
491
?&gt;
492
</pre>
493

    
494
<h5>opt 3, xCal</h5>
495
<pre>&lt;?php
496
.. .
497
$mlstr = iCal2XML( $v );                                   // <span class="comment">create well-formed XML, rfc6321</span>
498
.. .
499
?&gt;
500
</pre>
501
<br>
502
<br>
503

    
504

    
505
<h2>COPYRIGHT AND LICENSE</h2>
506

    
507
<h4>Copyright</h4>
508
<p>
509
iCalcreator v2.18<br>
510
Copyright (c) 2007-2013 Kjell-Inge Gustafsson, kigkonsult, All rights reserved.<br>
511
<a href="http://kigkonsult.se/iCalcreator/index.php" title="kigkonsult.se/iCalcreator" target="_blank">kigkonsult.se iCalcreator</a><br>
512
<a href="http://kigkonsult.se/contact/index.php" title="kigkonsult.se contact" target="_blank">kigkonsult.se contact</a>
513
</p>
514

    
515
<h4>License</h4>
516

    
517
<p>
518
This library is free software; you can redistribute it and/or
519
modify it under the terms of the GNU Lesser General Public
520
License as published by the Free Software Foundation; either
521
version 2.1 of the License, or (at your option) any later version.
522
</p>
523
<p>
524
This library is distributed in the hope that it will be useful,
525
but WITHOUT ANY WARRANTY; without even the implied warranty of
526
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
527
Lesser General Public License for more details.
528
</p>
529
<p>
530
You should have received a copy of the GNU Lesser General Public
531
License along with this library; if not, write to the Free Software
532
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
533
or download it <a href="http://kigkonsult.se/downloads/dl.php?f=LGPL" target="_blank">here</a>.
534
</p>
535
<br>
536
<br>
537
</body>
538
</html>