\Horde_Data_Vnote

Implement the Horde_Data:: API for vNote data.

Provides a number of utility methods that vCard and iCalendar implementation can share and rely on.

Summary

Methods
Properties
Constants
importData()
exportData()
exportFile()
nextStep()
__construct()
importFile()
importUrl()
getNewline()
getFilename()
getContentType()
warnings()
cleanup()
$storage
No constants found
_mapDate()
$_iCal
$_browser
$_http
$_cleanupCallback
$_contentType
$_extension
$_vars
$_warnings
N/A
No private methods found
No private properties found
N/A

Properties

$_iCal

$_iCal : 

Type

$_browser

$_browser : \Horde_Browser

Browser object.

Type

\Horde_Browser

$_http

$_http : \Horde_Http_Client

HTTP client object.

Type

\Horde_Http_Client

$_cleanupCallback

$_cleanupCallback : callback

Cleanup callback function.

Type

callback

$_contentType

$_contentType : string

MIME content type.

Type

string

$_extension

$_extension : string

File extension.

Type

string

$_vars

$_vars : \Horde_Variables

Variables object.

Type

\Horde_Variables

$_warnings

$_warnings : array

A list of warnings raised during the last operation.

Type

array

Methods

importData()

importData(  $text) 

Stub to import passed data.

Parameters

$text

exportData()

exportData(array  $data, string  $method = 'REQUEST') : string

Exports vcalendar data as a string. Unlike vEvent, vNote data is not enclosed in BEGIN|END:vCalendar.

Parameters

array $data

An array containing Horde_Icalendar_Vnote objects.

string $method

The iTip method to use.

Returns

string —

The iCalendar data.

exportFile()

exportFile(  $filename,   $data) 

Stub to export data to a file.

Parameters

$filename
$data

nextStep()

nextStep(integer  $action, array  $param = array()) : mixed

Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.

Parameters

integer $action

The current step. One of the IMPORT_* constants.

array $param

An associative array containing needed parameters for the current step.

Throws

\Horde_Data_Exception

Returns

mixed —

Either the next step as an integer constant or imported data set after the final step.

__construct()

__construct(\Horde_Data_Storage  $storage, array  $params = array()) 

Constructor.

Parameters

\Horde_Data_Storage $storage
array $params

Optional parameters:

  • browser: (Horde_Browser) A browser object.
  • http: (Horde_Http_Client) A HTTP client object.
  • cleanup: (callback) A callback to call at cleanup time.
  • vars: (Horde_Variables) Form data.

importFile()

importFile(  $filename,   $header = false) 

Imports a file.

Parameters

$filename
$header

importUrl()

importUrl(  $url,   $header = false) 

Imports a URL.

Parameters

$url
$header

getNewline()

getNewline() : string

Tries to determine the expected newline character based on the platform information passed by the browser's agent header.

Returns

string —

The guessed expected newline characters, either \n, \r or \r\n.

getFilename()

getFilename(string  $basename) : string

Returns the full filename including the basename and extension.

Parameters

string $basename

Basename for the file.

Returns

string —

The file name.

getContentType()

getContentType() : string

Returns the content type.

Returns

string —

The content type.

warnings()

warnings() : array

Returns a list of warnings that have been raised during the last operation.

Returns

array —

A (possibly empty) list of warnings.

cleanup()

cleanup() : mixed

Removes any uploaded and moved files.

Returns

mixed —

If callback called, the return value of this call. This should be the value of the first import step.

_mapDate()

_mapDate(string  $date, string  $type, array  $params, integer  $key) : string

Maps a date/time string to an associative array.

Parameters

string $date

The date.

string $type

One of 'date', 'time' or 'datetime'.

array $params

Two-dimensional array with additional information about the formatting. Possible keys are:

  • delimiter: The character that seperates the different date/time parts.
  • format: If 'ampm' and $date contains a time we assume that it is in AM/PM format.
  • order: If $type is 'datetime' the order of the day and time parts: -1 (timestamp), 0 (day/time), 1 (time/day).
integer $key

The key to use for $params.

Returns

string —

The date or time in ISO format.