ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilGlossaryTermGUI Class Reference

GUI class for glossary terms. More...

+ Collaboration diagram for ilGlossaryTermGUI:

Public Member Functions

 __construct ($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...
 
 setTabs ()
 output tabs More...
 
 displayLocator ()
 display locator More...
 
 getTabs ()
 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
 

Protected Attributes

 $log
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryTermGUI::__construct (   $a_id = 0)

Constructor @access public.

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

37 {
38 global $lng, $ilias, $tpl, $ilCtrl, $ilTabs;
39
40 $this->lng = $lng;
41 $this->ilias = $ilias;
42 $this->tpl = $tpl;
43 $this->ctrl = $ilCtrl;
44 $this->ctrl->saveParameter($this, array("term_id"));
45 $this->tabs_gui = $ilTabs;
46
47 $this->log = ilLoggerFactory::getLogger('glo');
48
49 if($a_id != 0)
50 {
51 $this->term = new ilGlossaryTerm($a_id);
52 require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
53 $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($a_id), false);
54 }
55 }
Class ilGlossaryTerm.
static _lookGlossaryID($term_id)
get glossary id form term id
static getLogger($a_component_id)
Get component logger.
Class ilObjGlossary.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)

References $ilCtrl, $ilias, $lng, $tpl, ilGlossaryTerm\_lookGlossaryID(), and ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

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

redirect script

Parameters
string$a_target

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

727 {
728 global $rbacsystem, $ilErr, $lng, $ilAccess;
729
730 $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
731
732 // get all references
733 if ($a_ref_id > 0)
734 {
735 $ref_ids = array($a_ref_id);
736 }
737 else
738 {
739 $ref_ids = ilObject::_getAllReferences($glo_id);
740 }
741
742 // check read permissions
743 foreach ($ref_ids as $ref_id)
744 {
745 // Permission check
746 if ($ilAccess->checkAccess("read", "", $ref_id))
747 {
748 $_GET["baseClass"] = "ilGlossaryPresentationGUI";
749 $_GET["term_id"] = $a_target;
750 $_GET["ref_id"] = $ref_id;
751 $_GET["cmd"] = "listDefinitions";
752 include_once("ilias.php");
753 exit;
754 }
755 }
756 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
757 {
758 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
759 ilObject::_lookupTitle($glo_id)), true);
761 }
762
763
764 $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
765 }
sprintf('%.4f', $callTime)
$_GET["client_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.
global $ilErr
Definition: raiseError.php:16
$ref_id
Definition: sahs_server.php:39

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

+ Here is the call graph for this function:

◆ addDefinition()

ilGlossaryTermGUI::addDefinition ( )

add definition

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

617 {
618 global $ilCtrl;
619
620 $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
621 $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
622 }

References $ilCtrl.

◆ cancel()

ilGlossaryTermGUI::cancel ( )

cancel adding definition

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

628 {
629 $this->ctrl->redirect($this, "listDefinitions");
630 }

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

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

578 {
579 $this->ctrl->redirect($this, "listDefinitions");
580 }

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

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

527 {
528 global $ilTabs;
529
530 //$this->getTemplate();
531 $this->displayLocator();
532 $this->setTabs();
533 $ilTabs->activateTab("definitions");
534
535 // content style
536 $this->tpl->setCurrentBlock("ContentStyle");
537 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
538 ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
539 $this->tpl->parseCurrentBlock();
540
541 // syntax style
542 $this->tpl->setCurrentBlock("SyntaxStyle");
543 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
545 $this->tpl->parseCurrentBlock();
546
547 $this->tpl->setTitle(
548 $this->lng->txt("cont_term").": ".$this->term->getTerm());
549 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
550
551 $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
552 ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
553
554 $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
555
556 $definition = new ilGlossaryDefinition($_GET["def"]);
557 $page_gui = new ilGlossaryDefPageGUI($definition->getId());
558 $page_gui->setTemplateOutput(false);
559 $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
560 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
561 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
562 $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
563 $output = $page_gui->preview();
564
565 $this->tpl->setCurrentBlock("definition");
566 $this->tpl->setVariable("PAGE_CONTENT", $output);
567 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
568 $this->tpl->setVariable("LINK_CANCEL",
569 $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion"));
570 $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
571 $this->ctrl->setParameter($this, "def", $definition->getId());
572 $this->tpl->setVariable("LINK_CONFIRM",
573 $this->ctrl->getLinkTarget($this, "deleteDefinition"));
574 $this->tpl->parseCurrentBlock();
575 }
Glossary definition page GUI class.
Class ilGlossaryDefinition.
displayLocator()
display locator
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id)
get content 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)
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output

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

+ Here is the call graph for this function:

◆ create()

ilGlossaryTermGUI::create ( )

form for new content object creation

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

142 {
143 // deprecated
144 }

◆ deleteDefinition()

ilGlossaryTermGUI::deleteDefinition ( )

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

584 {
585 $definition = new ilGlossaryDefinition($_GET["def"]);
586 $definition->delete();
587 $this->ctrl->redirect($this, "listDefinitions");
588 }

References $_GET.

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

display locator

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

658 {
659 require_once ("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
660 $gloss_loc = new ilGlossaryLocatorGUI();
661 $gloss_loc->setTerm($this->term);
662 $gloss_loc->setGlossary($this->glossary);
663 //$gloss_loc->setDefinition($this->definition);
664 $gloss_loc->display();
665 }

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

159 {
160 global $ilTabs, $ilCtrl;
161
162// $this->getTemplate();
163 $this->displayLocator();
164 $this->setTabs();
165 $ilTabs->activateTab("properties");
166
167 $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
168 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
169
170 if(!$a_form)
171 {
172 $a_form = $this->getEditTermForm();
173 }
174
175 $this->tpl->setContent($ilCtrl->getHTML($a_form));
176
177 $this->quickList();
178 }
quickList()
Set quick term list cmd into left navigation URL.
getEditTermForm()
Get edit term form.

References $ilCtrl, displayLocator(), getEditTermForm(), ilUtil\getImagePath(), 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 60 of file class.ilGlossaryTermGUI.php.

61 {
62 global $ilTabs;
63
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
66
67 $this->log->debug("glossary term, next class ".$next_class.", cmd: ".$cmd);
68
69 switch ($next_class)
70 {
71 case "iltermdefinitioneditorgui":
72 //$this->ctrl->setReturn($this, "listDefinitions");
73 $def_edit = new ilTermDefinitionEditorGUI();
74 //$ret = $def_edit->executeCommand();
75 $ret = $this->ctrl->forwardCommand($def_edit);
76 $this->quickList("edit", $def_edit);
77 break;
78
79 case "ilpropertyformgui";
80 $form = $this->getEditTermForm();
81 $this->ctrl->forwardCommand($form);
82 break;
83
84 case "ilobjectmetadatagui";
85 $this->setTabs();
86 $ilTabs->activateTab('meta_data');
87 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
88 $md_gui = new ilObjectMetaDataGUI(new ilObjGlossary($this->term->getGlossaryId(), false),
89 'term', $this->term->getId());
90 $this->ctrl->forwardCommand($md_gui);
91 $this->quickList();
92 break;
93
94 default:
95 $ret = $this->$cmd();
96 break;
97 }
98 }
Class ilObjectMetaDataGUI.
getId()
get object id @access public
GUI class for glossary term definition editor.
$ret
Definition: parser.php:6
$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 186 of file class.ilGlossaryTermGUI.php.

187 {
188 global $ilTabs, $ilCtrl;
189
190 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
191 $form = new ilPropertyFormGUI();
192 $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
193 $form->setTitle($this->lng->txt("cont_edit_term"));
194
195 $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
196 $term->setRequired(true);
197 $term->setValue($this->term->getTerm());
198 $form->addItem($term);
199
200 $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
201 $lang->setRequired(true);
203 $lang->setValue($this->term->getLanguage());
204 $form->addItem($lang);
205
206 // taxonomy
207 if ($this->term_glossary->getTaxonomyId() > 0)
208 {
209 include_once("./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
210 $tax_node_assign = new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), "tax_node", true);
211
212 include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
213 $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
214 $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
215 $node_ids = array();
216 foreach ($assgnmts as $a)
217 {
218 $node_ids[] = $a["node_id"];
219 }
220 $tax_node_assign->setValue($node_ids);
221
222 $form->addItem($tax_node_assign);
223
224 }
225
226 // advanced metadata
227 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
228 $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR,'glo',$this->term_glossary->getId(),'term',
229 $this->term->getId());
230 $this->record_gui->setPropertyForm($form);
231 $this->record_gui->parse();
232
233 $form->addCommandButton("updateTerm", $this->lng->txt("save"));
234
235 return $form;
236 }
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.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349

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

396 {
397 require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
398 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
399
400 $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
401
402 $term_links = array();
403 for($j=0; $j<count($defs); $j++)
404 {
405 $def = $defs[$j];
406 $page = new ilGlossaryDefPage($def["id"]);
407 $page->buildDom();
408 $page_links = $page->getInternalLinks();
409 foreach($page_links as $key => $page_link)
410 {
411 $term_links[$key] = $page_link;
412 }
413 }
414
415 return $term_links;
416 }
Glossary definition page object.
static getDefinitionList($a_term_id)
static

References ilGlossaryDefinition\getDefinitionList().

+ Here is the call graph for this function:

◆ getLinkXML()

ilGlossaryTermGUI::getLinkXML ( )

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

134 {
135 return $this->link_xml;
136 }

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

114 {
115 return $this->offline_directory;
116 }

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

286 {
287 global $lng;
288
289 if ($a_lang == "")
290 {
291 $a_lang = $lng->getLangKey();
292 }
293
294 $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
295// $this->output(true, $tpl);
296 if ($a_outputmode == "preview")
297 {
298 $a_outputmode = "presentation";
299 }
300 if ($a_outputmode == "offline")
301 {
302 $this->output(true, $tpl, $a_outputmode);
303 }
304 else
305 {
306 $this->output(false, $tpl, $a_outputmode);
307 }
308 if ($a_glo_ov_id != "")
309 {
310 $tpl->setCurrentBlock("glovlink");
311 $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
312 $tpl->setVariable("ID_LINK", $a_glo_ov_id);
313 $tpl->parseCurrentBlock();
314 }
315 $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
316 $tpl->setVariable("ID_CLOSE", $a_close_el_id);
317 return $tpl->get();
318 }
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 ( )

get tabs

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

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

◆ listDefinitions()

ilGlossaryTermGUI::listDefinitions ( )

list definitions

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

422 {
423 global $ilTabs;
424
425// $this->getTemplate();
426 $this->displayLocator();
427 $this->setTabs();
428 $ilTabs->activateTab("definitions");
429 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
430
431 // content style
432 $this->tpl->setCurrentBlock("ContentStyle");
433 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
434 ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId()));
435 $this->tpl->parseCurrentBlock();
436
437 // syntax style
438 $this->tpl->setCurrentBlock("SyntaxStyle");
439 $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
441 $this->tpl->parseCurrentBlock();
442
443 // load template for table
444 $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
445 //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
446 //ilUtil::sendInfo();
447// $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
448 $this->tpl->setTitle(
449 $this->lng->txt("cont_term").": ".$this->term->getTerm());
450 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
451
452 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
453
454 $this->tpl->setCurrentBlock("add_def");
455 $this->tpl->setVariable("TXT_ADD_DEFINITION",
456 $this->lng->txt("cont_add_definition"));
457 $this->tpl->setVariable("BTN_ADD", "addDefinition");
458 $this->tpl->parseCurrentBlock();
459 $this->tpl->setCurrentBlock("def_list");
460
462
463 $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
464
465 for($j=0; $j<count($defs); $j++)
466 {
467 $def = $defs[$j];
468 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
469 $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
470 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
471 $page_gui->setTemplateOutput(false);
472 $output = $page_gui->preview();
473
474 if (count($defs) > 1)
475 {
476 $this->tpl->setCurrentBlock("definition_header");
477 $this->tpl->setVariable("TXT_DEFINITION",
478 $this->lng->txt("cont_definition")." ".($j+1));
479 $this->tpl->parseCurrentBlock();
480 }
481
482 if ($j > 0)
483 {
484 $this->tpl->setCurrentBlock("up");
485 $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
486 $this->ctrl->setParameter($this, "def", $def["id"]);
487 $this->tpl->setVariable("LINK_UP",
488 $this->ctrl->getLinkTarget($this, "moveUp"));
489 $this->tpl->parseCurrentBlock();
490 }
491
492 if ($j+1 < count($defs))
493 {
494 $this->tpl->setCurrentBlock("down");
495 $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
496 $this->ctrl->setParameter($this, "def", $def["id"]);
497 $this->tpl->setVariable("LINK_DOWN",
498 $this->ctrl->getLinkTarget($this, "moveDown"));
499 $this->tpl->parseCurrentBlock();
500 }
501 $this->tpl->setCurrentBlock("submit_btns");
502 $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
503 $this->ctrl->setParameter($this, "def", $def["id"]);
504 $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
505 $this->tpl->setVariable("LINK_EDIT",
506 $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit"));
507 $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
508 $this->tpl->setVariable("LINK_DELETE",
509 $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion"));
510 $this->tpl->parseCurrentBlock();
511
512 $this->tpl->setCurrentBlock("definition");
513 $this->tpl->setVariable("PAGE_CONTENT", $output);
514 $this->tpl->parseCurrentBlock();
515 }
516 //$this->tpl->setCurrentBlock("def_list");
517 //$this->tpl->parseCurrentBlock();
518
519 $this->quickList();
520 }

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

+ Here is the call graph for this function:

◆ listUsages()

ilGlossaryTermGUI::listUsages ( )

List usage.

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

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

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

+ Here is the call graph for this function:

◆ moveDown()

ilGlossaryTermGUI::moveDown ( )

move definition downwards

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

606 {
607 $definition = new ilGlossaryDefinition($_GET["def"]);
608 $definition->moveDown();
609 $this->ctrl->redirect($this, "listDefinitions");
610 }

References $_GET.

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

move definition upwards

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

595 {
596 $definition = new ilGlossaryDefinition($_GET["def"]);
597 $definition->moveUp();
598 $this->ctrl->redirect($this, "listDefinitions");
599 }

References $_GET.

◆ output()

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

output glossary term definitions

used in ilLMPresentationGUI->ilGlossary()

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

326 {
327 if ($a_tpl != "")
328 {
329 $tpl = $a_tpl;
330 }
331 else
332 {
334 }
335
336 require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
337 require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
338
339 $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
340
341 $tpl->setVariable("TXT_TERM", $this->term->getTerm());
342
343 for($j=0; $j<count($defs); $j++)
344 {
345 $def = $defs[$j];
346 $page_gui = new ilGlossaryDefPageGUI($def["id"]);
347 $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
348 if (!$a_offline)
349 {
350 //$page_gui->setFullscreenLink(
351 // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
352 }
353 else
354 {
355 $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
356 }
357 $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=".$_GET["ref_id"]);
358
359 if (!$a_offline)
360 {
361 $page_gui->setOutputMode($a_outputmode);
362 }
363 else
364 {
365 $page_gui->setOutputMode("offline");
366 $page_gui->setOfflineDirectory($this->getOfflineDirectory());
367 }
368
369 //$page_gui->setOutputMode("edit");
370 //$page_gui->setPresentationTitle($this->term->getTerm());
371 $page_gui->setLinkXML($this->getLinkXML());
372 $page_gui->setTemplateOutput(false);
373 $output = $page_gui->presentation($page_gui->getOutputMode());
374
375 if (count($defs) > 1)
376 {
377 $tpl->setCurrentBlock("definition_header");
378 $tpl->setVariable("TXT_DEFINITION",
379 $this->lng->txt("cont_definition")." ".($j+1));
380 $tpl->parseCurrentBlock();
381 }
382
383 include_once './Services/MathJax/classes/class.ilMathJax.php';
384 ilMathJax::getInstance()->includeMathJax($tpl);
385
386 $tpl->setCurrentBlock("definition");
387 $tpl->setVariable("PAGE_CONTENT", $output);
388 $tpl->parseCurrentBlock();
389 }
390 }
getOfflineDirectory()
get offline directory
static getInstance()
Singleton: get instance.

References $_GET, $output, $tpl, ilGlossaryDefinition\getDefinitionList(), ilMathJax\getInstance(), getLinkXML(), and getOfflineDirectory().

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

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

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

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

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

+ Here is the call graph for this function:

◆ saveTerm()

ilGlossaryTermGUI::saveTerm ( )

save term

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

150 {
151 // deprecated
152 }

◆ setGlossary()

ilGlossaryTermGUI::setGlossary (   $a_glossary)

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

120 {
121 $this->glossary = $a_glossary;
122 if (!is_object($this->term_glossary))
123 {
124 $this->term_glossary = $a_glossary;
125 }
126 }

◆ setLinkXML()

ilGlossaryTermGUI::setLinkXML (   $a_link_xml)

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

129 {
130 $this->link_xml = $a_link_xml;
131 }

◆ setOfflineDirectory()

ilGlossaryTermGUI::setOfflineDirectory (   $offdir)

set offline directory to offdir

Parameters
offdircontains diretory where to store files

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

105 {
106 $this->offline_directory = $offdir;
107 }

◆ setTabs()

ilGlossaryTermGUI::setTabs ( )

output tabs

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

650 {
651 $this->getTabs();
652 }

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

244 {
245 $form = $this->getEditTermForm();
246 if($form->checkInput() &&
247 $this->record_gui->importEditFormPostValues())
248 {
249 // update term
250 $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
251 $this->term->setLanguage($_POST["term_language"]);
252 $this->term->update();
253
254 // update taxonomy assignment
255 if ($this->term_glossary->getTaxonomyId() > 0)
256 {
257 include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
258 $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
259 $ta->deleteAssignmentsOfItem($this->term->getId());
260 if (is_array($_POST["tax_node"]))
261 {
262 foreach ($_POST["tax_node"] as $node_id)
263 {
264 $ta->addAssignment($node_id, $this->term->getId());
265 }
266 }
267
268 }
269
270 $this->record_gui->writeEditForm();
271 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
272 $this->ctrl->redirect($this, "editTerm");
273 }
274
275 $form->setValuesByPost();
276 $this->editTerm($form);
277 }
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 __construct().

◆ $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 __construct(), _goto(), getOverlayHTML(), and getTabs().

◆ $log

ilGlossaryTermGUI::$log
protected

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

◆ $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: