Projet

Général

Profil

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

root / drupal7 / sites / all / libraries / iCalcreator-2.22.1 / docs / summary.html @ 99781f3b

1 85ad3d82 Assos Assos
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
2
<html>
3
<head>
4 0aee3c58 Assos Assos
<title>iCalcreator 2.22 summary</title>
5 85ad3d82 Assos Assos
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
6
<meta name="author"      content="Kjell-Inge Gustafsson, kigkonsult, All rights reserved">
7 0aee3c58 Assos Assos
<meta name="copyright"   content="2007-2015 Kjell-Inge Gustafsson, kigkonsult">
8 85ad3d82 Assos Assos
<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 0aee3c58 Assos Assos
<h1>iCalcreator v2.22</h1>
58 85ad3d82 Assos Assos
<p>
59 0aee3c58 Assos Assos
iCalcreator v2.22<br>
60
Copyright (c) 2007-2015 Kjell-Inge Gustafsson, kigkonsult, All rights reserved.<br>
61 85ad3d82 Assos Assos
<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 0aee3c58 Assos Assos
component property oriented. iCalcreator requires <em>PHP</em> >= 5.3.
98 85ad3d82 Assos Assos
</p>
99
<p>
100
More iCalcreator supplementary, usage and &quot;howto&quot; information will be found at kigkonsult.se iCalcreator
101
 <a href="http://kigkonsult.se/test/index.php" title="kigkonsult.se iCalcreator implement and test examples" target="_blank">coding and test</a> pages.
102
 A strong recommendation is to have the document
103
 <a href="http://kigkonsult.se/iCalcreator/docs/using.html" title="iCalcreator user's Manual" target="_blank">user's manual</a>
104
 open in parallel when exploiting the link.
105
</p>
106
107
<h4>iCal</h4>
108
<p>
109
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>.
110
 If You are not familiar with iCal, read this first!
111
</p>
112
<p>
113
Knowledge of <strong>calendar</strong> protocol rfc5545/rfc5546  is to recommend;
114
</p>
115
<dl>
116
<dt><a href="http://kigkonsult.se/downloads/dl.php?f=rfc5545" title="Download RFC5545 in text format" target="_blank">rfc5545</a>
117
<dd>Internet Calendaring and Scheduling Core Object Specification (iCalendar)
118
<dd>obsoletes <a href="http://kigkonsult.se/downloads/dl.php?f=rfc2445" title="Download RFC2445 in text format">rfc2445</a>
119
<dt><a href="http://kigkonsult.se/downloads/dl.php?f=rfc5546" title="Download RFC5546 in text format" target="_blank">rfc5546</a>
120
<dd>iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries
121
<dd>obsoletes <a href="http://kigkonsult.se/downloads/dl.php?f=rfc2446" title="Download RFC2446 in text format">rfc2446</a>.
122
</dl>
123
124
<h4>xCal</h4>
125
<p>
126
iCalcreator also supports xCal (iCal xml).
127
</p>
128
<dl>
129
<dt>
130
<dt><a href="http://kigkonsult.se/downloads/dl.php?f=rfc6321" title="Download RFC6321 in text format" target="_blank">rfc6321</a>
131
<dd>xCal: The XML Format for <strong>iCalendar</strong>
132
</dl>
133
134
<h4>SUPPORT</h4>
135
<p>
136
The main support channel is using iCalcreator
137
<a title="Sourceforge" href="http://sourceforge.net/projects/icalcreator/forums/" target="_blank">Sourceforge</a> forum.
138
</p>
139
<p>
140
Support and development is now focused on iCalcreator (Pro) 3.x versions, which, in turn, will affect future releases
141
of iCalcreator 2.x.
142
</p>
143
<p>
144 0aee3c58 Assos Assos
kigkonsult offer professional services for software support, design and new/re-development, customizations and adaptations
145
of <em>PHP</em>/<em>MySQL</em> solutions with focus on software lifecycle management, including long term utility, reliability and maintainability.
146 85ad3d82 Assos Assos
</p>
147
148
<h4>DONATE</h4>
149
<p>
150
You can show your appreciation for our free software,
151
and can support future development by making a donation to the kigkonsult GPL/LGPL projects.
152
</p>
153
<p>
154
Make a donation of any size by clicking <a href="http://kigkonsult.se/contact/index.php#Donate" title="Donate" target="_blank">here</a>.
155
Thanks in advance!
156
</p>
157
158
<h4>Contact</h4>
159
<p>
160
Use the <a href="http://kigkonsult.se/contact/index.php" title="kigkonsult.se/contact" target="_blank">contact page</a>
161
 for queries, improvement/development issues or professional support and development.
162
 Please note that paid support or consulting service has the highest priority.
163
</p>
164
165
<h4>Downloads and usage examples</h4>
166
<p>
167
At <a href="http://kigkonsult.se/iCalcreator/index.php" title="kigkonsult iCalcreator" target="_blank">kigkonsult.se</a> you can download the
168
<a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator complete manual" target="_blank">complete manual</a>
169
and review and explore iCalcreator usage at the
170
<a href="http://kigkonsult.se/test/index.php" title="kigkonsult.se iCalcreator implement and test examples" target="_blank">coding and test</a> pages.
171
</p>
172
173
<h4>INSTALL</h4>
174
<dl>
175
<dt>Unpack to any folder
176 0aee3c58 Assos Assos
<dd>add iCalcreator folder to your include-path
177 85ad3d82 Assos Assos
<dd>or unpack to your application-(include)-folder<br>
178
</dl>
179
<p>
180
Add
181
</p>
182
<pre>&lt;?php
183
.. .
184 0aee3c58 Assos Assos
require_once &quot;[path/]iCalcreator-&lt;version&gt;/iCalcreator.php&quot;;
185 85ad3d82 Assos Assos
.. .
186
?&gt;
187
</pre>
188
<p>
189
to your php-script.
190 0aee3c58 Assos Assos
The iCalcreator invoke has changed since previous version!
191
You may also need to set the default timezone.</p>
192 85ad3d82 Assos Assos
<p>
193
When creating a new calendar(/component) object instance, review config settings.
194
</p>
195
196
197
<h2>CREATE</h2>
198
199
<pre>&lt;?php
200
.. .
201 0aee3c58 Assos Assos
require_once &quot;iCalcreator-&lt;version&gt;/iCalcreator.php&quot;;
202 85ad3d82 Assos Assos
$tz = &quot;Europe/Stockholm&quot;;                                  // <span class="comment">define time zone</span>
203
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot;,           // <span class="comment">set Your unique id, </span>
204
                                                           // <span class="comment">required if any component UID is missing</span>
205
                 &quot;TZID&quot;      =&gt; $tz );                     // <span class="comment">opt. set &quot;calendar&quot; timezone</span>
206
$v = new vcalendar( $config );                             // <span class="comment">create a new calendar object instance</span>
207
208
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
209
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
210
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
211
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, $tz );                   // <span class="comment">required of some <strong>calendar</strong> software</span>
212
.. .
213
.. .
214 0aee3c58 Assos Assos
$vevent = $v->newComponent( &quot;vevent&quot; );                    // <span class="comment">create an event <strong>calendar</strong> component</span>
215 85ad3d82 Assos Assos
$vevent->setProperty( &quot;dtstart&quot;, array( &quot;year&quot;  =&gt; 2007
216
                                      , &quot;month&quot; =&gt;    4
217
                                      , &quot;day&quot;   =&gt;    1
218
                                      , &quot;hour&quot;  =&gt;   19
219
                                      , &quot;min&quot;   =&gt;    0
220
                                      , &quot;sec&quot;   =&gt;    0 ));
221
$vevent->setProperty( &quot;dtend&quot;,   array( &quot;year&quot;  =&gt; 2007
222
                                      , &quot;month&quot; =&gt;    4
223
                                      , &quot;day&quot;   =&gt;    1
224
                                      , &quot;hour&quot;  =&gt;   22
225
                                      , &quot;min&quot;   =&gt;   30
226
                                      , &quot;sec&quot;   =&gt;    0 ));
227
$vevent->setProperty( &quot;LOCATION&quot;, &quot;Central Placa&quot; );       // <span class="comment">property name - case independent</span>
228
$vevent->setProperty( &quot;summary&quot;, &quot;PHP summit&quot; );
229
$vevent->setProperty( &quot;description&quot;, &quot;This is a description&quot; );
230
$vevent->setProperty( &quot;comment&quot;, &quot;This is a comment&quot; );
231
$vevent->setProperty( &quot;attendee&quot;, &quot;attendee1@icaldomain.net&quot; );
232
.. .
233 0aee3c58 Assos Assos
$valarm = $vevent->newComponent( &quot;valarm&quot; );               // <span class="comment">create an event alarm</span>
234 85ad3d82 Assos Assos
$valarm->setProperty(&quot;action&quot;, &quot;DISPLAY&quot; );
235
$valarm->setProperty(&quot;description&quot;, $vevent->getProperty( &quot;description&quot; );
236
.. .                                                       // <span class="comment">reuse the event description</span>
237 0aee3c58 Assos Assos
$d = sprintf( '%04d%02d%02d %02d%02d%02d', 2007, 3, 31, 15, 0, 0 ); // local date
238 85ad3d82 Assos Assos
iCalUtilityFunctions::transformDateTime( $d, $tz, &quot;UTC&quot;, &quot;Ymd\THis\Z&quot;);
239
$valarm->setProperty( &quot;trigger&quot;, $d );                     // <span class="comment">create alarm trigger (in UTC datetime)</span>
240
.. .
241 0aee3c58 Assos Assos
$vevent = $v->newComponent( &quot;vevent&quot; );                    // <span class="comment">create next event calendar component</span>
242 85ad3d82 Assos Assos
$vevent->setProperty( &quot;dtstart&quot;, &quot;20070401&quot;, array(&quot;VALUE&quot; =&gt; &quot;DATE&quot;));// <span class="comment">alt. date format,</span>
243
                                                           // <span class="comment"> now for an all-day event</span>
244
$vevent->setProperty( &quot;organizer&quot; , &quot;boss@icaldomain.com&quot; );
245
$vevent->setProperty( &quot;summary&quot;, &quot;ALL-DAY event&quot; );
246
$vevent->setProperty( &quot;description&quot;, &quot;This is a description for an all-day event&quot; );
247
$vevent->setProperty( &quot;resources&quot;, &quot;COMPUTER PROJECTOR&quot; );
248
$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>
249
$vevent->parse( &quot;LOCATION:1CP Conference Room 4350&quot; );     // <span class="comment">supporting parse of</span>
250
                                                           // <span class="comment"> strict rfc5545 formatted text</span>
251
.. .
252
.. .// <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>
253
.. .// <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>
254
.. .
255 0aee3c58 Assos Assos
$xprops = array( &quot;X-LIC-LOCATION&quot; => $tz );                // <span class="comment">required of some <strong>calendar</strong> software</span>
256
iCalUtilityFunctions::createTimezone( $v, $tz, $xprops);   // <span class="comment">create timezone component(-s)</span>
257 85ad3d82 Assos Assos
                                                           // <span class="comment">based on all start dates in events</span>
258
                                                           // <span class="comment">(i.e. dtstart)</span>
259
.. .
260
?&gt;
261
</pre>
262
263
<h2>PARSE</h2>
264
<h4>iCal, rfc5545 / rfc2445 </h4>
265
<h5>create iCalcreator object instance</h5>
266
<pre>&lt;?php
267
.. .
268 0aee3c58 Assos Assos
require_once &quot;iCalcreator-&lt;version&gt;/iCalcreator.php&quot;;
269 85ad3d82 Assos Assos
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id, </span>
270
.. .                                                       // <span class="comment">required if any component UID is missing</span>
271
$v = new vcalendar( $config );                             // <span class="comment">create a new <strong>calendar</strong> object instance</span>
272
.. .
273
</pre>
274 0aee3c58 Assos Assos
<h5>then parse a local iCal file</h5>
275 85ad3d82 Assos Assos
<pre>.. .
276
$config = array( &quot;directory&quot; =&gt; &quot;calendar&quot;, &quot;filename&quot; =&gt; &quot;file.ics&quot; );
277
$v->setConfig( $config );                                  // <span class="comment">set directory and file name</span>
278
$v->parse();
279
.. .                                                       // <span class="comment">continue process (edit, parse,select)</span>
280
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
281
.. .
282
?&gt;
283
</pre>
284 0aee3c58 Assos Assos
<p>
285
On error, the setConfig method returns FALSE (ex. unvalid directory/filename).
286
</p>
287 85ad3d82 Assos Assos
<h5>or parse a remote iCal file (resource)</h5>
288
<pre>.. .
289
$v->setConfig( &quot;url&quot;, &quot;http://www.aDomain.net/file.ics&quot; ); // <span class="comment">supporting parse of remote files</span>
290
$v->parse();
291
.. .
292
$v->sort();                                                // <span class="comment">ensure start date order</span>
293
.. .                                                       // <span class="comment">(opt., <b>NOT</b> required after parse)</span>
294
.. .
295
.. .                                                       // <span class="comment">continue process (edit, parse,select)</span>
296
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
297
.. .
298
?&gt;
299
</pre>
300
<p>
301
On error, the parse method returns FALSE.
302
</p>
303
<h4>xCal, rfc6321 (XML)</h4>
304
<pre>&lt;?php
305
.. .
306 0aee3c58 Assos Assos
require_once &quot;iCalcreator-&lt;version&gt;/iCalcreator.php&quot;;
307 85ad3d82 Assos Assos
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id, </span>
308
.. .                                                       // <span class="comment">required if any component UID is missing</span>
309
.. .
310
$filename = 'xmlfile.xml';                                 // <span class="comment">use a local xCal file</span>
311 0aee3c58 Assos Assos
// $filename = 'http://kigkonsult.se/xcal.php?a=1&amp;b=2&amp;c=3';// <span class="comment">  or a remote xCal resource</span>
312
if( FALSE === ( $v = XMLfile2iCal( $filename, $config )))  // <span class="comment">convert the XML resource</span>
313
  exit( &quot;Error when parsing $filename&quot; );                  // <span class="comment">  to an iCalcreator object instance</span>
314
.. .                                                       // <span class="comment">continue process (edit, parse, select)</span>
315 85ad3d82 Assos Assos
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
316
.. .
317
?&gt;
318
</pre>
319
320
321
<h2>EDIT</h2>
322
<pre>&lt;?php
323
.. .
324 0aee3c58 Assos Assos
require_once &quot;iCalcreator-&lt;version&gt;/iCalcreator.php&quot;;
325 85ad3d82 Assos Assos
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot;            // <span class="comment">set Your unique id,</span>
326
               , &quot;directory&quot; =&gt; &quot;calendar&quot;                 // <span class="comment">import directory</span>
327 0aee3c58 Assos Assos
               , &quot;filename&quot; =&gt; &quot;file.ics&quot; );               // <span class="comment">and file name</span>
328 85ad3d82 Assos Assos
329
$v = new vcalendar( $config );                             // <span class="comment">create a new calendar object instance</span>
330
331
$v->parse();
332
333
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
334
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
335
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
336
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, &quot;Europe/Stockholm&quot; );    // <span class="comment">required of some <strong>calendar</strong> software</span>
337
338
while( $vevent = $v->getComponent( &quot;vevent&quot; )) {           // <span class="comment">read events, one by one</span>
339
  $uid = $vevent->getProperty( &quot;uid&quot; );                    // <span class="comment">uid required, one occurrence</span>
340
  .. .                                                     // <span class="comment">  (unique id/key for component)</span>
341
  $dtstart = $vevent->getProperty( &quot;dtstart&quot; );            // <span class="comment">dtstart required, one occurrence</span>
342
  .. .
343
  if( $description = $vevent->getProperty( &quot;description&quot;, 1 )) { // <span class="comment">opt. description, 1st occurrence</span>
344
    .. .                                                   // <span class="comment">edit the description</span>
345
    $vevent->setProperty( &quot;description&quot;, $description, FALSE, 1 ); // <span class="comment">update/replace the description</span>
346
  }
347
  while( $comment = $vevent->getProperty( &quot;comment&quot; )) {   // <span class="comment">optional comments</span>
348
    .. .                                                   // <span class="comment">manage comments</span>
349
  }
350
  .. .
351
  while( $vevent->deleteProperty( &quot;attendee&quot; ))
352
    continue;                                              // <span class="comment">remove all ATTENDEE properties .. .</span>
353
  .. .
354
  $v->setComponent ( $vevent, $uid );                      // <span class="comment">update/replace event in calendar</span>
355
                                                           // <span class="comment"> with <b>UID</b> as key</span>
356
}
357
.. .
358
.. .// <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>
359
.. .
360
?&gt;
361
</pre>
362
<br>
363
<br>
364
365
<h2>SELECT</h2>
366
<pre>&lt;?php
367
.. .
368 0aee3c58 Assos Assos
require_once &quot;iCalcreator-&lt;version&gt;/iCalcreator.php&quot;;
369 85ad3d82 Assos Assos
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id</span>
370
$v = new vcalendar( $config );                             // <span class="comment">create a new <strong>calendar</strong> object instance</span>
371
372
$v->setConfig( &quot;url&quot;, &quot;http://www.aDomain.net/file.ics&quot; ); // <span class="comment">iCalcreator also support remote files</span>
373
$v->parse();
374
375
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
376
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
377
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
378
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, &quot;Europe/Stockholm&quot; );    // <span class="comment">required of some <strong>calendar</strong> software</span>
379
.. .
380
?&gt;
381
</pre>
382
<h4>Date based select</h4>
383
<pre>&lt;?php
384
.. .
385
$eventArray = $v->selectComponents();                      // <span class="comment">select components occurring <b>today</b></span>
386
                                                           // <span class="comment">(including components</span>
387
                                                           // <span class="comment">with recurrence pattern)</span>
388
foreach( $eventArray as $year =&gt; $yearArray) {
389
 foreach( $yearArray as $month =&gt; $monthArray ) {
390
  foreach( $monthArray as $day =&gt; $dailyEventsArray ) {
391
   foreach( $dailyEventsArray as $vevent ) {
392
    $currddate = $event->getProperty( &quot;x-current-dtstart&quot; );
393
                                                           // <span class="comment">if member of a recurrence set</span>
394
                                                           // <span class="comment">returns array( </span>
395
                                                           // <span class="comment">    &quot;x-current-dtstart&quot;</span>
396
                                                           // <span class="comment">  , (string) date(</span>
397
                                                           // <span class="comment">    &quot;Y-m-d [H:i:s][timezone/UTC offset]&quot;))</span>
398
    $dtstart = $vevent->getProperty( &quot;dtstart&quot; );          // <span class="comment">dtstart required, one occurrence,</span>
399
                                                           // <span class="comment"> (orig. start date)</span>
400
    $summary = $vevent->getProperty( &quot;summary&quot; );
401
    $description = $vevent->getProperty( &quot;description&quot; );
402
    .. .
403
    .. .
404
   }
405
  }
406
 }
407
}
408
.. .
409
?&gt;
410
</pre>
411
<h4>Select specific property values</h4>
412
<pre>&lt;?php
413
.. .
414
$valueOccur = $v->getProperty( &quot;RESOURCES&quot; );              // <span class="comment">fetch specific property</span>
415
                                                           // <span class="comment">(unique) values and occurrences</span>
416
                                                           // <span class="comment">ATTENDEE, CATEGORIES, CONTACT,</span>
417
                                                           // <span class="comment">DTSTART, LOCATION, ORGANIZER,</span>
418
                                                           // <span class="comment">PRIORITY, RESOURCES, STATUS,</span>
419
                                                           // <span class="comment">SUMMARY, UID, URL,</span>
420
                                                           // <span class="comment">GEOLOCATION<sup>*</sup></span>
421
foreach( $valueOccur as $uniqueValue =&gt; $occurCnt ) {
422
  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;;
423
  .. .
424
}
425
.. .
426
?&gt;
427
</pre>
428
<p>
429
<sup>*</sup>) Using the non-standard directive "GEOLOCATION", iCalcreator returns output supporting
430
ISO6709 "Standard representation of geographic point location by coordinates",
431
by combining the "LOCATION" and "GEO" property values (only if "GEO" is set).
432
</p>
433
<h4>Select components based on specific property value</h4>
434
<pre>&lt;?php
435
.. .
436
$selectSpec = array( &quot;CATEGORIES&quot; =&gt; &quot;course1&quot; );
437 0aee3c58 Assos Assos
$specComps  = $v->selectComponents( $selectSpec );         // <span class="comment">selects components</span>
438 85ad3d82 Assos Assos
                                                           // <span class="comment">based on specific property value(-s)</span>
439
                                                           // <span class="comment">ATTENDEE, CATEGORIES, CONTACT,</span>
440
                                                           // <span class="comment">LOCATION, ORGANIZER,</span>
441
                                                           // <span class="comment">PRIORITY, RESOURCES, STATUS,</span>
442
                                                           // <span class="comment">SUMMARY, URL, UID</span>
443
foreach( $specComps as $comp ) {
444
 .. .
445
}
446
.. .
447
?&gt;
448
</pre>
449
<br>
450
<br>
451
452
<h2>OUTPUT</h2>
453
<h5>create iCalcreator object instance</h5>
454
<pre>&lt;?php
455
.. .
456 0aee3c58 Assos Assos
require_once &quot;iCalcreator-&lt;version&gt;/iCalcreator.php&quot;;
457 85ad3d82 Assos Assos
$config = array( &quot;unique_id&quot; =&gt; &quot;kigkonsult.se&quot; );         // <span class="comment">set Your unique id</span>
458
$v = new vcalendar( $config );                             // <span class="comment">create a new calendar object instance</span>
459
460
$v->setProperty( &quot;method&quot;, &quot;PUBLISH&quot; );                    // <span class="comment">required of some <strong>calendar</strong> software</span>
461
$v->setProperty( &quot;x-wr-calname&quot;, &quot;Calendar Sample&quot; );      // <span class="comment">required of some <strong>calendar</strong> software</span>
462
$v->setProperty( &quot;X-WR-CALDESC&quot;, &quot;Calendar Description&quot; ); // <span class="comment">required of some <strong>calendar</strong> software</span>
463
$v->setProperty( &quot;X-WR-TIMEZONE&quot;, &quot;Europe/Stockholm&quot; );    // <span class="comment">required of some <strong>calendar</strong> software</span>
464
.. .
465
.. .                                                       // <span class="comment">continue process (edit, parse,select)</span>
466
.. .                                                       // <span class="comment"> the iCalcreator object instance</span>
467
.. .
468
?&gt;
469
</pre>
470
<h5>opt 1</h5>
471
<pre>&lt;?php
472
.. .
473
$v->returnCalendar();                                      // <span class="comment">redirect calendar file to browser</span>
474 0aee3c58 Assos Assos
exit;
475 85ad3d82 Assos Assos
</pre>
476
477
<h5>opt 2</h5>
478
<pre>&lt;?php
479
.. .
480
$config = array( &quot;directory&quot; =&gt; &quot;depot&quot;, &quot;filename&quot; =&gt; &quot;calendar.ics&quot; );
481
$v->setConfig( $config );                                  // <span class="comment">set output directory and file name</span>
482
$v->saveCalendar();                                        // <span class="comment">save calendar to (local) file</span>
483
.. .
484
?&gt;
485
</pre>
486
487
<h5>opt 3, xCal</h5>
488
<pre>&lt;?php
489
.. .
490
$mlstr = iCal2XML( $v );                                   // <span class="comment">create well-formed XML, rfc6321</span>
491
.. .
492
?&gt;
493
</pre>
494
<br>
495
<br>
496
497
498
<h2>COPYRIGHT AND LICENSE</h2>
499
500
<h4>Copyright</h4>
501
<p>
502 0aee3c58 Assos Assos
iCalcreator v2.22<br>
503
Copyright (c) 2007-2015 Kjell-Inge Gustafsson, kigkonsult, All rights reserved.<br>
504 85ad3d82 Assos Assos
<a href="http://kigkonsult.se/iCalcreator/index.php" title="kigkonsult.se/iCalcreator" target="_blank">kigkonsult.se iCalcreator</a><br>
505
<a href="http://kigkonsult.se/contact/index.php" title="kigkonsult.se contact" target="_blank">kigkonsult.se contact</a>
506
</p>
507
508
<h4>License</h4>
509
510
<p>
511
This library is free software; you can redistribute it and/or
512
modify it under the terms of the GNU Lesser General Public
513
License as published by the Free Software Foundation; either
514
version 2.1 of the License, or (at your option) any later version.
515
</p>
516
<p>
517
This library is distributed in the hope that it will be useful,
518
but WITHOUT ANY WARRANTY; without even the implied warranty of
519
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
520
Lesser General Public License for more details.
521
</p>
522
<p>
523
You should have received a copy of the GNU Lesser General Public
524
License along with this library; if not, write to the Free Software
525
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
526
or download it <a href="http://kigkonsult.se/downloads/dl.php?f=LGPL" target="_blank">here</a>.
527
</p>
528
<br>
529
<br>
530
</body>
531 0aee3c58 Assos Assos
</html>