5 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
39 $this->ctrl->saveParameter($this, array(
"term_id"));
54 $next_class = $this->ctrl->getNextClass($this);
55 $cmd = $this->ctrl->getCmd();
59 case "iltermdefinitioneditorgui":
63 $ret =& $this->ctrl->forwardCommand($def_edit);
67 case "ilpropertyformgui";
69 $this->ctrl->forwardCommand($form);
72 case "ilobjectmetadatagui";
74 $ilTabs->activateTab(
'meta_data');
75 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
77 'term', $this->term->
getId());
78 $this->ctrl->forwardCommand($md_gui);
94 $this->offline_directory = $offdir;
103 return $this->offline_directory;
109 $this->glossary = $a_glossary;
114 $this->link_xml = $a_link_xml;
149 $ilTabs->activateTab(
"properties");
151 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
159 $this->tpl->setContent($ilCtrl->getHTML($a_form));
174 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
176 $form->setFormAction($this->ctrl->getFormAction($this,
"updateTerm"));
177 $form->setTitle($this->lng->txt(
"cont_edit_term"));
181 $term->setValue($this->term->getTerm());
182 $form->addItem($term);
185 $lang->setRequired(
true);
187 $lang->setValue($this->term->getLanguage());
188 $form->addItem(
$lang);
191 if ($this->glossary->getTaxonomyId() > 0)
193 include_once(
"./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
194 $tax_node_assign =
new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(),
"tax_node",
true);
196 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
197 $ta =
new ilTaxNodeAssignment(
"glo", $this->glossary->getId(),
"term", $this->glossary->getTaxonomyId());
200 foreach ($assgnmts as $a)
202 $node_ids[] = $a[
"node_id"];
204 $tax_node_assign->setValue($node_ids);
206 $form->addItem($tax_node_assign);
211 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
213 $this->term->getId());
215 $this->record_gui->parse();
217 $form->addCommandButton(
"updateTerm", $this->lng->txt(
"save"));
230 if($form->checkInput() &&
231 $this->record_gui->importEditFormPostValues())
235 $this->term->setLanguage(
$_POST[
"term_language"]);
236 $this->term->update();
239 if ($this->glossary->getTaxonomyId() > 0)
241 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
242 $ta =
new ilTaxNodeAssignment(
"glo", $this->glossary->getId(),
"term", $this->glossary->getTaxonomyId());
244 if (is_array(
$_POST[
"tax_node"]))
246 foreach (
$_POST[
"tax_node"] as $node_id)
248 $ta->addAssignment($node_id, $this->term->getId());
254 $this->record_gui->writeEditForm();
256 $this->ctrl->redirect($this,
"editTerm");
259 $form->setValuesByPost();
269 function getOverlayHTML($a_close_el_id, $a_glo_ov_id =
"", $a_lang =
"", $a_outputmode =
"offline")
275 $a_lang = $lng->getLangKey();
278 $tpl =
new ilTemplate(
"tpl.glossary_overlay.html",
true,
true,
"Modules/Glossary");
280 if ($a_outputmode ==
"preview")
282 $a_outputmode =
"presentation";
284 if ($a_outputmode ==
"offline")
286 $this->
output(
true, $tpl, $a_outputmode);
290 $this->
output(
false, $tpl, $a_outputmode);
292 if ($a_glo_ov_id !=
"")
294 $tpl->setCurrentBlock(
"glovlink");
295 $tpl->setVariable(
"TXT_LINK", $lng->txtlng(
"content",
"cont_sco_glossary", $a_lang));
296 $tpl->setVariable(
"ID_LINK", $a_glo_ov_id);
297 $tpl->parseCurrentBlock();
299 $tpl->setVariable(
"TXT_CLOSE", $lng->txtlng(
"common",
"close", $a_lang));
300 $tpl->setVariable(
"ID_CLOSE", $a_close_el_id);
309 function output($a_offline =
false, $a_tpl =
"", $a_outputmode =
"presentation")
320 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
321 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
325 $tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
327 for($j=0; $j<count($defs); $j++)
331 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
339 $page_gui->setFullscreenLink(
"fullscreen.html");
341 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=downloadFile&ref_id=".
$_GET[
"ref_id"]);
345 $page_gui->setOutputMode($a_outputmode);
349 $page_gui->setOutputMode(
"offline");
356 $page_gui->setTemplateOutput(
false);
357 $output = $page_gui->presentation($page_gui->getOutputMode());
359 if (count($defs) > 1)
361 $tpl->setCurrentBlock(
"definition_header");
362 $tpl->setVariable(
"TXT_DEFINITION",
363 $this->lng->txt(
"cont_definition").
" ".($j+1));
364 $tpl->parseCurrentBlock();
369 $tpl->setCurrentBlock(
"definition");
370 $tpl->setVariable(
"PAGE_CONTENT", $output);
371 $tpl->parseCurrentBlock();
380 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
381 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
385 $term_links = array();
386 for($j=0; $j<count($defs); $j++)
391 $page_links = $page->getInternalLinks();
392 foreach($page_links as $key => $page_link)
394 $term_links[$key] = $page_link;
411 $ilTabs->activateTab(
"definitions");
412 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
415 $this->tpl->setCurrentBlock(
"ContentStyle");
416 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
418 $this->tpl->parseCurrentBlock();
421 $this->tpl->setCurrentBlock(
"SyntaxStyle");
422 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
424 $this->tpl->parseCurrentBlock();
427 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_list.html",
true);
430 $this->tpl->addBlockfile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
431 $this->tpl->setTitle(
432 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
435 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
437 $this->tpl->setCurrentBlock(
"add_def");
438 $this->tpl->setVariable(
"TXT_ADD_DEFINITION",
439 $this->lng->txt(
"cont_add_definition"));
440 $this->tpl->setVariable(
"BTN_ADD",
"addDefinition");
441 $this->tpl->parseCurrentBlock();
442 $this->tpl->setCurrentBlock(
"def_list");
446 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
448 for($j=0; $j<count($defs); $j++)
452 $page_gui->setStyleId($this->glossary->getStyleSheetId());
453 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
454 $page_gui->setTemplateOutput(
false);
455 $output = $page_gui->preview();
457 if (count($defs) > 1)
459 $this->tpl->setCurrentBlock(
"definition_header");
460 $this->tpl->setVariable(
"TXT_DEFINITION",
461 $this->lng->txt(
"cont_definition").
" ".($j+1));
462 $this->tpl->parseCurrentBlock();
467 $this->tpl->setCurrentBlock(
"up");
468 $this->tpl->setVariable(
"TXT_UP", $this->lng->txt(
"up"));
469 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
470 $this->tpl->setVariable(
"LINK_UP",
471 $this->ctrl->getLinkTarget($this,
"moveUp"));
472 $this->tpl->parseCurrentBlock();
475 if ($j+1 < count($defs))
477 $this->tpl->setCurrentBlock(
"down");
478 $this->tpl->setVariable(
"TXT_DOWN", $this->lng->txt(
"down"));
479 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
480 $this->tpl->setVariable(
"LINK_DOWN",
481 $this->ctrl->getLinkTarget($this,
"moveDown"));
482 $this->tpl->parseCurrentBlock();
484 $this->tpl->setCurrentBlock(
"submit_btns");
485 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
486 $this->ctrl->setParameter($this,
"def", $def[
"id"]);
487 $this->ctrl->setParameterByClass(
"ilTermDefinitionEditorGUI",
"def", $def[
"id"]);
488 $this->tpl->setVariable(
"LINK_EDIT",
489 $this->ctrl->getLinkTargetByClass(array(
"ilTermDefinitionEditorGUI",
"ilGlossaryDefPageGUI"),
"edit"));
490 $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
"delete"));
491 $this->tpl->setVariable(
"LINK_DELETE",
492 $this->ctrl->getLinkTarget($this,
"confirmDefinitionDeletion"));
493 $this->tpl->parseCurrentBlock();
495 $this->tpl->setCurrentBlock(
"definition");
496 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
497 $this->tpl->parseCurrentBlock();
516 $ilTabs->activateTab(
"definitions");
519 $this->tpl->setCurrentBlock(
"ContentStyle");
520 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
522 $this->tpl->parseCurrentBlock();
525 $this->tpl->setCurrentBlock(
"SyntaxStyle");
526 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
528 $this->tpl->parseCurrentBlock();
530 $this->tpl->setTitle(
531 $this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
534 $this->tpl->addBlockfile(
"ADM_CONTENT",
"def_list",
"tpl.glossary_definition_delete.html",
true);
537 $this->tpl->setVariable(
"TXT_TERM", $this->term->getTerm());
542 $page_gui->setStyleId($this->glossary->getStyleSheetId());
543 $page_gui->setSourcecodeDownloadScript(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
544 $page_gui->setFileDownloadLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
545 $page_gui->setFullscreenLink(
"ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".
$_GET[
"ref_id"]);
546 $output = $page_gui->preview();
548 $this->tpl->setCurrentBlock(
"definition");
549 $this->tpl->setVariable(
"PAGE_CONTENT", $output);
550 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
551 $this->tpl->setVariable(
"LINK_CANCEL",
552 $this->ctrl->getLinkTarget($this,
"cancelDefinitionDeletion"));
553 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirm"));
554 $this->ctrl->setParameter($this,
"def", $definition->getId());
555 $this->tpl->setVariable(
"LINK_CONFIRM",
556 $this->ctrl->getLinkTarget($this,
"deleteDefinition"));
557 $this->tpl->parseCurrentBlock();
562 $this->ctrl->redirect($this,
"listDefinitions");
569 $definition->delete();
570 $this->ctrl->redirect($this,
"listDefinitions");
580 $definition->moveUp();
581 $this->ctrl->redirect($this,
"listDefinitions");
591 $definition->moveDown();
592 $this->ctrl->redirect($this,
"listDefinitions");
603 $ilCtrl->setParameterByClass(
"ilobjglossarygui",
"term_id", $this->term->getId());
604 $ilCtrl->redirectByClass(
"ilobjglossarygui",
"addDefinition");
612 $this->ctrl->redirect($this,
"listDefinitions");
621 $def->setTermId(
$_GET[
"term_id"]);
626 $this->ctrl->redirect($this,
"listDefinitions");
635 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
636 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
653 require_once (
"./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
655 $gloss_loc->setTerm($this->term);
656 $gloss_loc->setGlossary($this->glossary);
658 $gloss_loc->display();
667 global
$lng, $ilHelp;
670 $ilHelp->setScreenIdComponent(
"glo_term");
673 if (
$_GET[
"term_id"] !=
"")
675 $tabs_gui->addTab(
"properties",
677 $this->ctrl->getLinkTarget($this,
"editTerm"));
679 $tabs_gui->addTab(
"definitions",
680 $lng->txt(
"cont_definitions"),
681 $this->ctrl->getLinkTarget($this,
"listDefinitions"));
683 $tabs_gui->addTab(
"usage",
685 $this->ctrl->getLinkTarget($this,
"listUsages"));
687 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
689 "term", $this->term->
getId());
690 $mdtab = $mdgui->
getTab();
693 $tabs_gui->addTab(
"meta_data",
694 $lng->txt(
"meta_data"),
698 $tabs_gui->addNonTabbedLink(
"presentation_view",
699 $this->lng->txt(
"glo_presentation_view"),
703 "_".$_GET[
"term_id"].
"_".
$_GET[
"ref_id"].
"&client_id=".CLIENT_ID,
710 $tabs_gui->setBackTarget($this->lng->txt(
"glossary"),
711 $this->ctrl->getLinkTargetByClass(
"ilobjglossarygui",
"listTerms"));
720 public static function _goto($a_target, $a_ref_id =
"")
729 $ref_ids = array($a_ref_id);
740 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
742 $_GET[
"baseClass"] =
"ilGlossaryPresentationGUI";
743 $_GET[
"term_id"] = $a_target;
745 $_GET[
"cmd"] =
"listDefinitions";
746 include_once(
"ilias.php");
750 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
758 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
766 global $ilTabs,
$tpl;
772 $ilTabs->activateTab(
"usage");
774 $this->tpl->setTitle($this->lng->txt(
"cont_term").
": ".$this->term->getTerm());
777 include_once(
"./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
780 $tpl->setContent(
$tab->getHTML());
794 include_once(
"./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
796 $tpl->setLeftNavContent(
$tab->getHTML());
editTerm(ilPropertyFormGUI $a_form=null)
Edit term.
addDefinition()
add definition
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getAssignmentsOfItem($a_item_id)
Get assignments for item.
saveDefinition()
save definition
cancelDefinitionDeletion()
Taxonomy node <-> item assignment.
confirmDefinitionDeletion()
deletion confirmation screen
setTemplateOutput($a_output=true)
getDefinitionList($a_term_id)
static
getInternalLinks()
get internal links
setPropertyForm($form)
set property form object
static getNumberOfUsages($a_term_id)
Get number of usages.
output($a_offline=false, $a_tpl="", $a_outputmode="presentation")
output glossary term definitions
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
TableGUI class for media object usages listing.
static _lookupTitle($a_id)
lookup object title
create()
form for new content object creation
moveUp()
move definition upwards
getSyntaxStylePath()
get syntax style path
static _getAllReferences($a_id)
get all reference ids of object
displayLocator()
display locator
static _goto($a_target, $a_ref_id="")
redirect script
getEditTermForm()
Get edit term form.
deleteAssignmentsOfItem($a_item_id)
Delete assignments of item.
quickList()
Set quick term list cmd into left navigation URL.
GUI class for glossary term definition editor.
ilGlossaryTermGUI($a_id=0)
Constructor public.
getId()
get object id public
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
cancel()
cancel adding definition
special template class to simplify handling of ITX/PEAR
listDefinitions()
list definitions
This class represents a text property in a property form.
GUI class for glossary terms.
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
executeCommand()
execute command
Glossary definition page object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
includeMathjax($a_tpl=null)
Include Mathjax.
static _lookGlossaryID($term_id)
get glossary id form term id
Class ilGlossaryDefinition.
setOfflineDirectory($offdir)
set offline directory to offdir
getContentStylePath($a_style_id)
get content style path
Glossary definition page GUI class.
moveDown()
move definition downwards
getTabs(&$tabs_gui)
get tabs
getTemplate()
get template
getOverlayHTML($a_close_el_id, $a_glo_ov_id="", $a_lang="", $a_outputmode="offline")
Get overlay html.
getOfflineDirectory()
get offline directory