squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

calendar_data.php File Reference

Go to the source code of this file.

Namespaces

 plugins
 

Functions

 calendar_readmultiline ($string)
 
 calendar_encodedata (&$sValue, $sKey)
 
 readcalendardata ()
 
 writecalendardata ()
 
 delete_event ($date, $time)
 
 update_event ($date, $time)
 

Variables

 $calendardata = array()
 

Function Documentation

◆ calendar_encodedata()

calendar_encodedata ( $sValue,
  $sKey 
)

Callback function used to sanitize calendar data before saving it to file

Parameters
string$sValuearray value
string$sKeyarray key @access private
Since
1.5.1 and 1.4.7

add html line breaks remove original ASCII line feeds and carriage returns replace ASCII vertical bar with html code in order to sanitize field delimiter

Definition at line 50 of file calendar_data.php.

◆ calendar_readmultiline()

calendar_readmultiline (   $string)

Reads multilined calendar data

Plugin stores multiline texts converted to single line with PHP nl2br(). Function undoes nl2br() conversion and html encoding of ASCII vertical bar.

Older plugin versions sanitized data with htmlspecialchars. Since 1.5.1 calendar data is not sanitized. Output functions must make sure that data is correctly encoded and sanitized.

Parameters
string$stringcalendar string
Returns
string calendar string converted to multiline text @access private
Since
1.5.1 and 1.4.7

replace html line breaks with ASCII line feeds replace htmlencoded | with ASCII vertical bar

Definition at line 34 of file calendar_data.php.

Referenced by readcalendardata().

◆ delete_event()

delete_event (   $date,
  $time 
)

deletes event from file

Returns
void @access private

Definition at line 135 of file calendar_data.php.

References $calendardata, $data_dir, $date, $filename, $username, getHashedFile(), and writecalendardata().

◆ readcalendardata()

readcalendardata ( )

read events into array

data is | delimited, just like addressbook files are structured like this: date|time|length|priority|title|message files are divided by year for performance increase

Definition at line 67 of file calendar_data.php.

References $calendardata, $data, $data_dir, $filename, $username, calendar_readmultiline(), and getHashedFile().

◆ update_event()

update_event (   $date,
  $time 
)

same as delete but does not save calendar saving is done inside event_edit.php

Returns
void @access private
Todo:
code reuse

Definition at line 164 of file calendar_data.php.

References $calendardata, $data_dir, $date, $filename, $username, and getHashedFile().

◆ writecalendardata()

writecalendardata ( )

Saves calendar data

Returns
void @access private

Make sure that reminder field is set. Calendar forms don't implement it, but it is still used for calendar data. Backwards compatibility.

Definition at line 100 of file calendar_data.php.

References $calendardata, $color, $data_dir, $filename, $username, _(), error_box(), getHashedFile(), and sq_fwrite().

Referenced by delete_event().

Variable Documentation

◆ $calendardata

$calendardata = array()

this is array that contains all events it is three dimensional array with fallowing structure $calendardata[date][time] = array(length,priority,title,message,reminder);

Definition at line 18 of file calendar_data.php.

Referenced by confirm_deletion(), confirm_update(), delete_event(), drawmonthview(), initialize_events(), readcalendardata(), update_event(), update_event_form(), and writecalendardata().