ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilGlossaryTermGUI Class Reference

GUI class for glossary terms. More...

+ Collaboration diagram for ilGlossaryTermGUI:

Public Member Functions

 __construct ($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 (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

 $lng
 
 $tpl
 
 $glossary
 
 $term
 
 $link_xml
 

Protected Attributes

 $ctrl
 
 $tabs_gui
 
 $help
 
 $log
 
 $term_glossary = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryTermGUI::__construct (   $a_id = 0)

Constructor public.

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

References $_GET, $DIC, $ilCtrl, $lng, $tpl, ilGlossaryTerm\_lookGlossaryID(), ilObject\_lookupObjectId(), array, and ilLoggerFactory\getLogger().

56  {
57  global $DIC;
58 
59  $this->help = $DIC["ilHelp"];
60  $lng = $DIC->language();
61  $tpl = $DIC["tpl"];
62  $ilCtrl = $DIC->ctrl();
63  $ilTabs = $DIC->tabs();
64 
65  $this->lng = $lng;
66  $this->tpl = $tpl;
67  $this->ctrl = $ilCtrl;
68  $this->ctrl->saveParameter($this, array("term_id"));
69  $this->tabs_gui = $ilTabs;
70 
71  $this->log = ilLoggerFactory::getLogger('glo');
72 
73  $this->ref_id = $_GET["ref_id"];
74 
75  if ($a_id != 0) {
76  $this->term = new ilGlossaryTerm($a_id);
77  require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
78  if (ilObject::_lookupObjectId($this->ref_id) == ilGlossaryTerm::_lookGlossaryID($a_id)) {
79  $this->term_glossary = new ilObjGlossary($this->ref_id, true);
80  } else {
81  $this->term_glossary = new ilObjGlossary(ilGlossaryTerm::_lookGlossaryID($a_id), false);
82  }
83  }
84  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
Class ilGlossaryTerm.
Class ilObjGlossary.
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
static _lookGlossaryID($term_id)
get glossary id form term id
static getLogger($a_component_id)
Get component logger.
+ 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 772 of file class.ilGlossaryTermGUI.php.

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

773  {
774  global $DIC;
775 
776  $rbacsystem = $DIC->rbac()->system();
777  $ilErr = $DIC["ilErr"];
778  $lng = $DIC->language();
779  $ilAccess = $DIC->access();
780 
781  $glo_id = ilGlossaryTerm::_lookGlossaryID($a_target);//::_lookupContObjID($a_target);
782 
783  // get all references
784  if ($a_ref_id > 0) {
785  $ref_ids = array($a_ref_id);
786  } else {
787  $ref_ids = ilObject::_getAllReferences($glo_id);
788  }
789 
790  // check read permissions
791  foreach ($ref_ids as $ref_id) {
792  // Permission check
793  if ($ilAccess->checkAccess("read", "", $ref_id)) {
794  $_GET["baseClass"] = "ilGlossaryPresentationGUI";
795  $_GET["term_id"] = $a_target;
796  $_GET["ref_id"] = $ref_id;
797  $_GET["cmd"] = "listDefinitions";
798  include_once("ilias.php");
799  exit;
800  }
801  }
802  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
803  ilUtil::sendFailure(sprintf(
804  $lng->txt("msg_no_perm_read_item"),
805  ilObject::_lookupTitle($glo_id)
806  ), true);
808  }
809 
810 
811  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
812  }
global $ilErr
Definition: raiseError.php:16
global $DIC
Definition: saml.php:7
$_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
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _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 651 of file class.ilGlossaryTermGUI.php.

References $ctrl, and $ilCtrl.

652  {
654 
655  $ilCtrl->setParameterByClass("ilobjglossarygui", "term_id", $this->term->getId());
656  $ilCtrl->redirectByClass("ilobjglossarygui", "addDefinition");
657  }
global $ilCtrl
Definition: ilias.php:18

◆ cancel()

ilGlossaryTermGUI::cancel ( )

cancel adding definition

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

663  {
664  $this->ctrl->redirect($this, "listDefinitions");
665  }

◆ cancelDefinitionDeletion()

ilGlossaryTermGUI::cancelDefinitionDeletion ( )

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

613  {
614  $this->ctrl->redirect($this, "listDefinitions");
615  }

◆ confirmDefinitionDeletion()

ilGlossaryTermGUI::confirmDefinitionDeletion ( )

deletion confirmation screen

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

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

553  {
554  $ilTabs = $this->tabs_gui;
555 
556  //$this->getTemplate();
557  $this->displayLocator();
558  $this->setTabs();
559  $ilTabs->activateTab("definitions");
560 
561  // content style
562  $this->tpl->setCurrentBlock("ContentStyle");
563  $this->tpl->setVariable(
564  "LOCATION_CONTENT_STYLESHEET",
565  ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId())
566  );
567  $this->tpl->parseCurrentBlock();
568 
569  // syntax style
570  $this->tpl->setCurrentBlock("SyntaxStyle");
571  $this->tpl->setVariable(
572  "LOCATION_SYNTAX_STYLESHEET",
574  );
575  $this->tpl->parseCurrentBlock();
576 
577  $this->tpl->setTitle(
578  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
579  );
580  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
581 
582  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
583  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
584 
585  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
586 
587  $definition = new ilGlossaryDefinition($_GET["def"]);
588  $page_gui = new ilGlossaryDefPageGUI($definition->getId());
589  $page_gui->setTemplateOutput(false);
590  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
591  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
592  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
593  $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]);
594  $output = $page_gui->preview();
595 
596  $this->tpl->setCurrentBlock("definition");
597  $this->tpl->setVariable("PAGE_CONTENT", $output);
598  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
599  $this->tpl->setVariable(
600  "LINK_CANCEL",
601  $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion")
602  );
603  $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
604  $this->ctrl->setParameter($this, "def", $definition->getId());
605  $this->tpl->setVariable(
606  "LINK_CONFIRM",
607  $this->ctrl->getLinkTarget($this, "deleteDefinition")
608  );
609  $this->tpl->parseCurrentBlock();
610  }
setTemplateOutput($a_output=true)
$_GET["client_id"]
displayLocator()
display locator
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getSyntaxStylePath()
get syntax style path
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Class ilGlossaryDefinition.
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 173 of file class.ilGlossaryTermGUI.php.

174  {
175  // deprecated
176  }

◆ deleteDefinition()

ilGlossaryTermGUI::deleteDefinition ( )

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

References $_GET.

619  {
620  $definition = new ilGlossaryDefinition($_GET["def"]);
621  $definition->delete();
622  $this->ctrl->redirect($this, "listDefinitions");
623  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ displayLocator()

ilGlossaryTermGUI::displayLocator ( )

display locator

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

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

693  {
694  require_once("./Modules/Glossary/classes/class.ilGlossaryLocatorGUI.php");
695  $gloss_loc = new ilGlossaryLocatorGUI();
696  $gloss_loc->setTerm($this->term);
697  $gloss_loc->setGlossary($this->glossary);
698  //$gloss_loc->setDefinition($this->definition);
699  $gloss_loc->display();
700  }
+ Here is the caller graph for this function:

◆ editTerm()

ilGlossaryTermGUI::editTerm ( ilPropertyFormGUI  $a_form = null)

Edit term.

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

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

Referenced by updateTerm().

191  {
192  $ilTabs = $this->tabs_gui;
194 
195  // $this->getTemplate();
196  $this->displayLocator();
197  $this->setTabs();
198  $ilTabs->activateTab("properties");
199 
200  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
201  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
202 
203  if (!$a_form) {
204  $a_form = $this->getEditTermForm();
205  }
206 
207  $this->tpl->setContent($ilCtrl->getHTML($a_form));
208 
209  $this->quickList();
210  }
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:
+ Here is the caller graph for this function:

◆ executeCommand()

ilGlossaryTermGUI::executeCommand ( )

execute command

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

References $form, $ret, $tabs_gui, getEditTermForm(), quickList(), and setTabs().

90  {
91  $ilTabs = $this->tabs_gui;
92 
93  $next_class = $this->ctrl->getNextClass($this);
94  $cmd = $this->ctrl->getCmd();
95 
96  $this->log->debug("glossary term, next class " . $next_class . ", cmd: " . $cmd);
97 
98  switch ($next_class) {
99  case "iltermdefinitioneditorgui":
100  //$this->ctrl->setReturn($this, "listDefinitions");
101  $def_edit = new ilTermDefinitionEditorGUI();
102  //$ret = $def_edit->executeCommand();
103  $ret = $this->ctrl->forwardCommand($def_edit);
104  $this->quickList("edit", $def_edit);
105  break;
106 
107  case "ilpropertyformgui":
108  $form = $this->getEditTermForm();
109  $this->ctrl->forwardCommand($form);
110  break;
111 
112  case "ilobjectmetadatagui":
113  $this->setTabs();
114  $ilTabs->activateTab('meta_data');
115  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
116  $md_gui = new ilObjectMetaDataGUI(
117  $this->term_glossary,
118  'term',
119  $this->term->getId()
120  );
121  $this->ctrl->forwardCommand($md_gui);
122  $this->quickList();
123  break;
124 
125  default:
126  $ret = $this->$cmd();
127  break;
128  }
129  }
Class ilObjectMetaDataGUI.
getEditTermForm()
Get edit term form.
quickList()
Set quick term list cmd into left navigation URL.
GUI class for glossary term definition editor.
if(isset($_POST['submit'])) $form
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getEditTermForm()

ilGlossaryTermGUI::getEditTermForm ( )

Get edit term form.

Parameters

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

References $ctrl, $form, $ilCtrl, $lang, $tabs_gui, $term, ilMDLanguageItem\_getLanguages(), array, ilTaxNodeAssignment\getAssignmentsOfItem(), ilAdvancedMDRecordGUI\MODE_EDITOR, and ilAdvancedMDRecordGUI\setPropertyForm().

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

219  {
220  $ilTabs = $this->tabs_gui;
222 
223  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
224  $form = new ilPropertyFormGUI();
225  $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
226  $form->setTitle($this->lng->txt("cont_edit_term"));
227 
228  $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
229  $term->setRequired(true);
230  $term->setValue($this->term->getTerm());
231  $form->addItem($term);
232 
233  $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
234  $lang->setRequired(true);
235  $lang->setOptions(ilMDLanguageItem::_getLanguages());
236  $lang->setValue($this->term->getLanguage());
237  $form->addItem($lang);
238 
239  // taxonomy
240  if ($this->term_glossary->getTaxonomyId() > 0) {
241  include_once("./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php");
242  $tax_node_assign = new ilTaxSelectInputGUI($this->term_glossary->getTaxonomyId(), "tax_node", true);
243 
244  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
245  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
246  $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
247  $node_ids = array();
248  foreach ($assgnmts as $a) {
249  $node_ids[] = $a["node_id"];
250  }
251  $tax_node_assign->setValue($node_ids);
252 
253  $form->addItem($tax_node_assign);
254  }
255 
256  // advanced metadata
257  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
258  $this->record_gui = new ilAdvancedMDRecordGUI(
260  'glo',
261  $this->term_glossary->getId(),
262  'term',
263  $this->term->getId()
264  );
265  $this->record_gui->setPropertyForm($form);
266  $this->record_gui->parse();
267 
268  $form->addCommandButton("updateTerm", $this->lng->txt("save"));
269 
270  return $form;
271  }
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
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
Create styles array
The data for the language used.
+ 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 410 of file class.ilGlossaryTermGUI.php.

References $def, $key, array, and ilGlossaryDefinition\getDefinitionList().

411  {
412  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
413  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
414 
415  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
416 
417  $term_links = array();
418  for ($j=0; $j<count($defs); $j++) {
419  $def = $defs[$j];
420  $page = new ilGlossaryDefPage($def["id"]);
421  $page->buildDom();
422  $page_links = $page->getInternalLinks();
423  foreach ($page_links as $key => $page_link) {
424  $term_links[$key] = $page_link;
425  }
426  }
427 
428  return $term_links;
429  }
static getDefinitionList($a_term_id)
static
Glossary definition page object.
Create styles array
The data for the language used.
$def
Definition: croninfo.php:21
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ getLinkXML()

ilGlossaryTermGUI::getLinkXML ( )

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

References $link_xml.

Referenced by output().

166  {
167  return $this->link_xml;
168  }
+ Here is the caller graph for this function:

◆ getOfflineDirectory()

ilGlossaryTermGUI::getOfflineDirectory ( )

get offline directory

Returns
directory where to store offline files

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

Referenced by output().

147  {
148  return $this->offline_directory;
149  }
+ 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 315 of file class.ilGlossaryTermGUI.php.

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

316  {
317  $lng = $this->lng;
318 
319  if ($a_lang == "") {
320  $a_lang = $lng->getLangKey();
321  }
322 
323  $tpl = new ilTemplate("tpl.glossary_overlay.html", true, true, "Modules/Glossary");
324  // $this->output(true, $tpl);
325  if ($a_outputmode == "preview") {
326  $a_outputmode = "presentation";
327  }
328  if ($a_outputmode == "offline") {
329  $this->output(true, $tpl, $a_outputmode);
330  } else {
331  $this->output(false, $tpl, $a_outputmode);
332  }
333  if ($a_glo_ov_id != "") {
334  $tpl->setCurrentBlock("glovlink");
335  $tpl->setVariable("TXT_LINK", $lng->txtlng("content", "cont_sco_glossary", $a_lang));
336  $tpl->setVariable("ID_LINK", $a_glo_ov_id);
337  $tpl->parseCurrentBlock();
338  }
339  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $a_lang));
340  $tpl->setVariable("ID_CLOSE", $a_close_el_id);
341  return $tpl->get();
342  }
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 ( )

get tabs

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

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

Referenced by setTabs().

707  {
708  $lng = $this->lng;
709  $ilHelp = $this->help;
710 
711 
712  $ilHelp->setScreenIdComponent("glo_term");
713 
714  //echo ":".$_GET["term_id"].":";
715  if ($_GET["term_id"] != "") {
716  $this->tabs_gui->addTab(
717  "properties",
718  $lng->txt("term"),
719  $this->ctrl->getLinkTarget($this, "editTerm")
720  );
721 
722  $this->tabs_gui->addTab(
723  "definitions",
724  $lng->txt("cont_definitions"),
725  $this->ctrl->getLinkTarget($this, "listDefinitions")
726  );
727 
728  $this->tabs_gui->addTab(
729  "usage",
730  $lng->txt("cont_usage") . " (" . ilGlossaryTerm::getNumberOfUsages($_GET["term_id"]) . ")",
731  $this->ctrl->getLinkTarget($this, "listUsages")
732  );
733 
734  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
735  $mdgui = new ilObjectMetaDataGUI(
736  $this->term_glossary,
737  "term",
738  $this->term->getId()
739  );
740  $mdtab = $mdgui->getTab();
741  if ($mdtab) {
742  $this->tabs_gui->addTab(
743  "meta_data",
744  $lng->txt("meta_data"),
745  $mdtab
746  );
747  }
748 
749  $this->tabs_gui->addNonTabbedLink(
750  "presentation_view",
751  $this->lng->txt("glo_presentation_view"),
752  ILIAS_HTTP_PATH .
753  "/goto.php?target=" .
754  "git" .
755  "_" . $_GET["term_id"] . "_" . $_GET["ref_id"] . "&client_id=" . CLIENT_ID,
756  "_top"
757  );
758  }
759 
760  // back to glossary
761  $this->tabs_gui->setBackTarget(
762  $this->lng->txt("glossary"),
763  $this->ctrl->getLinkTargetByClass("ilobjglossarygui", "listTerms")
764  );
765  }
Class ilObjectMetaDataGUI.
$_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:

◆ listDefinitions()

ilGlossaryTermGUI::listDefinitions ( )

list definitions

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

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

435  {
436  $ilTabs = $this->tabs_gui;
437 
438  // $this->getTemplate();
439  $this->displayLocator();
440  $this->setTabs();
441  $ilTabs->activateTab("definitions");
442  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
443 
444  // content style
445  $this->tpl->setCurrentBlock("ContentStyle");
446  $this->tpl->setVariable(
447  "LOCATION_CONTENT_STYLESHEET",
448  ilObjStyleSheet::getContentStylePath($this->term_glossary->getStyleSheetId())
449  );
450  $this->tpl->parseCurrentBlock();
451 
452  // syntax style
453  $this->tpl->setCurrentBlock("SyntaxStyle");
454  $this->tpl->setVariable(
455  "LOCATION_SYNTAX_STYLESHEET",
457  );
458  $this->tpl->parseCurrentBlock();
459 
460  // load template for table
461  $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
462  //$this->tpl->addBlockfile("CONTENT", "def_list", "tpl.glossary_definition_list.html", true);
463  //ilUtil::sendInfo();
464  // $this->tpl->addBlockfile("STATUSLINE", "statusline", "tpl.statusline.html");
465  $this->tpl->setTitle(
466  $this->lng->txt("cont_term") . ": " . $this->term->getTerm()
467  );
468  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
469 
470  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
471 
472  $this->tpl->setCurrentBlock("add_def");
473  $this->tpl->setVariable(
474  "TXT_ADD_DEFINITION",
475  $this->lng->txt("cont_add_definition")
476  );
477  $this->tpl->setVariable("BTN_ADD", "addDefinition");
478  $this->tpl->parseCurrentBlock();
479  $this->tpl->setCurrentBlock("def_list");
480 
482 
483  $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
484 
485  for ($j=0; $j<count($defs); $j++) {
486  $def = $defs[$j];
487  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
488  $page_gui->setStyleId($this->term_glossary->getStyleSheetId());
489  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
490  $page_gui->setTemplateOutput(false);
491  $output = $page_gui->preview();
492 
493  if (count($defs) > 1) {
494  $this->tpl->setCurrentBlock("definition_header");
495  $this->tpl->setVariable(
496  "TXT_DEFINITION",
497  $this->lng->txt("cont_definition") . " " . ($j+1)
498  );
499  $this->tpl->parseCurrentBlock();
500  }
501 
502  if ($j > 0) {
503  $this->tpl->setCurrentBlock("up");
504  $this->tpl->setVariable("TXT_UP", $this->lng->txt("up"));
505  $this->ctrl->setParameter($this, "def", $def["id"]);
506  $this->tpl->setVariable(
507  "LINK_UP",
508  $this->ctrl->getLinkTarget($this, "moveUp")
509  );
510  $this->tpl->parseCurrentBlock();
511  }
512 
513  if ($j+1 < count($defs)) {
514  $this->tpl->setCurrentBlock("down");
515  $this->tpl->setVariable("TXT_DOWN", $this->lng->txt("down"));
516  $this->ctrl->setParameter($this, "def", $def["id"]);
517  $this->tpl->setVariable(
518  "LINK_DOWN",
519  $this->ctrl->getLinkTarget($this, "moveDown")
520  );
521  $this->tpl->parseCurrentBlock();
522  }
523  $this->tpl->setCurrentBlock("submit_btns");
524  $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
525  $this->ctrl->setParameter($this, "def", $def["id"]);
526  $this->ctrl->setParameterByClass("ilTermDefinitionEditorGUI", "def", $def["id"]);
527  $this->tpl->setVariable(
528  "LINK_EDIT",
529  $this->ctrl->getLinkTargetByClass(array("ilTermDefinitionEditorGUI", "ilGlossaryDefPageGUI"), "edit")
530  );
531  $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
532  $this->tpl->setVariable(
533  "LINK_DELETE",
534  $this->ctrl->getLinkTarget($this, "confirmDefinitionDeletion")
535  );
536  $this->tpl->parseCurrentBlock();
537 
538  $this->tpl->setCurrentBlock("definition");
539  $this->tpl->setVariable("PAGE_CONTENT", $output);
540  $this->tpl->parseCurrentBlock();
541  }
542  //$this->tpl->setCurrentBlock("def_list");
543  //$this->tpl->parseCurrentBlock();
544 
545  $this->quickList();
546  }
static getDefinitionList($a_term_id)
static
$_GET["client_id"]
displayLocator()
display locator
quickList()
Set quick term list cmd into left navigation URL.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Create styles array
The data for the language used.
Glossary definition page GUI class.
$def
Definition: croninfo.php:21
+ Here is the call graph for this function:

◆ listUsages()

ilGlossaryTermGUI::listUsages ( )

List usage.

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

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

818  {
819  $ilTabs = $this->tabs_gui;
820  $tpl = $this->tpl;
821 
822  //$this->displayLocator();
823  // $this->getTemplate();
824  $this->displayLocator();
825  $this->setTabs();
826  $ilTabs->activateTab("usage");
827 
828  $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
829  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_glo.svg"));
830 
831  include_once("./Modules/Glossary/classes/class.ilTermUsagesTableGUI.php");
832  $tab = new ilTermUsagesTableGUI($this, "listUsages", $_GET["term_id"]);
833 
834  $tpl->setContent($tab->getHTML());
835 
836  $this->quickList();
837  }
$_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 640 of file class.ilGlossaryTermGUI.php.

References $_GET.

641  {
642  $definition = new ilGlossaryDefinition($_GET["def"]);
643  $definition->moveDown();
644  $this->ctrl->redirect($this, "listDefinitions");
645  }
$_GET["client_id"]
Class ilGlossaryDefinition.

◆ moveUp()

ilGlossaryTermGUI::moveUp ( )

move definition upwards

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

References $_GET.

630  {
631  $definition = new ilGlossaryDefinition($_GET["def"]);
632  $definition->moveUp();
633  $this->ctrl->redirect($this, "listDefinitions");
634  }
$_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 349 of file class.ilGlossaryTermGUI.php.

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

Referenced by getOverlayHTML().

350  {
351  if ($a_tpl != "") {
352  $tpl = $a_tpl;
353  } else {
354  $tpl = $this->tpl;
355  }
356 
357  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
358  require_once("./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php");
359 
360  $defs = ilGlossaryDefinition::getDefinitionList($this->term->getId());
361 
362  $tpl->setVariable("TXT_TERM", $this->term->getTerm());
363 
364  for ($j=0; $j<count($defs); $j++) {
365  $def = $defs[$j];
366  $page_gui = new ilGlossaryDefPageGUI($def["id"]);
367  $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
368  if (!$a_offline) {
369  //$page_gui->setFullscreenLink(
370  // "ilias.php?baseClass=ilGlossaryPresentationGUI&cmd=fullscreen&ref_id=".$_GET["ref_id"]);
371  } else {
372  $page_gui->setFullscreenLink("fullscreen.html"); // id is set by xslt
373  }
374  $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;cmd=downloadFile&amp;ref_id=" . $_GET["ref_id"]);
375 
376  if (!$a_offline) {
377  $page_gui->setOutputMode($a_outputmode);
378  } else {
379  $page_gui->setOutputMode("offline");
380  $page_gui->setOfflineDirectory($this->getOfflineDirectory());
381  }
382 
383  //$page_gui->setOutputMode("edit");
384  //$page_gui->setPresentationTitle($this->term->getTerm());
385  $page_gui->setLinkXML($this->getLinkXML());
386  $page_gui->setTemplateOutput(false);
387  $output = $page_gui->presentation($page_gui->getOutputMode());
388 
389  if (count($defs) > 1) {
390  $tpl->setCurrentBlock("definition_header");
391  $tpl->setVariable(
392  "TXT_DEFINITION",
393  $this->lng->txt("cont_definition") . " " . ($j+1)
394  );
395  $tpl->parseCurrentBlock();
396  }
397 
398  include_once './Services/MathJax/classes/class.ilMathJax.php';
399  ilMathJax::getInstance()->includeMathJax($tpl);
400 
401  $tpl->setCurrentBlock("definition");
402  $tpl->setVariable("PAGE_CONTENT", $output);
403  $tpl->parseCurrentBlock();
404  }
405  }
static getDefinitionList($a_term_id)
static
$_GET["client_id"]
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static getInstance()
Singleton: get instance.
Glossary definition page GUI class.
$def
Definition: croninfo.php:21
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 842 of file class.ilGlossaryTermGUI.php.

References $ctrl, $ilCtrl, $tab, and $tpl.

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

843  {
844  $tpl = $this->tpl;
846 
847  //$tpl->setLeftNavUrl($ilCtrl->getLinkTarget($this, "showQuickList"));
848 
849  include_once("./Modules/Glossary/classes/class.ilTermQuickListTableGUI.php");
850  $tab = new ilTermQuickListTableGUI($this, "editTerm");
851  $tpl->setLeftNavContent($tab->getHTML());
852  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ saveDefinition()

ilGlossaryTermGUI::saveDefinition ( )

save definition

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

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

671  {
672  $def = new ilGlossaryDefinition();
673  $def->setTermId($_GET["term_id"]);
674  $def->setTitle(ilUtil::stripSlashes($_POST["title"]));#"content object ".$newObj->getId()); // set by meta_gui->save
675  $def->setDescription(ilUtil::stripSlashes($_POST["desc"])); // set by meta_gui->save
676  $def->create();
677 
678  $this->ctrl->redirect($this, "listDefinitions");
679  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class ilGlossaryDefinition.
$def
Definition: croninfo.php:21
$_POST["username"]
+ Here is the call graph for this function:

◆ saveTerm()

ilGlossaryTermGUI::saveTerm ( )

save term

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

182  {
183  // deprecated
184  }

◆ setGlossary()

ilGlossaryTermGUI::setGlossary (   $a_glossary)

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

153  {
154  $this->glossary = $a_glossary;
155  if (!is_object($this->term_glossary)) {
156  $this->term_glossary = $a_glossary;
157  }
158  }

◆ setLinkXML()

ilGlossaryTermGUI::setLinkXML (   $a_link_xml)

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

161  {
162  $this->link_xml = $a_link_xml;
163  }

◆ setOfflineDirectory()

ilGlossaryTermGUI::setOfflineDirectory (   $offdir)

set offline directory to offdir

Parameters
offdircontains diretory where to store files

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

137  {
138  $this->offline_directory = $offdir;
139  }

◆ setTabs()

ilGlossaryTermGUI::setTabs ( )

output tabs

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

References getTabs().

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

685  {
686  $this->getTabs();
687  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateTerm()

ilGlossaryTermGUI::updateTerm ( )

update term

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

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

279  {
280  $form = $this->getEditTermForm();
281  if ($form->checkInput() &&
282  $this->record_gui->importEditFormPostValues()) {
283  // update term
284  $this->term->setTerm(ilUtil::stripSlashes($_POST["term"]));
285  $this->term->setLanguage($_POST["term_language"]);
286  $this->term->update();
287 
288  // update taxonomy assignment
289  if ($this->term_glossary->getTaxonomyId() > 0) {
290  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
291  $ta = new ilTaxNodeAssignment("glo", $this->term_glossary->getId(), "term", $this->term_glossary->getTaxonomyId());
292  $ta->deleteAssignmentsOfItem($this->term->getId());
293  if (is_array($_POST["tax_node"])) {
294  foreach ($_POST["tax_node"] as $node_id) {
295  $ta->addAssignment($node_id, $this->term->getId());
296  }
297  }
298  }
299 
300  $this->record_gui->writeEditForm();
301  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
302  $this->ctrl->redirect($this, "editTerm");
303  }
304 
305  $form->setValuesByPost();
306  $this->editTerm($form);
307  }
editTerm(ilPropertyFormGUI $a_form=null)
Edit term.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Taxonomy node <-> item assignment.
getEditTermForm()
Get edit term form.
deleteAssignmentsOfItem($a_item_id)
Delete assignments of item.
if(isset($_POST['submit'])) $form
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilGlossaryTermGUI::$ctrl
protected

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

Referenced by addDefinition(), editTerm(), getEditTermForm(), and quickList().

◆ $glossary

ilGlossaryTermGUI::$glossary

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

◆ $help

ilGlossaryTermGUI::$help
protected

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

Referenced by getTabs().

◆ $link_xml

ilGlossaryTermGUI::$link_xml

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

Referenced by getLinkXML().

◆ $lng

ilGlossaryTermGUI::$lng

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

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

◆ $log

ilGlossaryTermGUI::$log
protected

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

◆ $tabs_gui

ilGlossaryTermGUI::$tabs_gui
protected

◆ $term

ilGlossaryTermGUI::$term

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

Referenced by getEditTermForm().

◆ $term_glossary

ilGlossaryTermGUI::$term_glossary = null
protected

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

◆ $tpl

ilGlossaryTermGUI::$tpl

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