ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilGlossaryTermGUI Class Reference

GUI class for glossary terms. More...

+ Collaboration diagram for ilGlossaryTermGUI:

Public Member Functions

 ilGlossaryTermGUI ($a_id=0)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 setOfflineDirectory ($offdir)
 set offline directory to offdir More...
 
 getOfflineDirectory ()
 get offline directory More...
 
 setGlossary ($a_glossary)
 
 setLinkXML ($a_link_xml)
 
 getLinkXML ()
 
 create ()
 form for new content object creation More...
 
 saveTerm ()
 save term More...
 
 editTerm ()
 Edit term. More...
 
 getEditTermForm ()
 Get edit term form. More...
 
 updateTerm ()
 update term More...
 
 getOverlayHTML ($a_close_el_id, $a_glo_ov_id="", $a_lang="", $a_outputmode="offline")
 Get overlay html. More...
 
 output ($a_offline=false, $a_tpl="", $a_outputmode="presentation")
 output glossary term definitions More...
 
 getInternalLinks ()
 get internal links More...
 
 listDefinitions ()
 list definitions More...
 
 confirmDefinitionDeletion ()
 deletion confirmation screen More...
 
 cancelDefinitionDeletion ()
 
 deleteDefinition ()
 
 moveUp ()
 move definition upwards More...
 
 moveDown ()
 move definition downwards More...
 
 addDefinition ()
 add definition More...
 
 cancel ()
 cancel adding definition More...
 
 saveDefinition ()
 save definition More...
 
 getTemplate ()
 get template More...
 
 setTabs ()
 output tabs More...
 
 displayLocator ()
 display locator More...
 
 getTabs (&$tabs_gui)
 get tabs More...
 
 listUsages ()
 List usage. More...
 
 quickList ()
 Set quick term list cmd into left navigation URL. More...
 

Static Public Member Functions

static _goto ($a_target, $a_ref_id="")
 redirect script More...
 

Data Fields

 $ilias
 
 $lng
 
 $tpl
 
 $glossary
 
 $term
 
 $link_xml
 

Detailed Description

GUI class for glossary terms.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilGlossaryTermGUI: ilTermDefinitionEditorGUI, ilGlossaryDefPageGUI, ilPropertyFormGUI

Definition at line 17 of file class.ilGlossaryTermGUI.php.

Member Function Documentation

◆ _goto()

static ilGlossaryTermGUI::_goto (   $a_target,
  $a_ref_id = "" 
)
static

redirect script

Parameters
string$a_target

Definition at line 722 of file class.ilGlossaryTermGUI.php.

723 {
724 global $rbacsystem, $ilErr, $lng, $ilAccess;
725
726 $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
727
728 // get all references
729 if ($a_ref_id > 0)
730 {
731 $ref_ids = array($a_ref_id);
732 }
733 else
734 {
735 $ref_ids = ilObject::_getAllReferences($glo_id);
736 }
737
738 // check read permissions
739 foreach ($ref_ids as $ref_id)
740 {
741 // Permission check
742 if ($ilAccess->checkAccess("read", "", $ref_id))
743 {
744 $_GET["baseClass"] = "ilGlossaryPresentationGUI";
745 $_GET["term_id"] = $a_target;
746 $_GET["ref_id"] = $ref_id;
747 $_GET["cmd"] = "listDefinitions";
748 include_once("ilias.php");
749 exit;
750 }
751 }
752 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
753 {
754 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
755 ilObject::_lookupTitle($glo_id)), true);
757 }
758
759
760 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
761 }
$_GET["client_id"]
static _lookGlossaryID($term_id)
get glossary id form term id
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:54
$ref_id
Definition: sahs_server.php:39

References $_GET, $ilErr, $lng, $ref_id, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilGlossaryTerm\_lookGlossaryID(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ addDefinition()

ilGlossaryTermGUI::addDefinition ( )

add definition

Definition at line 590 of file class.ilGlossaryTermGUI.php.

591 {
592 global $ilTabs;
593
594 $this->getTemplate();
595 $this->displayLocator();
596 $this->setTabs();
597 $ilTabs->activateTab("definitions");
598
599 $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
600 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
601
602 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
603 $form = new ilPropertyFormGUI();
604 $form->setFormAction($this->ctrl->getFormAction($this, "saveDefinition"));
605 $form->setTitle($this->lng->txt("gdf_new"));
606
607 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
608 $title->setRequired(true);
609 $form->addItem($title);
610
611 $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
612 $form->addItem($desc);
613
614 $form->addCommandButton("saveDefinition", $this->lng->txt("gdf_add"));
615 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
616
617 $this->tpl->setContent($form->getHTML());
618 }
displayLocator()
display locator
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References displayLocator(), ilUtil\getImagePath(), getTemplate(), and setTabs().

+ Here is the call graph for this function:

◆ cancel()

ilGlossaryTermGUI::cancel ( )

cancel adding definition

Definition at line 623 of file class.ilGlossaryTermGUI.php.

624 {
625 $this->ctrl->redirect($this, "listDefinitions");
626 }

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

Definition at line 551 of file class.ilGlossaryTermGUI.php.

552 {
553 $this->ctrl->redirect($this, "listDefinitions");
554 }

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

Definition at line 500 of file class.ilGlossaryTermGUI.php.

501 {
502 global $ilTabs;
503
504 $this->getTemplate();
505 $this->displayLocator();
506 $this->setTabs();
507 $ilTabs->activateTab("definitions");
508
509 // content style
510 $this->tpl->setCurrentBlock("ContentStyle");
511 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
512 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
513 $this->tpl->parseCurrentBlock();
514
515 // syntax style
516 $this->tpl->setCurrentBlock("SyntaxStyle");
517 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
519 $this->tpl->parseCurrentBlock();
520
521 $this->tpl->setTitle(
522 $this->lng->txt("cont_term").": ".$this->term->getTerm());
523 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
524
525 $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
526 ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
527
528 $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
529
530 $definition =& new ilGlossaryDefinition($_GET["def"]);
531 $page_gui = new ilGlossaryDefPageGUI($definition->getId());
532 $page_gui->setTemplateOutput(false);
533 $page_gui->setStyleId($this->glossary->getStyleSheetId());
534 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
535 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
536 $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
537 $output = $page_gui->preview();
538
539 $this->tpl->setCurrentBlock("definition");
540 $this->tpl->setVariable("PAGE_CONTENT", $output);
541 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
542 $this->tpl->setVariable("LINK_CANCEL",
543 $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion"));
544 $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
545 $this->ctrl->setParameter($this, "def", $definition->getId());
546 $this->tpl->setVariable("LINK_CONFIRM",
547 $this->ctrl->getLinkTarget($this, "deleteDefinition"));
548 $this->tpl->parseCurrentBlock();
549 }
Glossary definition page GUI class.
Class ilGlossaryDefinition.
getContentStylePath($a_style_id)
get content style path
getSyntaxStylePath()
get syntax style path
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.

References $_GET, displayLocator(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), ilObjStyleSheet\getSyntaxStylePath(), getTemplate(), ilUtil\sendQuestion(), and setTabs().

+ Here is the call graph for this function:

◆ create()

ilGlossaryTermGUI::create ( )

form for new content object creation

Definition at line 113 of file class.ilGlossaryTermGUI.php.

114 {
115 // deprecated
116 }

◆ deleteDefinition()

ilGlossaryTermGUI::deleteDefinition ( )

Definition at line 557 of file class.ilGlossaryTermGUI.php.

558 {
559 $definition =& new ilGlossaryDefinition($_GET["def"]);
560 $definition->delete();
561 $this->ctrl->redirect($this, "listDefinitions");
562 }

References $_GET.

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

display locator

Definition at line 664 of file class.ilGlossaryTermGUI.php.

665 {
666 require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
667 $gloss_loc =& new ilGlossaryLocatorGUI();
668 $gloss_loc->setTerm($this->term);
669 $gloss_loc->setGlossary($this->glossary);
670 //$gloss_loc->setDefinition($this->definition);
671 $gloss_loc->display();
672 }

Referenced by addDefinition(), confirmDefinitionDeletion(), editTerm(), listDefinitions(), and listUsages().

+ Here is the caller graph for this function:

◆ editTerm()

ilGlossaryTermGUI::editTerm ( )

Edit term.

Definition at line 130 of file class.ilGlossaryTermGUI.php.

131 {
132 global $ilTabs, $ilCtrl;
133
134 $this->getTemplate();
135 $this->displayLocator();
136 $this->setTabs();
137 $ilTabs->activateTab("properties");
138
139 $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
140 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
141
142 $form = $this->getEditTermForm();
143
144 $this->tpl->setContent($ilCtrl->getHTML($form));
145
146 $this->quickList();
147 }
quickList()
Set quick term list cmd into left navigation URL.
getEditTermForm()
Get edit term form.
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, displayLocator(), getEditTermForm(), ilUtil\getImagePath(), getTemplate(), quickList(), and setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilGlossaryTermGUI::executeCommand ( )

execute command

Definition at line 49 of file class.ilGlossaryTermGUI.php.

50 {
51 $next_class = $this->ctrl->getNextClass($this);
52 $cmd = $this->ctrl->getCmd();
53
54 switch ($next_class)
55 {
56
57 case "iltermdefinitioneditorgui":
58 //$this->ctrl->setReturn($this, "listDefinitions");
59 $def_edit =& new ilTermDefinitionEditorGUI();
60 //$ret =& $def_edit->executeCommand();
61 $ret =& $this->ctrl->forwardCommand($def_edit);
62 $this->quickList("edit", $def_edit);
63 break;
64
65 case "ilpropertyformgui";
66 $form = $this->getEditTermForm();
67 $this->ctrl->forwardCommand($form);
68 break;
69
70 default:
71 $ret =& $this->$cmd();
72 break;
73 }
74 }
GUI class for glossary term definition editor.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, getEditTermForm(), and quickList().

+ Here is the call graph for this function:

◆ getEditTermForm()

ilGlossaryTermGUI::getEditTermForm ( )

Get edit term form.

Parameters

return

Definition at line 155 of file class.ilGlossaryTermGUI.php.

156 {
157 global $ilTabs, $ilCtrl;
158
159 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
160 $form = new ilPropertyFormGUI();
161 $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
162 $form->setTitle($this->lng->txt("cont_edit_term"));
163
164 $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
165 $term->setRequired(true);
166 $term->setValue($this->term->getTerm());
167 $form->addItem($term);
168
169 $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
170 $lang->setRequired(true);
172 $lang->setValue($this->term->getLanguage());
173 $form->addItem($lang);
174
175 // taxonomy
176 if ($this->glossary->getTaxonomyId() > 0)
177 {
178 include_once("./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
179 $tax_node_assign = new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(), "tax_node", true);
180
181 include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
182 $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId());
183 $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
184 $node_ids = array();
185 foreach ($assgnmts as $a)
186 {
187 $node_ids[] = $a["node_id"];
188 }
189 $tax_node_assign->setValue($node_ids);
190
191 $form->addItem($tax_node_assign);
192
193 }
194
195 // advanced metadata
196 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
197 $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR,'glo',$this->glossary->getId(),'term',
198 $this->term->getId());
199 $this->record_gui->setPropertyForm($form);
200 $this->record_gui->setSelectedOnly(true);
201 $this->record_gui->parse();
202
203 $form->addCommandButton("updateTerm", $this->lng->txt("save"));
204
205 return $form;
206 }
This class represents a selection list property in a property form.
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.

References $ilCtrl, $lang, $term, ilMDLanguageItem\_getLanguages(), and ilAdvancedMDRecordGUI\MODE_EDITOR.

Referenced by editTerm(), executeCommand(), and updateTerm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInternalLinks()

ilGlossaryTermGUI::getInternalLinks ( )

get internal links

Definition at line 369 of file class.ilGlossaryTermGUI.php.

370 {
371 require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
372 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
373
374 $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
375
376 $term_links = array();
377 for($j=0; $j<count($defs); $j++)
378 {
379 $def = $defs[$j];
380 $page = new ilGlossaryDefPage($def["id"]);
381 $page->buildDom();
382 $page_links = $page->getInternalLinks();
383 foreach($page_links as $key => $page_link)
384 {
385 $term_links[$key] = $page_link;
386 }
387 }
388
389 return $term_links;
390 }
Glossary definition page object.

References ilGlossaryDefinition\getDefinitionList().

+ Here is the call graph for this function:

◆ getLinkXML()

ilGlossaryTermGUI::getLinkXML ( )

Definition at line 105 of file class.ilGlossaryTermGUI.php.

106 {
107 return $this->link_xml;
108 }

References $link_xml.

Referenced by output().

+ Here is the caller graph for this function:

◆ getOfflineDirectory()

ilGlossaryTermGUI::getOfflineDirectory ( )

get offline directory

Returns
directory where to store offline files

Definition at line 90 of file class.ilGlossaryTermGUI.php.

90 {
91 return $this->offline_directory;
92 }

Referenced by output().

+ Here is the caller graph for this function:

◆ getOverlayHTML()

ilGlossaryTermGUI::getOverlayHTML (   $a_close_el_id,
  $a_glo_ov_id = "",
  $a_lang = "",
  $a_outputmode = "offline" 
)

Get overlay html.

Parameters

return

Definition at line 260 of file class.ilGlossaryTermGUI.php.

261 {
262 global $lng;
263
264 if ($a_lang == "")
265 {
266 $a_lang = $lng->getLangKey();
267 }
268
269 $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
270// $this->output(true, $tpl);
271 if ($a_outputmode == "preview")
272 {
273 $a_outputmode = "presentation";
274 }
275 if ($a_outputmode == "offline")
276 {
277 $this->output(true, $tpl, $a_outputmode);
278 }
279 else
280 {
281 $this->output(false, $tpl, $a_outputmode);
282 }
283 if ($a_glo_ov_id != "")
284 {
285 $tpl->setCurrentBlock("glovlink");
286 $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
287 $tpl->setVariable("ID_LINK", $a_glo_ov_id);
288 $tpl->parseCurrentBlock();
289 }
290 $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
291 $tpl->setVariable("ID_CLOSE", $a_close_el_id);
292 return $tpl->get();
293 }
output($a_offline=false, $a_tpl="", $a_outputmode="presentation")
output glossary term definitions
special template class to simplify handling of ITX/PEAR

References $lng, $tpl, and output().

+ Here is the call graph for this function:

◆ getTabs()

ilGlossaryTermGUI::getTabs ( $tabs_gui)

get tabs

Definition at line 678 of file class.ilGlossaryTermGUI.php.

679 {
680 global $lng, $ilHelp;
681
682
683 $ilHelp->setScreenIdComponent("glo_term");
684
685//echo ":".$_GET["term_id"].":";
686 if ($_GET["term_id"] != "")
687 {
688 $tabs_gui->addTab("properties",
689 $lng->txt("term"),
690 $this->ctrl->getLinkTarget($this, "editTerm"));
691
692 $tabs_gui->addTab("definitions",
693 $lng->txt("cont_definitions"),
694 $this->ctrl->getLinkTarget($this, "listDefinitions"));
695
696 $tabs_gui->addTab("usage",
697 $lng->txt("cont_usage")." (".ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]).")",
698 $this->ctrl->getLinkTarget($this, "listUsages"));
699
700 $tabs_gui->addNonTabbedLink("presentation_view",
701 $this->lng->txt("glo_presentation_view"),
702 ILIAS_HTTP_PATH.
703 "/goto.php?target=".
704 "git".
705 "_".$_GET["term_id"]."_".$_GET["ref_id"]."&client_id=".CLIENT_ID,
706 "_top"
707 );
708
709 }
710
711 // back to glossary
712 $tabs_gui->setBackTarget($this->lng->txt("glossary"),
713 $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms"));
714
715 }
static getNumberOfUsages($a_term_id)
Get number of usages.

References $_GET, $lng, and ilGlossaryTerm\getNumberOfUsages().

Referenced by setTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilGlossaryTermGUI::getTemplate ( )

get template

Definition at line 646 of file class.ilGlossaryTermGUI.php.

647 {
648 $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
649 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
650 }

Referenced by addDefinition(), confirmDefinitionDeletion(), editTerm(), listDefinitions(), and listUsages().

+ Here is the caller graph for this function:

◆ ilGlossaryTermGUI()

ilGlossaryTermGUI::ilGlossaryTermGUI (   $a_id = 0)

Constructor @access public.

Definition at line 30 of file class.ilGlossaryTermGUI.php.

31 {
32 global $lng, $ilias, $tpl, $ilCtrl;
33
34 $this->lng =& $lng;
35 $this->ilias =& $ilias;
36 $this->tpl =& $tpl;
37 $this->ctrl =& $ilCtrl;
38 $this->ctrl->saveParameter($this, array("term_id"));
39
40 if($a_id != 0)
41 {
42 $this->term =& new ilGlossaryTerm($a_id);
43 }
44 }
Class ilGlossaryTerm.
redirection script todo: (a better solution should control the processing via a xml file)

References $ilCtrl, $ilias, $lng, and $tpl.

◆ listDefinitions()

ilGlossaryTermGUI::listDefinitions ( )

list definitions

Definition at line 395 of file class.ilGlossaryTermGUI.php.

396 {
397 global $ilTabs;
398
399 $this->getTemplate();
400 $this->displayLocator();
401 $this->setTabs();
402 $ilTabs->activateTab("definitions");
403 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
404
405 // content style
406 $this->tpl->setCurrentBlock("ContentStyle");
407 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
408 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
409 $this->tpl->parseCurrentBlock();
410
411 // syntax style
412 $this->tpl->setCurrentBlock("SyntaxStyle");
413 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
415 $this->tpl->parseCurrentBlock();
416
417 // load template for table
418 $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
419 //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
420 //ilUtil::sendInfo();
421 $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
422 $this->tpl->setTitle(
423 $this->lng->txt("cont_term").": ".$this->term->getTerm());
424 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
425
426 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
427
428 $this->tpl->setCurrentBlock("add_def");
429 $this->tpl->setVariable("TXT_ADD_DEFINITION",
430 $this->lng->txt("cont_add_definition"));
431 $this->tpl->setVariable("BTN_ADD", "addDefinition");
432 $this->tpl->parseCurrentBlock();
433 $this->tpl->setCurrentBlock("def_list");
434
436
437 $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
438
439 for($j=0; $j<count($defs); $j++)
440 {
441 $def = $defs[$j];
442 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
443 $page_gui->setStyleId($this->glossary->getStyleSheetId());
444 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
445 $page_gui->setTemplateOutput(false);
446 $output = $page_gui->preview();
447
448 if (count($defs) > 1)
449 {
450 $this->tpl->setCurrentBlock("definition_header");
451 $this->tpl->setVariable("TXT_DEFINITION",
452 $this->lng->txt("cont_definition")." ".($j+1));
453 $this->tpl->parseCurrentBlock();
454 }
455
456 if ($j > 0)
457 {
458 $this->tpl->setCurrentBlock("up");
459 $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
460 $this->ctrl->setParameter($this, "def", $def["id"]);
461 $this->tpl->setVariable("LINK_UP",
462 $this->ctrl->getLinkTarget($this, "moveUp"));
463 $this->tpl->parseCurrentBlock();
464 }
465
466 if ($j+1 < count($defs))
467 {
468 $this->tpl->setCurrentBlock("down");
469 $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
470 $this->ctrl->setParameter($this, "def", $def["id"]);
471 $this->tpl->setVariable("LINK_DOWN",
472 $this->ctrl->getLinkTarget($this, "moveDown"));
473 $this->tpl->parseCurrentBlock();
474 }
475 $this->tpl->setCurrentBlock("submit_btns");
476 $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
477 $this->ctrl->setParameter($this, "def", $def["id"]);
478 $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
479 $this->tpl->setVariable("LINK_EDIT",
480 $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit"));
481 $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
482 $this->tpl->setVariable("LINK_DELETE",
483 $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion"));
484 $this->tpl->parseCurrentBlock();
485
486 $this->tpl->setCurrentBlock("definition");
487 $this->tpl->setVariable("PAGE_CONTENT", $output);
488 $this->tpl->parseCurrentBlock();
489 }
490 //$this->tpl->setCurrentBlock("def_list");
491 //$this->tpl->parseCurrentBlock();
492
493 $this->quickList();
494 }

References $_GET, displayLocator(), ilObjStyleSheet\getContentStylePath(), ilGlossaryDefinition\getDefinitionList(), ilUtil\getImagePath(), ilObjStyleSheet\getSyntaxStylePath(), getTemplate(), quickList(), and setTabs().

+ Here is the call graph for this function:

◆ listUsages()

ilGlossaryTermGUI::listUsages ( )

List usage.

Definition at line 766 of file class.ilGlossaryTermGUI.php.

767 {
768 global $ilTabs, $tpl;
769
770 //$this->displayLocator();
771 $this->getTemplate();
772 $this->displayLocator();
773 $this->setTabs();
774 $ilTabs->activateTab("usage");
775
776 $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
777 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
778
779 include_once("./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
780 $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
781
782 $tpl->setContent($tab->getHTML());
783
784 $this->quickList();
785 }
TableGUI class for media object usages listing.

References $_GET, $tab, $tpl, displayLocator(), ilUtil\getImagePath(), getTemplate(), quickList(), and setTabs().

+ Here is the call graph for this function:

◆ moveDown()

ilGlossaryTermGUI::moveDown ( )

move definition downwards

Definition at line 579 of file class.ilGlossaryTermGUI.php.

580 {
581 $definition =& new ilGlossaryDefinition($_GET["def"]);
582 $definition->moveDown();
583 $this->ctrl->redirect($this, "listDefinitions");
584 }

References $_GET.

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

move definition upwards

Definition at line 568 of file class.ilGlossaryTermGUI.php.

569 {
570 $definition =& new ilGlossaryDefinition($_GET["def"]);
571 $definition->moveUp();
572 $this->ctrl->redirect($this, "listDefinitions");
573 }

References $_GET.

◆ output()

ilGlossaryTermGUI::output (   $a_offline = false,
  $a_tpl = "",
  $a_outputmode = "presentation" 
)

output glossary term definitions

used in ilLMPresentationGUI->ilGlossary()

Definition at line 300 of file class.ilGlossaryTermGUI.php.

301 {
302 if ($a_tpl != "")
303 {
304 $tpl = $a_tpl;
305 }
306 else
307 {
309 }
310
311 require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
312 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
313
314 $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
315
316 $tpl->setVariable("TXT_TERM", $this->term->getTerm());
317
318 for($j=0; $j<count($defs); $j++)
319 {
320 $def = $defs[$j];
321 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
322 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
323 if (!$a_offline)
324 {
325 //$page_gui->setFullscreenLink(
326 // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
327 }
328 else
329 {
330 $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
331 }
332 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=".$_GET["ref_id"]);
333
334 if (!$a_offline)
335 {
336 $page_gui->setOutputMode($a_outputmode);
337 }
338 else
339 {
340 $page_gui->setOutputMode("offline");
341 $page_gui->setOfflineDirectory($this->getOfflineDirectory());
342 }
343
344 //$page_gui->setOutputMode("edit");
345 //$page_gui->setPresentationTitle($this->term->getTerm());
346 $page_gui->setLinkXML($this->getLinkXML());
347 $page_gui->setTemplateOutput(false);
348 $output = $page_gui->presentation($page_gui->getOutputMode());
349
350 if (count($defs) > 1)
351 {
352 $tpl->setCurrentBlock("definition_header");
353 $tpl->setVariable("TXT_DEFINITION",
354 $this->lng->txt("cont_definition")." ".($j+1));
355 $tpl->parseCurrentBlock();
356 }
357
359
360 $tpl->setCurrentBlock("definition");
361 $tpl->setVariable("PAGE_CONTENT", $output);
362 $tpl->parseCurrentBlock();
363 }
364 }
getOfflineDirectory()
get offline directory
includeMathjax($a_tpl=null)
Include Mathjax.

References $_GET, $tpl, ilGlossaryDefinition\getDefinitionList(), getLinkXML(), getOfflineDirectory(), and ilUtil\includeMathjax().

Referenced by getOverlayHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quickList()

ilGlossaryTermGUI::quickList ( )

Set quick term list cmd into left navigation URL.

Definition at line 790 of file class.ilGlossaryTermGUI.php.

791 {
792 global $tpl, $ilCtrl;
793
794 //$tpl->setLeftNavUrl($ilCtrl->getLinkTarget($this, "showQuickList"));
795
796 include_once("./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
797 $tab = new ilTermQuickListTableGUI($this, "editTerm");
798 $tpl->setLeftNavContent($tab->getHTML());
799 }

References $ilCtrl, $tab, and $tpl.

Referenced by editTerm(), executeCommand(), listDefinitions(), and listUsages().

+ Here is the caller graph for this function:

◆ saveDefinition()

ilGlossaryTermGUI::saveDefinition ( )

save definition

Definition at line 631 of file class.ilGlossaryTermGUI.php.

632 {
633 $def =& new ilGlossaryDefinition();
634 $def->setTermId($_GET["term_id"]);
635 $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
636 $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
637 $def->create();
638
639 $this->ctrl->redirect($this, "listDefinitions");
640 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST['username']
Definition: cron.php:12

References $_GET, $_POST, and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveTerm()

ilGlossaryTermGUI::saveTerm ( )

save term

Definition at line 121 of file class.ilGlossaryTermGUI.php.

122 {
123 // deprecated
124 }

◆ setGlossary()

ilGlossaryTermGUI::setGlossary (   $a_glossary)

Definition at line 95 of file class.ilGlossaryTermGUI.php.

96 {
97 $this->glossary = $a_glossary;
98 }

◆ setLinkXML()

ilGlossaryTermGUI::setLinkXML (   $a_link_xml)

Definition at line 100 of file class.ilGlossaryTermGUI.php.

101 {
102 $this->link_xml = $a_link_xml;
103 }

◆ setOfflineDirectory()

ilGlossaryTermGUI::setOfflineDirectory (   $offdir)

set offline directory to offdir

Parameters
offdircontains diretory where to store files

Definition at line 81 of file class.ilGlossaryTermGUI.php.

81 {
82 $this->offline_directory = $offdir;
83 }

◆ setTabs()

ilGlossaryTermGUI::setTabs ( )

output tabs

Definition at line 655 of file class.ilGlossaryTermGUI.php.

656 {
657 global $ilTabs;
658 $this->getTabs($ilTabs);
659 }
getTabs(&$tabs_gui)
get tabs

References getTabs().

Referenced by addDefinition(), confirmDefinitionDeletion(), editTerm(), listDefinitions(), and listUsages().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateTerm()

ilGlossaryTermGUI::updateTerm ( )

update term

Definition at line 213 of file class.ilGlossaryTermGUI.php.

214 {
215 // update term
216 $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
217 $this->term->setLanguage($_POST["term_language"]);
218 $this->term->update();
219
220 // update taxonomy assignment
221 if ($this->glossary->getTaxonomyId() > 0)
222 {
223 include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
224 $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId());
225 $ta->deleteAssignmentsOfItem($this->term->getId());
226 if (is_array($_POST["tax_node"]))
227 {
228 foreach ($_POST["tax_node"] as $node_id)
229 {
230 $ta->addAssignment($node_id, $this->term->getId());
231 }
232 }
233
234 }
235
236 // advanced metadata
237 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
239 'glo',$this->glossary->getId(),'term', $this->term->getId());
240
241 // :TODO: proper validation
242 $form = $this->getEditTermForm();
243 $form->checkInput();
244
245 if($this->record_gui->importEditFormPostValues())
246 {
247 $this->record_gui->writeEditForm();
248 }
249
250 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
251 $this->ctrl->redirect($this, "editTerm");
252 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $_POST, getEditTermForm(), ilAdvancedMDRecordGUI\MODE_EDITOR, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

Field Documentation

◆ $glossary

ilGlossaryTermGUI::$glossary

Definition at line 22 of file class.ilGlossaryTermGUI.php.

◆ $ilias

ilGlossaryTermGUI::$ilias

Definition at line 19 of file class.ilGlossaryTermGUI.php.

Referenced by ilGlossaryTermGUI().

◆ $link_xml

ilGlossaryTermGUI::$link_xml

Definition at line 24 of file class.ilGlossaryTermGUI.php.

Referenced by getLinkXML().

◆ $lng

ilGlossaryTermGUI::$lng

Definition at line 20 of file class.ilGlossaryTermGUI.php.

Referenced by _goto(), getOverlayHTML(), getTabs(), and ilGlossaryTermGUI().

◆ $term

ilGlossaryTermGUI::$term

Definition at line 23 of file class.ilGlossaryTermGUI.php.

Referenced by getEditTermForm().

◆ $tpl

ilGlossaryTermGUI::$tpl

The documentation for this class was generated from the following file: