32 include_once
'class.ilMDBase.php';
36 function ilMDGeneral($a_rbac_id = 0,$a_obj_id = 0,$a_obj_type =
'')
44 $subs[
'Keyword'] =
'meta_keyword';
45 $subs[
'Language'] =
'meta_language';
46 $subs[
'Identifier'] =
'meta_identifier';
47 $subs[
'Description'] =
'meta_description';
56 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
62 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
69 $ide->setMetaId($a_identifier_id);
75 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
79 $ide->setParentType(
'meta_general');
85 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
91 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
98 $lan->setMetaId($a_language_id);
105 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
109 $lan->setParentType(
'meta_general');
115 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
121 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
124 if(!$a_description_id)
129 $des->setMetaId($a_description_id);
135 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
139 $des->setParentType(
'meta_general');
145 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
151 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
158 $key->setMetaId($a_keyword_id);
164 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
168 $key->setParentType(
'meta_general');
185 $this->structure = $a_structure;
194 return $this->structure;
198 $this->title = $a_title;
206 if(is_object($lng_obj))
208 $this->title_language = $lng_obj;
213 return is_object($this->title_language) ? $this->title_language :
false;
217 return is_object($this->title_language) ? $this->title_language->getLanguageCode() :
false;
222 $this->coverage = $a_coverage;
226 return $this->coverage;
231 if(is_object($lng_obj))
233 $this->coverage_language = $lng_obj;
238 return is_object($this->coverage_language) ? $this->coverage_language :
false;
242 return is_object($this->coverage_language) ? $this->coverage_language->getLanguageCode() :
false;
251 $fields[
'meta_general_id'] = array(
'integer',$next_id = $ilDB->nextId(
'il_meta_general'));
253 if($this->db->insert(
'il_meta_general',$fields))
267 if($this->db->update(
'il_meta_general',
268 $this->__getFields(),
269 array(
"meta_general_id" => array(
'integer',$this->
getMetaId()))))
315 $query =
"DELETE FROM il_meta_general ".
316 "WHERE meta_general_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
328 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
329 'obj_id' => array(
'integer',$this->
getObjId()),
330 'obj_type' => array(
'text',$this->
getObjType()),
331 'general_structure' => array(
'text',$this->
getStructure()),
332 'title' => array(
'text',$this->
getTitle()),
342 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
346 $query =
"SELECT * FROM il_meta_general ".
347 "WHERE meta_general_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
372 $writer->xmlStartTag(
'General',array(
'Structure' => $this->
getStructure() ?
379 $identifiers = array();
381 foreach($identifiers as $id)
385 $ide->toXML($writer);
388 if(!count($identifiers))
390 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
393 $ide->setExportMode(
true);
394 $ide->toXML($writer,
true);
405 foreach($languages as $id)
408 $lan->toXML($writer);
410 if(!count($languages))
413 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
415 $lan->toXML($writer);
420 foreach($descriptions as $id)
423 $des->toXML($writer);
425 if(!count($descriptions))
428 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
430 $des->toXML($writer);
436 foreach($keywords as $id)
439 $key->toXML($writer);
441 if(!count($keywords))
444 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
446 $key->toXML($writer);
457 $writer->xmlEndTag(
'General');
467 $query =
"SELECT meta_general_id FROM il_meta_general ".
468 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
469 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
475 return $row->meta_general_id;