ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 (ilPropertyFormGUI $a_form=null)
 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 @ilCtrl_Calls ilGlossaryTermGUI: ilObjectMetaDataGUI

Definition at line 18 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 720 of file class.ilGlossaryTermGUI.php.

721 {
722 global $rbacsystem, $ilErr, $lng, $ilAccess;
723
724 $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
725
726 // get all references
727 if ($a_ref_id > 0)
728 {
729 $ref_ids = array($a_ref_id);
730 }
731 else
732 {
733 $ref_ids = ilObject::_getAllReferences($glo_id);
734 }
735
736 // check read permissions
737 foreach ($ref_ids as $ref_id)
738 {
739 // Permission check
740 if ($ilAccess->checkAccess("read", "", $ref_id))
741 {
742 $_GET["baseClass"] = "ilGlossaryPresentationGUI";
743 $_GET["term_id"] = $a_target;
744 $_GET["ref_id"] = $ref_id;
745 $_GET["cmd"] = "listDefinitions";
746 include_once("ilias.php");
747 exit;
748 }
749 }
750 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
751 {
752 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
753 ilObject::_lookupTitle($glo_id)), true);
755 }
756
757
758 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
759 }
$_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 599 of file class.ilGlossaryTermGUI.php.

600 {
601 global $ilCtrl;
602
603 $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
604 $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
605 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl.

◆ cancel()

ilGlossaryTermGUI::cancel ( )

cancel adding definition

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

611 {
612 $this->ctrl->redirect($this, "listDefinitions");
613 }

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

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

561 {
562 $this->ctrl->redirect($this, "listDefinitions");
563 }

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

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

510 {
511 global $ilTabs;
512
513 $this->getTemplate();
514 $this->displayLocator();
515 $this->setTabs();
516 $ilTabs->activateTab("definitions");
517
518 // content style
519 $this->tpl->setCurrentBlock("ContentStyle");
520 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
521 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
522 $this->tpl->parseCurrentBlock();
523
524 // syntax style
525 $this->tpl->setCurrentBlock("SyntaxStyle");
526 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
528 $this->tpl->parseCurrentBlock();
529
530 $this->tpl->setTitle(
531 $this->lng->txt("cont_term").": ".$this->term->getTerm());
532 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
533
534 $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
535 ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
536
537 $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
538
539 $definition =& new ilGlossaryDefinition($_GET["def"]);
540 $page_gui = new ilGlossaryDefPageGUI($definition->getId());
541 $page_gui->setTemplateOutput(false);
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();
547
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();
558 }
Glossary definition page GUI class.
Class ilGlossaryDefinition.
displayLocator()
display locator
getContentStylePath($a_style_id)
get content style path
getSyntaxStylePath()
get syntax style path
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

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 125 of file class.ilGlossaryTermGUI.php.

126 {
127 // deprecated
128 }

◆ deleteDefinition()

ilGlossaryTermGUI::deleteDefinition ( )

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

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

References $_GET.

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

display locator

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

652 {
653 require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
654 $gloss_loc =& new ilGlossaryLocatorGUI();
655 $gloss_loc->setTerm($this->term);
656 $gloss_loc->setGlossary($this->glossary);
657 //$gloss_loc->setDefinition($this->definition);
658 $gloss_loc->display();
659 }

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

+ Here is the caller graph for this function:

◆ editTerm()

ilGlossaryTermGUI::editTerm ( ilPropertyFormGUI  $a_form = null)

Edit term.

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

143 {
144 global $ilTabs, $ilCtrl;
145
146 $this->getTemplate();
147 $this->displayLocator();
148 $this->setTabs();
149 $ilTabs->activateTab("properties");
150
151 $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
152 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
153
154 if(!$a_form)
155 {
156 $a_form = $this->getEditTermForm();
157 }
158
159 $this->tpl->setContent($ilCtrl->getHTML($a_form));
160
161 $this->quickList();
162 }
quickList()
Set quick term list cmd into left navigation URL.
getEditTermForm()
Get edit term form.

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

Referenced by updateTerm().

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

◆ executeCommand()

ilGlossaryTermGUI::executeCommand ( )

execute command

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

51 {
52 global $ilTabs;
53
54 $next_class = $this->ctrl->getNextClass($this);
55 $cmd = $this->ctrl->getCmd();
56
57 switch ($next_class)
58 {
59 case "iltermdefinitioneditorgui":
60 //$this->ctrl->setReturn($this, "listDefinitions");
61 $def_edit =& new ilTermDefinitionEditorGUI();
62 //$ret =& $def_edit->executeCommand();
63 $ret =& $this->ctrl->forwardCommand($def_edit);
64 $this->quickList("edit", $def_edit);
65 break;
66
67 case "ilpropertyformgui";
68 $form = $this->getEditTermForm();
69 $this->ctrl->forwardCommand($form);
70 break;
71
72 case "ilobjectmetadatagui";
73 $this->setTabs();
74 $ilTabs->activateTab('meta_data');
75 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
76 $md_gui = new ilObjectMetaDataGUI(new ilObjGlossary($this->term->getGlossaryId(), false),
77 'term', $this->term->getId());
78 $this->ctrl->forwardCommand($md_gui);
79 $this->quickList();
80 break;
81
82 default:
83 $ret =& $this->$cmd();
84 break;
85 }
86 }
Class ilObjGlossary.
Class ilObjectMetaDataGUI.
getId()
get object id @access public
GUI class for glossary term definition editor.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, getEditTermForm(), ilObject\getId(), quickList(), and setTabs().

+ Here is the call graph for this function:

◆ getEditTermForm()

ilGlossaryTermGUI::getEditTermForm ( )

Get edit term form.

Parameters

return

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

171 {
172 global $ilTabs, $ilCtrl;
173
174 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
175 $form = new ilPropertyFormGUI();
176 $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
177 $form->setTitle($this->lng->txt("cont_edit_term"));
178
179 $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
180 $term->setRequired(true);
181 $term->setValue($this->term->getTerm());
182 $form->addItem($term);
183
184 $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
185 $lang->setRequired(true);
187 $lang->setValue($this->term->getLanguage());
188 $form->addItem($lang);
189
190 // taxonomy
191 if ($this->glossary->getTaxonomyId() > 0)
192 {
193 include_once("./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
194 $tax_node_assign = new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(), "tax_node", true);
195
196 include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
197 $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId());
198 $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
199 $node_ids = array();
200 foreach ($assgnmts as $a)
201 {
202 $node_ids[] = $a["node_id"];
203 }
204 $tax_node_assign->setValue($node_ids);
205
206 $form->addItem($tax_node_assign);
207
208 }
209
210 // advanced metadata
211 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
212 $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR,'glo',$this->glossary->getId(),'term',
213 $this->term->getId());
214 $this->record_gui->setPropertyForm($form);
215 $this->record_gui->parse();
216
217 $form->addCommandButton("updateTerm", $this->lng->txt("save"));
218
219 return $form;
220 }
This class represents a property form user interface.
This class represents a selection list property in a property form.
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.
This class represents a text property in a property form.

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 378 of file class.ilGlossaryTermGUI.php.

379 {
380 require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
381 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
382
383 $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
384
385 $term_links = array();
386 for($j=0; $j<count($defs); $j++)
387 {
388 $def = $defs[$j];
389 $page = new ilGlossaryDefPage($def["id"]);
390 $page->buildDom();
391 $page_links = $page->getInternalLinks();
392 foreach($page_links as $key => $page_link)
393 {
394 $term_links[$key] = $page_link;
395 }
396 }
397
398 return $term_links;
399 }
Glossary definition page object.

References ilGlossaryDefinition\getDefinitionList().

+ Here is the call graph for this function:

◆ getLinkXML()

ilGlossaryTermGUI::getLinkXML ( )

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

118 {
119 return $this->link_xml;
120 }

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 102 of file class.ilGlossaryTermGUI.php.

102 {
103 return $this->offline_directory;
104 }

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 269 of file class.ilGlossaryTermGUI.php.

270 {
271 global $lng;
272
273 if ($a_lang == "")
274 {
275 $a_lang = $lng->getLangKey();
276 }
277
278 $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
279// $this->output(true, $tpl);
280 if ($a_outputmode == "preview")
281 {
282 $a_outputmode = "presentation";
283 }
284 if ($a_outputmode == "offline")
285 {
286 $this->output(true, $tpl, $a_outputmode);
287 }
288 else
289 {
290 $this->output(false, $tpl, $a_outputmode);
291 }
292 if ($a_glo_ov_id != "")
293 {
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();
298 }
299 $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
300 $tpl->setVariable("ID_CLOSE", $a_close_el_id);
301 return $tpl->get();
302 }
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 665 of file class.ilGlossaryTermGUI.php.

666 {
667 global $lng, $ilHelp;
668
669
670 $ilHelp->setScreenIdComponent("glo_term");
671
672//echo ":".$_GET["term_id"].":";
673 if ($_GET["term_id"] != "")
674 {
675 $tabs_gui->addTab("properties",
676 $lng->txt("term"),
677 $this->ctrl->getLinkTarget($this, "editTerm"));
678
679 $tabs_gui->addTab("definitions",
680 $lng->txt("cont_definitions"),
681 $this->ctrl->getLinkTarget($this, "listDefinitions"));
682
683 $tabs_gui->addTab("usage",
684 $lng->txt("cont_usage")." (".ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]).")",
685 $this->ctrl->getLinkTarget($this, "listUsages"));
686
687 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
688 $mdgui = new ilObjectMetaDataGUI(new ilObjGlossary($this->term->getGlossaryId(), false),
689 "term", $this->term->getId());
690 $mdtab = $mdgui->getTab();
691 if($mdtab)
692 {
693 $tabs_gui->addTab("meta_data",
694 $lng->txt("meta_data"),
695 $mdtab);
696 }
697
698 $tabs_gui->addNonTabbedLink("presentation_view",
699 $this->lng->txt("glo_presentation_view"),
700 ILIAS_HTTP_PATH.
701 "/goto.php?target=".
702 "git".
703 "_".$_GET["term_id"]."_".$_GET["ref_id"]."&client_id=".CLIENT_ID,
704 "_top"
705 );
706
707 }
708
709 // back to glossary
710 $tabs_gui->setBackTarget($this->lng->txt("glossary"),
711 $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms"));
712
713 }
static getNumberOfUsages($a_term_id)
Get number of usages.

References $_GET, $lng, ilObject\getId(), 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 633 of file class.ilGlossaryTermGUI.php.

634 {
635 $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
636 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
637 }

Referenced by 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 31 of file class.ilGlossaryTermGUI.php.

32 {
33 global $lng, $ilias, $tpl, $ilCtrl;
34
35 $this->lng =& $lng;
36 $this->ilias =& $ilias;
37 $this->tpl =& $tpl;
38 $this->ctrl =& $ilCtrl;
39 $this->ctrl->saveParameter($this, array("term_id"));
40
41 if($a_id != 0)
42 {
43 $this->term =& new ilGlossaryTerm($a_id);
44 }
45 }
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 404 of file class.ilGlossaryTermGUI.php.

405 {
406 global $ilTabs;
407
408 $this->getTemplate();
409 $this->displayLocator();
410 $this->setTabs();
411 $ilTabs->activateTab("definitions");
412 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
413
414 // content style
415 $this->tpl->setCurrentBlock("ContentStyle");
416 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
417 ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
418 $this->tpl->parseCurrentBlock();
419
420 // syntax style
421 $this->tpl->setCurrentBlock("SyntaxStyle");
422 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
424 $this->tpl->parseCurrentBlock();
425
426 // load template for table
427 $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
428 //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
429 //ilUtil::sendInfo();
430 $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
431 $this->tpl->setTitle(
432 $this->lng->txt("cont_term").": ".$this->term->getTerm());
433 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
434
435 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
436
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");
443
445
446 $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
447
448 for($j=0; $j<count($defs); $j++)
449 {
450 $def = $defs[$j];
451 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
452 $page_gui->setStyleId($this->glossary->getStyleSheetId());
453 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
454 $page_gui->setTemplateOutput(false);
455 $output = $page_gui->preview();
456
457 if (count($defs) > 1)
458 {
459 $this->tpl->setCurrentBlock("definition_header");
460 $this->tpl->setVariable("TXT_DEFINITION",
461 $this->lng->txt("cont_definition")." ".($j+1));
462 $this->tpl->parseCurrentBlock();
463 }
464
465 if ($j > 0)
466 {
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();
473 }
474
475 if ($j+1 < count($defs))
476 {
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();
483 }
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();
494
495 $this->tpl->setCurrentBlock("definition");
496 $this->tpl->setVariable("PAGE_CONTENT", $output);
497 $this->tpl->parseCurrentBlock();
498 }
499 //$this->tpl->setCurrentBlock("def_list");
500 //$this->tpl->parseCurrentBlock();
501
502 $this->quickList();
503 }

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 764 of file class.ilGlossaryTermGUI.php.

765 {
766 global $ilTabs, $tpl;
767
768 //$this->displayLocator();
769 $this->getTemplate();
770 $this->displayLocator();
771 $this->setTabs();
772 $ilTabs->activateTab("usage");
773
774 $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
775 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
776
777 include_once("./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
778 $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
779
780 $tpl->setContent($tab->getHTML());
781
782 $this->quickList();
783 }
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 588 of file class.ilGlossaryTermGUI.php.

589 {
590 $definition =& new ilGlossaryDefinition($_GET["def"]);
591 $definition->moveDown();
592 $this->ctrl->redirect($this, "listDefinitions");
593 }

References $_GET.

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

move definition upwards

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

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

References $_GET.

◆ output()

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

output glossary term definitions

used in ilLMPresentationGUI->ilGlossary()

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

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

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

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 618 of file class.ilGlossaryTermGUI.php.

619 {
620 $def =& new ilGlossaryDefinition();
621 $def->setTermId($_GET["term_id"]);
622 $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
623 $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
624 $def->create();
625
626 $this->ctrl->redirect($this, "listDefinitions");
627 }
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 133 of file class.ilGlossaryTermGUI.php.

134 {
135 // deprecated
136 }

◆ setGlossary()

ilGlossaryTermGUI::setGlossary (   $a_glossary)

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

108 {
109 $this->glossary = $a_glossary;
110 }

◆ setLinkXML()

ilGlossaryTermGUI::setLinkXML (   $a_link_xml)

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

113 {
114 $this->link_xml = $a_link_xml;
115 }

◆ setOfflineDirectory()

ilGlossaryTermGUI::setOfflineDirectory (   $offdir)

set offline directory to offdir

Parameters
offdircontains diretory where to store files

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

93 {
94 $this->offline_directory = $offdir;
95 }

◆ setTabs()

ilGlossaryTermGUI::setTabs ( )

output tabs

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

643 {
644 global $ilTabs;
645 $this->getTabs($ilTabs);
646 }
getTabs(&$tabs_gui)
get tabs

References getTabs().

Referenced by confirmDefinitionDeletion(), editTerm(), executeCommand(), 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 227 of file class.ilGlossaryTermGUI.php.

228 {
229 $form = $this->getEditTermForm();
230 if($form->checkInput() &&
231 $this->record_gui->importEditFormPostValues())
232 {
233 // update term
234 $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
235 $this->term->setLanguage($_POST["term_language"]);
236 $this->term->update();
237
238 // update taxonomy assignment
239 if ($this->glossary->getTaxonomyId() > 0)
240 {
241 include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
242 $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId());
243 $ta->deleteAssignmentsOfItem($this->term->getId());
244 if (is_array($_POST["tax_node"]))
245 {
246 foreach ($_POST["tax_node"] as $node_id)
247 {
248 $ta->addAssignment($node_id, $this->term->getId());
249 }
250 }
251
252 }
253
254 $this->record_gui->writeEditForm();
255 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
256 $this->ctrl->redirect($this, "editTerm");
257 }
258
259 $form->setValuesByPost();
260 $this->editTerm($form);
261 }
editTerm(ilPropertyFormGUI $a_form=null)
Edit term.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

Field Documentation

◆ $glossary

ilGlossaryTermGUI::$glossary

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

◆ $ilias

ilGlossaryTermGUI::$ilias

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

Referenced by ilGlossaryTermGUI().

◆ $link_xml

ilGlossaryTermGUI::$link_xml

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

Referenced by getLinkXML().

◆ $lng

ilGlossaryTermGUI::$lng

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

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

◆ $term

ilGlossaryTermGUI::$term

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

Referenced by getEditTermForm().

◆ $tpl

ilGlossaryTermGUI::$tpl

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