当前位置: 首页>>代码示例>>PHP>>正文


PHP ilXmlWriter类代码示例

本文整理汇总了PHP中ilXmlWriter的典型用法代码示例。如果您正苦于以下问题:PHP ilXmlWriter类的具体用法?PHP ilXmlWriter怎么用?PHP ilXmlWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ilXmlWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: toXml

 /**
  * Write xml
  * @param ilXmlWriter $writer
  */
 public function toXml(ilXmlWriter $writer)
 {
     switch ($this->getPatternSubType()) {
         case ilDidacticTemplateFilterPattern::PATTERN_SUBTYPE_REGEX:
         default:
             $writer->xmlElement('excludePattern', array('preg' => $this->getPattern()));
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilDidacticTemplateExcludeFilterPattern.php

示例2: _appendXMLByObjId

 /**
  * Get xml of object values
  *
  * @access public
  * @static
  * @param object instance of ilXmlWriter
  * @param int $a_obj_id
  */
 public static function _appendXMLByObjId(ilXmlWriter $xml_writer, $a_obj_id)
 {
     global $ilDB;
     $type = ilObject::_lookupType($a_obj_id);
     // Get active field_definitions
     $query = "SELECT field_id FROM adv_md_record amr " . "JOIN adv_md_record_objs amro ON amr.record_id = amro.record_id " . "JOIN adv_mdf_definition amfd ON amr.record_id = amfd.record_id " . "WHERE active = 1 " . "AND obj_type = " . $ilDB->quote($type, 'text') . " ";
     $xml_writer->xmlStartTag('AdvancedMetaData');
     $res = $ilDB->query($query);
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php';
         $value = ilAdvancedMDValue::_getInstance($a_obj_id, $row->field_id);
         $value->appendXML($xml_writer);
     }
     $xml_writer->xmlEndTag('AdvancedMetaData');
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:23,代码来源:class.ilAdvancedMDValues.php

示例3: __construct

 /**
  * Constructor
  *
  * @access public
  * @param
  * 
  */
 public function __construct($a_record_ids)
 {
     global $ilSetting;
     parent::ilXmlWriter();
     $this->settings = $ilSetting;
     $this->record_ids = $a_record_ids ? $a_record_ids : array();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:14,代码来源:class.ilAdvancedMDRecordXMLWriter.php

示例4: ilExerciseXMLWriter

 /**
  * constructor
  * @param	string	xml version
  * @param	string	output encoding
  * @param	string	input encoding
  * @access	public
  */
 function ilExerciseXMLWriter()
 {
     // @todo: needs to be revised for multiple assignments per exercise
     //die ("Needs revision for ILIAS 4.1");
     parent::ilXmlWriter();
     $this->attachFileContents = ilExerciseXMLWriter::$CONTENT_ATTACH_NO;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:14,代码来源:class.ilExerciseXMLWriter.php

示例5: ilObjectXMLWriter

 /**
  * constructor
  * @param	string	xml version
  * @param	string	output encoding
  * @param	string	input encoding
  * @access	public
  */
 function ilObjectXMLWriter()
 {
     global $ilias, $ilUser;
     parent::ilXmlWriter();
     $this->ilias =& $ilias;
     $this->user_id = $ilUser->getId();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:14,代码来源:class.ilObjectXMLWriter.php

示例6: ilCourseXMLWriter

 /**
  * constructor
  * @param	string	xml version
  * @param	string	output encoding
  * @param	string	input encoding
  * @access	public
  */
 function ilCourseXMLWriter(&$course_obj)
 {
     global $ilias;
     parent::ilXmlWriter();
     $this->EXPORT_VERSION = "2";
     $this->ilias =& $ilias;
     $this->course_obj =& $course_obj;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:15,代码来源:class.ilCourseXMLWriter.php

示例7: ilGroupXMLWriter

 /**
  * constructor
  * @param	string	xml version
  * @param	string	output encoding
  * @param	string	input encoding
  * @access	public
  */
 function ilGroupXMLWriter($group_obj)
 {
     global $ilias;
     parent::ilXmlWriter();
     $this->EXPORT_VERSION = "3";
     $this->ilias =& $ilias;
     $this->group_obj =& $group_obj;
     $this->participants = ilGroupParticipants::_getInstanceByObjId($this->group_obj->getId());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:16,代码来源:class.ilGroupXMLWriter.php

示例8: simpleExport

 public function simpleExport($orgu_ref_id)
 {
     $nodes = $this->getStructure($orgu_ref_id);
     $writer = new ilXmlWriter();
     $writer->xmlStartTag("OrgUnits");
     foreach ($nodes as $orgu_ref_id) {
         $orgu = new ilObjOrgUnit($orgu_ref_id);
         if ($orgu->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
             continue;
         }
         $attrs = $this->getAttrForOrgu($orgu);
         $writer->xmlStartTag("OrgUnit", $attrs);
         $writer->xmlElement("reference_id", null, $orgu->getRefId());
         $writer->xmlElement("external_id", null, $orgu->getImportId());
         $writer->xmlElement("title", null, $orgu->getTitle());
         $writer->xmlElement("description", null, $orgu->getDescription());
         $writer->xmlEndTag("OrgUnit");
     }
     $writer->xmlEndTag("OrgUnits");
     return $writer;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:21,代码来源:class.ilOrgUnitExporter.php

示例9: ilUserXMLWriter

 /**
  * constructor
  * @param	string	xml version
  * @param	string	output encoding
  * @param	string	input encoding
  * @access	public
  */
 function ilUserXMLWriter()
 {
     global $ilias, $ilUser;
     parent::ilXmlWriter();
     $this->ilias =& $ilias;
     $this->user_id = $ilUser->getId();
     $this->attachRoles = false;
     /*		$this->exportablePrefs = array(
     			"priv_feed_pass", "language", "style", "skin", 'ilPageEditor_HTMLMode',
     			 'ilPageEditor_JavaScript', 'ilPageEditor_MediaMode', 'tst_javascript', 
     			 'tst_lastquestiontype', 'tst_multiline_answers', 'tst_use_previous_answers',
     			'graphicalAnswerSetting', "weekstart" 				
     		);*/
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:21,代码来源:class.ilUserXMLWriter.php

示例10: ilnetucateXMLAPI

 /**
  * Constructor
  * @access	public
  */
 function ilnetucateXMLAPI()
 {
     global $ilias;
     define('ILINC_MEMBER_NOTSET', 'ilinc_notset');
     define('ILINC_MEMBER_DOCENT', 'ilinc_docent');
     define('ILINC_MEMBER_STUDENT', 'ilinc_student');
     parent::ilXmlWriter();
     $this->ilias =& $ilias;
     $this->reg_login = $this->ilias->getSetting("ilinc_registrar_login");
     $this->reg_passwd = $this->ilias->getSetting("ilinc_registrar_passwd");
     $this->customer_id = $this->ilias->getSetting("ilinc_customer_id");
     $this->server_scheme = $this->ilias->getSetting("ilinc_protocol");
     $this->server_addr = $this->ilias->getSetting("ilinc_server");
     $this->server_path = $this->ilias->getSetting("ilinc_path");
     $this->server_port = $this->ilias->getSetting("ilinc_port");
     $this->server_timeout = $this->ilias->getSetting("ilinc_timeout");
     $this->user_max_strlen = 32;
     // Max string length of full username (title + firstname + lastname)
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilnetucateXMLAPI.php

示例11: toXML

 /**
  * To Xml.
  * This method writes only the subset Record (including all fields)
  * Use class.ilAdvancedMDRecordXMLWriter to generate a complete xml presentation.
  *
  * @access public
  * @param object ilXmlWriter
  * 
  */
 public function toXML(ilXmlWriter $writer)
 {
     $writer->xmlStartTag('Record', array('active' => $this->isActive() ? 1 : 0, 'id' => $this->generateImportId()));
     $writer->xmlElement('Title', null, $this->getTitle());
     $writer->xmlElement('Description', null, $this->getDescription());
     foreach ($this->getAssignedObjectTypes() as $obj_type) {
         $writer->xmlElement('ObjectType', null, $obj_type);
     }
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
     foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($this->getRecordId()) as $definition) {
         $definition->toXML($writer);
     }
     $writer->xmlEndTag('Record');
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:23,代码来源:class.ilAdvancedMDRecord.php

示例12: toXML

 /**
  * Returns an xml representation of the question
  *
  * @return string The xml representation of the question
  * @access public
  */
 function toXML($a_include_header = TRUE, $obligatory_state = "")
 {
     include_once "./Services/Xml/classes/class.ilXmlWriter.php";
     $a_xml_writer = new ilXmlWriter();
     $a_xml_writer->xmlHeader();
     $this->insertXML($a_xml_writer, $a_include_header, $obligatory_state);
     $xml = $a_xml_writer->xmlDumpMem(FALSE);
     if (!$a_include_header) {
         $pos = strpos($xml, "?>");
         $xml = substr($xml, $pos + 2);
     }
     return $xml;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.SurveyMultipleChoiceQuestion.php

示例13: ilSoapInstallationInfoXMLWriter

 /**
  * constructor
  * @param	string	xml version
  * @param	string	output encoding
  * @param	string	input encoding
  * @access	public
  */
 function ilSoapInstallationInfoXMLWriter()
 {
     parent::ilXmlWriter();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:11,代码来源:class.ilSoapInstallationInfoXMLWriter.php

示例14: toXML

 /**
  * Returns a QTI xml representation of the question
  *
  * Returns a QTI xml representation of the question and sets the internal
  * domxml variable with the DOM XML representation of the QTI xml representation
  *
  * @return string The QTI xml representation of the question
  * @access public
  */
 function toXML($a_include_header = true, $a_include_binary = true, $a_shuffle = false, $test_output = false, $force_image_references = false)
 {
     global $ilias;
     include_once "./classes/class.ilXmlWriter.php";
     $a_xml_writer = new ilXmlWriter();
     // set xml header
     $a_xml_writer->xmlHeader();
     $a_xml_writer->xmlStartTag("questestinterop");
     $attrs = array("ident" => "il_" . IL_INST_ID . "_qst_" . $this->object->getId(), "title" => $this->object->getTitle());
     $a_xml_writer->xmlStartTag("item", $attrs);
     // add question description
     $a_xml_writer->xmlElement("qticomment", NULL, $this->object->getComment());
     // add estimated working time
     $workingtime = $this->object->getEstimatedWorkingTime();
     $duration = sprintf("P0Y0M0DT%dH%dM%dS", $workingtime["h"], $workingtime["m"], $workingtime["s"]);
     $a_xml_writer->xmlElement("duration", NULL, $duration);
     // add ILIAS specific metadata
     $a_xml_writer->xmlStartTag("itemmetadata");
     $a_xml_writer->xmlStartTag("qtimetadata");
     $a_xml_writer->xmlStartTag("qtimetadatafield");
     $a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
     $a_xml_writer->xmlElement("fieldentry", NULL, $ilias->getSetting("ilias_version"));
     $a_xml_writer->xmlEndTag("qtimetadatafield");
     $a_xml_writer->xmlStartTag("qtimetadatafield");
     $a_xml_writer->xmlElement("fieldlabel", NULL, "QUESTIONTYPE");
     $a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getQuestionType());
     $a_xml_writer->xmlEndTag("qtimetadatafield");
     $a_xml_writer->xmlStartTag("qtimetadatafield");
     $a_xml_writer->xmlElement("fieldlabel", NULL, "AUTHOR");
     $a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getAuthor());
     $a_xml_writer->xmlEndTag("qtimetadatafield");
     $a_xml_writer->xmlStartTag("qtimetadatafield");
     $a_xml_writer->xmlElement("fieldlabel", NULL, "points");
     $a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getPoints());
     $a_xml_writer->xmlEndTag("qtimetadatafield");
     $a_xml_writer->xmlStartTag("qtimetadatafield");
     $a_xml_writer->xmlElement("fieldlabel", NULL, "textrating");
     $a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getTextRating());
     $a_xml_writer->xmlEndTag("qtimetadatafield");
     $a_xml_writer->xmlStartTag("qtimetadatafield");
     $a_xml_writer->xmlElement("fieldlabel", NULL, "requestedanswers");
     $a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getCorrectAnswers());
     $a_xml_writer->xmlEndTag("qtimetadatafield");
     $a_xml_writer->xmlEndTag("qtimetadata");
     // removed additional metadata from assFormulaQuestion
     $a_xml_writer->xmlEndTag("itemmetadata");
     // PART I: qti presentation
     $attrs = array("label" => $this->object->getTitle());
     $a_xml_writer->xmlStartTag("presentation", $attrs);
     // add flow to presentation
     $a_xml_writer->xmlStartTag("flow");
     // add material with question text to presentation
     $this->object->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
     // add answers to presentation
     $attrs = array();
     $attrs = array("ident" => "SYNTAX TREE", "rcardinality" => "Multiple");
     $a_xml_writer->xmlStartTag("response_lid", $attrs);
     $solution = $this->object->getSuggestedSolution(0);
     if (count($solution)) {
         if (preg_match("/il_(\\d*?)_(\\w+)_(\\d+)/", $solution["internal_link"], $matches)) {
             $a_xml_writer->xmlStartTag("material");
             $intlink = "il_" . IL_INST_ID . "_" . $matches[2] . "_" . $matches[3];
             if (strcmp($matches[1], "") != 0) {
                 $intlink = $solution["internal_link"];
             }
             $attrs = array("label" => "suggested_solution");
             $a_xml_writer->xmlElement("mattext", $attrs, $intlink);
             $a_xml_writer->xmlEndTag("material");
         }
     }
     // shuffle output
     $attrs = array();
     $a_xml_writer->xmlStartTag("render_choice", $attrs);
     $answers =& $this->object->getAnswers();
     $akeys = array_keys($answers);
     if ($this->object->getShuffle() && $a_shuffle) {
         $akeys = $this->object->pcArrayShuffle($akeys);
     }
     // add answers
     foreach ($akeys as $index) {
         $answer = $answers[$index];
         $attrs = array("ident" => $index);
         $a_xml_writer->xmlStartTag("response_label", $attrs);
         $this->object->addQTIMaterial($a_xml_writer, $answer->getAnswertext());
         $a_xml_writer->xmlEndTag("response_label");
     }
     $a_xml_writer->xmlEndTag("render_choice");
     $a_xml_writer->xmlEndTag("response_lid");
     $a_xml_writer->xmlEndTag("flow");
     $a_xml_writer->xmlEndTag("presentation");
     // PART II: qti resprocessing
//.........这里部分代码省略.........
开发者ID:prometoys,项目名称:fourtree,代码行数:101,代码来源:class.SyntaxTreeExport.php

示例15: addPropertiesToXML

 protected function addPropertiesToXML(ilXmlWriter $a_writer)
 {
     $a_writer->xmlElement('FieldValue', array("id" => "min"), $this->getMin());
     $a_writer->xmlElement('FieldValue', array("id" => "max"), $this->getMax());
     $a_writer->xmlElement('FieldValue', array("id" => "suffix"), $this->getSuffix());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:6,代码来源:class.ilAdvancedMDFieldDefinitionInteger.php


注:本文中的ilXmlWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。