XML writer class. More...
Public Member Functions | |
ilSoapRoleObjectXMLWriter () | |
constructor | |
setObjects (&$roles) | |
setType ($type) | |
start () | |
getXML () | |
__buildHeader () | |
__buildFooter () | |
Data Fields | |
$ilias | |
$xml | |
$roles | |
$role_type | |
$user_id = 0 |
XML writer class.
Class to simplify manual writing of xml documents. It only supports writing xml sequentially, because the xml document is saved in a string with no additional structure information. The author is responsible for well-formedness and validity of the xml document.
Definition at line 40 of file class.ilSoapRoleObjectXMLWriter.php.
ilSoapRoleObjectXMLWriter::__buildFooter | ( | ) |
Definition at line 145 of file class.ilSoapRoleObjectXMLWriter.php.
References ilXmlWriter::xmlEndTag().
Referenced by start().
{ $this->xmlEndTag('Roles'); }
ilSoapRoleObjectXMLWriter::__buildHeader | ( | ) |
Definition at line 134 of file class.ilSoapRoleObjectXMLWriter.php.
References ilXmlWriter::xmlHeader(), ilXmlWriter::xmlSetDtdDef(), ilXmlWriter::xmlSetGenCmt(), and ilXmlWriter::xmlStartTag().
Referenced by start().
{ $this->xmlSetDtdDef("<!DOCTYPE Roles PUBLIC \"-//ILIAS//DTD ILIAS Roles//EN\" \"".ILIAS_HTTP_PATH."/xml/ilias_role_object_3_7.dtd\">"); $this->xmlSetGenCmt("Roles information of ilias system"); $this->xmlHeader(); $this->xmlStartTag('Roles'); return true; }
ilSoapRoleObjectXMLWriter::getXML | ( | ) |
Definition at line 128 of file class.ilSoapRoleObjectXMLWriter.php.
References ilXmlWriter::xmlDumpMem().
{ return $this->xmlDumpMem(FALSE); }
ilSoapRoleObjectXMLWriter::ilSoapRoleObjectXMLWriter | ( | ) |
constructor
string | xml version | |
string | output encoding | |
string | input encoding public |
Definition at line 55 of file class.ilSoapRoleObjectXMLWriter.php.
References $ilias, and ilXmlWriter::ilXmlWriter().
{ global $ilias,$ilUser; parent::ilXmlWriter(); $this->ilias =& $ilias; $this->user_id = $ilUser->getId(); }
ilSoapRoleObjectXMLWriter::setObjects | ( | &$ | roles | ) |
Definition at line 66 of file class.ilSoapRoleObjectXMLWriter.php.
References $roles.
{ $this->roles = & $roles; }
ilSoapRoleObjectXMLWriter::setType | ( | $ | type | ) |
Definition at line 71 of file class.ilSoapRoleObjectXMLWriter.php.
References $type.
{ $this->role_type = $type; }
ilSoapRoleObjectXMLWriter::start | ( | ) |
Definition at line 77 of file class.ilSoapRoleObjectXMLWriter.php.
References $ref_id, __buildFooter(), __buildHeader(), ilUtil::__extractRefId(), ilObjRole::_getTranslation(), ilXmlWriter::xmlElement(), ilXmlWriter::xmlEndTag(), and ilXmlWriter::xmlStartTag().
{ if (!is_array($this->roles)) return false; $this->__buildHeader(); include_once './classes/class.ilObjRole.php'; foreach ($this->roles as $role) { // if role type is not empty and does not match, then continue; if (!empty($this->role_type) && strcasecmp ($this->role_type, $role["role_type"]) != 0 ) { continue; } $attrs = array( 'role_type' => ucwords($role["role_type"]), 'id' => $role["obj_id"]); // open tag $this->xmlStartTag("Role", $attrs); $this->xmlElement('Title',null, $role["title"]); $this->xmlElement('Description',null, $role["description"]); $this->xmlElement('Translation',null,ilObjRole::_getTranslation($role["title"])); if ($ref_id = ilUtil::__extractRefId($role["title"])) { $ownerObj = IlObjectFactory::getInstanceByRefId($ref_id, false); if (is_object($ownerObj)) { $attrs = array ("obj_id" => $ownerObj->getId(), "ref_id" => $ownerObj->getRefId(), "type" => $ownerObj->getType()); $this->xmlStartTag('AssignedObject', $attrs); $this->xmlElement ('Title', null, $ownerObj->getTitle()); $this->xmlElement ('Description', null, $ownerObj->getDescription()); $this->xmlEndTag ('AssignedObject', $attrs); } } $this->xmlEndTag ("Role"); } $this->__buildFooter(); return true; }
ilSoapRoleObjectXMLWriter::$ilias |
Definition at line 42 of file class.ilSoapRoleObjectXMLWriter.php.
Referenced by ilSoapRoleObjectXMLWriter().
ilSoapRoleObjectXMLWriter::$role_type |
Definition at line 45 of file class.ilSoapRoleObjectXMLWriter.php.
ilSoapRoleObjectXMLWriter::$roles |
Definition at line 44 of file class.ilSoapRoleObjectXMLWriter.php.
Referenced by setObjects().
ilSoapRoleObjectXMLWriter::$user_id = 0 |
Definition at line 46 of file class.ilSoapRoleObjectXMLWriter.php.
ilSoapRoleObjectXMLWriter::$xml |
Definition at line 43 of file class.ilSoapRoleObjectXMLWriter.php.