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/Migration/DBUpdate_5295/classes/class.ilMDIdentifier.php';
56 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDIdentifier.php';
58 if (!$a_identifier_id) {
62 $ide->setMetaId($a_identifier_id);
68 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDIdentifier.php';
72 $ide->setParentType(
'meta_general');
78 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguage.php';
84 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguage.php';
86 if (!$a_language_id) {
90 $lan->setMetaId($a_language_id);
96 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguage.php';
100 $lan->setParentType(
'meta_general');
106 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDDescription.php';
112 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDDescription.php';
115 if (!$a_description_id) {
119 $des->setMetaId($a_description_id);
125 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDDescription.php';
129 $des->setParentType(
'meta_general');
135 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDKeyword.php';
141 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDKeyword.php';
143 if (!$a_keyword_id) {
147 $key->setMetaId($a_keyword_id);
153 include_once
'Services/Migration/DBUpdate_5295/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'));
244 if ($this->db->insert(
'il_meta_general', $fields)) {
255 $ilDB = $DIC[
'ilDB'];
258 if ($this->db->update(
260 $this->__getFields(),
261 array(
"meta_general_id" => array(
'integer',$this->
getMetaId()))
269 public function delete()
273 $ilDB = $DIC[
'ilDB'];
303 $query =
"DELETE FROM il_meta_general " .
304 "WHERE meta_general_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
316 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
317 'obj_id' => array(
'integer',$this->
getObjId()),
318 'obj_type' => array(
'text',$this->
getObjType()),
319 'general_structure' => array(
'text',$this->
getStructure()),
320 'title' => array(
'text',$this->
getTitle()),
330 $ilDB = $DIC[
'ilDB'];
332 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
335 $query =
"SELECT * FROM il_meta_general " .
336 "WHERE meta_general_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
360 $writer->xmlStartTag(
'General', array(
'Structure' => $this->
getStructure() ?
367 $identifiers = array();
369 foreach ($identifiers as
$id) {
372 $ide->toXML($writer);
375 if (!count($identifiers)) {
376 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDIdentifier.php';
382 $ide->setExportMode(
true);
383 $ide->toXML($writer,
true);
399 $lan->toXML($writer);
403 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguage.php';
405 $lan->toXML($writer);
410 foreach ($descriptions as $id) {
412 $des->toXML($writer);
414 if (!count($descriptions)) {
416 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDDescription.php';
418 $des->toXML($writer);
424 foreach ($keywords as $id) {
426 $key->toXML($writer);
428 if (!count($keywords)) {
430 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDKeyword.php';
432 $key->toXML($writer);
445 $writer->xmlEndTag(
'General');
451 public static function _getId($a_rbac_id, $a_obj_id)
455 $ilDB = $DIC[
'ilDB'];
457 $query =
"SELECT meta_general_id FROM il_meta_general " .
458 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
459 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
464 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)