ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilICalWriter Class Reference
+ Collaboration diagram for ilICalWriter:

Public Member Functions

 __construct ()
 
 addLine ($a_line)
 Add a line to the ical string. More...
 
 __toString ()
 Return ical string. More...
 

Static Public Member Functions

static escapeText ($a_text)
 

Data Fields

const LINEBREAK = "\r\n"
 
const LINE_SIZE = 75
 
const BEGIN_LINE_WHITESPACE = ' '
 

Private Attributes

 $ical = ''
 

Detailed Description

Definition at line 24 of file class.ilICalWriter.php.

Constructor & Destructor Documentation

◆ __construct()

ilICalWriter::__construct ( )

Definition at line 33 of file class.ilICalWriter.php.

34  {
35  $this->ical = '';
36  }

Member Function Documentation

◆ __toString()

ilICalWriter::__toString ( )

Return ical string.

Returns

Definition at line 94 of file class.ilICalWriter.php.

References $ical.

95  {
96  return $this->ical;
97  }

◆ addLine()

ilICalWriter::addLine (   $a_line)

Add a line to the ical string.

Returns
Parameters
object$a_line

Definition at line 62 of file class.ilICalWriter.php.

References array, ilStr\strLen(), and ilStr\subStr().

63  {
64  //$chunks = str_split($a_line, self::LINE_SIZE);
65 
66  include_once './Services/Utilities/classes/class.ilStr.php';
67 
68  // use multibyte split
69  $chunks = array();
70  $len = ilStr::strLen($a_line);
71  while($len)
72  {
73  $chunks[] = ilStr::subStr($a_line,0,self::LINE_SIZE);
74  $a_line = ilStr::subStr($a_line, self::LINE_SIZE, $len);
75  $len = ilStr::strLen($a_line);
76  }
77 
78  for($i = 0; $i < count($chunks); $i++)
79  {
80  $this->ical .= $chunks[$i];
81  if(isset($chunks[$i+1]))
82  {
83  $this->ical .= self::LINEBREAK;
84  $this->ical .= self::BEGIN_LINE_WHITESPACE;
85  }
86  }
87  $this->ical .= self::LINEBREAK;
88  }
static strLen($a_string)
Definition: class.ilStr.php:91
Create styles array
The data for the language used.
static subStr($a_str, $a_start, $a_length=NULL)
Definition: class.ilStr.php:15
+ Here is the call graph for this function:

◆ escapeText()

static ilICalWriter::escapeText (   $a_text)
static

Definition at line 38 of file class.ilICalWriter.php.

References array.

Referenced by ilCalendarExport\createVEVENT().

39  {
40  $a_text = str_replace("\r\n", '\\n', $a_text);
41 
42  return preg_replace(
43  array(
44  '/\\\/',
45  '/;/',
46  '/,/',
47  ),
48  array(
49  '\\',
50  '\;',
51  '\,',
52  ),
53  $a_text
54  );
55  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

Field Documentation

◆ $ical

ilICalWriter::$ical = ''
private

Definition at line 31 of file class.ilICalWriter.php.

Referenced by __toString().

◆ BEGIN_LINE_WHITESPACE

const ilICalWriter::BEGIN_LINE_WHITESPACE = ' '

Definition at line 29 of file class.ilICalWriter.php.

◆ LINE_SIZE

const ilICalWriter::LINE_SIZE = 75

Definition at line 28 of file class.ilICalWriter.php.

◆ LINEBREAK

const ilICalWriter::LINEBREAK = "\r\n"

Definition at line 26 of file class.ilICalWriter.php.


The documentation for this class was generated from the following file: