32 include_once
'class.ilMDBase.php';
38 $subs[
'Keyword'] =
'meta_keyword';
39 $subs[
'Language'] =
'meta_language';
40 $subs[
'Identifier'] =
'meta_identifier';
41 $subs[
'Description'] =
'meta_description';
50 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
56 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
58 if (!$a_identifier_id) {
62 $ide->setMetaId($a_identifier_id);
68 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
72 $ide->setParentType(
'meta_general');
78 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
84 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
86 if (!$a_language_id) {
90 $lan->setMetaId($a_language_id);
96 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
100 $lan->setParentType(
'meta_general');
106 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
112 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
115 if (!$a_description_id) {
119 $des->setMetaId($a_description_id);
125 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
129 $des->setParentType(
'meta_general');
135 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
141 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
143 if (!$a_keyword_id) {
147 $key->setMetaId($a_keyword_id);
153 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
157 $key->setParentType(
'meta_general');
167 switch ($a_structure) {
173 $this->structure = $a_structure;
182 return $this->structure;
186 $this->title = $a_title;
194 if (is_object($lng_obj)) {
195 $this->title_language = $lng_obj;
200 return is_object($this->title_language) ? $this->title_language :
false;
204 return is_object($this->title_language) ? $this->title_language->getLanguageCode() :
false;
209 $this->coverage = $a_coverage;
213 return $this->coverage;
218 if (is_object($lng_obj)) {
219 $this->coverage_language = $lng_obj;
224 return is_object($this->coverage_language) ? $this->coverage_language :
false;
228 return is_object($this->coverage_language) ? $this->coverage_language->getLanguageCode() :
false;
236 $ilDB = $DIC[
'ilDB'];
239 $fields[
'meta_general_id'] = array(
'integer',$next_id =
$ilDB->nextId(
'il_meta_general'));
241 $this->log->debug(
"Insert General " . print_r($fields,
true));
245 if ($this->db->insert(
'il_meta_general', $fields)) {
256 $ilDB = $DIC[
'ilDB'];
259 if ($this->db->update(
261 $this->__getFields(),
262 array(
"meta_general_id" => array(
'integer',$this->
getMetaId()))
270 public function delete()
274 $ilDB = $DIC[
'ilDB'];
304 $query =
"DELETE FROM il_meta_general " .
305 "WHERE meta_general_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
317 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
318 'obj_id' => array(
'integer',$this->
getObjId()),
319 'obj_type' => array(
'text',$this->
getObjType()),
320 'general_structure' => array(
'text',$this->
getStructure()),
321 'title' => array(
'text',$this->
getTitle()),
331 $ilDB = $DIC[
'ilDB'];
333 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
336 $query =
"SELECT * FROM il_meta_general " .
337 "WHERE meta_general_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
361 $writer->xmlStartTag(
'General', array(
'Structure' => $this->
getStructure() ?
368 $identifiers = array();
370 foreach ($identifiers as
$id) {
373 $ide->toXML($writer);
376 if (!count($identifiers)) {
377 include_once
'Services/MetaData/classes/class.ilMDIdentifier.php';
383 $ide->setExportMode(
true);
384 $ide->toXML($writer,
true);
400 $lan->toXML($writer);
404 include_once
'Services/MetaData/classes/class.ilMDLanguage.php';
406 $lan->toXML($writer);
411 foreach ($descriptions as $id) {
413 $des->toXML($writer);
415 if (!count($descriptions)) {
417 include_once
'Services/MetaData/classes/class.ilMDDescription.php';
419 $des->toXML($writer);
425 foreach ($keywords as $id) {
427 $key->toXML($writer);
429 if (!count($keywords)) {
431 include_once
'Services/MetaData/classes/class.ilMDKeyword.php';
433 $key->toXML($writer);
446 $writer->xmlEndTag(
'General');
452 public static function _getId($a_rbac_id, $a_obj_id)
456 $ilDB = $DIC[
'ilDB'];
458 $query =
"SELECT meta_general_id FROM il_meta_general " .
459 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
460 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
465 return $row->meta_general_id;
setCoverageLanguage(&$lng_obj)
setStructure($a_structure)
& getLanguage($a_language_id)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
& getKeyword($a_keyword_id)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
if(!array_key_exists('StateId', $_REQUEST)) $id
setMetaId($a_meta_id, $a_read_data=true)
foreach($_POST as $key=> $value) $res
& getIdentifier($a_identifier_id)
getCoverageLanguageCode()
setTitleLanguage(&$lng_obj)
& getDescription($a_description_id)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
static _getId($a_rbac_id, $a_obj_id)