function toXML(&$writer)
 {
     if ($this->getMetaDataScheme()) {
         $attr['MetadataScheme'] = $this->getMetaDataScheme();
     }
     if ($this->getLanguageCode()) {
         $attr['Language'] = $this->getLanguageCode();
     }
     $writer->xmlStartTag('Meta-Metadata', $attr ? $attr : null);
     // ELEMENT IDENTIFIER
     $identifiers = $this->getIdentifierIds();
     foreach ($identifiers as $id) {
         $ide =& $this->getIdentifier($id);
         $ide->toXML($writer);
     }
     if (!count($identifiers)) {
         include_once 'Services/Metadata/classes/class.ilMDIdentifier.php';
         $ide = new ilMDIdentifier($this->getRBACId(), $this->getObjId());
         $ide->toXML($writer);
     }
     // ELEMETN Contribute
     $contributes = $this->getContributeIds();
     foreach ($contributes as $id) {
         $con =& $this->getContribute($id);
         $con->toXML($writer);
     }
     if (!count($contributes)) {
         include_once 'Services/MetaData/classes/class.ilMDContribute.php';
         $con = new ilMDContribute($this->getRBACId(), $this->getObjId());
         $con->toXML($writer);
     }
     $writer->xmlEndTag('Meta-Metadata');
 }
示例#2
0
 /**
  * test contribute
  * @group IL_Init
  * @return
  */
 public function testContribute()
 {
     include_once './Services/MetaData/classes/class.ilMDContribute.php';
     include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
     $con = new ilMDContribute(1, 2, 'xxx');
     $con->setDate('date');
     $con->setRole('ScriptWriter');
     $ret = $con->save();
     $this->assertGreaterThan(0, $ret);
     $con->setDate('desc2');
     $con->update();
     $con->read();
     $desc = $con->getDate();
     $this->assertEquals('desc2', $desc);
     $con->delete();
 }
示例#3
0
 function toXML(&$writer)
 {
     $writer->xmlStartTag('Lifecycle', array('Status' => $this->getStatus() ? $this->getStatus() : 'Draft'));
     $writer->xmlElement('Version', array('Language' => $this->getVersionLanguageCode() ? $this->getVersionLanguageCode() : 'en'), $this->getVersion());
     // contribute
     $contributes = $this->getContributeIds();
     foreach ($contributes as $id) {
         $con =& $this->getContribute($id);
         $con->toXML($writer);
     }
     if (!count($contributes)) {
         include_once 'Services/MetaData/classes/class.ilMDContribute.php';
         $con = new ilMDContribute($this->getRBACId(), $this->getObjId());
         $con->toXML($writer);
     }
     $writer->xmlEndTag('Lifecycle');
 }
 function &getContributeIds()
 {
     include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDContribute.php';
     return ilMDContribute::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_lifecycle');
 }
 /**
  * Fill html meta tags
  *
  * @access public
  * @static
  *
  * @param int rbac_id
  * @param int obj_id
  * @param string obj type
  */
 public static function _fillHTMLMetaTags($a_rbac_id, $a_obj_id, $a_type)
 {
     global $tpl, $ilObjDataCache;
     include_once 'Services/MetaData/classes/class.ilMDKeyword.php';
     foreach (ilMDKeyword::_getKeywordsByLanguageAsString($a_rbac_id, $a_obj_id, $a_type) as $lng_code => $key_string) {
         $tpl->setCurrentBlock('mh_meta_item');
         $tpl->setVariable('MH_META_NAME', 'keywords');
         $tpl->setVariable('MH_META_LANG', $lng_code);
         $tpl->setVariable('MH_META_CONTENT', $key_string);
         $tpl->parseCurrentBlock();
     }
     include_once 'Services/MetaData/classes/class.ilMDContribute.php';
     foreach (ilMDContribute::_lookupAuthors($a_rbac_id, $a_obj_id, $a_type) as $author) {
         $tpl->setCurrentBlock('mh_meta_item');
         $tpl->setVariable('MH_META_NAME', 'author');
         $tpl->setVariable('MH_META_CONTENT', $author);
         $tpl->parseCurrentBlock();
     }
 }