00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 require_once("./classes/class.ilMetaData.php");
00025
00036 class ilMetaDataGUI
00037 {
00038 var $ilias;
00039 var $tpl;
00040 var $lng;
00041 var $obj;
00042 var $meta_obj;
00043
00044
00049 function ilMetaDataGUI()
00050 {
00051 global $ilias, $tpl, $lng;
00052 $lng->LoadLanguageModule("meta");
00053
00054 $this->ilias =& $ilias;
00055 $this->tpl =& $tpl;
00056 $this->lng =& $lng;
00057
00058 }
00059
00060
00061 function setObject(&$a_obj)
00062 {
00063 $this->obj =& $a_obj;
00064 $this->meta_obj =& $this->obj->getMetaData();
00065 }
00066
00070 function curValue($a_val_name)
00071 {
00072 if(is_object($this->meta_obj))
00073 {
00074 $method = "get".$a_val_name;
00075 return $this->meta_obj->$method();
00076 }
00077 else
00078 {
00079 return "";
00080 }
00081 }
00082
00086 function showLangSel($a_name, $a_value = "")
00087 {
00088 $tpl = new ilTemplate("tpl.lang_selection.html", true, true);
00089 $languages = ilMetaData::getLanguages();
00090 foreach($languages as $code => $text)
00091 {
00092 $tpl->setCurrentBlock("lg_option");
00093 $tpl->setVariable("VAL_LG", $code);
00094 $tpl->setVariable("TXT_LG", $text);
00095 if ($a_value != "" &&
00096 $a_value == $code)
00097 {
00098 $tpl->setVariable("SELECTED", "selected");
00099 }
00100 $tpl->parseCurrentBlock();
00101 }
00102 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00103 $tpl->setVariable("SEL_NAME", $a_name);
00104 $return = $tpl->get();
00105 unset($tpl);
00106
00107 return $return;
00108 }
00109
00110 function fillGeneral($a_formaction, $a_section = "General", $a_language = "")
00111 {
00112
00113 $tpl = new ilTemplate("tpl.meta_data_editor_general.html", true, true);
00114 $tpl->setVariable("TXT_GENERAL", $this->lng->txt("meta_general"));
00115 $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
00116 $tpl->setVariable("TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
00117 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
00118 $tpl->setVariable("TXT_KEYWORD", $this->lng->txt("meta_keyword"));
00119 $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
00120 $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
00121 $tpl->setVariable("TXT_STRUCTURE", $this->lng->txt("meta_structure"));
00122 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00123 $tpl->setVariable("TXT_ATOMIC", $this->lng->txt("meta_atomic"));
00124 $tpl->setVariable("TXT_COLLECTION", $this->lng->txt("meta_collection"));
00125 $tpl->setVariable("TXT_NETWORKED", $this->lng->txt("meta_networked"));
00126 $tpl->setVariable("TXT_HIERARCHICAL", $this->lng->txt("meta_hierarchical"));
00127 $tpl->setVariable("TXT_LINEAR", $this->lng->txt("meta_linear"));
00128
00129 if (is_array($general = $this->meta_obj->getElement("General")))
00130 {
00131 $tpl->setVariable("STRUCTURE_VAL_" . strtoupper($general[0]["Structure"]), " selected");
00132 }
00133
00134
00135 if (is_array($identifier = $this->meta_obj->getElement("Identifier", "General")))
00136 {
00137 for ($i = 0; $i < count($identifier); $i++)
00138 {
00139 if (count($identifier) > 1)
00140 {
00141 $tpl->setCurrentBlock("identifier_delete");
00142 $tpl->setVariable("IDENTIFIER_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=General&meta_name=Identifier&meta_index=" . $i);
00143 $tpl->setVariable("IDENTIFIER_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00144 $tpl->parseCurrentBlock();
00145 }
00146 $tpl->setCurrentBlock("identifier_loop");
00147 $tpl->setVariable("IDENTIFIER_LOOP_NO", $i);
00148 $tpl->setVariable("IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
00149 $tpl->setVariable("IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt("meta_catalog"));
00150 $tpl->setVariable("IDENTIFIER_LOOP_VAL_IDENTIFIER_CATALOG", ilUtil::prepareFormOutput($identifier[$i]["Catalog"]));
00151 $tpl->setVariable("IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt("meta_entry"));
00152 $tpl->setVariable("IDENTIFIER_LOOP_VAL_IDENTIFIER_ENTRY", ilUtil::prepareFormOutput($identifier[$i]["Entry"]));
00153 $tpl->setVariable("IDENTIFIER_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Identifier&meta_language=" . $a_language . "&meta_path=General&meta_section=" . $a_section);
00154 $tpl->setVariable("IDENTIFIER_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00155 $tpl->parseCurrentBlock();
00156 }
00157
00158 }
00159
00160
00161 if (is_array($language = $this->meta_obj->getElement("Language", "General")))
00162 {
00163 for ($i = 0; $i < count($language); $i++)
00164 {
00165 if (count($language) > 1)
00166 {
00167 $tpl->setCurrentBlock("language_delete");
00168 $tpl->setVariable("LANGUAGE_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=General&meta_name=Language&meta_index=" . $i);
00169 $tpl->setVariable("LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00170 $tpl->parseCurrentBlock();
00171 }
00172 $tpl->setCurrentBlock("language_loop");
00173 $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00174 $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00175 $tpl->setVariable("LANGUAGE_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Language][" . $i . "][Language]", $language[$i]["Language"]));
00176 $tpl->setVariable("LANGUAGE_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Language&meta_language=" . $a_language . "&meta_path=General&meta_section=" . $a_section);
00177 $tpl->setVariable("LANGUAGE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00178 $tpl->parseCurrentBlock();
00179 }
00180 }
00181
00182
00183 $title = $this->meta_obj->getElement("Title", "General");
00184 $tpl->setVariable("TXT_TITLE", $this->lng->txt("meta_title"));
00185 $tpl->setVariable("TXT_VALUE", $this->lng->txt("meta_value"));
00186 $tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($title[0]["value"]));
00187 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
00188 $tpl->setVariable("VAL_TITLE_LANGUAGE", $this->showLangSel("meta[Title][Language]", $title[0]["Language"]));
00189
00190
00191 if (is_array($description = $this->meta_obj->getElement("Description", "General")))
00192 {
00193 for ($i = 0; $i < count($description); $i++)
00194 {
00195 if (count($description) > 1)
00196 {
00197 $tpl->setCurrentBlock("description_delete");
00198 $tpl->setVariable("DESCRIPTION_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=General&meta_name=Description&meta_index=" . $i);
00199 $tpl->setVariable("DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00200 $tpl->parseCurrentBlock();
00201 }
00202 $tpl->setCurrentBlock("description_loop");
00203 $tpl->setVariable("DESCRIPTION_LOOP_NO", $i);
00204 $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
00205 $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00206 $tpl->setVariable("DESCRIPTION_LOOP_VAL", ilUtil::stripSlashes($description[$i]["value"]));
00207 $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00208 $tpl->setVariable("DESCRIPTION_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Description][" . $i . "][Language]", $description[$i]["Language"]));
00209 $tpl->setVariable("DESCRIPTION_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Description&meta_language=" . $a_language . "&meta_path=General&meta_section=" . $a_section);
00210 $tpl->setVariable("DESCRIPTION_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00211 $tpl->parseCurrentBlock();
00212 }
00213 }
00214
00215
00216 if (is_array($keyword = $this->meta_obj->getElement("Keyword", "General")))
00217 {
00218 for ($i = 0; $i < count($keyword); $i++)
00219 {
00220 if (count($keyword) > 1)
00221 {
00222 $tpl->setCurrentBlock("keyword_delete");
00223 $tpl->setVariable("KEYWORD_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=General&meta_name=Keyword&meta_index=" . $i);
00224 $tpl->setVariable("KEYWORD_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00225 $tpl->parseCurrentBlock();
00226 }
00227 $tpl->setCurrentBlock("keyword_loop");
00228 $tpl->setVariable("KEYWORD_LOOP_NO", $i);
00229 $tpl->setVariable("KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt("meta_keyword"));
00230 $tpl->setVariable("KEYWORD_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00231 $tpl->setVariable("KEYWORD_LOOP_VAL", ilUtil::prepareFormOutput($keyword[$i]["value"]));
00232 $tpl->setVariable("KEYWORD_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00233 $tpl->setVariable("KEYWORD_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Keyword][" . $i . "][Language]", $keyword[$i]["Language"]));
00234 $tpl->setVariable("KEYWORD_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Keyword&meta_language=" . $a_language . "&meta_path=General&meta_section=" . $a_section);
00235 $tpl->setVariable("KEYWORD_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00236 $tpl->parseCurrentBlock();
00237 }
00238 }
00239
00240
00241 if (is_array($coverage = $this->meta_obj->getElement("Coverage", "General")))
00242 {
00243 $tpl->setCurrentBlock("keyword_loop");
00244 $tpl->setVariable("COVERAGE_LOOP_TXT_COVERAGE", $this->lng->txt("meta_coverage"));
00245 $tpl->setVariable("COVERAGE_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00246 $tpl->setVariable("COVERAGE_LOOP_VAL", ilUtil::prepareFormOutput($coverage[0]["value"]));
00247 $tpl->setVariable("COVERAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00248 $tpl->setVariable("COVERAGE_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Coverage][Language]", $coverage[0]["Language"]));
00249 $tpl->setVariable("COVERAGE_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=General&meta_name=Coverage&meta_index=0");
00250 $tpl->setVariable("COVERAGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00251 $tpl->parseCurrentBlock();
00252 }
00253 else
00254 {
00255 $tpl->setVariable("TXT_COVERAGE", $this->lng->txt("meta_coverage"));
00256 }
00257
00258 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
00259 $tpl->setVariable("VAL_SECTION", $a_section);
00260 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00261 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00262
00263 $this->tpl->setCurrentBlock("general");
00264 $this->tpl->setVariable("GENERAL", $tpl->get());
00265 $this->tpl->parseCurrentBlock();
00266 unset($tpl);
00267
00268 return true;
00269 }
00270
00271 function fillLifecycle($a_formaction, $a_section = "Lifecycle", $a_language = "")
00272 {
00273 if (!is_array($lifecycle = $this->meta_obj->getElement("Lifecycle")))
00274 {
00275 $this->tpl->setCurrentBlock("no_lifecycle");
00276 $this->tpl->setVariable("TXT_NO_LIFECYCLE", $this->lng->txt("meta_no_lifecycle"));
00277 $this->tpl->setVariable("TXT_ADD_LIFECYCLE", $this->lng->txt("meta_add"));
00278 $this->tpl->setVariable("ACTION_ADD_LIFECYCLE", $a_formaction . "&cmd=addMeta&meta_name=Lifecycle&meta_language=" . $a_language . "&meta_section=" . $a_section);
00279 $this->tpl->parseCurrentBlock();
00280 }
00281 else
00282 {
00283
00284 $tpl = new ilTemplate("tpl.meta_data_editor_lifecycle.html", true, true);
00285 $tpl->setVariable("TXT_LIFECYCLE", $this->lng->txt("meta_lifecycle"));
00286 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Lifecycle&meta_index=0");
00287 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
00288 $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
00289 $tpl->setVariable("TXT_CONTRIBUTE", $this->lng->txt("meta_contribute"));
00290 $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
00291 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00292 $tpl->setVariable("TXT_STATUS", $this->lng->txt("meta_status"));
00293 $tpl->setVariable("TXT_DRAFT", $this->lng->txt("meta_draft"));
00294 $tpl->setVariable("TXT_FINAL", $this->lng->txt("meta_final"));
00295 $tpl->setVariable("TXT_REVISED", $this->lng->txt("meta_revised"));
00296 $tpl->setVariable("TXT_UNAVAILABLE", $this->lng->txt("meta_unavailable"));
00297
00298 if (is_array($lifecycle = $this->meta_obj->getElement("Lifecycle")))
00299 {
00300 $tpl->setVariable("VAL_STATUS_" . strtoupper($lifecycle[0]["Status"]), " selected");
00301 }
00302
00303
00304 if (is_array($version = $this->meta_obj->getElement("Version", "Lifecycle")))
00305 {
00306 $tpl->setVariable("TXT_VERSION", $this->lng->txt("meta_version"));
00307 $tpl->setVariable("TXT_VALUE", $this->lng->txt("meta_value"));
00308 $tpl->setVariable("VAL_VERSION", ilUtil::prepareFormOutput($version[0]["value"]));
00309 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
00310 $tpl->setVariable("VAL_VERSION_LANGUAGE", $this->showLangSel("meta[Version][Language]", $version[0]["Language"]));
00311 }
00312
00313
00314 if (is_array($contribute = $this->meta_obj->getElement("Contribute", "Lifecycle")))
00315 {
00316 for ($i = 0; $i < count($contribute); $i++)
00317 {
00318 if (is_array($entity = $this->meta_obj->getElement("Entity", "Lifecycle/Contribute", $i)))
00319 {
00320 $entities = count($entity);
00321 for ($j = 0; $j < count($entity); $j++)
00322 {
00323 if (count($entity) > 1)
00324 {
00325 $tpl->setCurrentBlock("contribute_entity_delete");
00326 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Lifecycle/Contribute&meta_name=Entity&meta_index=" . $i . "," . $j);
00327 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00328 $tpl->parseCurrentBlock();
00329 }
00330
00331 $tpl->setCurrentBlock("contribute_entity_loop");
00332 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_NO", $j);
00333 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_CONTRIBUTE_NO", $i);
00334 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_ENTITY", $this->lng->txt("meta_entity"));
00335 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00336 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_VAL_ENTITY", ilUtil::prepareFormOutput($entity[$j]["value"]));
00337
00338 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Entity&meta_language=" . $a_language . "&meta_path=Lifecycle/Contribute&meta_section=" . $a_section . "&meta_index=" . $i);
00339 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00340 $tpl->parseCurrentBlock();
00341 }
00342 }
00343
00344 if (count($contribute) > 1)
00345 {
00346 $tpl->setCurrentBlock("contribute_delete");
00347 $tpl->setVariable("CONTRIBUTE_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Lifecycle&meta_name=Contribute&meta_index=" . $i);
00348 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00349 $tpl->parseCurrentBlock();
00350 }
00351
00352 $tpl->setCurrentBlock("contribute_loop");
00353 $tpl->setVariable("CONTRIBUTE_LOOP_NO", $i);
00354 $tpl->setVariable("CONTRIBUTE_LOOP_ROWSPAN", (2* $entities) + 2);
00355 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_CONTRIBUTE", $this->lng->txt("meta_contribute"));
00356 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE", $this->lng->txt("meta_role"));
00357 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00358 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE_PUBLISHER", $this->lng->txt("meta_publisher"));
00359 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE_AUTHOR", $this->lng->txt("meta_author"));
00360 $tpl->setVariable("CONTRIBUTE_LOOP_VAL_ROLE_" . strtoupper($contribute[$i]["Role"]), " selected");
00361 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DATE", $this->lng->txt("meta_date"));
00362 if (is_array($date = $this->meta_obj->getElement("Date", "Lifecycle/Contribute", $i)))
00363 {
00364 $tpl->setVariable("CONTRIBUTE_LOOP_VAL_DATE", ilUtil::prepareFormOutput($date[0]["value"]));
00365 }
00366 $tpl->setVariable("CONTRIBUTE_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Contribute&meta_language=" . $a_language . "&meta_path=Lifecycle&meta_section=" . $a_section);
00367 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00368 $tpl->parseCurrentBlock();
00369 }
00370 }
00371
00372 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
00373 $tpl->setVariable("VAL_SECTION", $a_section);
00374 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00375 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00376
00377 $this->tpl->setCurrentBlock("lifecycle");
00378 $this->tpl->setVariable("LIFECYCLE", $tpl->get());
00379 $this->tpl->parseCurrentBlock();
00380 unset($tpl);
00381
00382 }
00383
00384 return true;
00385 }
00386
00387 function fillMetaMetadata($a_formaction, $a_section = "Meta-Metadata", $a_language = "")
00388 {
00389 if (!is_array($meta_metadata = $this->meta_obj->getElement("Meta-Metadata")))
00390 {
00391 $this->tpl->setCurrentBlock("no_meta_metadata");
00392 $this->tpl->setVariable("TXT_NO_META_METADATA", $this->lng->txt("meta_no_meta_metadata"));
00393 $this->tpl->setVariable("TXT_ADD_META_METADATA", $this->lng->txt("meta_add"));
00394 $this->tpl->setVariable("ACTION_ADD_META_METADATA", $a_formaction . "&cmd=addMeta&meta_name=Meta-Metadata&meta_language=" . $a_language . "&meta_section=" . $a_section);
00395 $this->tpl->parseCurrentBlock();
00396 }
00397 else
00398 {
00399
00400 $tpl = new ilTemplate("tpl.meta_data_editor_meta_metadata.html", true, true);
00401 $tpl->setVariable("TXT_META_METADATA", $this->lng->txt("meta_meta_metadata"));
00402 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Meta-Metadata&meta_index=0");
00403 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
00404 $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
00405 $tpl->setVariable("TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
00406 $tpl->setVariable("TXT_CONTRIBUTE", $this->lng->txt("meta_contribute"));
00407 $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
00408 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00409 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
00410 $tpl->setVariable("TXT_METADATASCHEME", $this->lng->txt("meta_metadatascheme"));
00411
00412 if (is_array($meta_metadata = $this->meta_obj->getElement("Meta-Metadata")))
00413 {
00414 $tpl->setVariable("VAL_LANGUAGE", $this->showLangSel("meta[Language]", $meta_metadata[0]["Language"]));
00415 $tpl->setVariable("VAL_METADATASCHEME", ilUtil::stripSlashes($meta_metadata[0]["MetadataScheme"]));
00416 }
00417
00418
00419 if (is_array($identifier = $this->meta_obj->getElement("Identifier", "Meta-Metadata")))
00420 {
00421 for ($i = 0; $i < count($identifier); $i++)
00422 {
00423 if (count($identifier) > 1)
00424 {
00425 $tpl->setCurrentBlock("identifier_delete");
00426 $tpl->setVariable("IDENTIFIER_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Meta-Metadata&meta_name=Identifier&meta_index=" . $i);
00427 $tpl->setVariable("IDENTIFIER_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00428 $tpl->parseCurrentBlock();
00429 }
00430
00431 $tpl->setCurrentBlock("identifier_loop");
00432 $tpl->setVariable("IDENTIFIER_LOOP_NO", $i);
00433 $tpl->setVariable("IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
00434 $tpl->setVariable("IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt("meta_catalog"));
00435 $tpl->setVariable("IDENTIFIER_LOOP_VAL_IDENTIFIER_CATALOG", ilUtil::prepareFormOutput($identifier[$i]["Catalog"]));
00436 $tpl->setVariable("IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt("meta_entry"));
00437 $tpl->setVariable("IDENTIFIER_LOOP_VAL_IDENTIFIER_ENTRY", ilUtil::prepareFormOutput($identifier[$i]["Entry"]));
00438 $tpl->setVariable("IDENTIFIER_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Identifier&meta_language=" . $a_language . "&meta_path=Meta-Metadata&meta_section=" . $a_section);
00439 $tpl->setVariable("IDENTIFIER_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00440 $tpl->parseCurrentBlock();
00441 }
00442 }
00443
00444
00445 if (is_array($contribute = $this->meta_obj->getElement("Contribute", "Meta-Metadata")))
00446 {
00447 for ($i = 0; $i < count($contribute); $i++)
00448 {
00449 if (is_array($entity = $this->meta_obj->getElement("Entity", "Meta-Metadata/Contribute", $i)))
00450 {
00451 $entities = count($entity);
00452 for ($j = 0; $j < count($entity); $j++)
00453 {
00454 if (count($entity) > 1)
00455 {
00456 $tpl->setCurrentBlock("contribute_delete");
00457 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Meta-Metadata/Contribute&meta_name=Entity&&meta_index=" . $i . "," . $j);
00458 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00459 $tpl->parseCurrentBlock();
00460 }
00461
00462 $tpl->setCurrentBlock("contribute_entity_loop");
00463 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_NO", $j);
00464 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_CONTRIBUTE_NO", $i);
00465 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_ENTITY", $this->lng->txt("meta_entity"));
00466 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00467 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_VAL_ENTITY", ilUtil::prepareFormOutput($entity[$j]["value"]));
00468
00469 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Entity&meta_language=" . $a_language . "&meta_path=Meta-Metadata/Contribute&meta_section=" . $a_section . "&meta_index=" . $i);
00470 $tpl->setVariable("CONTRIBUTE_ENTITY_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00471 $tpl->parseCurrentBlock();
00472 }
00473 }
00474
00475 if (count($contribute) > 1)
00476 {
00477 $tpl->setCurrentBlock("contribute_delete");
00478 $tpl->setVariable("CONTRIBUTE_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Meta-Metadata&meta_name=Contribute&meta_index=" . $i);
00479 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00480 $tpl->parseCurrentBlock();
00481 }
00482
00483 $tpl->setCurrentBlock("contribute_loop");
00484 $tpl->setVariable("CONTRIBUTE_LOOP_NO", $i);
00485 $tpl->setVariable("CONTRIBUTE_LOOP_ROWSPAN", ($entities) + 2);
00486 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_CONTRIBUTE", $this->lng->txt("meta_contribute"));
00487 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE", $this->lng->txt("meta_role"));
00488 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00489 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE_PUBLISHER", $this->lng->txt("meta_publisher"));
00490 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ROLE_AUTHOR", $this->lng->txt("meta_author"));
00491 $tpl->setVariable("CONTRIBUTE_LOOP_VAL_ROLE_" . strtoupper($contribute[$i]["Role"]), " selected");
00492 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_DATE", $this->lng->txt("meta_date"));
00493 if (is_array($date = $this->meta_obj->getElement("Date", "Meta-Metadata/Contribute", $i)))
00494 {
00495 $tpl->setVariable("CONTRIBUTE_LOOP_VAL_DATE", ilUtil::prepareFormOutput($date[0]["value"]));
00496 }
00497 $tpl->setVariable("CONTRIBUTE_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Contribute&meta_language=" . $a_language . "&meta_path=Meta-Metadata&meta_section=" . urlencode($a_section));
00498 $tpl->setVariable("CONTRIBUTE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00499 $tpl->parseCurrentBlock();
00500 }
00501 }
00502
00503 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
00504 $tpl->setVariable("VAL_SECTION", $a_section);
00505 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00506 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00507
00508 $this->tpl->setCurrentBlock("meta_metadata");
00509 $this->tpl->setVariable("META_METADATA", $tpl->get());
00510 $this->tpl->parseCurrentBlock();
00511 unset($tpl);
00512
00513 }
00514
00515 return true;
00516 }
00517
00518 function fillEducational($a_formaction, $a_section = "Educational", $a_language = "")
00519 {
00520 if (!is_array($educational = $this->meta_obj->getElement("Educational")))
00521 {
00522 $this->tpl->setCurrentBlock("no_educational");
00523 $this->tpl->setVariable("TXT_NO_EDUCATIONAL", $this->lng->txt("meta_no_educational"));
00524 $this->tpl->setVariable("TXT_ADD_EDUCATIONAL", $this->lng->txt("meta_add"));
00525 $this->tpl->setVariable("ACTION_ADD_EDUCATIONAL", $a_formaction . "&cmd=addMeta&meta_name=Educational&meta_language=" . $a_language . "&meta_section=" . $a_section);
00526 $this->tpl->parseCurrentBlock();
00527 }
00528 else
00529 {
00530
00531 $tpl = new ilTemplate("tpl.meta_data_editor_educational.html", true, true);
00532 $tpl->setVariable("TXT_EDUCATIONAL", $this->lng->txt("meta_educational"));
00533 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Educational&meta_index=0");
00534 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
00535 $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
00536 $tpl->setVariable("TXT_TYPICALAGERANGE", $this->lng->txt("meta_typical_age_range"));
00537 $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
00538 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
00539 $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
00540 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00541
00542 $tpl->setVariable("TXT_INTERACTIVITYTYPE", $this->lng->txt("meta_interactivity_type"));
00543 $tpl->setVariable("TXT_LEARNINGRESOURCETYPE", $this->lng->txt("meta_learning_resource_type"));
00544 $tpl->setVariable("TXT_INTERACTIVITYLEVEL", $this->lng->txt("meta_interactivity_level"));
00545 $tpl->setVariable("TXT_SEMANTICDENSITY", $this->lng->txt("meta_semantic_density"));
00546 $tpl->setVariable("TXT_INTENDEDENDUSERROLE", $this->lng->txt("meta_intended_end_user_role"));
00547 $tpl->setVariable("TXT_CONTEXT", $this->lng->txt("meta_context"));
00548 $tpl->setVariable("TXT_DIFFICULTY", $this->lng->txt("meta_difficulty"));
00549 if (is_array($educational = $this->meta_obj->getElement("Educational")))
00550 {
00551 $tpl->setVariable("VAL_INTERACTIVITYTYPE_" . strtoupper($educational[0]["InteractivityType"]), " selected");
00552 $tpl->setVariable("VAL_LEARNINGRESOURCETYPE_" . strtoupper($educational[0]["LearningResourceType"]), " selected");
00553 $tpl->setVariable("VAL_INTERACTIVITYLEVEL_" . strtoupper($educational[0]["InteractivityLevel"]), " selected");
00554 $tpl->setVariable("VAL_SEMANTICDENSITY_" . strtoupper($educational[0]["SemanticDensity"]), " selected");
00555 $tpl->setVariable("VAL_INTENDEDENDUSERROLE_" . strtoupper($educational[0]["IntendedEndUserRole"]), " selected");
00556 $tpl->setVariable("VAL_CONTEXT_" . strtoupper($educational[0]["Context"]), " selected");
00557 $tpl->setVariable("VAL_DIFFICULTY_" . strtoupper($educational[0]["Difficulty"]), " selected");
00558 }
00559
00560 $tpl->setVariable("TXT_ACTIVE", $this->lng->txt("meta_active"));
00561 $tpl->setVariable("TXT_EXPOSITIVE", $this->lng->txt("meta_expositive"));
00562 $tpl->setVariable("TXT_MIXED", $this->lng->txt("meta_mixed"));
00563 $tpl->setVariable("TXT_EXERCISE", $this->lng->txt("meta_exercise"));
00564 $tpl->setVariable("TXT_SIMULATION", $this->lng->txt("meta_simulation"));
00565 $tpl->setVariable("TXT_QUESTIONNAIRE", $this->lng->txt("meta_questionnaire"));
00566 $tpl->setVariable("TXT_DIAGRAMM", $this->lng->txt("meta_diagramm"));
00567 $tpl->setVariable("TXT_FIGURE", $this->lng->txt("meta_figure"));
00568 $tpl->setVariable("TXT_GRAPH", $this->lng->txt("meta_graph"));
00569 $tpl->setVariable("TXT_INDEX", $this->lng->txt("meta_index"));
00570 $tpl->setVariable("TXT_SLIDE", $this->lng->txt("meta_slide"));
00571 $tpl->setVariable("TXT_TABLE", $this->lng->txt("meta_table"));
00572 $tpl->setVariable("TXT_NARRATIVETEXT", $this->lng->txt("meta_narrative_text"));
00573 $tpl->setVariable("TXT_EXAM", $this->lng->txt("meta_exam"));
00574 $tpl->setVariable("TXT_EXPERIMENT", $this->lng->txt("meta_experiment"));
00575 $tpl->setVariable("TXT_PROBLEMSTATEMENT", $this->lng->txt("meta_problem_statement"));
00576 $tpl->setVariable("TXT_SELFASSESSMENT", $this->lng->txt("meta_self_assessment"));
00577 $tpl->setVariable("TXT_LECTURE", $this->lng->txt("meta_lecture"));
00578 $tpl->setVariable("TXT_VERYLOW", $this->lng->txt("meta_very_low"));
00579 $tpl->setVariable("TXT_LOW", $this->lng->txt("meta_low"));
00580 $tpl->setVariable("TXT_MEDIUM", $this->lng->txt("meta_medium"));
00581 $tpl->setVariable("TXT_HIGH", $this->lng->txt("meta_high"));
00582 $tpl->setVariable("TXT_VERYHIGH", $this->lng->txt("meta_very_low"));
00583 $tpl->setVariable("TXT_TEACHER", $this->lng->txt("meta_teacher"));
00584 $tpl->setVariable("TXT_AUTHOR", $this->lng->txt("meta_author"));
00585 $tpl->setVariable("TXT_LEARNER", $this->lng->txt("meta_learner"));
00586 $tpl->setVariable("TXT_MANAGER", $this->lng->txt("meta_manager"));
00587 $tpl->setVariable("TXT_SCHOOL", $this->lng->txt("meta_school"));
00588 $tpl->setVariable("TXT_HIGHEREDUCATION", $this->lng->txt("meta_higher_education"));
00589 $tpl->setVariable("TXT_TRAINING", $this->lng->txt("meta_training"));
00590 $tpl->setVariable("TXT_OTHER", $this->lng->txt("meta_other"));
00591 $tpl->setVariable("TXT_VERYEASY", $this->lng->txt("meta_very_easy"));
00592 $tpl->setVariable("TXT_EASY", $this->lng->txt("meta_easy"));
00593 $tpl->setVariable("TXT_DIFFICULT", $this->lng->txt("meta_difficult"));
00594 $tpl->setVariable("TXT_VERYDIFFICULT", $this->lng->txt("meta_very_difficult"));
00595
00596
00597 if (is_array($typicalAgeRange = $this->meta_obj->getElement("TypicalAgeRange", "Educational")))
00598 {
00599 for ($i = 0; $i < count($typicalAgeRange); $i++)
00600 {
00601 if (count($typicalAgeRange) > 1)
00602 {
00603 $tpl->setCurrentBlock("typicalagerange_delete");
00604 $tpl->setVariable("TYPICALAGERANGE_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Educational&meta_name=TypicalAgeRange&meta_index=" . $i);
00605 $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00606 $tpl->parseCurrentBlock();
00607 }
00608
00609 $tpl->setCurrentBlock("typicalagerange_loop");
00610 $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_TYPICALAGERANGE", $this->lng->txt("meta_typical_age_range"));
00611 $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00612 $tpl->setVariable("TYPICALAGERANGE_LOOP_VAL", ilUtil::prepareFormOutput($typicalAgeRange[$i]["value"]));
00613 $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00614 $tpl->setVariable("TYPICALAGERANGE_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[TypicalAgeRange][" . $i . "][Language]", $typicalAgeRange[$i]["Language"]));
00615 $tpl->setVariable("TYPICALAGERANGE_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=TypicalAgeRange&meta_language=" . $a_language . "&meta_path=Educational&meta_section=" . $a_section);
00616 $tpl->setVariable("TYPICALAGERANGE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00617 $tpl->parseCurrentBlock();
00618 }
00619 }
00620
00621
00622 if (is_array($typicalLearningTime = $this->meta_obj->getElement("TypicalLearningTime", "Educational")))
00623 {
00624 $tpl->setVariable("TXT_TYPICALLEARNINGTIME", $this->lng->txt("meta_typical_learning_time"));
00625 $tpl->setVariable("VAL_TYPICALLEARNINGTIME", ilUtil::prepareFormOutput($typicalLearningTime[0]["value"]));
00626 }
00627
00628
00629 if (is_array($description = $this->meta_obj->getElement("Description", "Educational")))
00630 {
00631 for ($i = 0; $i < count($description); $i++)
00632 {
00633 $tpl->setCurrentBlock("description_loop");
00634 $tpl->setVariable("DESCRIPTION_LOOP_NO", $i);
00635 $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
00636 $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00637 $tpl->setVariable("DESCRIPTION_LOOP_VAL", ilUtil::stripSlashes($description[$i]["value"]));
00638 $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00639 $tpl->setVariable("DESCRIPTION_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Description][" . $i . "][Language]", $description[$i]["Language"]));
00640 $tpl->setVariable("DESCRIPTION_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Educational&meta_name=Description&meta_index=" . $i);
00641 $tpl->setVariable("DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00642 $tpl->setVariable("DESCRIPTION_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Description&meta_language=" . $a_language . "&meta_path=Educational&meta_section=" . $a_section);
00643 $tpl->setVariable("DESCRIPTION_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00644 $tpl->parseCurrentBlock();
00645 }
00646 }
00647
00648
00649 if (is_array($language = $this->meta_obj->getElement("Language", "Educational")))
00650 {
00651 for ($i = 0; $i < count($language); $i++)
00652 {
00653 $tpl->setCurrentBlock("language_loop");
00654 $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00655 $tpl->setVariable("LANGUAGE_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00656 $tpl->setVariable("LANGUAGE_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Language][" . $i . "][Language]", $language[$i]["Language"]));
00657
00658 $tpl->setVariable("LANGUAGE_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Educational&meta_name=Language&meta_index=" . $i);
00659 $tpl->setVariable("LANGUAGE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00660 $tpl->setVariable("LANGUAGE_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Language&meta_language=" . $a_language . "&meta_path=Educational&meta_section=" . $a_section);
00661 $tpl->setVariable("LANGUAGE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00662 $tpl->parseCurrentBlock();
00663 }
00664 }
00665
00666 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
00667 $tpl->setVariable("VAL_SECTION", $a_section);
00668 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00669 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00670
00671 $this->tpl->setCurrentBlock("educational");
00672 $this->tpl->setVariable("EDUCATIONAL", $tpl->get());
00673 $this->tpl->parseCurrentBlock();
00674 unset($tpl);
00675
00676 }
00677
00678 return true;
00679 }
00680
00681 function fillRights($a_formaction, $a_section = "Rights", $a_language = "")
00682 {
00683 if (!is_array($rights = $this->meta_obj->getElement("Rights")))
00684 {
00685 $this->tpl->setCurrentBlock("no_rights");
00686 $this->tpl->setVariable("TXT_NO_RIGHTS", $this->lng->txt("meta_no_rights"));
00687 $this->tpl->setVariable("TXT_ADD_RIGHTS", $this->lng->txt("meta_add"));
00688 $this->tpl->setVariable("ACTION_ADD_RIGHTS", $a_formaction . "&cmd=addMeta&meta_name=Rights&meta_language=" . $a_language . "&meta_section=" . $a_section);
00689 $this->tpl->parseCurrentBlock();
00690 }
00691 else
00692 {
00693
00694 $tpl = new ilTemplate("tpl.meta_data_editor_rights.html", true, true);
00695 $tpl->setVariable("TXT_RIGHTS", $this->lng->txt("meta_rights"));
00696 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Rights&meta_index=0");
00697 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
00698
00699 $tpl->setVariable("TXT_COST", $this->lng->txt("meta_cost"));
00700 $tpl->setVariable("TXT_COPYRIGHTANDOTHERRESTRICTIONS", $this->lng->txt("meta_copyright_and_other_restrictions"));
00701 if (is_array($rights = $this->meta_obj->getElement("Rights")))
00702 {
00703 $tpl->setVariable("VAL_COST_" . strtoupper($rights[0]["Cost"]), " selected");
00704 $tpl->setVariable("VAL_COPYRIGHTANDOTHERRESTRICTIONS_" . strtoupper($rights[0]["CopyrightAndOtherRestrictions"]), " selected");
00705 }
00706
00707 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00708 $tpl->setVariable("TXT_YES", $this->lng->txt("meta_yes"));
00709 $tpl->setVariable("TXT_NO", $this->lng->txt("meta_no"));
00710
00711
00712 if (is_array($description = $this->meta_obj->getElement("Description", "Rights")))
00713 {
00714 for ($i = 0; $i < count($description); $i++)
00715 {
00716 $tpl->setCurrentBlock("description_loop");
00717 $tpl->setVariable("DESCRIPTION_LOOP_NO", $i);
00718 $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
00719 $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00720 $tpl->setVariable("DESCRIPTION_LOOP_VAL", ilUtil::stripSlashes($description[$i]["value"]));
00721 $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00722 $tpl->setVariable("DESCRIPTION_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Description][" . $i . "][Language]", $description[$i]["Language"]));
00723 $tpl->parseCurrentBlock();
00724 }
00725 }
00726
00727 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
00728 $tpl->setVariable("VAL_SECTION", $a_section);
00729 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00730 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00731
00732 $this->tpl->setCurrentBlock("rights");
00733 $this->tpl->setVariable("RIGHTS", $tpl->get());
00734 $this->tpl->parseCurrentBlock();
00735 unset($tpl);
00736
00737 }
00738
00739 return true;
00740 }
00741
00742 function fillAnnotation($a_formaction, $a_section = "Annotation", $a_language = "")
00743 {
00744 if (!is_array($rights = $this->meta_obj->getElement("Annotation")))
00745 {
00746 $this->tpl->setCurrentBlock("no_annotation");
00747 $this->tpl->setVariable("TXT_NO_ANNOTATION", $this->lng->txt("meta_no_annotation"));
00748 $this->tpl->setVariable("TXT_ADD_ANNOTATION", $this->lng->txt("meta_add"));
00749 $this->tpl->setVariable("ACTION_ADD_ANNOTATION", $a_formaction . "&cmd=addMeta&meta_name=Annotation&meta_language=" . $a_language . "&meta_section=" . $a_section);
00750 $this->tpl->parseCurrentBlock();
00751 }
00752 else
00753 {
00754
00755 $tpl = new ilTemplate("tpl.meta_data_editor_annotation.html", true, true);
00756 $tpl->setVariable("TXT_ANNOTATION", $this->lng->txt("meta_annotation"));
00757 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Annotation&meta_index=0");
00758 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
00759
00760 $tpl->setVariable("TXT_ENTITY", $this->lng->txt("meta_entity"));
00761 if (is_array($entity = $this->meta_obj->getElement("Entity", "Annotation")))
00762 {
00763 $tpl->setVariable("VAL_ENTITY", ilUtil::prepareFormOutput($entity[0]["value"]));
00764 }
00765 $tpl->setVariable("TXT_DATE", $this->lng->txt("meta_date"));
00766 if (is_array($date = $this->meta_obj->getElement("Date", "Annotation")))
00767 {
00768 $tpl->setVariable("VAL_DATE", ilUtil::prepareFormOutput($date[0]["value"]));
00769 }
00770
00771
00772 if (is_array($description = $this->meta_obj->getElement("Description", "Annotation")))
00773 {
00774 $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
00775 $tpl->setVariable("TXT_VALUE", $this->lng->txt("meta_value"));
00776 $tpl->setVariable("VAL_DESCRIPTION", ilUtil::stripSlashes($description[0]["value"]));
00777 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
00778 $tpl->setVariable("VAL_DESCRIPTION_LANGUAGE", $this->showLangSel("meta[Description][Language]", $description[0]["Language"]));
00779 }
00780
00781 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
00782 $tpl->setVariable("VAL_SECTION", $a_section);
00783 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00784 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00785
00786 $this->tpl->setCurrentBlock("annotation");
00787 $this->tpl->setVariable("ANNOTATION", $tpl->get());
00788 $this->tpl->parseCurrentBlock();
00789 unset($tpl);
00790
00791 }
00792
00793 return true;
00794 }
00795
00796 function fillClassification($a_formaction, $a_section = "Classification", $a_language = "")
00797 {
00798 if (!is_array($classification = $this->meta_obj->getElement("Classification")))
00799 {
00800 $this->tpl->setCurrentBlock("no_classification");
00801 $this->tpl->setVariable("TXT_NO_CLASSIFICATION", $this->lng->txt("meta_no_classification"));
00802 $this->tpl->setVariable("TXT_ADD_CLASSIFICATION", $this->lng->txt("meta_add"));
00803 $this->tpl->setVariable("ACTION_ADD_CLASSIFICATION", $a_formaction . "&cmd=addMeta&meta_name=Classification&meta_language=" . $a_language . "&meta_section=" . $a_section);
00804 $this->tpl->parseCurrentBlock();
00805 }
00806 else
00807 {
00808
00809 $tpl = new ilTemplate("tpl.meta_data_editor_classification.html", true, true);
00810 $tpl->setVariable("TXT_CLASSIFICATION", $this->lng->txt("meta_classification"));
00811 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Classification&meta_index=0");
00812 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
00813 $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
00814 $tpl->setVariable("TXT_TAXONPATH", $this->lng->txt("meta_taxon_path"));
00815 $tpl->setVariable("TXT_KEYWORD", $this->lng->txt("meta_keyword"));
00816 $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
00817 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00818
00819 $tpl->setVariable("TXT_PURPOSE", $this->lng->txt("meta_purpose"));
00820 $tpl->setVariable("TXT_DESCIPLINE", $this->lng->txt("meta_learning_resource_type"));
00821 $tpl->setVariable("TXT_IDEA", $this->lng->txt("meta_idea"));
00822 $tpl->setVariable("TXT_PREREQUISITE", $this->lng->txt("meta_prerequisite"));
00823 $tpl->setVariable("TXT_EDUCATIONALOBJECTIVE", $this->lng->txt("meta_educational_objective"));
00824 $tpl->setVariable("TXT_ACCESSIBILITYRESTRICTIONS", $this->lng->txt("meta_accessibility_restrictions"));
00825 $tpl->setVariable("TXT_EDUCATIONALLEVEL", $this->lng->txt("meta_educational_level"));
00826 $tpl->setVariable("TXT_SKILLLEVEL", $this->lng->txt("meta_skill_level"));
00827 $tpl->setVariable("TXT_SECURITYLEVEL", $this->lng->txt("meta_security_level"));
00828 $tpl->setVariable("TXT_COMPETENCY", $this->lng->txt("meta_competency"));
00829 if (is_array($classification = $this->meta_obj->getElement("Classification")))
00830 {
00831 $tpl->setVariable("VAL_PURPOSE_" . strtoupper($classification[0]["Purpose"]), " selected");
00832 }
00833
00834
00835 if (is_array($taxonPath = $this->meta_obj->getElement("TaxonPath", "Classification")))
00836 {
00837 for ($i = 0; $i < count($taxonPath); $i++)
00838 {
00839 if (is_array($taxon = $this->meta_obj->getElement("Taxon", "Classification/TaxonPath", $i)))
00840 {
00841 $taxons = count($taxon);
00842 for ($j = 0; $j < count($taxon); $j++)
00843 {
00844 if (count($taxon) > 1)
00845 {
00846 $tpl->setCurrentBlock("taxon_delete");
00847 $tpl->setVariable("TAXONPATH_TAXON_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Classification/TaxonPath&meta_name=Taxon&meta_index=" . $i . "," . $j);
00848 $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00849 $tpl->parseCurrentBlock();
00850 }
00851
00852 $tpl->setCurrentBlock("taxonpath_taxon_loop");
00853 $tpl->setVariable("TAXONPATH_TAXON_LOOP_NO", $j);
00854 $tpl->setVariable("TAXONPATH_TAXON_LOOP_TAXONPATH_NO", $i);
00855 $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_TAXON", $this->lng->txt("meta_taxon"));
00856 $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00857 $tpl->setVariable("TAXONPATH_TAXON_LOOP_VAL_TAXON", ilUtil::prepareFormOutput($taxon[$j]["value"]));
00858 $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_ID", $this->lng->txt("meta_id"));
00859 $tpl->setVariable("TAXONPATH_TAXON_LOOP_VAL_ID", ilUtil::prepareFormOutput($taxon[$j]["Id"]));
00860 $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00861 $tpl->setVariable("TAXONPATH_TAXON_LOOP_VAL_TAXON_LANGUAGE", $this->showLangSel("meta[TaxonPath][" . $i . "][Taxon][" . $j . "][Language]", $taxon[$j]["Language"]));
00862 $tpl->setVariable("TAXONPATH_TAXON_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Taxon&meta_language=" . $a_language . "&meta_path=Classification/TaxonPath&meta_section=" . $a_section . "&meta_index=" . $i);
00863 $tpl->setVariable("TAXONPATH_TAXON_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00864 $tpl->parseCurrentBlock();
00865 }
00866 }
00867
00868 if (count($taxonPath) > 1)
00869 {
00870 $tpl->setCurrentBlock("taxonpath_delete");
00871 $tpl->setVariable("TAXONPATH_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Classification&meta_name=TaxonPath&meta_index=" . $i);
00872 $tpl->setVariable("TAXONPATH_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00873 $tpl->parseCurrentBlock();
00874 }
00875
00876 $tpl->setCurrentBlock("taxonpath_loop");
00877 $tpl->setVariable("TAXONPATH_LOOP_NO", $i);
00878 $tpl->setVariable("TAXONPATH_LOOP_ROWSPAN", (3 * $taxons) + 2);
00879 $tpl->setVariable("TAXONPATH_LOOP_TXT_TAXONPATH", $this->lng->txt("meta_taxon_path"));
00880 $tpl->setVariable("TAXONPATH_LOOP_TXT_SOURCE", $this->lng->txt("meta_source"));
00881 $tpl->setVariable("TAXONPATH_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00882 $tpl->setVariable("TAXONPATH_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00883 if (is_array($source = $this->meta_obj->getElement("Source", "Classification/TaxonPath", $i)))
00884 {
00885 $tpl->setVariable("TAXONPATH_LOOP_VAL_SOURCE", ilUtil::prepareFormOutput($source[0]["value"]));
00886 $tpl->setVariable("TAXONPATH_LOOP_VAL_SOURCE_LANGUAGE", $this->showLangSel("meta[TaxonPath][" . $i . "][Source][Language]", $source[0]["Language"]));
00887 }
00888 $tpl->setVariable("TAXONPATH_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=TaxonPath&meta_language=" . $a_language . "&meta_path=Classification&meta_section=" . $a_section);
00889 $tpl->setVariable("TAXONPATH_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00890 $tpl->parseCurrentBlock();
00891 }
00892 }
00893
00894
00895 if (is_array($description = $this->meta_obj->getElement("Description", "Classification")))
00896 {
00897 $tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("meta_description"));
00898 $tpl->setVariable("TXT_VALUE", $this->lng->txt("meta_value"));
00899 $tpl->setVariable("VAL_DESCRIPTION", ilUtil::stripSlashes($description[0]["value"]));
00900 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("meta_language"));
00901 $tpl->setVariable("VAL_DESCRIPTION_LANGUAGE", $this->showLangSel("meta[Description][Language]", $description[0]["Language"]));
00902 }
00903
00904
00905 if (is_array($keyword = $this->meta_obj->getElement("Keyword", "Classification")))
00906 {
00907 for ($i = 0; $i < count($keyword); $i++)
00908 {
00909 if (count($keyword) > 1)
00910 {
00911 $tpl->setCurrentBlock("keyword_delete");
00912 $tpl->setVariable("KEYWORD_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Classification&meta_name=Keyword&meta_index=" . $i);
00913 $tpl->setVariable("KEYWORD_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00914 $tpl->parseCurrentBlock();
00915 }
00916
00917 $tpl->setCurrentBlock("keyword_loop");
00918 $tpl->setVariable("KEYWORD_LOOP_NO", $i);
00919 $tpl->setVariable("KEYWORD_LOOP_TXT_KEYWORD", $this->lng->txt("meta_keyword"));
00920 $tpl->setVariable("KEYWORD_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00921 $tpl->setVariable("KEYWORD_LOOP_VAL", ilUtil::prepareFormOutput($keyword[$i]["value"]));
00922 $tpl->setVariable("KEYWORD_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
00923 $tpl->setVariable("KEYWORD_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Keyword][" . $i . "][Language]", $keyword[$i]["Language"]));
00924 $tpl->setVariable("KEYWORD_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Keyword&meta_language=" . $a_language . "&meta_path=Classification&meta_section=" . $a_section);
00925 $tpl->setVariable("KEYWORD_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00926 $tpl->parseCurrentBlock();
00927 }
00928 }
00929
00930 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
00931 $tpl->setVariable("VAL_SECTION", $a_section);
00932 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00933 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00934
00935 $this->tpl->setCurrentBlock("classification");
00936 $this->tpl->setVariable("CLASSIFICATION", $tpl->get());
00937 $this->tpl->parseCurrentBlock();
00938 unset($tpl);
00939
00940 }
00941
00942 return true;
00943 }
00944
00945 function fillTechnical($a_formaction, $a_section = "Technical", $a_language = "")
00946 {
00947 if (!is_array($technical = $this->meta_obj->getElement("Technical")))
00948 {
00949 $this->tpl->setCurrentBlock("no_technical");
00950 $this->tpl->setVariable("TXT_NO_TECHNICAL", $this->lng->txt("meta_no_technical"));
00951 $this->tpl->setVariable("TXT_ADD_TECHNICAL", $this->lng->txt("meta_add"));
00952 $this->tpl->setVariable("ACTION_ADD_TECHNICAL", $a_formaction . "&cmd=addMeta&meta_name=Technical&meta_language=" . $a_language . "&meta_section=" . $a_section);
00953 $this->tpl->parseCurrentBlock();
00954 }
00955 else
00956 {
00957
00958 $tpl = new ilTemplate("tpl.meta_data_editor_technical.html", true, true);
00959 $tpl->setVariable("TXT_TECHNICAL", $this->lng->txt("meta_technical"));
00960 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Technical&meta_index=0");
00961 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
00962 $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
00963 $tpl->setVariable("TXT_FORMAT", $this->lng->txt("meta_format"));
00964 $tpl->setVariable("TXT_LOCATION", $this->lng->txt("meta_location"));
00965 $tpl->setVariable("TXT_ADD", $this->lng->txt("meta_add"));
00966 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
00967
00968
00969 if (is_array($format = $this->meta_obj->getElement("Format", "Technical")))
00970 {
00971 for ($i = 0; $i < count($format); $i++)
00972 {
00973 $tpl->setCurrentBlock("format_loop");
00974 $tpl->setVariable("FORMAT_LOOP_NO", $i);
00975 $tpl->setVariable("FORMAT_LOOP_TXT_FORMAT", $this->lng->txt("meta_format"));
00976 $tpl->setVariable("FORMAT_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
00977 $tpl->setVariable("FORMAT_LOOP_VAL", ilUtil::prepareFormOutput($format[$i]["value"]));
00978 $tpl->setVariable("FORMAT_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=Format&meta_index=" . $i);
00979 $tpl->setVariable("FORMAT_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
00980 $tpl->setVariable("FORMAT_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Format&meta_language=" . $a_language . "&meta_path=Technical&meta_section=" . $a_section);
00981 $tpl->setVariable("FORMAT_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
00982 $tpl->parseCurrentBlock();
00983 }
00984 }
00985
00986
00987 if (is_array($size = $this->meta_obj->getElement("Size", "Technical")))
00988 {
00989 $tpl->setCurrentBlock("size");
00990 $tpl->setVariable("SIZE_TXT_SIZE", $this->lng->txt("meta_size"));
00991 $tpl->setVariable("SIZE_TXT_VALUE", $this->lng->txt("meta_value"));
00992 $tpl->setVariable("SIZE_VAL", ilUtil::prepareFormOutput($size[0]["value"]));
00993 $tpl->setVariable("SIZE_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=Size&meta_index=0");
00994 $tpl->setVariable("SIZE_TXT_DELETE", $this->lng->txt("meta_delete"));
00995 $tpl->parseCurrentBlock();
00996 }
00997 else
00998 {
00999 $tpl->setVariable("TXT_SIZE", $this->lng->txt("meta_size"));
01000 }
01001
01002
01003 if (is_array($location = $this->meta_obj->getElement("Location", "Technical")))
01004 {
01005 for ($i = 0; $i < count($location); $i++)
01006 {
01007 $tpl->setCurrentBlock("location_loop");
01008 $tpl->setVariable("LOCATION_LOOP_NO", $i);
01009 $tpl->setVariable("LOCATION_LOOP_TXT_LOCATION", $this->lng->txt("meta_location"));
01010 $tpl->setVariable("LOCATION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
01011 $tpl->setVariable("LOCATION_LOOP_VAL", ilUtil::prepareFormOutput($location[$i]["value"]));
01012 $tpl->setVariable("LOCATION_LOOP_TXT_TYPE", $this->lng->txt("meta_type"));
01013 $tpl->setVariable("LOCATION_LOOP_TXT_LOCALFILE", $this->lng->txt("meta_local_file"));
01014 $tpl->setVariable("LOCATION_LOOP_TXT_REFERENCE", $this->lng->txt("meta_reference"));
01015 $tpl->setVariable("LOCATION_LOOP_TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
01016 $tpl->setVariable("LOCATION_LOOP_VAL_TYPE_" . strtoupper($location[$i]["Type"]), " selected");
01017 $tpl->setVariable("LOCATION_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=Location&meta_index=" . $i);
01018 $tpl->setVariable("LOCATION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
01019 $tpl->setVariable("LOCATION_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Location&meta_language=" . $a_language . "&meta_path=Technical&meta_section=" . $a_section);
01020 $tpl->setVariable("LOCATION_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
01021 $tpl->parseCurrentBlock();
01022 }
01023 }
01024
01025
01026 if (is_array($requirement = $this->meta_obj->getElement("Requirement", "Technical")))
01027 {
01028 for ($i = 0; $i < count($requirement); $i++)
01029 {
01030 $tpl->setCurrentBlock("requirement_loop");
01031 $tpl->setVariable("REQUIREMENT_LOOP_NO", $i);
01032 $tpl->setVariable("REQUIREMENT_LOOP_TXT_REQUIREMENT", $this->lng->txt("meta_requirement"));
01033 $tpl->setVariable("REQUIREMENT_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=Requirement&meta_index=" . $i);
01034 $tpl->setVariable("REQUIREMENT_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
01035 $tpl->setVariable("REQUIREMENT_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Requirement&meta_language=" . $a_language . "&meta_path=Technical&meta_section=" . $a_section);
01036 $tpl->setVariable("REQUIREMENT_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
01037 $tpl->setVariable("REQUIREMENT_LOOP_TXT_TYPE", $this->lng->txt("meta_type"));
01038 $tpl->setVariable("REQUIREMENT_LOOP_TXT_OPERATINGSYSTEM", $this->lng->txt("meta_operating_system"));
01039 $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME", $this->lng->txt("meta_name"));
01040 $tpl->setVariable("REQUIREMENT_LOOP_TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
01041 $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME_PCDOS", $this->lng->txt("meta_pc_dos"));
01042 $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME_MSWINDOWS", $this->lng->txt("meta_ms_windows"));
01043 $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME_MACOS", $this->lng->txt("meta_mac_os"));
01044 $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME_UNIX", $this->lng->txt("meta_unix"));
01045 $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME_MULTIOS", $this->lng->txt("meta_multi_os"));
01046 $tpl->setVariable("REQUIREMENT_LOOP_TXT_NAME_NONE", $this->lng->txt("meta_none"));
01047 $tpl->setVariable("REQUIREMENT_LOOP_TXT_MINIMUMVERSION", $this->lng->txt("meta_minimum_version"));
01048 $tpl->setVariable("REQUIREMENT_LOOP_TXT_MAXIMUMVERSION", $this->lng->txt("meta_maximum_version"));
01049 $tpl->setVariable("REQUIREMENT_LOOP_TXT_BROWSER", $this->lng->txt("meta_browser"));
01050 if (is_array($operatingSystem = $this->meta_obj->getElement("OperatingSystem", "Technical/Requirement/Type", $i)))
01051 {
01052 $tpl->setVariable("REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_NAME_" . strtoupper($operatingSystem[0]["Name"]), " selected");
01053 $tpl->setVariable("REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MINIMUMVERSION", ilUtil::prepareFormOutput($operatingSystem[0]["MinimumVersion"]));
01054 $tpl->setVariable("REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MAXIMUMVERSION", ilUtil::prepareFormOutput($operatingSystem[0]["MaximumVersion"]));
01055 }
01056 if (is_array($browser = $this->meta_obj->getElement("Browser", "Technical/Requirement/Type", $i)))
01057 {
01058 $tpl->setVariable("REQUIREMENT_LOOP_VAL_BROWSER_NAME_" . strtoupper($browser[0]["Name"]), " selected");
01059 $tpl->setVariable("REQUIREMENT_LOOP_VAL_BROWSER_MINIMUMVERSION", ilUtil::prepareFormOutput($browser[0]["MinimumVersion"]));
01060 $tpl->setVariable("REQUIREMENT_LOOP_VAL_BROWSER_MAXIMUMVERSION", ilUtil::prepareFormOutput($browser[0]["MaximumVersion"]));
01061 }
01062 $tpl->parseCurrentBlock();
01063 }
01064 }
01065 else
01066 {
01067 $tpl->setVariable("TXT_ORCOMPOSITE", $this->lng->txt("meta_or_composite"));
01068 }
01069
01070
01071 if (is_array($orcomposite = $this->meta_obj->getElement("OrComposite", "Technical")))
01072 {
01073 for ($i = 0; $i < count($orcomposite); $i++)
01074 {
01075 if (is_array($requirement = $this->meta_obj->getElement("Requirement", "Technical/OrComposite", $i)))
01076 {
01077 for ($j = 0; $j < count($requirement); $j++)
01078 {
01079 if (count($requirement) > 1)
01080 {
01081 $tpl->setCurrentBlock("orcomposite_requirement_delete");
01082 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical/OrComposite&meta_name=Requirement&meta_index=" . $i . "," . $j);
01083 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
01084 $tpl->parseCurrentBlock();
01085 }
01086
01087 $tpl->setCurrentBlock("orcomposite_requirement_loop");
01088 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_NO", $j);
01089 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_ORCOMPOSITE_NO", $i);
01090 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_REQUIREMENT", $this->lng->txt("meta_requirement"));
01091 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Requirement&meta_language=" . $a_language . "&meta_path=Technical/OrComposite&meta_section=" . $a_section . "&meta_index=" . $i);
01092 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
01093 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_TYPE", $this->lng->txt("meta_type"));
01094 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_OPERATINGSYSTEM", $this->lng->txt("meta_operating_system"));
01095 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_NAME", $this->lng->txt("meta_name"));
01096 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
01097 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_NAME_PCDOS", $this->lng->txt("meta_pc_dos"));
01098 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_NAME_MSWINDOWS", $this->lng->txt("meta_ms_windows"));
01099 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_NAME_MACOS", $this->lng->txt("meta_mac_os"));
01100 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_NAME_UNIX", $this->lng->txt("meta_unix"));
01101 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_NAME_MULTIOS", $this->lng->txt("meta_multi_os"));
01102 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_NAME_NONE", $this->lng->txt("meta_none"));
01103 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_MINIMUMVERSION", $this->lng->txt("meta_minimum_version"));
01104 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_MAXIMUMVERSION", $this->lng->txt("meta_maximum_version"));
01105 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_TXT_BROWSER", $this->lng->txt("meta_browser"));
01106 if (is_array($operatingSystem = $this->meta_obj->getElement("OperatingSystem", "Technical/OrComposite/Requirement/Type", $i)))
01107 {
01108 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_NAME_" . strtoupper($operatingSystem[0]["Name"]), " selected");
01109 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MINIMUMVERSION", ilUtil::prepareFormOutput($operatingSystem[0]["MinimumVersion"]));
01110 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_VAL_OPERATINGSYSTEM_MAXIMUMVERSION", ilUtil::prepareFormOutput($operatingSystem[0]["MaximumVersion"]));
01111 }
01112 if (is_array($browser = $this->meta_obj->getElement("Browser", "Technical/OrComposite/Requirement/Type", $i)))
01113 {
01114 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_VAL_BROWSER_NAME_" . strtoupper($browser[0]["Name"]), " selected");
01115 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_VAL_BROWSER_MINIMUMVERSION", ilUtil::prepareFormOutput($browser[0]["MinimumVersion"]));
01116 $tpl->setVariable("ORCOMPOSITE_REQUIREMENT_LOOP_VAL_BROWSER_MAXIMUMVERSION", ilUtil::prepareFormOutput($browser[0]["MaximumVersion"]));
01117 }
01118 $tpl->parseCurrentBlock();
01119 }
01120 }
01121 $tpl->setCurrentBlock("orcomposite_loop");
01122 $tpl->setVariable("ORCOMPOSITE_LOOP_TXT_ORCOMPOSITE", $this->lng->txt("meta_or_composite"));
01123 $tpl->setVariable("ORCOMPOSITE_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=OrComposite&meta_index=" . $i);
01124 $tpl->setVariable("ORCOMPOSITE_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
01125 $tpl->setVariable("ORCOMPOSITE_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=OrComposite&meta_language=" . $a_language . "&meta_path=Technical&meta_section=" . $a_section);
01126 $tpl->setVariable("ORCOMPOSITE_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
01127 $tpl->parseCurrentBlock();
01128 }
01129 }
01130 else
01131 {
01132 $tpl->setVariable("TXT_REQUIREMENT", $this->lng->txt("meta_requirement"));
01133 }
01134
01135
01136 if (is_array($installationRemarks = $this->meta_obj->getElement("InstallationRemarks", "Technical")))
01137 {
01138 $tpl->setCurrentBlock("installationremarks");
01139 $tpl->setVariable("INSTALLATIONREMARKS_TXT_INSTALLATIONREMARKS", $this->lng->txt("meta_installation_remarks"));
01140 $tpl->setVariable("INSTALLATIONREMARKS_TXT_VALUE", $this->lng->txt("meta_value"));
01141 $tpl->setVariable("INSTALLATIONREMARKS_VAL", ilUtil::prepareFormOutput($installationRemarks[0]["value"]));
01142 $tpl->setVariable("INSTALLATIONREMARKS_TXT_LANGUAGE", $this->lng->txt("meta_language"));
01143 $tpl->setVariable("INSTALLATIONREMARKS_VAL_LANGUAGE", $this->showLangSel("meta[InstallationRemarks][Language]", $installationRemarks[0]["Language"]));
01144 $tpl->setVariable("INSTALLATIONREMARKS_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=InstallationRemarks&meta_index=0");
01145 $tpl->setVariable("INSTALLATIONREMARKS_TXT_DELETE", $this->lng->txt("meta_delete"));
01146 $tpl->parseCurrentBlock();
01147 }
01148 else
01149 {
01150 $tpl->setVariable("TXT_INSTALLATIONREMARKS", $this->lng->txt("meta_installation_remarks"));
01151 }
01152
01153
01154 if (is_array($otherPlattformRequirements = $this->meta_obj->getElement("OtherPlattformRequirements", "Technical")))
01155 {
01156 $tpl->setCurrentBlock("otherplattformrequirements");
01157 $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_TXT_OTHERPLATTFORMREQUIREMENTS", $this->lng->txt("meta_other_plattform_requirements"));
01158 $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_TXT_VALUE", $this->lng->txt("meta_value"));
01159 $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_VAL", ilUtil::prepareFormOutput($otherPlattformRequirements[0]["value"]));
01160 $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_TXT_LANGUAGE", $this->lng->txt("meta_language"));
01161 $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_VAL_LANGUAGE", $this->showLangSel("meta[OtherPlattformRequirements][Language]", $otherPlattformRequirements[0]["Language"]));
01162 $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=OtherPlattformRequirements&meta_index=0");
01163 $tpl->setVariable("OTHERPLATTFORMREQUIREMENTS_TXT_DELETE", $this->lng->txt("meta_delete"));
01164 $tpl->parseCurrentBlock();
01165 }
01166 else
01167 {
01168 $tpl->setVariable("TXT_OTHERPLATTFORMREQUIREMENTS", $this->lng->txt("meta_other_plattform_requirements"));
01169 }
01170
01171
01172 if (is_array($duration = $this->meta_obj->getElement("Duration", "Technical")))
01173 {
01174 $tpl->setCurrentBlock("duration");
01175 $tpl->setVariable("DURATION_TXT_DURATION", $this->lng->txt("meta_duration"));
01176 $tpl->setVariable("DURATION_TXT_VALUE", $this->lng->txt("meta_value"));
01177 $tpl->setVariable("DURATION_VAL", ilUtil::prepareFormOutput($duration[0]["value"]));
01178 $tpl->setVariable("DURATION_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Technical&meta_name=Duration&meta_index=0");
01179 $tpl->setVariable("DURATION_TXT_DELETE", $this->lng->txt("meta_delete"));
01180 $tpl->parseCurrentBlock();
01181 }
01182 else
01183 {
01184 $tpl->setVariable("TXT_DURATION", $this->lng->txt("meta_duration"));
01185 }
01186
01187 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
01188 $tpl->setVariable("VAL_SECTION", $a_section);
01189 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
01190 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
01191
01192 $this->tpl->setCurrentBlock("technical");
01193 $this->tpl->setVariable("TECHNICAL", $tpl->get());
01194 $this->tpl->parseCurrentBlock();
01195 unset($tpl);
01196
01197 }
01198
01199 return true;
01200 }
01201
01202 function fillRelation($a_formaction, $a_section = "Relation", $a_language = "")
01203 {
01204 if (!is_array($relation = $this->meta_obj->getElement("Relation")))
01205 {
01206 $this->tpl->setCurrentBlock("no_relation");
01207 $this->tpl->setVariable("TXT_NO_RELATION", $this->lng->txt("meta_no_relation"));
01208 $this->tpl->setVariable("TXT_ADD_RELATION", $this->lng->txt("meta_add"));
01209 $this->tpl->setVariable("ACTION_ADD_RELATION", $a_formaction . "&cmd=addMeta&meta_name=Relation&meta_language=" . $a_language . "&meta_section=" . $a_section);
01210 $this->tpl->parseCurrentBlock();
01211 }
01212 else
01213 {
01214
01215 $tpl = new ilTemplate("tpl.meta_data_editor_relation.html", true, true);
01216 $tpl->setVariable("TXT_RELATION", $this->lng->txt("meta_relation"));
01217 $tpl->setVariable("ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_name=Relation&meta_index=0");
01218 $tpl->setVariable("TXT_DELETE", $this->lng->txt("meta_delete"));
01219 $tpl->setVariable("TXT_NEW_ELEMENT", $this->lng->txt("meta_new_element"));
01220 $tpl->setVariable("TXT_KIND", $this->lng->txt("meta_kind"));
01221 $tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("meta_please_select"));
01222 $tpl->setVariable("TXT_ISPARTOF", $this->lng->txt("meta_is_part_of"));
01223 $tpl->setVariable("TXT_HASPART", $this->lng->txt("meta_has_part"));
01224 $tpl->setVariable("TXT_ISVERSIONOF", $this->lng->txt("meta_is_version_of"));
01225 $tpl->setVariable("TXT_HASVERSION", $this->lng->txt("meta_has_version"));
01226 $tpl->setVariable("TXT_ISFORMATOF", $this->lng->txt("meta_is_format_of"));
01227 $tpl->setVariable("TXT_HASFORMAT", $this->lng->txt("meta_has_format"));
01228 $tpl->setVariable("TXT_REFERENCES", $this->lng->txt("meta_references"));
01229 $tpl->setVariable("TXT_ISREFERENCEDBY", $this->lng->txt("meta_is_referenced_by"));
01230 $tpl->setVariable("TXT_ISBASEDON", $this->lng->txt("meta_is_based_on"));
01231 $tpl->setVariable("TXT_ISBASISFOR", $this->lng->txt("meta_is_basis_for"));
01232 $tpl->setVariable("TXT_REQUIRES", $this->lng->txt("meta_requires"));
01233 $tpl->setVariable("TXT_ISREQUIREDBY", $this->lng->txt("meta_is_required_by"));
01234 $tpl->setVariable("TXT_RESOURCE", $this->lng->txt("meta_resource"));
01235 $tpl->setVariable("VAL_KIND_" . strtoupper($relation[0]["Kind"]), " selected");
01236
01237
01238 if (is_array($identifier = $this->meta_obj->getElement("Identifier_", "Relation/Resource")))
01239 {
01240 for ($i = 0; $i < count($identifier); $i++)
01241 {
01242 if (count($identifier) > 1)
01243 {
01244 $tpl->setCurrentBlock("identifier_delete");
01245 $tpl->setVariable("IDENTIFIER_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Relation/Resource&meta_name=Identifier_&meta_index=" . $i);
01246 $tpl->setVariable("IDENTIFIER_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
01247 $tpl->parseCurrentBlock();
01248 }
01249
01250 $tpl->setCurrentBlock("identifier_loop");
01251 $tpl->setVariable("IDENTIFIER_LOOP_NO", $i);
01252 $tpl->setVariable("IDENTIFIER_LOOP_TXT_IDENTIFIER", $this->lng->txt("meta_identifier"));
01253 $tpl->setVariable("IDENTIFIER_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Identifier_&meta_language=" . $a_language . "&meta_path=Relation/Resource&meta_section=" . $a_section);
01254 $tpl->setVariable("IDENTIFIER_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
01255 $tpl->setVariable("IDENTIFIER_LOOP_TXT_ENTRY", $this->lng->txt("meta_entry"));
01256 $tpl->setVariable("IDENTIFIER_LOOP_TXT_CATALOG", $this->lng->txt("meta_catalog"));
01257 $tpl->setVariable("IDENTIFIER_LOOP_VAL_CATALOG", ilUtil::prepareFormOutput($identifier[$i]["Catalog"]));
01258 $tpl->setVariable("IDENTIFIER_LOOP_VAL_ENTRY", ilUtil::prepareFormOutput($identifier[$i]["Entry"]));
01259 $tpl->parseCurrentBlock();
01260 }
01261 }
01262
01263
01264 if (is_array($description = $this->meta_obj->getElement("Description", "Relation/Resource")))
01265 {
01266 for ($i = 0; $i < count($description); $i++)
01267 {
01268 if (count($description) > 1)
01269 {
01270 $tpl->setCurrentBlock("description_delete");
01271 $tpl->setVariable("DESCRIPTION_LOOP_ACTION_DELETE", $a_formaction . "&cmd=deleteMeta&meta_section=" . $a_section . "&meta_language=" . $a_language . "&meta_path=Relation/Resource&meta_name=Description&meta_index=" . $i);
01272 $tpl->setVariable("DESCRIPTION_LOOP_TXT_DELETE", $this->lng->txt("meta_delete"));
01273 $tpl->parseCurrentBlock();
01274 }
01275
01276 $tpl->setCurrentBlock("description_loop");
01277 $tpl->setVariable("DESCRIPTION_LOOP_NO", $i);
01278 $tpl->setVariable("DESCRIPTION_LOOP_TXT_DESCRIPTION", $this->lng->txt("meta_description"));
01279 $tpl->setVariable("DESCRIPTION_LOOP_ACTION_ADD", $a_formaction . "&cmd=addMeta&meta_name=Description&meta_language=" . $a_language . "&meta_path=Relation/Resource&meta_section=" . $a_section);
01280 $tpl->setVariable("DESCRIPTION_LOOP_TXT_ADD", $this->lng->txt("meta_add"));
01281 $tpl->setVariable("DESCRIPTION_LOOP_TXT_VALUE", $this->lng->txt("meta_value"));
01282 $tpl->setVariable("DESCRIPTION_LOOP_TXT_LANGUAGE", $this->lng->txt("meta_language"));
01283 $tpl->setVariable("DESCRIPTION_LOOP_VAL", ilUtil::stripSlashes($description[$i]["value"]));
01284 $tpl->setVariable("DESCRIPTION_LOOP_VAL_LANGUAGE", $this->showLangSel("meta[Resource][Description][" . $i . "][Language]", $description[$i]["Language"]));
01285 $tpl->parseCurrentBlock();
01286 }
01287 }
01288
01289 $tpl->setVariable("EDIT_ACTION", $a_formaction . "&cmd=post");
01290 $tpl->setVariable("VAL_SECTION", $a_section);
01291 $tpl->setVariable("TARGET", $this->getTargetFrame("save"));
01292 $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
01293
01294 $this->tpl->setCurrentBlock("relation");
01295 $this->tpl->setVariable("RELATION", $tpl->get());
01296 $this->tpl->parseCurrentBlock();
01297 unset($tpl);
01298
01299 }
01300
01301 return true;
01302 }
01303
01304 function edit($a_temp_var, $a_temp_block, $a_formaction, $a_section = "", $a_language = "")
01305 {
01306
01307 if ($a_language == "")
01308 {
01309 $a_language = $this->ilias->account->getLanguage();
01310 }
01311 $this->tpl->addBlockFile($a_temp_var, $a_temp_block, "tpl.meta_data_editor.html", false);
01312
01313 if ($a_section == "")
01314 {
01315 $a_section = "General";
01316 }
01317 $sections = array("General", "Lifecycle", "Meta-Metadata", "Technical",
01318 "Educational", "Rights", "Relation", "Annotation", "Classification");
01319 if (in_array($a_section, $sections))
01320 {
01321 $func = "fill" . str_replace("-", "", $a_section);
01322
01323 $this->$func($a_formaction, $a_section, $a_language);
01324 }
01325
01326 $this->tpl->setCurrentBlock("adm_content");
01327 $this->tpl->setVariable("CHOOSE_SECTION_ACTION", $a_formaction . "&cmd=chooseMetaSection");
01328 $this->tpl->setVariable("TXT_CHOOSE_SECTION", $this->lng->txt("meta_choose_section"));
01329 for ($i = 0; $i < count($sections); $i++)
01330 {
01331 if ($a_section != $sections[$i])
01332 {
01333 $this->tpl->setVariable("META_SECTION_" . strtoupper($sections[$i]), "in");
01334 }
01335 }
01336 $this->tpl->setVariable("TXT_OK", $this->lng->txt("ok"));
01337 $this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
01338 $this->tpl->parseCurrentBlock();
01339
01340 }
01341
01342 function save($a_section = "General")
01343 {
01344
01345 if (is_array($_POST["meta"]))
01346 {
01347 $meta = $_POST["meta"];
01348 $this->meta_obj->setTitle(ilUtil::stripSlashes($meta["Title"]["Value"]));
01349 $this->meta_obj->setMeta($meta);
01350 }
01351
01352 else if (is_array($_POST["Fobject"]))
01353 {
01354 $meta = $_POST["Fobject"];
01355 $this->meta_obj->setTitle(ilUtil::stripSlashes($meta["title"]));
01356 $this->meta_obj->setMeta($meta);
01357 }
01358 $this->meta_obj->setSection($a_section);
01359 $this->obj->updateMetaData();
01360 }
01361
01362 function &create()
01363 {
01364 $this->meta_obj =& new ilMetaData();
01365
01366 if (is_array($_POST["meta"]))
01367 {
01368 $meta = $_POST["meta"];
01369 $this->meta_obj->setTitle(ilUtil::stripSlashes($meta["Title"]["Value"]));
01370 }
01371
01372 else if (is_array($_POST["Fobject"]))
01373 {
01374 $meta = $_POST["Fobject"];
01375 $this->meta_obj->setTitle(ilUtil::stripSlashes($meta["title"]));
01376 }
01377
01378 return $this->meta_obj;
01379 }
01380
01388 function getTargetFrame($a_cmd, $a_target_frame = "")
01389 {
01390 if ($this->target_frame[$a_cmd] != "")
01391 {
01392 return $this->target_frame[$a_cmd];
01393 }
01394 elseif (!empty($a_target_frame))
01395 {
01396 return $a_target_frame;
01397 }
01398 else
01399 {
01400 return;
01401 }
01402 }
01403
01411 function setTargetFrame($a_cmd, $a_target_frame)
01412 {
01413 $this->target_frame[$a_cmd] = $a_target_frame;
01414 }
01415 }
01416 ?>