ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGlossaryTermGUI Class Reference

GUI class for glossary terms. More...

+ Collaboration diagram for ilGlossaryTermGUI:

Public Member Functions

 ilGlossaryTermGUI ($a_id=0)
 Constructor 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...
 
 _goto ($a_target, $a_ref_id="")
 redirect script More...
 
 listUsages ()
 List usage. More...
 
 quickList ()
 Set quick term list cmd into left navigation URL. More...
 

Data Fields

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

Detailed Description

Member Function Documentation

◆ _goto()

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

redirect script

Parameters
string$a_target

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

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

716  {
717  global $rbacsystem, $ilErr, $lng, $ilAccess;
718 
719  $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
720 
721  // get all references
722  if ($a_ref_id > 0)
723  {
724  $ref_ids = array($a_ref_id);
725  }
726  else
727  {
728  $ref_ids = ilObject::_getAllReferences($glo_id);
729  }
730 
731  // check read permissions
732  foreach ($ref_ids as $ref_id)
733  {
734  // Permission check
735  if ($ilAccess->checkAccess("read", "", $ref_id))
736  {
737  $_GET["baseClass"] = "ilGlossaryPresentationGUI";
738  $_GET["term_id"] = $a_target;
739  $_GET["ref_id"] = $ref_id;
740  $_GET["cmd"] = "listDefinitions";
741  include_once("ilias.php");
742  exit;
743  }
744  }
745  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
746  {
747  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
748  ilObject::_lookupTitle($glo_id)), true);
750  }
751 
752 
753  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
754  }
exit
Definition: login.php:54
$_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.
$ref_id
Definition: sahs_server.php:39
_lookGlossaryID($term_id)
get glossary id form term id
+ Here is the call graph for this function:

◆ addDefinition()

ilGlossaryTermGUI::addDefinition ( )

add definition

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

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

584  {
585  global $ilTabs;
586 
587  $this->getTemplate();
588  $this->displayLocator();
589  $this->setTabs();
590  $ilTabs->activateTab("definitions");
591 
592  $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
593  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
594 
595  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
596  $form = new ilPropertyFormGUI();
597  $form->setFormAction($this->ctrl->getFormAction($this, "saveDefinition"));
598  $form->setTitle($this->lng->txt("gdf_new"));
599 
600  $title = new ilTextInputGUI($this->lng->txt("title"), "title");
601  $title->setRequired(true);
602  $form->addItem($title);
603 
604  $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
605  $form->addItem($desc);
606 
607  $form->addCommandButton("saveDefinition", $this->lng->txt("gdf_add"));
608  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
609 
610  $this->tpl->setContent($form->getHTML());
611  }
This class represents a property form user interface.
displayLocator()
display locator
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a text property in a property form.
This class represents a text area property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ cancel()

ilGlossaryTermGUI::cancel ( )

cancel adding definition

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

617  {
618  $this->ctrl->redirect($this, "listDefinitions");
619  }

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

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

545  {
546  $this->ctrl->redirect($this, "listDefinitions");
547  }

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

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

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

494  {
495  global $ilTabs;
496 
497  $this->getTemplate();
498  $this->displayLocator();
499  $this->setTabs();
500  $ilTabs->activateTab("definitions");
501 
502  // content style
503  $this->tpl->setCurrentBlock("ContentStyle");
504  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
505  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
506  $this->tpl->parseCurrentBlock();
507 
508  // syntax style
509  $this->tpl->setCurrentBlock("SyntaxStyle");
510  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
512  $this->tpl->parseCurrentBlock();
513 
514  $this->tpl->setTitle(
515  $this->lng->txt("cont_term").": ".$this->term->getTerm());
516  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
517 
518  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
519  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
520 
521  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
522 
523  $definition =& new ilGlossaryDefinition($_GET["def"]);
524  $page_gui = new ilGlossaryDefPageGUI($definition->getId());
525  $page_gui->setTemplateOutput(false);
526  $page_gui->setStyleId($this->glossary->getStyleSheetId());
527  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
528  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
529  $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=".$_GET["ref_id"]);
530  $output = $page_gui->preview();
531 
532  $this->tpl->setCurrentBlock("definition");
533  $this->tpl->setVariable("PAGE_CONTENT", $output);
534  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
535  $this->tpl->setVariable("LINK_CANCEL",
536  $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion"));
537  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
538  $this->ctrl->setParameter($this, "def", $definition->getId());
539  $this->tpl->setVariable("LINK_CONFIRM",
540  $this->ctrl->getLinkTarget($this, "deleteDefinition"));
541  $this->tpl->parseCurrentBlock();
542  }
setTemplateOutput($a_output=true)
$_GET["client_id"]
getSyntaxStylePath()
get syntax style path
displayLocator()
display locator
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
Class ilGlossaryDefinition.
getContentStylePath($a_style_id)
get content style path
Glossary definition page GUI class.
+ 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 550 of file class.ilGlossaryTermGUI.php.

References $_GET.

551  {
552  $definition =& new ilGlossaryDefinition($_GET["def"]);
553  $definition->delete();
554  $this->ctrl->redirect($this, "listDefinitions");
555  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

display locator

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

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

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  }
+ Here is the caller graph for this function:

◆ editTerm()

ilGlossaryTermGUI::editTerm ( )

Edit term.

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

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

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_term_b.png"));
141 
142  $form = $this->getEditTermForm();
143 
144  $this->tpl->setContent($ilCtrl->getHTML($form));
145 
146  $this->quickList();
147  }
displayLocator()
display locator
getEditTermForm()
Get edit term form.
global $ilCtrl
Definition: ilias.php:18
quickList()
Set quick term list cmd into left navigation URL.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ executeCommand()

ilGlossaryTermGUI::executeCommand ( )

execute command

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

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

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  }
$cmd
Definition: sahs_server.php:35
getEditTermForm()
Get edit term form.
quickList()
Set quick term list cmd into left navigation URL.
GUI class for glossary term definition editor.
+ Here is the call graph for this function:

◆ getEditTermForm()

ilGlossaryTermGUI::getEditTermForm ( )

Get edit term form.

Parameters

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

References $ilCtrl, $lang, ilMDLanguageItem\_getLanguages(), ilTaxNodeAssignment\getAssignmentsOfItem(), ilAdvancedMDRecordGUI\MODE_EDITOR, ilAdvancedMDRecordGUI\setPropertyForm(), and ilFormPropertyGUI\setRequired().

Referenced by editTerm(), and executeCommand().

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);
171  $lang->setOptions(ilMDLanguageItem::_getLanguages());
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  $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR,'glo',$this->glossary->getId(),'term',
198  $this->term->getId());
199  $record_gui->setPropertyForm($form);
200  $record_gui->setSelectedOnly(true);
201  $record_gui->parse();
202 
203  $form->addCommandButton("updateTerm", $this->lng->txt("save"));
204 
205  return $form;
206  }
getAssignmentsOfItem($a_item_id)
Get assignments for item.
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.
This class represents a selection list property in a property form.
This class represents a property form user interface.
setPropertyForm($form)
set property form object
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
+ 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 362 of file class.ilGlossaryTermGUI.php.

References ilGlossaryDefinition\getDefinitionList().

363  {
364  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
365  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
366 
367  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
368 
369  $term_links = array();
370  for($j=0; $j<count($defs); $j++)
371  {
372  $def = $defs[$j];
373  $page = new ilGlossaryDefPage($def["id"]);
374  $page->buildDom();
375  $page_links = $page->getInternalLinks();
376  foreach($page_links as $key => $page_link)
377  {
378  $term_links[$key] = $page_link;
379  }
380  }
381 
382  return $term_links;
383  }
getDefinitionList($a_term_id)
static
Glossary definition page object.
+ Here is the call graph for this function:

◆ getLinkXML()

ilGlossaryTermGUI::getLinkXML ( )

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

References $link_xml.

Referenced by output().

106  {
107  return $this->link_xml;
108  }
+ 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.

Referenced by output().

90  {
91  return $this->offline_directory;
92  }
+ 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

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

References $lng, and output().

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

◆ getTabs()

ilGlossaryTermGUI::getTabs ( $tabs_gui)

get tabs

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

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

Referenced by setTabs().

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  $tabs_gui->addTab("properties",
682  $lng->txt("properties"),
683  $this->ctrl->getLinkTarget($this, "editTerm"));
684 
685  $tabs_gui->addTab("definitions",
686  $lng->txt("cont_definitions"),
687  $this->ctrl->getLinkTarget($this, "listDefinitions"));
688 
689  $tabs_gui->addTab("usage",
690  $lng->txt("cont_usage")." (".ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]).")",
691  $this->ctrl->getLinkTarget($this, "listUsages"));
692 
693  $tabs_gui->addNonTabbedLink("presentation_view",
694  $this->lng->txt("glo_presentation_view"),
695  ILIAS_HTTP_PATH.
696  "/goto.php?target=".
697  "git".
698  "_".$_GET["term_id"]."_".$_GET["ref_id"]."&client_id=".CLIENT_ID,
699  "_top"
700  );
701 
702  }
703 
704  // back to glossary
705  $tabs_gui->setBackTarget($this->lng->txt("glossary"),
706  $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms"));
707 
708  }
$_GET["client_id"]
static getNumberOfUsages($a_term_id)
Get number of usages.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilGlossaryTermGUI::getTemplate ( )

get template

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

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

640  {
641  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
642  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
643  }
+ Here is the caller graph for this function:

◆ ilGlossaryTermGUI()

ilGlossaryTermGUI::ilGlossaryTermGUI (   $a_id = 0)

Constructor public.

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

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

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.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ listDefinitions()

ilGlossaryTermGUI::listDefinitions ( )

list definitions

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

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

389  {
390  global $ilTabs;
391 
392  $this->getTemplate();
393  $this->displayLocator();
394  $this->setTabs();
395  $ilTabs->activateTab("definitions");
396  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
397 
398  // content style
399  $this->tpl->setCurrentBlock("ContentStyle");
400  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
401  ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
402  $this->tpl->parseCurrentBlock();
403 
404  // syntax style
405  $this->tpl->setCurrentBlock("SyntaxStyle");
406  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
408  $this->tpl->parseCurrentBlock();
409 
410  // load template for table
411  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
412  //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
413  //ilUtil::sendInfo();
414  $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
415  $this->tpl->setTitle(
416  $this->lng->txt("cont_term").": ".$this->term->getTerm());
417  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
418 
419  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
420 
421  $this->tpl->setCurrentBlock("add_def");
422  $this->tpl->setVariable("TXT_ADD_DEFINITION",
423  $this->lng->txt("cont_add_definition"));
424  $this->tpl->setVariable("BTN_ADD", "addDefinition");
425  $this->tpl->parseCurrentBlock();
426  $this->tpl->setCurrentBlock("def_list");
427 
429 
430  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
431 
432  for($j=0; $j<count($defs); $j++)
433  {
434  $def = $defs[$j];
435  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
436  $page_gui->setStyleId($this->glossary->getStyleSheetId());
437  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=".$_GET["ref_id"]);
438  $page_gui->setTemplateOutput(false);
439  $output = $page_gui->preview();
440 
441  if (count($defs) > 1)
442  {
443  $this->tpl->setCurrentBlock("definition_header");
444  $this->tpl->setVariable("TXT_DEFINITION",
445  $this->lng->txt("cont_definition")." ".($j+1));
446  $this->tpl->parseCurrentBlock();
447  }
448 
449  if ($j > 0)
450  {
451  $this->tpl->setCurrentBlock("up");
452  $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
453  $this->ctrl->setParameter($this, "def", $def["id"]);
454  $this->tpl->setVariable("LINK_UP",
455  $this->ctrl->getLinkTarget($this, "moveUp"));
456  $this->tpl->parseCurrentBlock();
457  }
458 
459  if ($j+1 < count($defs))
460  {
461  $this->tpl->setCurrentBlock("down");
462  $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
463  $this->ctrl->setParameter($this, "def", $def["id"]);
464  $this->tpl->setVariable("LINK_DOWN",
465  $this->ctrl->getLinkTarget($this, "moveDown"));
466  $this->tpl->parseCurrentBlock();
467  }
468  $this->tpl->setCurrentBlock("submit_btns");
469  $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
470  $this->ctrl->setParameter($this, "def", $def["id"]);
471  $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
472  $this->tpl->setVariable("LINK_EDIT",
473  $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit"));
474  $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
475  $this->tpl->setVariable("LINK_DELETE",
476  $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion"));
477  $this->tpl->parseCurrentBlock();
478 
479  $this->tpl->setCurrentBlock("definition");
480  $this->tpl->setVariable("PAGE_CONTENT", $output);
481  $this->tpl->parseCurrentBlock();
482  }
483  //$this->tpl->setCurrentBlock("def_list");
484  //$this->tpl->parseCurrentBlock();
485 
486  $this->quickList();
487  }
getDefinitionList($a_term_id)
static
$_GET["client_id"]
getSyntaxStylePath()
get syntax style path
displayLocator()
display locator
quickList()
Set quick term list cmd into left navigation URL.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getContentStylePath($a_style_id)
get content style path
Glossary definition page GUI class.
+ Here is the call graph for this function:

◆ listUsages()

ilGlossaryTermGUI::listUsages ( )

List usage.

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

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

760  {
761  global $ilTabs, $tpl;
762 
763  //$this->displayLocator();
764  $this->getTemplate();
765  $this->displayLocator();
766  $this->setTabs();
767  $ilTabs->activateTab("usage");
768 
769  $this->tpl->setTitle($this->lng->txt("cont_term").": ".$this->term->getTerm());
770  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
771 
772  include_once("./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
773  $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
774 
775  $tpl->setContent($tab->getHTML());
776 
777  $this->quickList();
778  }
$_GET["client_id"]
TableGUI class for media object usages listing.
displayLocator()
display locator
quickList()
Set quick term list cmd into left navigation URL.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ moveDown()

ilGlossaryTermGUI::moveDown ( )

move definition downwards

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

References $_GET.

573  {
574  $definition =& new ilGlossaryDefinition($_GET["def"]);
575  $definition->moveDown();
576  $this->ctrl->redirect($this, "listDefinitions");
577  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

move definition upwards

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

References $_GET.

562  {
563  $definition =& new ilGlossaryDefinition($_GET["def"]);
564  $definition->moveUp();
565  $this->ctrl->redirect($this, "listDefinitions");
566  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ output()

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

output glossary term definitions

used in ilLMPresentationGUI->ilGlossary()

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

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

Referenced by getOverlayHTML().

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

References $ilCtrl, $tab, and $tpl.

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

784  {
785  global $tpl, $ilCtrl;
786 
787  //$tpl->setLeftNavUrl($ilCtrl->getLinkTarget($this, "showQuickList"));
788 
789  include_once("./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
790  $tab = new ilTermQuickListTableGUI($this, "editTerm");
791  $tpl->setLeftNavContent($tab->getHTML());
792  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ saveDefinition()

ilGlossaryTermGUI::saveDefinition ( )

save definition

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

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

625  {
626  $def =& new ilGlossaryDefinition();
627  $def->setTermId($_GET["term_id"]);
628  $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
629  $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
630  $def->create();
631 
632  $this->ctrl->redirect($this, "listDefinitions");
633  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class ilGlossaryDefinition.
+ 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 648 of file class.ilGlossaryTermGUI.php.

References getTabs().

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

649  {
650  global $ilTabs;
651  $this->getTabs($ilTabs);
652  }
getTabs(&$tabs_gui)
get tabs
+ 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.

References $_POST, ilTaxNodeAssignment\deleteAssignmentsOfItem(), ilAdvancedMDRecordGUI\loadFromPost(), ilAdvancedMDRecordGUI\MODE_EDITOR, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

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  $record_gui->loadFromPost();
241  $record_gui->saveValues();
242 
243  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
244  $this->ctrl->redirect($this, "editTerm");
245  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Taxonomy node <-> item assignment.
$_POST['username']
Definition: cron.php:12
deleteAssignmentsOfItem($a_item_id)
Delete assignments of item.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
loadFromPost()
Load values from post.
+ 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.

◆ $tpl

ilGlossaryTermGUI::$tpl

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

Referenced by ilGlossaryTermGUI(), listUsages(), output(), and quickList().


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