32 include_once
'Services/MetaData/classes/class.ilMD.php';
33 include_once
'Services/MetaData/classes/class.ilMDUtilSelect.php';
35 define(
'IL_TLT_MAX_HOURS',99);
55 $this->md_obj =&
new ilMD($a_rbac_id,$a_obj_id,$a_obj_type);
59 $this->lng->loadLanguageModule(
'meta');
61 include_once(
'Services/MetaData/classes/class.ilMDSettings.php');
66 $this->tabs_gui =& $ilTabs;
74 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
93 include_once
'Services/MetaData/classes/class.ilMD2XML.php';
96 $xml_writer =&
new ilMD2XML($this->md_obj->getRBACId(),$this->md_obj->getObjId(),$this->md_obj->getObjType());
99 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
103 $this->tpl->setVariable(
"MD_CONTENT",htmlentities($xml_writer->getXML()));
114 if(!is_object($this->md_section = $this->md_obj->getGeneral()))
116 $this->md_section = $this->md_obj->addGeneral();
117 $this->md_section->save();
120 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
124 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_quick_edit_scorm.html',
'Services/MetaData');
126 $this->ctrl->setReturn($this,
'listGeneral');
127 $this->ctrl->setParameter($this,
'section',
'meta_general');
128 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
130 $this->tpl->setVariable(
"TXT_QUICK_EDIT", $this->lng->txt(
"meta_quickedit"));
131 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
132 $this->tpl->setVariable(
"TXT_KEYWORD", $this->lng->txt(
"meta_keyword"));
133 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
134 $this->tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
138 foreach($ids = $this->md_section->getLanguageIds() as $id)
140 $md_lan = $this->md_section->getLanguage($id);
144 $this->tpl->setCurrentBlock(
"language_head");
145 $this->tpl->setVariable(
"ROWSPAN_LANG", count($ids));
146 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
147 $this->tpl->parseCurrentBlock();
153 $this->ctrl->setParameter($this,
'meta_index',$id);
154 $this->ctrl->setParameter($this,
'meta_path',
'meta_language');
156 $this->tpl->setCurrentBlock(
"language_delete");
157 $this->tpl->setVariable(
"LANGUAGE_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
158 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
159 $this->tpl->parseCurrentBlock();
161 $this->tpl->setCurrentBlock(
"language_loop");
162 $this->tpl->setVariable(
"LANGUAGE_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
'gen_language['.$id.
'][language]',
163 $md_lan->getLanguageCode()));
164 $this->tpl->parseCurrentBlock();
169 $this->tpl->setCurrentBlock(
"language_head");
170 $this->tpl->setVariable(
"ROWSPAN_LANG", 1);
171 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
172 $this->tpl->parseCurrentBlock();
173 $this->tpl->setCurrentBlock(
"language_loop");
174 $this->tpl->setVariable(
"LANGUAGE_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
'gen_language[][language]',
176 $this->tpl->parseCurrentBlock();
180 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
183 $this->md_section->getTitleLanguageCode()));
186 foreach($ids = $this->md_section->getDescriptionIds() as $id)
188 $md_des = $this->md_section->getDescription($id);
192 $this->ctrl->setParameter($this,
'meta_index',$id);
193 $this->ctrl->setParameter($this,
'meta_path',
'meta_description');
195 $this->tpl->setCurrentBlock(
"description_delete");
196 $this->tpl->setVariable(
"DESCRIPTION_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
197 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
198 $this->tpl->parseCurrentBlock();
201 $this->tpl->setCurrentBlock(
"description_loop");
202 $this->tpl->setVariable(
"DESCRIPTION_LOOP_NO",$id);
203 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
204 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
206 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
207 $this->tpl->setVariable(
"DESCRIPTION_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"gen_description[".$id.
'][language]',
208 $md_des->getDescriptionLanguageCode()));
209 $this->tpl->parseCurrentBlock();
215 foreach($ids = $this->md_section->getKeywordIds() as $id)
217 $md_key = $this->md_section->getKeyword($id);
218 $keywords[$md_key->getKeywordLanguageCode()][]
219 = $md_key->getKeyword();
222 foreach($keywords as
$lang => $keyword_set)
226 $this->tpl->setCurrentBlock(
"keyword_head");
227 $this->tpl->setVariable(
"ROWSPAN_KEYWORD", count($keywords));
228 $this->tpl->setVariable(
"TXT_COMMA_SEP2",$this->lng->txt(
'comma_separated'));
229 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt(
"keywords"));
230 $this->tpl->parseCurrentBlock();
234 $this->tpl->setCurrentBlock(
"keyword_loop");
236 implode($keyword_set,
", ")));
237 $this->tpl->setVariable(
"LANG",
$lang);
238 $this->tpl->setVariable(
"KEYWORD_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"keyword[language][$lang]",
240 $this->tpl->parseCurrentBlock();
243 if (count($keywords) == 0)
245 $this->tpl->setCurrentBlock(
"keyword_head");
246 $this->tpl->setVariable(
"ROWSPAN_KEYWORD", 1);
247 $this->tpl->setVariable(
"TXT_COMMA_SEP2",$this->lng->txt(
'comma_separated'));
248 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt(
"keywords"));
249 $this->tpl->parseCurrentBlock();
250 $this->tpl->setCurrentBlock(
"keyword_loop");
251 $this->tpl->setVariable(
"KEYWORD_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"keyword[language][$lang]",
257 $this->tpl->setVariable(
"TXT_EXPERTS",$lng->txt(
'meta_subjectmatterexpert'));
258 $this->tpl->setVariable(
"TXT_COMMA_SEP",$this->lng->txt(
'comma_separated'));
259 $this->tpl->setVariable(
"TXT_SCOPROP_EXPERT",$this->lng->txt(
'sco_propagate'));
260 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
262 $sep = $ent_str =
"";
263 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
265 $md_con = $this->md_section->getContribute($con_id);
266 if ($md_con->getRole() ==
"SubjectMatterExpert")
268 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
270 $md_ent = $md_con->getEntity($ent_id);
271 $ent_str = $ent_str.$sep.$md_ent->getEntity();
279 $this->tpl->setVariable(
"TXT_DESIGNERS",$lng->txt(
'meta_instructionaldesigner'));
280 $this->tpl->setVariable(
"TXT_SCOPROP_DESIGNERS",$this->lng->txt(
'sco_propagate'));
281 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
283 $sep = $ent_str =
"";
284 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
286 $md_con = $this->md_section->getContribute($con_id);
287 if ($md_con->getRole() ==
"InstructionalDesigner")
289 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
291 $md_ent = $md_con->getEntity($ent_id);
292 $ent_str = $ent_str.$sep.$md_ent->getEntity();
300 $this->tpl->setVariable(
"TXT_POC",$lng->txt(
'meta_pointofcontact'));
301 $this->tpl->setVariable(
"TXT_SCOPROP_POC",$this->lng->txt(
'sco_propagate'));
302 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
304 $sep = $ent_str =
"";
305 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
307 $md_con = $this->md_section->getContribute($con_id);
308 if ($md_con->getRole() ==
"PointOfContact")
310 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
312 $md_ent = $md_con->getEntity($ent_id);
313 $ent_str = $ent_str.$sep.$md_ent->getEntity();
321 $this->tpl->setVariable(
"TXT_STATUS",$this->lng->txt(
'meta_status'));
322 if(!is_object($this->md_section = $this->md_obj->getLifecycle()))
324 $this->md_section = $this->md_obj->addLifecycle();
325 $this->md_section->save();
327 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
331 array(0 => $this->lng->txt(
'meta_please_select'))));
337 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionGUI.php');
340 $this->md_obj->getRBACId(),
341 $this->md_obj->getObjId());
357 #if(is_object($this->md_section = $this->md_obj->getEducational()))
359 # $this->tpl->setVariable("VAL_TYPICAL_LEARN_TIME", ilUtil::prepareFormOutput($this->md_section->getTypicalLearningTime()));
362 $tlt = array(0,0,0,0,0);
364 if(is_object($this->md_section = $this->md_obj->getEducational()))
366 include_once
'Services/MetaData/classes/class.ilMDUtils.php';
370 if(strlen($this->md_section->getTypicalLearningTime()))
372 $tlt = array(0,0,0,0,0);
377 $this->tpl->setVariable(
"TXT_MONTH",$this->lng->txt(
'md_months'));
381 $this->tpl->setVariable(
"TXT_DAYS",$this->lng->txt(
'md_days'));
382 $this->tpl->setVariable(
"TXT_TIME",$this->lng->txt(
'md_time'));
384 $this->tpl->setVariable(
"TXT_TYPICAL_LEARN_TIME",$this->lng->txt(
'meta_typical_learning_time'));
386 $tlt[2],$tlt[3],$tlt[4],
388 $this->tpl->setVariable(
"TLT_HINT",$tlt[4] ?
'(hh:mm:ss)' :
'(hh:mm)');
392 $this->tpl->setCurrentBlock(
"tlt_not_valid");
393 $this->tpl->setVariable(
"TXT_CURRENT_VAL",$this->lng->txt(
'meta_current_value'));
394 $this->tpl->setVariable(
"TLT",$this->md_section->getTypicalLearningTime());
395 $this->tpl->setVariable(
"INFO_TLT_NOT_VALID",$this->lng->txt(
'meta_info_tlt_not_valid'));
396 $this->tpl->parseCurrentBlock();
400 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save'));
406 if(!is_object($this->md_section = $this->md_obj->getGeneral()))
408 $this->md_section = $this->md_obj->addGeneral();
409 $this->md_section->save();
412 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
416 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_quick_edit.html',
'Services/MetaData');
418 $this->ctrl->setReturn($this,
'listGeneral');
419 $this->ctrl->setParameter($this,
'section',
'meta_general');
420 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
422 $this->tpl->setVariable(
"TXT_QUICK_EDIT", $this->lng->txt(
"meta_quickedit"));
423 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
424 $this->tpl->setVariable(
"TXT_KEYWORD", $this->lng->txt(
"meta_keyword"));
425 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
426 $this->tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
430 foreach($ids = $this->md_section->getLanguageIds() as $id)
432 $md_lan = $this->md_section->getLanguage($id);
436 $this->tpl->setCurrentBlock(
"language_head");
437 $this->tpl->setVariable(
"ROWSPAN_LANG", count($ids));
438 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
439 $this->tpl->parseCurrentBlock();
445 $this->ctrl->setParameter($this,
'meta_index',$id);
446 $this->ctrl->setParameter($this,
'meta_path',
'meta_language');
448 $this->tpl->setCurrentBlock(
"language_delete");
449 $this->tpl->setVariable(
"LANGUAGE_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
450 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
451 $this->tpl->parseCurrentBlock();
453 $this->tpl->setCurrentBlock(
"language_loop");
454 $this->tpl->setVariable(
"LANGUAGE_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
'gen_language['.$id.
'][language]',
455 $md_lan->getLanguageCode()));
456 $this->tpl->parseCurrentBlock();
461 $this->tpl->setCurrentBlock(
"language_head");
462 $this->tpl->setVariable(
"ROWSPAN_LANG", 1);
463 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
464 $this->tpl->parseCurrentBlock();
465 $this->tpl->setCurrentBlock(
"language_loop");
466 $this->tpl->setVariable(
"LANGUAGE_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
'gen_language[][language]',
468 $this->tpl->parseCurrentBlock();
472 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
475 $this->md_section->getTitleLanguageCode()));
478 foreach($ids = $this->md_section->getDescriptionIds() as $id)
480 $md_des = $this->md_section->getDescription($id);
484 $this->ctrl->setParameter($this,
'meta_index',$id);
485 $this->ctrl->setParameter($this,
'meta_path',
'meta_description');
487 $this->tpl->setCurrentBlock(
"description_delete");
488 $this->tpl->setVariable(
"DESCRIPTION_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
489 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
490 $this->tpl->parseCurrentBlock();
493 $this->tpl->setCurrentBlock(
"description_loop");
494 $this->tpl->setVariable(
"DESCRIPTION_LOOP_NO",$id);
495 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
496 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
498 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
499 $this->tpl->setVariable(
"DESCRIPTION_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"gen_description[".$id.
'][language]',
500 $md_des->getDescriptionLanguageCode()));
501 $this->tpl->parseCurrentBlock();
507 foreach($ids = $this->md_section->getKeywordIds() as $id)
509 $md_key = $this->md_section->getKeyword($id);
510 if (trim($md_key->getKeyword()) !=
"")
512 $keywords[$md_key->getKeywordLanguageCode()][]
513 = $md_key->getKeyword();
517 foreach($keywords as
$lang => $keyword_set)
521 $this->tpl->setCurrentBlock(
"keyword_head");
522 $this->tpl->setVariable(
"ROWSPAN_KEYWORD", count($keywords));
523 $this->tpl->setVariable(
"TXT_COMMA_SEP2",
524 sprintf($this->lng->txt(
'md_separated_by'), $this->md_settings->getDelimiter()));
525 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt(
"keywords"));
526 $this->tpl->parseCurrentBlock();
530 $this->tpl->setCurrentBlock(
"keyword_loop");
532 implode($keyword_set, $this->md_settings->getDelimiter().
" ")));
533 $this->tpl->setVariable(
"LANG",
$lang);
534 $this->tpl->setVariable(
"KEYWORD_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"keyword[language][$lang]",
536 $this->tpl->parseCurrentBlock();
539 if (count($keywords) == 0)
541 $this->tpl->setCurrentBlock(
"keyword_head");
542 $this->tpl->setVariable(
"ROWSPAN_KEYWORD", 1);
543 $this->tpl->setVariable(
"TXT_COMMA_SEP2",
544 sprintf($this->lng->txt(
'md_separated_by'), $this->md_settings->getDelimiter()));
545 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt(
"keywords"));
546 $this->tpl->parseCurrentBlock();
547 $this->tpl->setCurrentBlock(
"keyword_loop");
548 $this->tpl->setVariable(
"KEYWORD_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"keyword[language][$lang]",
554 $this->tpl->setVariable(
"TXT_AUTHORS",$this->lng->txt(
'authors'));
555 $this->tpl->setVariable(
"TXT_COMMA_SEP",
556 sprintf($this->lng->txt(
'md_separated_by'), $this->md_settings->getDelimiter()));
557 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
559 $sep = $ent_str =
"";
560 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
562 $md_con = $this->md_section->getContribute($con_id);
563 if ($md_con->getRole() ==
"Author")
565 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
567 $md_ent = $md_con->getEntity($ent_id);
568 $ent_str = $ent_str.$sep.$md_ent->getEntity();
569 $sep = $this->md_settings->getDelimiter().
" ";
580 include_once(
'Services/MetaData/classes/class.ilMDCopyrightSelectionGUI.php');
583 $this->md_obj->getRBACId(),
584 $this->md_obj->getObjId());
600 #if(is_object($this->md_section = $this->md_obj->getEducational()))
602 # $this->tpl->setVariable("VAL_TYPICAL_LEARN_TIME", ilUtil::prepareFormOutput($this->md_section->getTypicalLearningTime()));
605 $tlt = array(0,0,0,0,0);
607 if(is_object($this->md_section = $this->md_obj->getEducational()))
609 include_once
'Services/MetaData/classes/class.ilMDUtils.php';
613 if(strlen($this->md_section->getTypicalLearningTime()))
615 $tlt = array(0,0,0,0,0);
620 $this->tpl->setVariable(
"TXT_MONTH",$this->lng->txt(
'md_months'));
624 $this->tpl->setVariable(
"TXT_DAYS",$this->lng->txt(
'md_days'));
625 $this->tpl->setVariable(
"TXT_TIME",$this->lng->txt(
'md_time'));
627 $this->tpl->setVariable(
"TXT_TYPICAL_LEARN_TIME",$this->lng->txt(
'meta_typical_learning_time'));
629 $tlt[2],$tlt[3],$tlt[4],
631 $this->tpl->setVariable(
"TLT_HINT",$tlt[4] ?
'(hh:mm:ss)' :
'(hh:mm)');
635 $this->tpl->setCurrentBlock(
"tlt_not_valid");
636 $this->tpl->setVariable(
"TXT_CURRENT_VAL",$this->lng->txt(
'meta_current_value'));
637 $this->tpl->setVariable(
"TLT",$this->md_section->getTypicalLearningTime());
638 $this->tpl->setVariable(
"INFO_TLT_NOT_VALID",$this->lng->txt(
'meta_info_tlt_not_valid'));
639 $this->tpl->parseCurrentBlock();
643 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save'));
651 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
653 if(!trim(
$_POST[
'gen_title']))
661 $this->md_section = $this->md_obj->getGeneral();
664 $this->md_section->update();
667 if(is_array(
$_POST[
'gen_language']))
673 $md_lan = $this->md_section->getLanguage($id);
679 $md_lan = $this->md_section->addLanguage();
686 if(is_array(
$_POST[
'gen_description']))
690 $md_des = $this->md_section->getDescription($id);
699 if(is_array(
$_POST[
"keywords"][
"value"]))
701 $new_keywords = array();
702 foreach(
$_POST[
"keywords"][
"value"] as
$lang => $keywords)
705 $keywords = explode($this->md_settings->getDelimiter(), $keywords);
706 foreach($keywords as $keyword)
708 $new_keywords[$language][] = trim($keyword);
713 foreach($ids = $this->md_section->getKeywordIds() as $id)
715 $md_key = $this->md_section->getKeyword($id);
717 $lang = $md_key->getKeywordLanguageCode();
720 if (is_array($new_keywords[
$lang]) &&
721 in_array($md_key->getKeyword(), $new_keywords[
$lang]))
723 unset($new_keywords[$lang]
724 [array_search($md_key->getKeyword(), $new_keywords[
$lang])]);
733 foreach ($new_keywords as
$lang => $key_arr)
735 foreach($key_arr as $keyword)
739 $md_key = $this->md_section->addKeyword();
751 if(
$_POST[
'copyright_id'] or
$_POST[
'rights_copyright'])
753 if(!is_object($this->md_section = $this->md_obj->getRights()))
755 $this->md_section = $this->md_obj->addRights();
756 $this->md_section->save();
758 if($_POST[
'copyright_id'])
760 $this->md_section->setCopyrightAndOtherRestrictions(
"Yes");
761 $this->md_section->setDescription(
'il_copyright_entry__'.IL_INST_ID.
'__'.(
int) $_POST[
'copyright_id']);
765 $this->md_section->setCopyrightAndOtherRestrictions(
"Yes");
768 $this->md_section->update();
772 if(is_object($this->md_section = $this->md_obj->getRights()))
774 $this->md_section->setCopyrightAndOtherRestrictions(
"No");
775 $this->md_section->setDescription(
"");
776 $this->md_section->update();
783 if($_POST[
'tlt'][
'mo'] or $_POST[
'tlt'][
'd'] or
784 $_POST[
"tlt"][
'h'] or $_POST[
'tlt'][
'm'] or $_POST[
'tlt'][
's'])
786 if(!is_object($this->md_section = $this->md_obj->getEducational()))
788 $this->md_section = $this->md_obj->addEducational();
789 $this->md_section->save();
791 $this->md_section->setPhysicalTypicalLearningTime($_POST[
'tlt'][
'mo'],$_POST[
'tlt'][
'd'],
792 $_POST[
'tlt'][
'h'],$_POST[
'tlt'][
'm'],$_POST[
'tlt'][
's']);
793 $this->md_section->update();
797 if(is_object($this->md_section = $this->md_obj->getEducational()))
799 $this->md_section->setPhysicalTypicalLearningTime(0,0,0,0,0);
800 $this->md_section->update();
806 if ($_POST[
"life_authors"] !=
"")
808 if(!is_object($this->md_section = $this->md_obj->getLifecycle()))
810 $this->md_section = $this->md_obj->addLifecycle();
811 $this->md_section->save();
815 $auth_arr = explode($this->md_settings->getDelimiter(), $_POST[
"life_authors"]);
816 for($i = 0; $i < count($auth_arr); $i++)
818 $auth_arr[$i] = trim($auth_arr[$i]);
824 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
826 $md_con = $this->md_section->getContribute($con_id);
827 if ($md_con->getRole() ==
"Author")
829 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
831 $md_ent = $md_con->getEntity($ent_id);
834 if (in_array($md_ent->getEntity(), $auth_arr))
836 unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr)]);
843 $md_con_author = $md_con;
848 if (count($auth_arr) > 0)
850 if (!is_object($md_con_author))
852 $md_con_author = $this->md_section->addContribute();
853 $md_con_author->setRole(
"Author");
854 $md_con_author->save();
856 foreach ($auth_arr as
$auth)
858 $md_ent = $md_con_author->addEntity();
866 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
868 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
870 $md_con = $this->md_section->getContribute($con_id);
871 if ($md_con->getRole() ==
"Author")
883 $this->ctrl->redirect($this,
'listSection');
889 $module_id = $this->md_obj->obj_id;
890 if($this->md_obj->obj_type==
'sco')
891 $module_id = $this->md_obj->rbac_id;
892 $tree =
new ilTree($module_id);
893 $tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
894 $tree->setTreeTablePK(
"slm_id");
895 foreach($tree->getSubTree($tree->getNodeData($tree->getRootId()),
true,
'sco') as $sco)
897 $sco_md =
new ilMD($module_id,$sco[
'obj_id'],
'sco');
898 if (
$_POST[$request] !=
"")
901 if(!is_object($sco_md_section = $sco_md->getLifecycle()))
903 $sco_md_section = $sco_md->addLifecycle();
904 $sco_md_section->save();
907 $auth_arr = explode(
",",
$_POST[$request]);
908 for($i = 0; $i < count($auth_arr); $i++)
910 $auth_arr[$i] = trim($auth_arr[$i]);
916 foreach(($ids = $sco_md_section->getContributeIds()) as $con_id)
918 $md_con = $sco_md_section->getContribute($con_id);
919 if ($md_con->getRole() ==
$type)
921 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
923 $md_ent = $md_con->getEntity($ent_id);
926 if (in_array($md_ent->getEntity(), $auth_arr))
928 unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr)]);
935 $md_con_author = $md_con;
940 if (count($auth_arr) > 0)
942 if (!is_object($md_con_author))
944 $md_con_author = $sco_md_section->addContribute();
945 $md_con_author->setRole(
$type);
946 $md_con_author->save();
948 foreach ($auth_arr as
$auth)
950 $md_ent = $md_con_author->addEntity();
958 if(is_object($sco_md_section = $sco_md->getLifecycle()))
960 foreach(($ids = $sco_md_section->getContributeIds()) as $con_id)
962 $md_con = $sco_md_section->getContribute($con_id);
963 if ($md_con->getRole() ==
$type)
993 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
996 $this->md_section = $this->md_obj->getGeneral();
999 $this->md_section->update();
1002 if(is_array(
$_POST[
'gen_language']))
1008 $md_lan = $this->md_section->getLanguage($id);
1014 $md_lan = $this->md_section->addLanguage();
1021 if(is_array(
$_POST[
'gen_description']))
1023 foreach(
$_POST[
'gen_description'] as $id =>
$data)
1025 $md_des = $this->md_section->getDescription($id);
1034 if(is_array(
$_POST[
"keywords"][
"value"]))
1036 $new_keywords = array();
1037 foreach(
$_POST[
"keywords"][
"value"] as
$lang => $keywords)
1040 $keywords = explode(
",", $keywords);
1041 foreach($keywords as $keyword)
1043 $new_keywords[$language][] = trim($keyword);
1048 foreach($ids = $this->md_section->getKeywordIds() as $id)
1050 $md_key = $this->md_section->getKeyword($id);
1052 $lang = $md_key->getKeywordLanguageCode();
1055 if (is_array($new_keywords[
$lang]) &&
1056 in_array($md_key->getKeyword(), $new_keywords[
$lang]))
1058 unset($new_keywords[$lang]
1059 [array_search($md_key->getKeyword(), $new_keywords[
$lang])]);
1068 foreach ($new_keywords as
$lang => $key_arr)
1070 foreach($key_arr as $keyword)
1074 $md_key = $this->md_section->addKeyword();
1086 if(
$_POST[
'copyright_id'] or
$_POST[
'rights_copyright'])
1088 if(!is_object($this->md_section = $this->md_obj->getRights()))
1090 $this->md_section = $this->md_obj->addRights();
1091 $this->md_section->save();
1093 if($_POST[
'copyright_id'])
1095 $this->md_section->setCopyrightAndOtherRestrictions(
"Yes");
1096 $this->md_section->setDescription(
'il_copyright_entry__'.IL_INST_ID.
'__'.(
int) $_POST[
'copyright_id']);
1100 $this->md_section->setCopyrightAndOtherRestrictions(
"Yes");
1103 $this->md_section->update();
1107 if(is_object($this->md_section = $this->md_obj->getRights()))
1109 $this->md_section->setCopyrightAndOtherRestrictions(
"No");
1110 $this->md_section->setDescription(
"");
1111 $this->md_section->update();
1118 if($_POST[
'tlt'][
'mo'] or $_POST[
'tlt'][
'd'] or
1119 $_POST[
"tlt"][
'h'] or $_POST[
'tlt'][
'm'] or $_POST[
'tlt'][
's'])
1121 if(!is_object($this->md_section = $this->md_obj->getEducational()))
1123 $this->md_section = $this->md_obj->addEducational();
1124 $this->md_section->save();
1126 $this->md_section->setPhysicalTypicalLearningTime($_POST[
'tlt'][
'mo'],$_POST[
'tlt'][
'd'],
1127 $_POST[
'tlt'][
'h'],$_POST[
'tlt'][
'm'],$_POST[
'tlt'][
's']);
1128 $this->md_section->update();
1132 if(is_object($this->md_section = $this->md_obj->getEducational()))
1134 $this->md_section->setPhysicalTypicalLearningTime(0,0,0,0,0);
1135 $this->md_section->update();
1141 if ($_POST[
"life_experts"] !=
"")
1143 if(!is_object($this->md_section = $this->md_obj->getLifecycle()))
1145 $this->md_section = $this->md_obj->addLifecycle();
1146 $this->md_section->save();
1150 $auth_arr = explode(
",", $_POST[
"life_experts"]);
1151 for($i = 0; $i < count($auth_arr); $i++)
1153 $auth_arr[$i] = trim($auth_arr[$i]);
1156 $md_con_author =
"";
1159 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
1161 $md_con = $this->md_section->getContribute($con_id);
1162 if ($md_con->getRole() ==
"SubjectMatterExpert")
1164 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
1166 $md_ent = $md_con->getEntity($ent_id);
1169 if (in_array($md_ent->getEntity(), $auth_arr))
1171 unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr)]);
1178 $md_con_author = $md_con;
1183 if (count($auth_arr) > 0)
1185 if (!is_object($md_con_author))
1187 $md_con_author = $this->md_section->addContribute();
1188 $md_con_author->setRole(
"SubjectMatterExpert");
1189 $md_con_author->save();
1191 foreach ($auth_arr as
$auth)
1193 $md_ent = $md_con_author->addEntity();
1201 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
1203 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
1205 $md_con = $this->md_section->getContribute($con_id);
1206 if ($md_con->getRole() ==
"SubjectMatterExpert")
1216 if ($_POST[
"life_designers"] !=
"")
1218 if(!is_object($this->md_section = $this->md_obj->getLifecycle()))
1220 $this->md_section = $this->md_obj->addLifecycle();
1221 $this->md_section->save();
1225 $auth_arr = explode(
",", $_POST[
"life_designers"]);
1226 for($i = 0; $i < count($auth_arr); $i++)
1228 $auth_arr[$i] = trim($auth_arr[$i]);
1231 $md_con_author =
"";
1234 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
1236 $md_con = $this->md_section->getContribute($con_id);
1237 if ($md_con->getRole() ==
"InstructionalDesigner")
1239 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
1241 $md_ent = $md_con->getEntity($ent_id);
1244 if (in_array($md_ent->getEntity(), $auth_arr))
1246 unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr)]);
1253 $md_con_author = $md_con;
1258 if (count($auth_arr) > 0)
1260 if (!is_object($md_con_author))
1262 $md_con_author = $this->md_section->addContribute();
1263 $md_con_author->setRole(
"InstructionalDesigner");
1264 $md_con_author->save();
1266 foreach ($auth_arr as
$auth)
1268 $md_ent = $md_con_author->addEntity();
1276 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
1278 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
1280 $md_con = $this->md_section->getContribute($con_id);
1281 if ($md_con->getRole() ==
"InstructionalDesigner")
1291 if ($_POST[
"life_poc"] !=
"")
1293 if(!is_object($this->md_section = $this->md_obj->getLifecycle()))
1295 $this->md_section = $this->md_obj->addLifecycle();
1296 $this->md_section->save();
1300 $auth_arr = explode(
",", $_POST[
"life_poc"]);
1301 for($i = 0; $i < count($auth_arr); $i++)
1303 $auth_arr[$i] = trim($auth_arr[$i]);
1306 $md_con_author =
"";
1309 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
1311 $md_con = $this->md_section->getContribute($con_id);
1312 if ($md_con->getRole() ==
"PointOfContact")
1314 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
1316 $md_ent = $md_con->getEntity($ent_id);
1319 if (in_array($md_ent->getEntity(), $auth_arr))
1321 unset($auth_arr[array_search($md_ent->getEntity(), $auth_arr)]);
1328 $md_con_author = $md_con;
1333 if (count($auth_arr) > 0)
1335 if (!is_object($md_con_author))
1337 $md_con_author = $this->md_section->addContribute();
1338 $md_con_author->setRole(
"PointOfContact");
1339 $md_con_author->save();
1341 foreach ($auth_arr as
$auth)
1343 $md_ent = $md_con_author->addEntity();
1351 if(is_object($this->md_section = $this->md_obj->getLifecycle()))
1353 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
1355 $md_con = $this->md_section->getContribute($con_id);
1356 if ($md_con->getRole() ==
"PointOfContact")
1365 $this->md_section = $this->md_obj->getLifecycle();
1366 $this->md_section->setVersionLanguage(
new ilMDLanguageItem($_POST[
'lif_language']));
1368 $this->md_section->setStatus($_POST[
'lif_status']);
1369 $this->md_section->update();
1377 $this->ctrl->redirect($this,
'listSection');
1385 if(!is_object($this->md_section = $this->md_obj->getGeneral()))
1387 $this->md_section = $this->md_obj->addGeneral();
1388 $this->md_section->save();
1391 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
1395 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_general.html',
'Services/MetaData');
1397 $this->ctrl->setReturn($this,
'listGeneral');
1398 $this->ctrl->setParameter($this,
'section',
'meta_general');
1399 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
1403 $this->tpl->setVariable(
"TXT_GENERAL", $this->lng->txt(
"meta_general"));
1404 $this->tpl->setVariable(
"TXT_IDENTIFIER", $this->lng->txt(
"meta_identifier"));
1405 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
1406 $this->tpl->setVariable(
"TXT_KEYWORD", $this->lng->txt(
"meta_keyword"));
1407 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
1408 $this->tpl->setVariable(
"TXT_STRUCTURE", $this->lng->txt(
"meta_structure"));
1409 $this->tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
1410 $this->tpl->setVariable(
"TXT_ATOMIC", $this->lng->txt(
"meta_atomic"));
1411 $this->tpl->setVariable(
"TXT_COLLECTION", $this->lng->txt(
"meta_collection"));
1412 $this->tpl->setVariable(
"TXT_NETWORKED", $this->lng->txt(
"meta_networked"));
1413 $this->tpl->setVariable(
"TXT_HIERARCHICAL", $this->lng->txt(
"meta_hierarchical"));
1414 $this->tpl->setVariable(
"TXT_LINEAR", $this->lng->txt(
"meta_linear"));
1417 $this->tpl->setVariable(
"STRUCTURE_VAL_".strtoupper($this->md_section->getStructure()),
" selected=selected");
1421 foreach($ids = $this->md_section->getIdentifierIds() as $id)
1423 $md_ide = $this->md_section->getIdentifier($id);
1428 $this->tpl->setCurrentBlock(
"id_head");
1429 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt(
"meta_identifier"));
1430 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt(
"meta_catalog"));
1431 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt(
"meta_entry"));
1432 $this->tpl->setVariable(
"ROWSPAN_ID", count($ids));
1433 $this->tpl->parseCurrentBlock();
1439 $this->ctrl->setParameter($this,
'meta_index',$id);
1440 $this->ctrl->setParameter($this,
'meta_path',
'meta_identifier');
1442 if ($md_ide->getCatalog() !=
"ILIAS")
1444 $this->tpl->setCurrentBlock(
"identifier_delete");
1445 $this->tpl->setVariable(
"IDENTIFIER_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1446 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1447 $this->tpl->parseCurrentBlock();
1451 $this->tpl->setCurrentBlock(
"identifier_loop");
1452 if ($md_ide->getCatalog() ==
"ILIAS")
1454 $this->tpl->setVariable(
"DISABLE_IDENT",
' disabled="disabled" ');
1456 $this->tpl->setVariable(
"IDENTIFIER_LOOP_NO", $id);
1457 $this->tpl->setVariable(
"IDENTIFIER_LOOP_VAL_IDENTIFIER_CATALOG",
1459 $this->tpl->setVariable(
"IDENTIFIER_LOOP_VAL_IDENTIFIER_ENTRY",
1461 $this->tpl->parseCurrentBlock();
1467 foreach($ids = $this->md_section->getLanguageIds() as $id)
1469 $md_lan = $this->md_section->getLanguage($id);
1473 $this->tpl->setCurrentBlock(
"language_head");
1474 $this->tpl->setVariable(
"ROWSPAN_LANG", count($ids));
1475 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
1476 $this->tpl->parseCurrentBlock();
1480 if (count($ids) > 1)
1482 $this->ctrl->setParameter($this,
'meta_index',$id);
1483 $this->ctrl->setParameter($this,
'meta_path',
'meta_language');
1485 $this->tpl->setCurrentBlock(
"language_delete");
1486 $this->tpl->setVariable(
"LANGUAGE_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1487 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
1488 $this->tpl->parseCurrentBlock();
1490 $this->tpl->setCurrentBlock(
"language_loop");
1491 $this->tpl->setVariable(
"LANGUAGE_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
'gen_language['.$id.
'][language]',
1492 $md_lan->getLanguageCode()));
1493 $this->tpl->parseCurrentBlock();
1497 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
1500 $this->md_section->getTitleLanguageCode()));
1504 foreach($ids = $this->md_section->getDescriptionIds() as $id)
1506 $md_des = $this->md_section->getDescription($id);
1508 if (count($ids) > 1)
1510 $this->ctrl->setParameter($this,
'meta_index',$id);
1511 $this->ctrl->setParameter($this,
'meta_path',
'meta_description');
1513 $this->tpl->setCurrentBlock(
"description_delete");
1514 $this->tpl->setVariable(
"DESCRIPTION_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1515 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
1516 $this->tpl->parseCurrentBlock();
1519 $this->tpl->setCurrentBlock(
"description_loop");
1520 $this->tpl->setVariable(
"DESCRIPTION_LOOP_NO",$id);
1521 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
1522 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
1524 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
1525 $this->tpl->setVariable(
"DESCRIPTION_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"gen_description[".$id.
'][language]',
1526 $md_des->getDescriptionLanguageCode()));
1527 $this->tpl->parseCurrentBlock();
1532 foreach($ids = $this->md_section->getKeywordIds() as $id)
1534 $md_key = $this->md_section->getKeyword($id);
1538 $this->tpl->setCurrentBlock(
"keyword_head");
1539 $this->tpl->setVariable(
"ROWSPAN_KEYWORD", count($ids));
1540 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt(
"meta_keyword"));
1541 $this->tpl->parseCurrentBlock();
1548 $this->ctrl->setParameter($this,
'meta_index',$id);
1549 $this->ctrl->setParameter($this,
'meta_path',
'meta_keyword');
1551 $this->tpl->setCurrentBlock(
"keyword_delete");
1552 $this->tpl->setVariable(
"KEYWORD_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1553 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
1554 $this->tpl->parseCurrentBlock();
1557 $this->tpl->setCurrentBlock(
"keyword_loop");
1558 $this->tpl->setVariable(
"KEYWORD_LOOP_NO",$id);
1559 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
1561 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
1562 $this->tpl->setVariable(
"KEYWORD_LOOP_VAL_LANGUAGE", $this->
__showLanguageSelect(
"gen_keyword[".$id.
'][language]',
1563 $md_key->getKeywordLanguageCode()));
1565 $this->tpl->parseCurrentBlock();
1569 $this->tpl->setVariable(
"COVERAGE_LOOP_TXT_COVERAGE",$this->lng->txt(
'meta_coverage'));
1571 $this->tpl->setVariable(
"COVERAGE_LOOP_TXT_LANGUAGE",$this->lng->txt(
'meta_language'));
1572 $this->tpl->setVariable(
"COVERAGE_LOOP_VAL_LANGUAGE",$this->
__showLanguageSelect(
'gen_coverage_language',
1573 $this->md_section->getCoverageLanguageCode()));
1575 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save'));
1583 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
1585 if(!strlen(trim(
$_POST[
'gen_title'])))
1593 $this->md_section = $this->md_obj->getGeneral();
1594 $this->md_section->setStructure(
$_POST[
'gen_structure']);
1599 $this->md_section->update();
1602 if(is_array(
$_POST[
'gen_identifier']))
1606 $md_ide = $this->md_section->getIdentifier($id);
1614 if(is_array(
$_POST[
'gen_language']))
1618 $md_lan = $this->md_section->getLanguage($id);
1624 if(is_array(
$_POST[
'gen_description']))
1626 foreach(
$_POST[
'gen_description'] as $id =>
$data)
1628 $md_des = $this->md_section->getDescription($id);
1635 if(is_array(
$_POST[
'gen_keyword']))
1639 $md_key = $this->md_section->getKeyword($id);
1650 $this->ctrl->setParameter($this,
"section",
"meta_general");
1652 $this->ctrl->redirect($this,
'listSection');
1657 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
1660 $this->md_section = $this->md_obj->getTechnical();
1667 $this->md_section->update();
1670 if(is_array(
$_POST[
'met_format']))
1674 $md_for = $this->md_section->getFormat($id);
1680 if(is_array(
$_POST[
'met_location']))
1684 $md_loc = $this->md_section->getLocation($id);
1690 if(is_array(
$_POST[
'met_re']))
1695 $md_re = $this->md_section->getRequirement($id);
1716 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
1718 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_technical.html',
'Services/MetaData');
1721 $this->ctrl->setParameter($this,
"section",
"meta_technical");
1722 if(!is_object($this->md_section = $this->md_obj->getTechnical()))
1724 $this->tpl->setCurrentBlock(
"no_technical");
1725 $this->tpl->setVariable(
"TXT_NO_TECHNICAL", $this->lng->txt(
"meta_no_technical"));
1726 $this->tpl->setVariable(
"TXT_ADD_TECHNICAL", $this->lng->txt(
"meta_add"));
1727 $this->tpl->setVariable(
"ACTION_ADD_TECHNICAL",$this->ctrl->getLinkTarget($this,
"addSection"));
1728 $this->tpl->parseCurrentBlock();
1732 $this->ctrl->setReturn($this,
'listTechnical');
1733 $this->ctrl->setParameter($this,
"meta_index", $this->md_section->getMetaId());
1735 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
1736 $this->tpl->setVariable(
"TXT_TECHNICAL",$this->lng->txt(
'meta_technical'));
1739 $this->tpl->setVariable(
"ACTION_DELETE",
1740 $this->ctrl->getLinkTarget($this,
"deleteSection"));
1741 $this->tpl->setVariable(
"TXT_DELETE",$this->lng->txt(
'delete'));
1747 foreach($ids = $this->md_section->getFormatIds() as $id)
1749 $md_for =& $this->md_section->getFormat($id);
1751 $this->tpl->setCurrentBlock(
"format_loop");
1753 $this->ctrl->setParameter($this,
'meta_index',$id);
1754 $this->ctrl->setParameter($this,
'meta_path',
'meta_format');
1755 $this->tpl->setVariable(
"FORMAT_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1756 $this->tpl->setVariable(
"FORMAT_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1758 $this->tpl->setVariable(
"FORMAT_LOOP_NO",$id);
1759 $this->tpl->setVariable(
"FORMAT_LOOP_TXT_FORMAT",$this->lng->txt(
'meta_format'));
1762 $this->tpl->parseCurrentBlock();
1765 $this->tpl->setVariable(
"SIZE_TXT_SIZE",$this->lng->txt(
'meta_size'));
1769 foreach($ids = $this->md_section->getLocationIds() as $id)
1771 $md_loc =& $this->md_section->getLocation($id);
1773 $this->tpl->setCurrentBlock(
"location_loop");
1775 $this->ctrl->setParameter($this,
'meta_index',$id);
1776 $this->ctrl->setParameter($this,
'meta_path',
'meta_location');
1777 $this->tpl->setVariable(
"LOCATION_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1778 $this->tpl->setVariable(
"LOCATION_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1780 $this->tpl->setVariable(
"LOCATION_LOOP_TXT_LOCATION",$this->lng->txt(
'meta_location'));
1781 $this->tpl->setVariable(
"LOCATION_LOOP_NO",$id);
1782 $this->tpl->setVariable(
"LOCATION_LOOP_TXT_TYPE",$this->lng->txt(
'meta_type'));
1785 $this->tpl->setVariable(
"SEL_LOCATION_TYPE",
1787 "met_location[".$id.
"][Type]",
1788 array(0 => $this->lng->txt(
'meta_please_select'))));
1789 $this->tpl->parseCurrentBlock();
1792 foreach($ids = $this->md_section->getRequirementIds() as $id)
1794 $md_re =& $this->md_section->getRequirement($id);
1796 $this->tpl->setCurrentBlock(
"requirement_loop");
1798 $this->ctrl->setParameter($this,
'meta_index',$id);
1799 $this->ctrl->setParameter($this,
'meta_path',
'meta_requirement');
1800 $this->tpl->setVariable(
"REQUIREMENT_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1801 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1803 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_REQUIREMENT",$this->lng->txt(
'meta_requirement'));
1804 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_TYPE",$this->lng->txt(
'meta_type'));
1805 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_OPERATINGSYSTEM",$this->lng->txt(
'meta_operating_system'));
1806 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_BROWSER",$this->lng->txt(
'meta_browser'));
1807 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_NAME",$this->lng->txt(
'meta_name'));
1808 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_MINIMUMVERSION",$this->lng->txt(
'meta_minimum_version'));
1809 $this->tpl->setVariable(
"REQUIREMENT_LOOP_TXT_MAXIMUMVERSION",$this->lng->txt(
'meta_maximum_version'));
1811 $this->tpl->setVariable(
"REQUIREMENT_LOOP_NO",$id);
1812 $this->tpl->setVariable(
"REQUIREMENT_SEL_OS_NAME",
1814 "met_re[".$id.
"][os][name]",
1815 array(0 => $this->lng->txt(
'meta_please_select'))));
1816 $this->tpl->setVariable(
"REQUIREMENT_SEL_BROWSER_NAME",
1818 "met_re[".$id.
"][browser][name]",
1819 array(0 => $this->lng->txt(
'meta_please_select'))));
1821 $this->tpl->setVariable(
"REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MINIMUMVERSION",
1824 $this->tpl->setVariable(
"REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MAXIMUMVERSION",
1827 $this->tpl->setVariable(
"REQUIREMENT_LOOP_VAL_BROWSER_MINIMUMVERSION",
1830 $this->tpl->setVariable(
"REQUIREMENT_LOOP_VAL_BROWSER_MAXIMUMVERSION",
1832 $this->tpl->parseCurrentBlock();
1836 foreach($ids = $this->md_section->getOrCompositeIds() as $or_id)
1838 $md_or =& $this->md_section->getOrComposite($or_id);
1839 foreach($ids = $md_or->getRequirementIds() as $id)
1841 $md_re =& $this->md_section->getRequirement($id);
1843 $this->tpl->setCurrentBlock(
"orrequirement_loop");
1845 $this->ctrl->setParameter($this,
'meta_index',$id);
1846 $this->ctrl->setParameter($this,
'meta_path',
'meta_requirement');
1847 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1848 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1850 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_REQUIREMENT",$this->lng->txt(
'meta_requirement'));
1851 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_TYPE",$this->lng->txt(
'meta_type'));
1852 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_OPERATINGSYSTEM",$this->lng->txt(
'meta_operating_system'));
1853 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_BROWSER",$this->lng->txt(
'meta_browser'));
1854 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_NAME",$this->lng->txt(
'meta_name'));
1855 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_MINIMUMVERSION",$this->lng->txt(
'meta_minimum_version'));
1856 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_TXT_MAXIMUMVERSION",$this->lng->txt(
'meta_maximum_version'));
1858 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_NO",$id);
1859 $this->tpl->setVariable(
"ORREQUIREMENT_SEL_OS_NAME",
1861 "met_re[".$id.
"][os][name]",
1862 array(0 => $this->lng->txt(
'meta_please_select'))));
1863 $this->tpl->setVariable(
"ORREQUIREMENT_SEL_BROWSER_NAME",
1865 "met_re[".$id.
"][browser][name]",
1866 array(0 => $this->lng->txt(
'meta_please_select'))));
1868 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MINIMUMVERSION",
1871 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MAXIMUMVERSION",
1874 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_VAL_BROWSER_MINIMUMVERSION",
1877 $this->tpl->setVariable(
"ORREQUIREMENT_LOOP_VAL_BROWSER_MAXIMUMVERSION",
1879 $this->tpl->parseCurrentBlock();
1881 $this->tpl->setCurrentBlock(
"orcomposite_loop");
1883 $this->ctrl->setParameter($this,
'meta_index',$or_id);
1884 $this->ctrl->setParameter($this,
'meta_path',
'meta_or_composite');
1885 $this->ctrl->setParameter($this,
'meta_technical',$this->md_section->getMetaId());
1886 $this->tpl->setVariable(
"ORCOMPOSITE_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1887 $this->tpl->setVariable(
"ORCOMPOSITE_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1889 $this->tpl->setVariable(
"ORCOMPOSITE_LOOP_TXT_ORCOMPOSITE",$this->lng->txt(
'meta_or_composite'));
1890 $this->tpl->parseCurrentBlock();
1894 $this->tpl->setVariable(
"INSTALLATIONREMARKS_TXT_INSTALLATIONREMARKS",$this->lng->txt(
'meta_installation_remarks'));
1895 $this->tpl->setVariable(
"INSTALLATIONREMARKS_TXT_LANGUAGE",$this->lng->txt(
'meta_language'));
1897 $this->tpl->setVariable(
"INSTALLATIONREMARKS_VAL",
ilUtil::prepareFormOutput($this->md_section->getInstallationRemarks()));
1898 $this->tpl->setVariable(
"INSTALLATIONREMARKS_VAL_LANGUAGE",
1900 $this->md_section->getInstallationRemarksLanguageCode()));
1903 $this->tpl->setVariable(
"OTHERPLATTFORMREQUIREMENTS_TXT_OTHERPLATTFORMREQUIREMENTS",
1904 $this->lng->txt(
'meta_other_plattform_requirements'));
1905 $this->tpl->setVariable(
"OTHERPLATTFORMREQUIREMENTS_TXT_LANGUAGE",$this->lng->txt(
'meta_language'));
1907 $this->tpl->setVariable(
"OTHERPLATTFORMREQUIREMENTS_VAL",
1909 $this->tpl->setVariable(
"OTHERPLATTFORMREQUIREMENTS_VAL_LANGUAGE",
1911 $this->md_section->getOtherPlatformRequirementsLanguageCode()));
1914 $this->tpl->setVariable(
"DURATION_TXT_DURATION",$this->lng->txt(
'meta_duration'));
1917 $this->tpl->setCurrentBlock(
"technical");
1918 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save'));
1919 $this->tpl->parseCurrentBlock();
1926 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
1928 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_lifecycle.html',
'Services/MetaData');
1931 $this->ctrl->setParameter($this,
"section",
"meta_lifecycle");
1932 if(!is_object($this->md_section = $this->md_obj->getLifecycle()))
1934 $this->tpl->setCurrentBlock(
"no_lifecycle");
1935 $this->tpl->setVariable(
"TXT_NO_LIFECYCLE", $this->lng->txt(
"meta_no_lifecycle"));
1936 $this->tpl->setVariable(
"TXT_ADD_LIFECYCLE", $this->lng->txt(
"meta_add"));
1937 $this->tpl->setVariable(
"ACTION_ADD_LIFECYCLE",$this->ctrl->getLinkTarget($this,
"addSection"));
1938 $this->tpl->parseCurrentBlock();
1942 $this->ctrl->setReturn($this,
'listLifecycle');
1943 $this->ctrl->setParameter($this,
"meta_index", $this->md_section->getMetaId());
1945 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
1946 $this->tpl->setVariable(
"TXT_LIFECYCLE",$this->lng->txt(
'meta_lifecycle'));
1949 $this->tpl->setVariable(
"ACTION_DELETE",
1950 $this->ctrl->getLinkTarget($this,
"deleteSection"));
1951 $this->tpl->setVariable(
"TXT_DELETE",$this->lng->txt(
'delete'));
1957 $this->tpl->setVariable(
"TXT_STATUS",$this->lng->txt(
'meta_status'));
1960 array(0 => $this->lng->txt(
'meta_please_select'))));
1962 $this->tpl->setVariable(
"TXT_VERSION",$this->lng->txt(
'meta_version'));
1965 $this->tpl->setVariable(
"TXT_LANGUAGE",$this->lng->txt(
'meta_language'));
1967 $this->md_section->getVersionLanguageCode()));
1970 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
1972 $md_con = $this->md_section->getContribute($con_id);
1976 $this->ctrl->setParameter($this,
'meta_index',$con_id);
1977 $this->ctrl->setParameter($this,
'meta_path',
'meta_contribute');
1979 $this->tpl->setCurrentBlock(
"contribute_delete");
1980 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1981 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1982 $this->tpl->parseCurrentBlock();
1985 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
1987 $md_ent = $md_con->getEntity($ent_id);
1989 $this->ctrl->setParameter($this,
'meta_path',
'meta_entity');
1991 if(count($ent_ids) > 1)
1993 $this->tpl->setCurrentBlock(
"contribute_entity_delete");
1995 $this->ctrl->setParameter($this,
'meta_index',$ent_id);
1996 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
1997 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
1998 $this->tpl->parseCurrentBlock();
2001 $this->tpl->setCurrentBlock(
"contribute_entity_loop");
2003 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_CONTRIBUTE_NO",$con_id);
2004 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_NO",$ent_id);
2006 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_TXT_ENTITY",$this->lng->txt(
'meta_entity'));
2007 $this->tpl->parseCurrentBlock();
2009 $this->tpl->setCurrentBlock(
"contribute_loop");
2011 $this->ctrl->setParameter($this,
'section_element',
'meta_entity');
2012 $this->ctrl->setParameter($this,
'meta_index',$con_id);
2013 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_ACTION_ADD",$this->ctrl->getLinkTarget($this,
'addSectionElement'));
2014 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_TXT_ADD",
2015 $this->lng->txt(
'add').
" ".$this->lng->txt(
'meta_entity'));
2017 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_ROWSPAN",2 + count($ent_ids));
2018 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_CONTRIBUTE",$this->lng->txt(
'meta_contribute'));
2019 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_ROLE",$this->lng->txt(
'meta_role'));
2021 "met_contribute[".$con_id.
"][Role]",
2022 array(0 => $this->lng->txt(
'meta_please_select'))));
2023 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_DATE",$this->lng->txt(
'meta_date'));
2024 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_NO",$con_id);
2027 $this->tpl->parseCurrentBlock();
2029 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save'));
2035 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
2038 $this->md_section = $this->md_obj->getLifecycle();
2041 $this->md_section->setStatus(
$_POST[
'lif_status']);
2042 $this->md_section->update();
2045 if(is_array(
$_POST[
'met_identifier']))
2049 $md_ide = $this->md_section->getIdentifier($id);
2056 if(is_array(
$_POST[
'met_contribute']))
2060 $md_con =& $this->md_section->getContribute($id);
2065 if(is_array(
$_POST[
'met_entity'][$id]))
2067 foreach(
$_POST[
'met_entity'][$id] as $ent_id =>
$data)
2069 $md_ent =& $md_con->getEntity($ent_id);
2088 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
2090 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_meta_metadata.html',
'Services/MetaData');
2093 $this->ctrl->setParameter($this,
"section",
"meta_meta_metadata");
2094 if(!is_object($this->md_section = $this->md_obj->getMetaMetadata()))
2096 $this->tpl->setCurrentBlock(
"no_meta_meta");
2097 $this->tpl->setVariable(
"TXT_NO_META_META", $this->lng->txt(
"meta_no_meta_metadata"));
2098 $this->tpl->setVariable(
"TXT_ADD_META_META", $this->lng->txt(
"meta_add"));
2099 $this->tpl->setVariable(
"ACTION_ADD_META_META",$this->ctrl->getLinkTarget($this,
"addSection"));
2100 $this->tpl->parseCurrentBlock();
2104 $this->ctrl->setReturn($this,
'listMetaMetaData');
2105 $this->ctrl->setParameter($this,
"meta_index", $this->md_section->getMetaId());
2107 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
2108 $this->tpl->setVariable(
"TXT_META_METADATA",$this->lng->txt(
'meta_meta_metadata'));
2111 $this->tpl->setVariable(
"ACTION_DELETE",
2112 $this->ctrl->getLinkTarget($this,
"deleteSection"));
2113 $this->tpl->setVariable(
"TXT_DELETE",$this->lng->txt(
'delete'));
2118 $this->tpl->setVariable(
"TXT_LANGUAGE",$this->lng->txt(
'meta_language'));
2120 $this->tpl->setVariable(
"VAL_LANGUAGE",$this->
__showLanguageSelect(
'met_language',$this->md_section->getLanguageCode()));
2121 $this->tpl->setVariable(
"TXT_METADATASCHEME",$this->lng->txt(
'meta_metadatascheme'));
2122 $this->tpl->setVariable(
"VAL_METADATASCHEME",$this->md_section->getMetaDataScheme());
2126 foreach($ids = $this->md_section->getIdentifierIds() as $id)
2128 $md_ide = $this->md_section->getIdentifier($id);
2132 $this->ctrl->setParameter($this,
'meta_index',$id);
2133 $this->ctrl->setParameter($this,
'meta_path',
'meta_identifier');
2135 $this->tpl->setCurrentBlock(
"identifier_delete");
2136 $this->tpl->setVariable(
"IDENTIFIER_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
2137 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
2138 $this->tpl->parseCurrentBlock();
2141 $this->tpl->setCurrentBlock(
"identifier_loop");
2142 $this->tpl->setVariable(
"IDENTIFIER_LOOP_NO", $id);
2143 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt(
"meta_identifier"));
2144 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt(
"meta_catalog"));
2145 $this->tpl->setVariable(
"IDENTIFIER_LOOP_VAL_IDENTIFIER_CATALOG",
2147 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt(
"meta_entry"));
2148 $this->tpl->setVariable(
"IDENTIFIER_LOOP_VAL_IDENTIFIER_ENTRY",
2150 $this->tpl->parseCurrentBlock();
2154 foreach(($ids = $this->md_section->getContributeIds()) as $con_id)
2156 $md_con = $this->md_section->getContribute($con_id);
2160 $this->ctrl->setParameter($this,
'meta_index',$con_id);
2161 $this->ctrl->setParameter($this,
'meta_path',
'meta_contribute');
2163 $this->tpl->setCurrentBlock(
"contribute_delete");
2164 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
2165 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
2166 $this->tpl->parseCurrentBlock();
2169 foreach($ent_ids = $md_con->getEntityIds() as $ent_id)
2171 $md_ent = $md_con->getEntity($ent_id);
2173 $this->ctrl->setParameter($this,
'meta_path',
'meta_entity');
2175 if(count($ent_ids) > 1)
2177 $this->tpl->setCurrentBlock(
"contribute_entity_delete");
2179 $this->ctrl->setParameter($this,
'meta_index',$ent_id);
2180 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_ACTION_DELETE",$this->ctrl->getLinkTarget($this,
'deleteElement'));
2181 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_TXT_DELETE",$this->lng->txt(
'delete'));
2182 $this->tpl->parseCurrentBlock();
2185 $this->tpl->setCurrentBlock(
"contribute_entity_loop");
2187 $this->ctrl->setParameter($this,
'section_element',
'meta_entity');
2188 $this->ctrl->setParameter($this,
'meta_index',$con_id);
2189 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_ACTION_ADD",$this->ctrl->getLinkTarget($this,
'addSectionElement'));
2190 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_TXT_ADD",$this->lng->txt(
'add'));
2193 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_CONTRIBUTE_NO",$con_id);
2194 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_NO",$ent_id);
2196 $this->tpl->setVariable(
"CONTRIBUTE_ENTITY_LOOP_TXT_ENTITY",$this->lng->txt(
'meta_entity'));
2197 $this->tpl->parseCurrentBlock();
2199 $this->tpl->setCurrentBlock(
"contribute_loop");
2200 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_ROWSPAN",2 + count($ent_ids));
2201 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_CONTRIBUTE",$this->lng->txt(
'meta_contribute'));
2202 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_ROLE",$this->lng->txt(
'meta_role'));
2204 "met_contribute[".$con_id.
"][Role]",
2205 array(0 => $this->lng->txt(
'meta_please_select'))));
2206 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_TXT_DATE",$this->lng->txt(
'meta_date'));
2207 $this->tpl->setVariable(
"CONTRIBUTE_LOOP_NO",$con_id);
2210 $this->tpl->parseCurrentBlock();
2212 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save'));
2218 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
2221 $this->md_section = $this->md_obj->getMetaMetadata();
2223 $this->md_section->update();
2226 if(is_array(
$_POST[
'met_identifier']))
2230 $md_ide = $this->md_section->getIdentifier($id);
2237 if(is_array(
$_POST[
'met_contribute']))
2241 $md_con =& $this->md_section->getContribute($id);
2246 if(is_array(
$_POST[
'met_entity'][$id]))
2248 foreach(
$_POST[
'met_entity'][$id] as $ent_id =>
$data)
2250 $md_ent =& $md_con->getEntity($ent_id);
2269 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
2271 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_rights.html',
'Services/MetaData');
2273 if(!is_object($this->md_section = $this->md_obj->getRights()))
2275 $this->tpl->setCurrentBlock(
"no_rights");
2276 $this->tpl->setVariable(
"TXT_NO_RIGHTS", $this->lng->txt(
"meta_no_rights"));
2277 $this->tpl->setVariable(
"TXT_ADD_RIGHTS", $this->lng->txt(
"meta_add"));
2278 $this->ctrl->setParameter($this,
"section",
"meta_rights");
2279 $this->tpl->setVariable(
"ACTION_ADD_RIGHTS",
2280 $this->ctrl->getLinkTarget($this,
"addSection"));
2281 $this->tpl->parseCurrentBlock();
2286 $this->ctrl->setReturn($this,
'listRights');
2287 $this->ctrl->setParameter($this,
'section',
'meta_rights');
2288 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
2290 $this->tpl->setVariable(
"TXT_RIGHTS", $this->lng->txt(
"meta_rights"));
2291 $this->tpl->setVariable(
"TXT_COST", $this->lng->txt(
"meta_cost"));
2292 $this->tpl->setVariable(
"TXT_COPYRIGHTANDOTHERRESTRICTIONS", $this->lng->txt(
"meta_copyright_and_other_restrictions"));
2293 $this->tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
2294 $this->tpl->setVariable(
"TXT_YES", $this->lng->txt(
"meta_yes"));
2295 $this->tpl->setVariable(
"TXT_NO", $this->lng->txt(
"meta_no"));
2297 $this->ctrl->setParameter($this,
"section",
"meta_rights");
2298 $this->ctrl->setParameter($this,
"meta_index", $this->md_section->getMetaId());
2299 $this->tpl->setVariable(
"ACTION_DELETE",
2300 $this->ctrl->getLinkTarget($this,
"deleteSection"));
2302 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"meta_delete"));
2304 $this->tpl->setVariable(
"VAL_COST_".strtoupper($this->md_section->getCosts()),
" selected");
2305 $this->tpl->setVariable(
"VAL_COPYRIGHTANDOTHERRESTRICTIONS_".
2306 strtoupper($this->md_section->getCopyrightAndOtherRestrictions()),
" selected");
2308 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
2309 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
2311 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2312 $this->tpl->setVariable(
"DESCRIPTION_LOOP_VAL_LANGUAGE",
2314 $this->md_section->getDescriptionLanguageCode()));
2316 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2318 $this->tpl->setCurrentBlock(
"rights");
2319 $this->tpl->parseCurrentBlock();
2326 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
2329 $this->md_section = $this->md_obj->getRights();
2330 $this->md_section->setCosts(
$_POST[
'rights'][
'Cost']);
2331 $this->md_section->setCopyrightAndOtherRestrictions(
$_POST[
'rights'][
'CopyrightAndOtherRestrictions']);
2332 $this->md_section->setDescriptionLanguage(
new ilMDLanguageItem(
$_POST[
'rights'][
'DescriptionLanguage']));
2334 $this->md_section->update();
2346 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
2348 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_educational.html',
'Services/MetaData');
2350 if(!is_object($this->md_section = $this->md_obj->getEducational()))
2352 $this->tpl->setCurrentBlock(
"no_educational");
2353 $this->tpl->setVariable(
"TXT_NO_EDUCATIONAL", $this->lng->txt(
"meta_no_educational"));
2354 $this->tpl->setVariable(
"TXT_ADD_EDUCATIONAL", $this->lng->txt(
"meta_add"));
2355 $this->ctrl->setParameter($this,
"section",
"meta_educational");
2356 $this->tpl->setVariable(
"ACTION_ADD_EDUCATIONAL",
2357 $this->ctrl->getLinkTarget($this,
"addSection"));
2358 $this->tpl->parseCurrentBlock();
2362 $this->ctrl->setReturn($this,
'listEducational');
2363 $this->ctrl->setParameter($this,
'section',
'meta_educational');
2364 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
2366 $this->ctrl->setParameter($this,
"meta_index", $this->md_section->getMetaId());
2367 $this->tpl->setVariable(
"ACTION_DELETE",
2368 $this->ctrl->getLinkTarget($this,
"deleteSection"));
2370 $this->tpl->setVariable(
"TXT_EDUCATIONAL", $this->lng->txt(
"meta_educational"));
2371 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"meta_delete"));
2372 $this->tpl->setVariable(
"TXT_NEW_ELEMENT", $this->lng->txt(
"meta_new_element"));
2373 $this->tpl->setVariable(
"TXT_TYPICALAGERANGE", $this->lng->txt(
"meta_typical_age_range"));
2374 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
2375 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2376 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"meta_add"));
2377 $this->tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
2379 $this->tpl->setVariable(
"TXT_INTERACTIVITYTYPE", $this->lng->txt(
"meta_interactivity_type"));
2380 $this->tpl->setVariable(
"TXT_LEARNINGRESOURCETYPE", $this->lng->txt(
"meta_learning_resource_type"));
2381 $this->tpl->setVariable(
"TXT_INTERACTIVITYLEVEL", $this->lng->txt(
"meta_interactivity_level"));
2382 $this->tpl->setVariable(
"TXT_SEMANTICDENSITY", $this->lng->txt(
"meta_semantic_density"));
2383 $this->tpl->setVariable(
"TXT_INTENDEDENDUSERROLE", $this->lng->txt(
"meta_intended_end_user_role"));
2384 $this->tpl->setVariable(
"TXT_CONTEXT", $this->lng->txt(
"meta_context"));
2385 $this->tpl->setVariable(
"TXT_DIFFICULTY", $this->lng->txt(
"meta_difficulty"));
2387 $this->tpl->setVariable(
"VAL_INTERACTIVITYTYPE_" . strtoupper($this->md_section->getInteractivityType()),
" selected");
2388 $this->tpl->setVariable(
"VAL_LEARNINGRESOURCETYPE_" . strtoupper($this->md_section->getLearningResourceType()),
" selected");
2389 $this->tpl->setVariable(
"VAL_INTERACTIVITYLEVEL_" . strtoupper($this->md_section->getInteractivityLevel()),
" selected");
2390 $this->tpl->setVariable(
"VAL_SEMANTICDENSITY_" . strtoupper($this->md_section->getSemanticDensity()),
" selected");
2391 $this->tpl->setVariable(
"VAL_INTENDEDENDUSERROLE_" . strtoupper($this->md_section->getIntendedEndUserRole()),
" selected");
2392 $this->tpl->setVariable(
"VAL_CONTEXT_" . strtoupper($this->md_section->getContext()),
" selected");
2393 $this->tpl->setVariable(
"VAL_DIFFICULTY_" . strtoupper($this->md_section->getDifficulty()),
" selected");
2394 #$this->tpl->setVariable("VAL_TYPICALLEARNINGTIME", ilUtil::prepareFormOutput($this->md_section->getTypicalLearningTime()));
2396 $this->tpl->setVariable(
"TXT_ACTIVE", $this->lng->txt(
"meta_active"));
2397 $this->tpl->setVariable(
"TXT_EXPOSITIVE", $this->lng->txt(
"meta_expositive"));
2398 $this->tpl->setVariable(
"TXT_MIXED", $this->lng->txt(
"meta_mixed"));
2399 $this->tpl->setVariable(
"TXT_EXERCISE", $this->lng->txt(
"meta_exercise"));
2400 $this->tpl->setVariable(
"TXT_SIMULATION", $this->lng->txt(
"meta_simulation"));
2401 $this->tpl->setVariable(
"TXT_QUESTIONNAIRE", $this->lng->txt(
"meta_questionnaire"));
2402 $this->tpl->setVariable(
"TXT_DIAGRAMM", $this->lng->txt(
"meta_diagramm"));
2403 $this->tpl->setVariable(
"TXT_FIGURE", $this->lng->txt(
"meta_figure"));
2404 $this->tpl->setVariable(
"TXT_GRAPH", $this->lng->txt(
"meta_graph"));
2405 $this->tpl->setVariable(
"TXT_INDEX", $this->lng->txt(
"meta_index"));
2406 $this->tpl->setVariable(
"TXT_SLIDE", $this->lng->txt(
"meta_slide"));
2407 $this->tpl->setVariable(
"TXT_TABLE", $this->lng->txt(
"meta_table"));
2408 $this->tpl->setVariable(
"TXT_NARRATIVETEXT", $this->lng->txt(
"meta_narrative_text"));
2409 $this->tpl->setVariable(
"TXT_EXAM", $this->lng->txt(
"meta_exam"));
2410 $this->tpl->setVariable(
"TXT_EXPERIMENT", $this->lng->txt(
"meta_experiment"));
2411 $this->tpl->setVariable(
"TXT_PROBLEMSTATEMENT", $this->lng->txt(
"meta_problem_statement"));
2412 $this->tpl->setVariable(
"TXT_SELFASSESSMENT", $this->lng->txt(
"meta_self_assessment"));
2413 $this->tpl->setVariable(
"TXT_LECTURE", $this->lng->txt(
"meta_lecture"));
2414 $this->tpl->setVariable(
"TXT_VERYLOW", $this->lng->txt(
"meta_very_low"));
2415 $this->tpl->setVariable(
"TXT_LOW", $this->lng->txt(
"meta_low"));
2416 $this->tpl->setVariable(
"TXT_MEDIUM", $this->lng->txt(
"meta_medium"));
2417 $this->tpl->setVariable(
"TXT_HIGH", $this->lng->txt(
"meta_high"));
2418 $this->tpl->setVariable(
"TXT_VERYHIGH", $this->lng->txt(
"meta_very_high"));
2419 $this->tpl->setVariable(
"TXT_TEACHER", $this->lng->txt(
"meta_teacher"));
2420 $this->tpl->setVariable(
"TXT_AUTHOR", $this->lng->txt(
"meta_author"));
2421 $this->tpl->setVariable(
"TXT_LEARNER", $this->lng->txt(
"meta_learner"));
2422 $this->tpl->setVariable(
"TXT_MANAGER", $this->lng->txt(
"meta_manager"));
2423 $this->tpl->setVariable(
"TXT_SCHOOL", $this->lng->txt(
"meta_school"));
2424 $this->tpl->setVariable(
"TXT_HIGHEREDUCATION", $this->lng->txt(
"meta_higher_education"));
2425 $this->tpl->setVariable(
"TXT_TRAINING", $this->lng->txt(
"meta_training"));
2426 $this->tpl->setVariable(
"TXT_OTHER", $this->lng->txt(
"meta_other"));
2427 $this->tpl->setVariable(
"TXT_VERYEASY", $this->lng->txt(
"meta_very_easy"));
2428 $this->tpl->setVariable(
"TXT_EASY", $this->lng->txt(
"meta_easy"));
2429 $this->tpl->setVariable(
"TXT_DIFFICULT", $this->lng->txt(
"meta_difficult"));
2430 $this->tpl->setVariable(
"TXT_VERYDIFFICULT", $this->lng->txt(
"meta_very_difficult"));
2431 $this->tpl->setVariable(
"TXT_TYPICALLEARNINGTIME", $this->lng->txt(
"meta_typical_learning_time"));
2435 $tlt = array(0,0,0,0,0);
2438 include_once
'Services/MetaData/classes/class.ilMDUtils.php';
2442 if(strlen($this->md_section->getTypicalLearningTime()))
2444 $tlt = array(0,0,0,0,0);
2449 $this->tpl->setVariable(
"TXT_MONTH",$this->lng->txt(
'md_months'));
2453 $this->tpl->setVariable(
"TXT_DAYS",$this->lng->txt(
'md_days'));
2454 $this->tpl->setVariable(
"TXT_TIME",$this->lng->txt(
'md_time'));
2456 $this->tpl->setVariable(
"TXT_TYPICAL_LEARN_TIME",$this->lng->txt(
'meta_typical_learning_time'));
2458 $tlt[2],$tlt[3],$tlt[4],
2460 $this->tpl->setVariable(
"TLT_HINT",$tlt[4] ?
'(hh:mm:ss)' :
'(hh:mm)');
2464 $this->tpl->setCurrentBlock(
"tlt_not_valid");
2465 $this->tpl->setVariable(
"TXT_CURRENT_VAL",$this->lng->txt(
'meta_current_value'));
2466 $this->tpl->setVariable(
"TLT",$this->md_section->getTypicalLearningTime());
2467 $this->tpl->setVariable(
"INFO_TLT_NOT_VALID",$this->lng->txt(
'meta_info_tlt_not_valid'));
2468 $this->tpl->parseCurrentBlock();
2474 foreach($ids = $this->md_section->getTypicalAgeRangeIds() as $id)
2476 $md_age = $this->md_section->getTypicalAgeRange($id);
2479 if (is_object($md_age))
2484 $this->tpl->setCurrentBlock(
"agerange_head");
2485 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_TXT_TYPICALAGERANGE",
2486 $this->lng->txt(
"meta_typical_age_range"));
2487 $this->tpl->setVariable(
"ROWSPAN_AGERANGE", count($ids));
2488 $this->tpl->parseCurrentBlock();
2493 $this->ctrl->setParameter($this,
'meta_index', $id);
2494 $this->ctrl->setParameter($this,
'meta_path',
'educational_typical_age_range');
2496 $this->tpl->setCurrentBlock(
"typicalagerange_delete");
2497 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_ACTION_DELETE",
2498 $this->ctrl->getLinkTarget($this,
"deleteElement"));
2499 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
2500 $this->tpl->parseCurrentBlock();
2502 $this->tpl->setCurrentBlock(
"typicalagerange_loop");
2503 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
2505 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_NO", $id);
2506 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2507 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_VAL_LANGUAGE",
2509 $md_age->getTypicalAgeRangeLanguageCode()));
2510 $this->ctrl->setParameter($this,
"section_element",
"educational_typical_age_range");
2511 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_ACTION_ADD",
2512 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
2513 $this->tpl->setVariable(
"TYPICALAGERANGE_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
2514 $this->tpl->parseCurrentBlock();
2520 foreach($ids = $this->md_section->getDescriptionIds() as $id)
2524 $this->tpl->setCurrentBlock(
"desc_head");
2525 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
2526 $this->tpl->setVariable(
"ROWSPAN_DESC", count($ids));
2527 $this->tpl->parseCurrentBlock();
2531 $md_des = $this->md_section->getDescription($id);
2533 $this->ctrl->setParameter($this,
'meta_index', $id);
2534 $this->ctrl->setParameter($this,
'meta_path',
'educational_description');
2536 $this->tpl->setCurrentBlock(
"description_loop");
2537 $this->tpl->setVariable(
"DESCRIPTION_LOOP_NO", $id);
2538 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
2540 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2541 $this->tpl->setVariable(
"DESCRIPTION_LOOP_VAL_LANGUAGE",
2543 $md_des->getDescriptionLanguageCode()));
2544 $this->tpl->setVariable(
"DESCRIPTION_LOOP_ACTION_DELETE",
2545 $this->ctrl->getLinkTarget($this,
"deleteElement"));
2546 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
2547 $this->ctrl->setParameter($this,
"section_element",
"educational_description");
2548 $this->tpl->setVariable(
"DESCRIPTION_LOOP_ACTION_ADD",
2549 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
2550 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
2551 $this->tpl->parseCurrentBlock();
2557 foreach($ids = $this->md_section->getLanguageIds() as $id)
2561 $this->tpl->setCurrentBlock(
"language_head");
2562 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2563 $this->tpl->setVariable(
"ROWSPAN_LANG", count($ids));
2564 $this->tpl->parseCurrentBlock();
2568 $md_lang = $this->md_section->getLanguage($id);
2570 $this->ctrl->setParameter($this,
'meta_index', $id);
2571 $this->ctrl->setParameter($this,
'meta_path',
'educational_language');
2573 $this->tpl->setCurrentBlock(
"language_loop");
2574 $this->tpl->setVariable(
"LANGUAGE_LOOP_VAL_LANGUAGE",
2576 $md_lang->getLanguageCode()));
2578 $this->tpl->setVariable(
"LANGUAGE_LOOP_ACTION_DELETE",
2579 $this->ctrl->getLinkTarget($this,
"deleteElement"));
2580 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
2581 $this->ctrl->setParameter($this,
"section_element",
"educational_language");
2582 $this->tpl->setVariable(
"LANGUAGE_LOOP_ACTION_ADD",
2583 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
2584 $this->tpl->setVariable(
"LANGUAGE_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
2585 $this->tpl->parseCurrentBlock();
2589 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2591 $this->tpl->setCurrentBlock(
"educational");
2592 $this->tpl->parseCurrentBlock();
2598 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
2601 $this->md_section = $this->md_obj->getEducational();
2602 $this->md_section->setInteractivityType(
$_POST[
'educational'][
'InteractivityType']);
2603 $this->md_section->setLearningResourceType(
$_POST[
'educational'][
'LearningResourceType']);
2604 $this->md_section->setInteractivityLevel(
$_POST[
'educational'][
'InteractivityLevel']);
2605 $this->md_section->setSemanticDensity(
$_POST[
'educational'][
'SemanticDensity']);
2606 $this->md_section->setIntendedEndUserRole(
$_POST[
'educational'][
'IntendedEndUserRole']);
2607 $this->md_section->setContext(
$_POST[
'educational'][
'Context']);
2608 $this->md_section->setDifficulty(
$_POST[
'educational'][
'Difficulty']);
2616 $this->md_section->setPhysicalTypicalLearningTime($_POST[
'tlt'][
'mo'],$_POST[
'tlt'][
'd'],
2617 $_POST[
'tlt'][
'h'],$_POST[
'tlt'][
'm'],$_POST[
'tlt'][
's']);
2621 $this->md_section->setTypicalLearningTime(
'');
2627 foreach($ids = $this->md_section->getTypicalAgeRangeIds() as $id)
2629 $md_age = $this->md_section->getTypicalAgeRange($id);
2630 $md_age->setTypicalAgeRange(
ilUtil::stripSlashes($_POST[
'educational'][
'TypicalAgeRange'][$id][
'Value']));
2631 $md_age->setTypicalAgeRangeLanguage(
2632 new ilMDLanguageItem($_POST[
'educational'][
'TypicalAgeRange'][$id][
'Language']));
2637 foreach($ids = $this->md_section->getDescriptionIds() as $id)
2639 $md_des = $this->md_section->getDescription($id);
2640 $md_des->setDescription(
ilUtil::stripSlashes($_POST[
'educational'][
'Description'][$id][
'Value']));
2641 $md_des->setDescriptionLanguage(
2642 new ilMDLanguageItem($_POST[
'educational'][
'Description'][$id][
'Language']));
2647 foreach($ids = $this->md_section->getLanguageIds() as $id)
2649 $md_lang = $this->md_section->getLanguage($id);
2650 $md_lang->setLanguage(
2655 $this->md_section->update();
2667 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
2669 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_relation.html',
'Services/MetaData');
2671 $rel_ids = $this->md_obj->getRelationIds();
2672 if (!is_array($rel_ids) || count($rel_ids) == 0)
2674 $this->tpl->setCurrentBlock(
"no_relation");
2675 $this->tpl->setVariable(
"TXT_NO_RELATION", $this->lng->txt(
"meta_no_relation"));
2676 $this->tpl->setVariable(
"TXT_ADD_RELATION", $this->lng->txt(
"meta_add"));
2677 $this->ctrl->setParameter($this,
"section",
"meta_relation");
2678 $this->tpl->setVariable(
"ACTION_ADD_RELATION",
2679 $this->ctrl->getLinkTarget($this,
"addSection"));
2680 $this->tpl->parseCurrentBlock();
2684 foreach($rel_ids as $rel_id)
2686 $this->md_section = $this->md_obj->getRelation($rel_id);
2688 $this->ctrl->setParameter($this,
'meta_index', $rel_id);
2689 $this->ctrl->setParameter($this,
"section",
"meta_relation");
2692 $res_ids = $this->md_section->getIdentifier_Ids();
2693 foreach ($res_ids as $res_id)
2695 $ident = $this->md_section->getIdentifier_($res_id);
2696 $this->ctrl->setParameter($this,
"meta_index", $res_id);
2698 if (count($res_ids) > 1)
2700 $this->tpl->setCurrentBlock(
"identifier_delete");
2701 $this->ctrl->setParameter($this,
"meta_path",
"relation_resource_identifier");
2702 $this->tpl->setVariable(
"IDENTIFIER_LOOP_ACTION_DELETE",
2703 $this->ctrl->getLinkTarget($this,
"deleteElement"));
2704 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
2705 $this->tpl->parseCurrentBlock();
2708 $this->tpl->setCurrentBlock(
"identifier_loop");
2710 $this->tpl->setVariable(
"IDENTIFIER_LOOP_NO", $res_id);
2711 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt(
"meta_identifier"));
2712 $this->ctrl->setParameter($this,
'meta_index', $rel_id);
2713 $this->ctrl->setParameter($this,
"section_element",
"relation_resource_identifier");
2714 $this->tpl->setVariable(
"IDENTIFIER_LOOP_ACTION_ADD",
2715 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
2716 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
2717 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt(
"meta_entry"));
2718 $this->tpl->setVariable(
"IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt(
"meta_catalog"));
2719 $this->tpl->setVariable(
"IDENTIFIER_LOOP_VAL_CATALOG",
2721 $this->tpl->setVariable(
"IDENTIFIER_LOOP_VAL_ENTRY",
2723 $this->tpl->parseCurrentBlock();
2727 $res_dess = $this->md_section->getDescriptionIds();
2728 foreach ($res_dess as $res_des)
2730 $des = $this->md_section->getDescription($res_des);
2731 $this->ctrl->setParameter($this,
"meta_index", $res_des);
2733 if (count($res_dess) > 1)
2735 $this->tpl->setCurrentBlock(
"description_delete");
2736 $this->ctrl->setParameter($this,
"meta_path",
"relation_resource_description");
2737 $this->tpl->setVariable(
"DESCRIPTION_LOOP_ACTION_DELETE",
2738 $this->ctrl->getLinkTarget($this,
"deleteElement"));
2739 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
2740 $this->tpl->parseCurrentBlock();
2743 $this->tpl->setCurrentBlock(
"description_loop");
2744 $this->tpl->setVariable(
"DESCRIPTION_LOOP_NO", $res_des);
2745 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
2746 $this->ctrl->setParameter($this,
'meta_index', $rel_id);
2747 $this->ctrl->setParameter($this,
"section_element",
"relation_resource_description");
2748 $this->tpl->setVariable(
"DESCRIPTION_LOOP_ACTION_ADD",
2749 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
2750 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
2751 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
2752 $this->tpl->setVariable(
"DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2753 $this->tpl->setVariable(
"DESCRIPTION_LOOP_VAL",
2755 $this->tpl->setVariable(
"DESCRIPTION_LOOP_VAL_LANGUAGE",
2757 $des->getDescriptionLanguageCode()));
2758 $this->tpl->parseCurrentBlock();
2761 $this->tpl->setCurrentBlock(
"relation_loop");
2762 $this->tpl->setVariable(
"REL_ID", $rel_id);
2763 $this->tpl->setVariable(
"TXT_RELATION", $this->lng->txt(
"meta_relation"));
2764 $this->ctrl->setParameter($this,
"meta_index", $this->md_section->getMetaId());
2765 $this->tpl->setVariable(
"ACTION_DELETE",
2766 $this->ctrl->getLinkTarget($this,
"deleteSection"));
2767 $this->ctrl->setParameter($this,
"section",
"meta_relation");
2768 $this->tpl->setVariable(
"ACTION_ADD",
2769 $this->ctrl->getLinkTarget($this,
"addSection"));
2770 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"meta_delete"));
2771 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"meta_add"));
2772 $this->tpl->setVariable(
"TXT_NEW_ELEMENT", $this->lng->txt(
"meta_new_element"));
2773 $this->tpl->setVariable(
"TXT_KIND", $this->lng->txt(
"meta_kind"));
2774 $this->tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
2775 $this->tpl->setVariable(
"TXT_ISPARTOF", $this->lng->txt(
"meta_is_part_of"));
2776 $this->tpl->setVariable(
"TXT_HASPART", $this->lng->txt(
"meta_has_part"));
2777 $this->tpl->setVariable(
"TXT_ISVERSIONOF", $this->lng->txt(
"meta_is_version_of"));
2778 $this->tpl->setVariable(
"TXT_HASVERSION", $this->lng->txt(
"meta_has_version"));
2779 $this->tpl->setVariable(
"TXT_ISFORMATOF", $this->lng->txt(
"meta_is_format_of"));
2780 $this->tpl->setVariable(
"TXT_HASFORMAT", $this->lng->txt(
"meta_has_format"));
2781 $this->tpl->setVariable(
"TXT_REFERENCES", $this->lng->txt(
"meta_references"));
2782 $this->tpl->setVariable(
"TXT_ISREFERENCEDBY", $this->lng->txt(
"meta_is_referenced_by"));
2783 $this->tpl->setVariable(
"TXT_ISBASEDON", $this->lng->txt(
"meta_is_based_on"));
2784 $this->tpl->setVariable(
"TXT_ISBASISFOR", $this->lng->txt(
"meta_is_basis_for"));
2785 $this->tpl->setVariable(
"TXT_REQUIRES", $this->lng->txt(
"meta_requires"));
2786 $this->tpl->setVariable(
"TXT_ISREQUIREDBY", $this->lng->txt(
"meta_is_required_by"));
2787 $this->tpl->setVariable(
"TXT_RESOURCE", $this->lng->txt(
"meta_resource"));
2788 $this->tpl->setVariable(
"VAL_KIND_" . strtoupper($this->md_section->getKind()),
" selected");
2789 $this->tpl->parseCurrentBlock();
2792 $this->tpl->setCurrentBlock(
"relation");
2793 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
2794 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2795 $this->tpl->parseCurrentBlock();
2801 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
2804 foreach($ids = $this->md_obj->getRelationIds() as $id)
2807 $relation = $this->md_obj->getRelation($id);
2808 $relation->setKind(
$_POST[
'relation'][$id][
'Kind']);
2810 $relation->update();
2813 $res_idents = $relation->getIdentifier_Ids();
2814 foreach ($res_idents as $res_id)
2816 $ident = $relation->getIdentifier_($res_id);
2823 $res_dess = $relation->getDescriptionIds();
2824 foreach ($res_dess as $res_des)
2826 $des = $relation->getDescription($res_des);
2828 $des->setDescriptionLanguage(
2844 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
2846 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_annotation.html',
'Services/MetaData');
2848 $anno_ids = $this->md_obj->getAnnotationIds();
2849 if (!is_array($anno_ids) || count($anno_ids) == 0)
2851 $this->tpl->setCurrentBlock(
"no_annotation");
2852 $this->tpl->setVariable(
"TXT_NO_ANNOTATION", $this->lng->txt(
"meta_no_annotation"));
2853 $this->tpl->setVariable(
"TXT_ADD_ANNOTATION", $this->lng->txt(
"meta_add"));
2854 $this->ctrl->setParameter($this,
"section",
"meta_annotation");
2855 $this->tpl->setVariable(
"ACTION_ADD_ANNOTATION",
2856 $this->ctrl->getLinkTarget($this,
"addSection"));
2857 $this->tpl->parseCurrentBlock();
2861 foreach($anno_ids as $anno_id)
2863 $this->ctrl->setParameter($this,
'meta_index', $anno_id);
2864 $this->ctrl->setParameter($this,
"section",
"meta_annotation");
2866 $this->md_section = $this->md_obj->getAnnotation($anno_id);
2868 $this->tpl->setCurrentBlock(
"annotation_loop");
2869 $this->tpl->setVariable(
"ANNOTATION_ID", $anno_id);
2870 $this->tpl->setVariable(
"TXT_ANNOTATION", $this->lng->txt(
"meta_annotation"));
2871 $this->ctrl->setParameter($this,
"meta_index", $anno_id);
2872 $this->tpl->setVariable(
"ACTION_DELETE",
2873 $this->ctrl->getLinkTarget($this,
"deleteSection"));
2874 $this->ctrl->setParameter($this,
"section",
"meta_annotation");
2875 $this->tpl->setVariable(
"ACTION_ADD",
2876 $this->ctrl->getLinkTarget($this,
"addSection"));
2877 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"meta_delete"));
2878 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"meta_add"));
2880 $this->tpl->setVariable(
"TXT_ENTITY", $this->lng->txt(
"meta_entity"));
2882 $this->tpl->setVariable(
"TXT_DATE", $this->lng->txt(
"meta_date"));
2886 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
2887 $this->tpl->setVariable(
"TXT_VALUE", $this->lng->txt(
"meta_value"));
2889 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2890 $this->tpl->setVariable(
"VAL_DESCRIPTION_LANGUAGE",
2892 $this->md_section->getDescriptionLanguageCode()));
2894 $this->tpl->parseCurrentBlock();
2897 $this->tpl->setCurrentBlock(
"annotation");
2898 $this->tpl->setVariable(
"EDIT_ACTION",$this->ctrl->getFormAction($this));
2899 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2900 $this->tpl->parseCurrentBlock();
2906 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
2909 foreach($ids = $this->md_obj->getAnnotationIds() as $id)
2912 $annotation = $this->md_obj->getAnnotation($id);
2916 $annotation->setDescriptionLanguage(
2919 $annotation->update();
2932 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.md_editor.html',
'Services/MetaData');
2933 $this->
__setTabs(
'meta_classification');
2934 $this->tpl->addBlockFile(
'MD_CONTENT',
'md_content',
'tpl.md_classification.html',
'Services/MetaData');
2936 $class_ids = $this->md_obj->getClassificationIds();
2937 if (!is_array($class_ids) || count($class_ids) == 0)
2939 $this->tpl->setCurrentBlock(
"no_classification");
2940 $this->tpl->setVariable(
"TXT_NO_CLASSIFICATION", $this->lng->txt(
"meta_no_classification"));
2941 $this->tpl->setVariable(
"TXT_ADD_CLASSIFICATION", $this->lng->txt(
"meta_add"));
2942 $this->ctrl->setParameter($this,
"section",
"meta_classification");
2943 $this->tpl->setVariable(
"ACTION_ADD_CLASSIFICATION",
2944 $this->ctrl->getLinkTarget($this,
"addSection"));
2945 $this->tpl->parseCurrentBlock();
2949 foreach($class_ids as $class_id)
2951 $this->md_section = $this->md_obj->getClassification($class_id);
2952 $this->ctrl->setParameter($this,
"section",
"meta_classification");
2955 $tp_ids = $this->md_section->getTaxonPathIds();
2956 foreach ($tp_ids as $tp_id)
2958 $tax_path = $this->md_section->getTaxonPath($tp_id);
2960 $tax_ids = $tax_path->getTaxonIds();
2962 foreach($tax_ids as $tax_id)
2964 $taxon = $tax_path->getTaxon($tax_id);
2966 if (count($tax_ids) > 1)
2968 $this->tpl->setCurrentBlock(
"taxon_delete");
2969 $this->ctrl->setParameter($this,
"meta_index", $tax_id);
2970 $this->ctrl->setParameter($this,
"meta_path",
"classification_taxon");
2971 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_ACTION_DELETE",
2972 $this->ctrl->getLinkTarget($this,
"deleteElement"));
2973 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
2974 $this->tpl->parseCurrentBlock();
2977 $this->tpl->setCurrentBlock(
"taxonpath_taxon_loop");
2978 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_NO", $tax_id);
2979 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_TAXONPATH_NO", $tp_id);
2980 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_TXT_TAXON", $this->lng->txt(
"meta_taxon"));
2981 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
2983 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_TXT_ID", $this->lng->txt(
"meta_id"));
2985 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
2986 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_VAL_TAXON_LANGUAGE",
2988 $taxon->getTaxonLanguageCode()));
2990 $this->ctrl->setParameter($this,
"section_element",
"Taxon_".$class_id);
2991 $this->ctrl->setParameter($this,
"meta_index", $tp_id);
2992 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_ACTION_ADD",
2993 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
2994 $this->tpl->setVariable(
"TAXONPATH_TAXON_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
2995 $this->tpl->parseCurrentBlock();
2998 if (count($tp_ids) > 1)
3000 $this->tpl->setCurrentBlock(
"taxonpath_delete");
3001 $this->ctrl->setParameter($this,
"meta_index", $tp_id);
3002 $this->ctrl->setParameter($this,
"meta_path",
"classification_taxon_path");
3003 $this->tpl->setVariable(
"TAXONPATH_LOOP_ACTION_DELETE",
3004 $this->ctrl->getLinkTarget($this,
"deleteElement"));
3005 $this->tpl->setVariable(
"TAXONPATH_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
3006 $this->tpl->parseCurrentBlock();
3009 $this->tpl->setCurrentBlock(
"taxonpath_loop");
3010 $this->tpl->setVariable(
"TAXONPATH_LOOP_NO", $tp_id);
3011 $this->tpl->setVariable(
"TAXONPATH_LOOP_ROWSPAN", (3 * count($tax_ids)) + 2);
3012 $this->tpl->setVariable(
"TAXONPATH_LOOP_TXT_TAXONPATH", $this->lng->txt(
"meta_taxon_path"));
3013 $this->tpl->setVariable(
"TAXONPATH_LOOP_TXT_SOURCE", $this->lng->txt(
"meta_source"));
3014 $this->tpl->setVariable(
"TAXONPATH_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
3015 $this->tpl->setVariable(
"TAXONPATH_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
3017 $this->tpl->setVariable(
"TAXONPATH_LOOP_VAL_SOURCE_LANGUAGE",
3019 $tax_path->getSourceLanguageCode()));
3020 $this->ctrl->setParameter($this,
"section_element",
"TaxonPath_".$class_id);
3021 $this->ctrl->setParameter($this,
"meta_index", $class_id);
3022 $this->tpl->setVariable(
"TAXONPATH_LOOP_ACTION_ADD",
3023 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
3024 $this->tpl->setVariable(
"TAXONPATH_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
3025 $this->tpl->parseCurrentBlock();
3029 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"meta_description"));
3030 $this->tpl->setVariable(
"TXT_VALUE", $this->lng->txt(
"meta_value"));
3031 $this->tpl->setVariable(
"VAL_DESCRIPTION",
3033 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
3034 $this->tpl->setVariable(
"VAL_DESCRIPTION_LANGUAGE",
3036 $this->md_section->getDescriptionLanguageCode()));
3039 $key_ids = $this->md_section->getKeywordIds();
3040 foreach ($key_ids as $key_id)
3042 if (count($key_ids) > 1)
3044 $this->ctrl->setParameter($this,
"meta_index", $key_id);
3045 $this->ctrl->setParameter($this,
"meta_path",
"classification_keyword");
3046 $this->tpl->setCurrentBlock(
"keyword_delete");
3047 $this->tpl->setVariable(
"KEYWORD_LOOP_ACTION_DELETE",
3048 $this->ctrl->getLinkTarget($this,
"deleteElement"));
3049 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_DELETE", $this->lng->txt(
"meta_delete"));
3050 $this->tpl->parseCurrentBlock();
3053 $keyword = $this->md_section->getKeyword($key_id);
3054 $this->tpl->setCurrentBlock(
"keyword_loop");
3055 $this->tpl->setVariable(
"KEYWORD_LOOP_NO", $key_id);
3056 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt(
"meta_keyword"));
3057 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_VALUE", $this->lng->txt(
"meta_value"));
3058 $this->tpl->setVariable(
"KEYWORD_LOOP_VAL",
3060 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_LANGUAGE", $this->lng->txt(
"meta_language"));
3061 $this->tpl->setVariable(
"KEYWORD_LOOP_VAL_LANGUAGE",
3063 $keyword->getKeywordLanguageCode()));
3064 $this->ctrl->setParameter($this,
"meta_index", $class_id);
3065 $this->ctrl->setParameter($this,
"section_element",
"Keyword_".$class_id);
3066 $this->tpl->setVariable(
"KEYWORD_LOOP_ACTION_ADD",
3067 $this->ctrl->getLinkTarget($this,
"addSectionElement"));
3068 $this->tpl->setVariable(
"KEYWORD_LOOP_TXT_ADD", $this->lng->txt(
"meta_add"));
3069 $this->tpl->parseCurrentBlock();
3072 $this->tpl->setCurrentBlock(
"classification_loop");
3073 $this->tpl->setVariable(
"TXT_CLASSIFICATION", $this->lng->txt(
"meta_classification"));
3074 $this->ctrl->setParameter($this,
"meta_index", $class_id);
3075 $this->tpl->setVariable(
"ACTION_DELETE",
3076 $this->ctrl->getLinkTarget($this,
"deleteSection"));
3077 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"meta_delete"));
3078 $this->tpl->setVariable(
"ACTION_ADD",
3079 $this->ctrl->getLinkTarget($this,
"addSection"));
3080 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"meta_add"));
3082 $this->tpl->setVariable(
"TXT_NEW_ELEMENT", $this->lng->txt(
"meta_new_element"));
3083 $this->tpl->setVariable(
"TXT_TAXONPATH", $this->lng->txt(
"meta_taxon_path"));
3084 $this->tpl->setVariable(
"TXT_KEYWORD", $this->lng->txt(
"meta_keyword"));
3085 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"meta_add"));
3087 $this->tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
3088 $this->tpl->setVariable(
"CLASS_ID", $class_id);
3089 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"meta_purpose"));
3090 $this->tpl->setVariable(
"TXT_DISCIPLINE", $this->lng->txt(
"meta_learning_resource_type"));
3091 $this->tpl->setVariable(
"TXT_IDEA", $this->lng->txt(
"meta_idea"));
3092 $this->tpl->setVariable(
"TXT_PREREQUISITE", $this->lng->txt(
"meta_prerequisite"));
3093 $this->tpl->setVariable(
"TXT_EDUCATIONALOBJECTIVE", $this->lng->txt(
"meta_educational_objective"));
3094 $this->tpl->setVariable(
"TXT_ACCESSIBILITYRESTRICTIONS", $this->lng->txt(
"meta_accessibility_restrictions"));
3095 $this->tpl->setVariable(
"TXT_EDUCATIONALLEVEL", $this->lng->txt(
"meta_educational_level"));
3096 $this->tpl->setVariable(
"TXT_SKILLLEVEL", $this->lng->txt(
"meta_skill_level"));
3097 $this->tpl->setVariable(
"TXT_SECURITYLEVEL", $this->lng->txt(
"meta_security_level"));
3098 $this->tpl->setVariable(
"TXT_COMPETENCY", $this->lng->txt(
"meta_competency"));
3099 $this->tpl->setVariable(
"VAL_PURPOSE_" . strtoupper($this->md_section->getPurpose()),
" selected");
3100 $this->tpl->parseCurrentBlock();
3103 $this->tpl->setCurrentBlock(
"classification");
3104 $this->tpl->setVariable(
"EDIT_ACTION",
3105 $this->ctrl->getFormAction($this));
3106 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3107 $this->tpl->parseCurrentBlock();
3113 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
3116 foreach($ids = $this->md_obj->getClassificationIds() as $id)
3119 $classification = $this->md_obj->getClassification($id);
3120 $classification->setPurpose(
$_POST[
'classification'][$id][
'Purpose']);
3123 $classification->setDescriptionLanguage(
3126 $classification->update();
3128 $key_ids = $classification->getKeywordIds();
3129 foreach ($key_ids as $key_id)
3131 $keyword = $classification->getKeyword($key_id);
3133 $keyword->setKeywordLanguage(
3138 $tp_ids = $classification->getTaxonPathIds();
3139 foreach ($tp_ids as $tp_id)
3141 $tax_path = $classification->getTaxonPath($tp_id);
3143 $tax_path->setSourceLanguage(
3145 $tax_path->update();
3147 $tax_ids = $tax_path->getTaxonIds();
3149 foreach($tax_ids as $tax_id)
3151 $taxon = $tax_path->getTaxon($tax_id);
3153 $taxon->setTaxonLanguage(
3170 include_once
'Services/MetaData/classes/class.ilMDFactory.php';
3173 $md_element->delete();
3182 include_once
'Services/MetaData/classes/class.ilMDFactory.php';
3185 $md_element->delete();
3195 switch(
$_GET[
'section'])
3197 case 'meta_technical':
3198 $this->md_section =& $this->md_obj->addTechnical();
3199 $this->md_section->save();
3203 case 'meta_lifecycle':
3204 $this->md_section =& $this->md_obj->addLifecycle();
3205 $this->md_section->save();
3206 $con =& $this->md_section->addContribute();
3209 $ent =& $con->addEntity();
3213 case 'meta_meta_metadata':
3214 $this->md_section = $this->md_obj->addMetaMetadata();
3215 $this->md_section->save();
3217 $ide =& $this->md_section->addIdentifier();
3220 $con =& $this->md_section->addContribute();
3223 $ent =& $con->addEntity();
3228 $this->md_section = $this->md_obj->addRights();
3229 $this->md_section->save();
3232 case 'meta_educational':
3233 $this->md_section = $this->md_obj->addEducational();
3234 $this->md_section->save();
3237 case 'meta_relation':
3238 $this->md_section = $this->md_obj->addRelation();
3239 $this->md_section->save();
3240 $ident = $this->md_section->addIdentifier_();
3242 $des = $this->md_section->addDescription();
3246 case 'meta_annotation':
3247 $this->md_section = $this->md_obj->addAnnotation();
3248 $this->md_section->save();
3251 case 'meta_classification':
3252 $this->md_section = $this->md_obj->addClassification();
3253 $this->md_section->save();
3255 $taxon_path =& $this->md_section->addTaxonPath();
3256 $taxon_path->save();
3258 $taxon =& $taxon_path->addTaxon();
3261 $key =& $this->md_section->addKeyword();
3273 $section_element = (empty(
$_POST[
'section_element']))
3274 ?
$_GET[
'section_element']
3275 :
$_POST[
'section_element'];
3279 switch(
$_GET[
'section'])
3281 case 'meta_technical':
3282 $this->md_section =& $this->md_obj->getTechnical();
3285 case 'meta_lifecycle':
3286 $this->md_section =& $this->md_obj->getLifecycle();
3289 case 'meta_meta_metadata':
3290 $this->md_section =& $this->md_obj->getMetaMetadata();
3293 case 'meta_general':
3294 $this->md_section = $this->md_obj->getGeneral();
3297 case 'meta_educational':
3298 $this->md_section = $this->md_obj->getEducational();
3301 case 'meta_classification':
3302 $arr = explode(
"_", $section_element);
3303 $section_element = $arr[0];
3304 $this->md_section = $this->md_obj->getClassification($arr[1]);
3309 switch($section_element)
3311 case 'meta_or_composite':
3312 $md_new =& $this->md_section->addOrComposite();
3313 $md_new = $md_new->addRequirement();
3316 case 'meta_requirement':
3317 $md_new =& $this->md_section->addRequirement();
3320 case 'meta_location':
3321 $md_new =& $this->md_section->addLocation();
3325 $md_new = $this->md_section->addFormat();
3329 $md_new = $this->md_section->getContribute((
int)
$_GET[
'meta_index']);
3330 $md_new = $md_new->addEntity();
3333 case 'meta_identifier':
3334 $md_new = $this->md_section->addIdentifier();
3337 case 'meta_contribute':
3338 $md_new =& $this->md_section->addContribute();
3340 $md_new = $md_new->addEntity();
3343 case 'educational_language':
3344 case 'meta_language':
3345 $md_new = $this->md_section->addLanguage();
3348 case 'educational_description':
3349 case 'meta_description':
3350 $md_new = $this->md_section->addDescription();
3354 case 'meta_keyword':
3355 $md_new = $this->md_section->addKeyword();
3358 case 'educational_typical_age_range':
3359 $md_new = $this->md_section->addTypicalAgeRange();
3362 case 'relation_resource_identifier':
3363 $rel = $this->md_obj->getRelation($_GET[
'meta_index']);
3364 $md_new = $rel->addIdentifier_();
3367 case 'relation_resource_description':
3368 $rel = $this->md_obj->getRelation($_GET[
'meta_index']);
3369 $md_new = $rel->addDescription();
3373 $md_new = $this->md_section->addTaxonPath();
3375 $md_new = $md_new->addTaxon();
3379 $tax_path = $this->md_section->getTaxonPath($_GET[
'meta_index']);
3380 $md_new = $tax_path->addTaxon();
3395 case 'meta_general':
3398 case 'meta_lifecycle':
3401 case 'meta_technical':
3404 case 'meta_meta_metadata':
3405 return $this->listMetaMetadata();
3408 return $this->
debug();
3413 case 'meta_educational':
3416 case 'meta_relation':
3419 case 'meta_annotation':
3422 case 'meta_classification':
3426 if($this->md_obj->obj_type==
'sahs'||$this->md_obj->obj_type==
'sco')
3437 if(count($subs = $this->md_section->getPossibleSubelements()))
3441 $this->tpl->setCurrentBlock(
"subelements");
3442 $this->tpl->setVariable(
"SEL_SUBELEMENTS",
ilUtil::formSelect(
'',
'section_element',$subs));
3443 $this->tpl->setVariable(
"TXT_NEW_ELEMENT", $this->lng->txt(
"meta_new_element"));
3444 $this->tpl->parseCurrentBlock();
3446 $this->tpl->setVariable(
"TXT_ADD",$this->lng->txt(
'meta_add'));
3456 $tabs = array(
'meta_quickedit' =>
'listQuickEdit',
3457 'meta_general' =>
'listGeneral',
3458 'meta_lifecycle' =>
'listLifecycle',
3459 'meta_meta_metadata' =>
'listMetaMetadata',
3460 'meta_technical' =>
'listTechnical',
3461 'meta_educational' =>
'listEducational',
3462 'meta_rights' =>
'listRights',
3463 'meta_relation' =>
'listRelation',
3464 'meta_annotation' =>
'listAnnotation',
3465 'meta_classification' =>
'listClassification');
3469 $tabs[
'debug'] =
'debug';
3472 #include_once("classes/class.ilTabsGUI.php");
3473 #$tab_gui = new ilTabsGUI();
3474 #$tab_gui->setSubTabs();
3475 foreach($tabs as $key => $target)
3477 if($a_active == $key)
3485 $this->ctrl->setParameter($this,
'section',$key);
3486 $this->tabs_gui->addSubTabTarget($key, $this->ctrl->getLinkTarget($this,
'listSection'),
3487 "",
"",
"", $active);
3489 #$this->tpl->setVariable("SUB_TABS", $tab_gui->getHTML());
3499 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
3505 $tpl->setCurrentBlock(
"lg_option");
3506 $tpl->setVariable(
"VAL_LG", $code);
3507 $tpl->setVariable(
"TXT_LG", $text);
3509 if ($a_value !=
"" &&
3512 $tpl->setVariable(
"SELECTED",
"selected");
3515 $tpl->parseCurrentBlock();
3517 $tpl->setVariable(
"TXT_PLEASE_SELECT", $this->lng->txt(
"meta_please_select"));
3518 $tpl->setVariable(
"SEL_NAME", $a_name);
3520 $return =
$tpl->get();
3528 for($i = 0;$i <= 24;$i++)
3530 $options[$i] = sprintf(
'%02d',$i);
3538 for($i = 0;$i <= 31;$i++)
3540 $options[$i] = sprintf(
'%02d',$i);
3550 $this->observers[$a_element][
'class'] =& $a_class;
3551 $this->observers[$a_element][
'method'] =& $a_method;
3557 if(isset($this->observers[$a_element]))
3559 $class =& $this->observers[$a_element][
'class'];
3560 $method = $this->observers[$a_element][
'method'];
3562 return $class->$method($a_element);