Umfragen
xml Class Reference

Public Member Functions

 __construct ()
 import ($xml)
 imports an xml tree
 export ($objects)
 exports an xml tree

Private Member Functions

 insert_widget (widget $widget, SimpleXMLElement $parent)
 inserts a widget into a parent SimpleXMLElement
 insert_poll (poll $poll, SimpleXMLElement $parent)
 inserts poll into a parent SimpleXMLElement
 make_widget (SimpleXMLElement $sxe)
 makes an widget from a SimpleXMLElement
 make_poll (SimpleXMLElement $sxe)
 makes a poll from a SimpleXMLElement
 insert_option_list (object_list $list, SimpleXMLElement $parent)
 inserts the option_list into a parent SimpleXMLElement
 insert_widget_list (object_list $list, SimpleXMLElement $parent)
 inserts the widget_list of containers into a parent SimpleXMLElement
 string2bool ($str)
 converts a string to a bool. Used for bool values in import.
 bool2string ($bool)
 converts a bool to a string. Used for bool values in export.
 is_string_bool ($str)
 checks if the provided string is a bool.

Private Attributes

 $doc
 SimpleXMLElement object for internal processing.

Detailed Description

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

Constructor & Destructor Documentation

__construct ( )

Definition at line 37 of file xml.class.php.

Member Function Documentation

bool2string (   $bool)
private

converts a bool to a string. Used for bool values in export.

Parameters
bool$bool
Returns
string "true" or "false"
See Also
xml::string2bool()

Definition at line 323 of file xml.class.php.

export (   $objects)

exports an xml tree

Parameters
mixed$objectscan be a poll objetc, a widget object or an array of widgets or polls
Returns
string XML tree or empty string on failure.

Definition at line 80 of file xml.class.php.

import (   $xml)

imports an xml tree

Parameters
string$xmlxml tree as string can have a widget_list a poll or a poll_list root element
Returns
array of widgets or polls or single poll object

Definition at line 47 of file xml.class.php.

insert_option_list ( object_list  $list,
SimpleXMLElement  $parent 
)
private

inserts the option_list into a parent SimpleXMLElement

Parameters
array$listof widgets
SimpleXMLElement$parent

Definition at line 283 of file xml.class.php.

insert_poll ( poll  $poll,
SimpleXMLElement  $parent 
)
private

inserts poll into a parent SimpleXMLElement

Parameters
poll$pollpoll object
SimpleXMLElement$parentthe parent SimpleXMLElement (eg poll_list)

Definition at line 153 of file xml.class.php.

insert_widget ( widget  $widget,
SimpleXMLElement  $parent 
)
private

inserts a widget into a parent SimpleXMLElement

Parameters
widget$widgetto be instrted
SimpleXMLElement$parentthe parent SimpleXMLElement (eg option_list or widget_list)

Definition at line 110 of file xml.class.php.

insert_widget_list ( object_list  $list,
SimpleXMLElement  $parent 
)
private

inserts the widget_list of containers into a parent SimpleXMLElement

Parameters
array$listof widgets
SimpleXMLElement$parent

Definition at line 295 of file xml.class.php.

is_string_bool (   $str)
private

checks if the provided string is a bool.

See Also
xml::bool2string()
xml::string2bool()
Parameters
string$str
Returns
bool

Definition at line 338 of file xml.class.php.

make_poll ( SimpleXMLElement  $sxe)
private

makes a poll from a SimpleXMLElement

Parameters
SimpleXMLElement$sxe
Returns
poll
Exceptions
Exceptionwhen there was no handler for the version of the XML tree (<poll version="">)

Definition at line 242 of file xml.class.php.

make_widget ( SimpleXMLElement  $sxe)
private

makes an widget from a SimpleXMLElement

Parameters
SimpleXMLElement$sxe
Returns
widget
Exceptions
Exceptionwhen there was no handler for the version of the XML tree (<widget version="">)

Definition at line 188 of file xml.class.php.

string2bool (   $str)
private

converts a string to a bool. Used for bool values in import.

Parameters
string$streither TRUE or FALSE
Returns
bool
See Also
xml::bool2string()

Definition at line 309 of file xml.class.php.

Field Documentation

$doc
private

SimpleXMLElement object for internal processing.

Definition at line 35 of file xml.class.php.


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