本文整理汇总了PHP中ilXmlWriter::appendXML方法的典型用法代码示例。如果您正苦于以下问题:PHP ilXmlWriter::appendXML方法的具体用法?PHP ilXmlWriter::appendXML怎么用?PHP ilXmlWriter::appendXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilXmlWriter
的用法示例。
在下文中一共展示了ilXmlWriter::appendXML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toXML
/**
* Write webresource xml
* @param ilXmlWriter $writer
* @return
*/
public function toXML(ilXmlWriter $writer)
{
$attribs = array("obj_id" => "il_" . IL_INST_ID . "_webr_" . $this->getId());
$writer->xmlStartTag('WebLinks', $attribs);
// LOM MetaData
include_once 'Services/MetaData/classes/class.ilMD2XML.php';
$md2xml = new ilMD2XML($this->getId(), $this->getId(), 'webr');
$md2xml->startExport();
$writer->appendXML($md2xml->getXML());
// Sorting
include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
switch (ilContainerSortingSettings::_lookupSortMode($this->getId())) {
case ilContainer::SORT_MANUAL:
$writer->xmlElement('Sorting', array('type' => 'Manual'));
break;
case ilContainer::SORT_TITLE:
default:
$writer->xmlElement('Sorting', array('type' => 'Title'));
break;
}
// All links
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$links = new ilLinkResourceItems($this->getId());
$links->toXML($writer);
$writer->xmlEndTag('WebLinks');
return true;
}
示例2: toXml
/**
* Write xml of template action
* @param ilXmlWriter $writer
*/
public function toXml(ilXmlWriter $writer)
{
$writer->xmlStartTag('localRoleAction');
$il_id = 'il_' . IL_INST_ID . '_' . ilObject::_lookupType($this->getRoleTemplateId()) . '_' . $this->getRoleTemplateId();
$writer->xmlStartTag('roleTemplate', array('id' => $il_id));
include_once './Services/AccessControl/classes/class.ilRoleXmlExport.php';
$exp = new ilRoleXmlExport();
$exp->setMode(ilRoleXmlExport::MODE_DTPL);
$exp->addRole($this->getRoleTemplateId(), ROLE_FOLDER_ID);
$exp->write();
$writer->appendXML($exp->xmlDumpMem(FALSE));
$writer->xmlEndTag('roleTemplate');
$writer->xmlEndTag('localRoleAction');
}