ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 = 74
 
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 34 of file class.ilICalWriter.php.

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

Member Function Documentation

◆ __toString()

ilICalWriter::__toString ( )

Return ical string.

Returns

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

References $ical.

93  {
94  return $this->ical;
95  }

◆ addLine()

ilICalWriter::addLine (   $a_line)

Add a line to the ical string.

Returns
Parameters
object$a_line

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

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

64  {
65  //$chunks = str_split($a_line, self::LINE_SIZE);
66 
67  include_once './Services/Utilities/classes/class.ilStr.php';
68 
69  // use multibyte split
70  $chunks = array();
71  $len = ilStr::strLen($a_line);
72  while ($len) {
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  $this->ical .= $chunks[$i];
80  if (isset($chunks[$i+1])) {
81  $this->ical .= self::LINEBREAK;
82  $this->ical .= self::BEGIN_LINE_WHITESPACE;
83  }
84  }
85  $this->ical .= self::LINEBREAK;
86  }
static strLen($a_string)
Definition: class.ilStr.php:78
static subStr($a_str, $a_start, $a_length=null)
Definition: class.ilStr.php:15
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ escapeText()

static ilICalWriter::escapeText (   $a_text)
static

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

References array.

Referenced by ilCalendarExport\createVEVENT().

40  {
41  $a_text = str_replace("\r\n", '\\n', $a_text);
42 
43  return preg_replace(
44  array(
45  '/\\\/',
46  '/;/',
47  '/,/',
48  ),
49  array(
50  '\\',
51  '\;',
52  '\,',
53  ),
54  $a_text
55  );
56  }
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 32 of file class.ilICalWriter.php.

Referenced by __toString().

◆ BEGIN_LINE_WHITESPACE

const ilICalWriter::BEGIN_LINE_WHITESPACE = ' '

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

◆ LINE_SIZE

const ilICalWriter::LINE_SIZE = 74

Definition at line 29 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: