ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilGlossaryForeignTermCollectorGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilGlossaryForeignTermCollectorGUI:

Public Member Functions

 executeCommand ()
 
 showGlossarySelector ()
 
 setForeignGlossary ()
 
 showTerms ()
 
 copyTerms ()
 
 referenceTerms ()
 

Static Public Member Functions

static getInstance (ilObjGlossaryGUI $a_glossary_gui)
 

Protected Attributes

ilObjGlossary $foreign_glossary
 
ILIAS Glossary Editing EditingGUIRequest $request
 
ILIAS Glossary Term TermManager $term_manager
 
ILIAS components ILIAS Glossary Table TableManager $table_manager
 
ilObjGlossaryGUI $glossary_gui
 
ilObjGlossary $glossary
 
int $fglo_ref_id
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ILIAS UI Renderer $ui_ren
 
string $requested_table_glossary_foreign_term_action = ""
 
array $requested_table_glossary_foreign_term_ids = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Collects terms (reference or copy) from other glossaries

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ copyTerms()

ilGlossaryForeignTermCollectorGUI::copyTerms ( )

Definition at line 147 of file class.ilGlossaryForeignTermCollectorGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

147  : void
148  {
149  if ($this->requested_table_glossary_foreign_term_action === "copyTerms"
150  && !empty($this->requested_table_glossary_foreign_term_ids)
151  && $this->requested_table_glossary_foreign_term_ids[0] === "ALL_OBJECTS"
152  ) {
153  foreach ($this->foreign_glossary->getTermList() as $term) {
154  $this->term_manager->copyTermFromOtherGlossary(
155  $this->foreign_glossary->getRefId(),
156  (int) $term["id"]
157  );
158  }
159  } elseif ($this->requested_table_glossary_foreign_term_action === "copyTerms") {
160  foreach ($this->requested_table_glossary_foreign_term_ids as $term_id) {
161  $this->term_manager->copyTermFromOtherGlossary(
162  $this->foreign_glossary->getRefId(),
163  (int) $term_id
164  );
165  }
166  }
167  if (empty($this->requested_table_glossary_foreign_term_ids)) {
168  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
169  $this->ctrl->redirect($this, "showTerms");
170  }
171 
172  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
173  $this->ctrl->returnToParent($this);
174  }
+ Here is the call graph for this function:

◆ executeCommand()

ilGlossaryForeignTermCollectorGUI::executeCommand ( )

Definition at line 92 of file class.ilGlossaryForeignTermCollectorGUI.php.

References ILIAS\Repository\ctrl().

92  : void
93  {
94  $next_class = $this->ctrl->getNextClass($this);
95  $cmd = $this->ctrl->getCmd("showGlossarySelector");
96 
97  switch ($next_class) {
98  default:
99  if (in_array($cmd, array("showGlossarySelector", "setForeignGlossary", "showTerms", "copyTerms", "referenceTerms"))) {
100  $this->$cmd();
101  }
102  }
103  }
+ Here is the call graph for this function:

◆ getInstance()

static ilGlossaryForeignTermCollectorGUI::getInstance ( ilObjGlossaryGUI  $a_glossary_gui)
static

Definition at line 87 of file class.ilGlossaryForeignTermCollectorGUI.php.

Referenced by ilObjGlossaryGUI\executeCommand().

87  : self
88  {
89  return new self($a_glossary_gui);
90  }
+ Here is the caller graph for this function:

◆ referenceTerms()

ilGlossaryForeignTermCollectorGUI::referenceTerms ( )

Definition at line 176 of file class.ilGlossaryForeignTermCollectorGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

176  : void
177  {
178  $term_ids = [];
179  if ($this->requested_table_glossary_foreign_term_action === "referenceTerms"
180  && !empty($this->requested_table_glossary_foreign_term_ids)
181  && $this->requested_table_glossary_foreign_term_ids[0] === "ALL_OBJECTS"
182  ) {
183  foreach ($this->foreign_glossary->getTermList() as $term) {
184  $term_ids[] = (int) $term["id"];
185  }
186  } elseif ($this->requested_table_glossary_foreign_term_action === "referenceTerms") {
187  $term_ids = array_map("intval", $this->requested_table_glossary_foreign_term_ids);
188  }
189  if (empty($term_ids)) {
190  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
191  $this->ctrl->redirect($this, "showTerms");
192  }
193 
194  $this->term_manager->referenceTermsFromOtherGlossary(
195  $this->foreign_glossary->getRefId(),
196  $term_ids
197  );
198 
199  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
200  $this->ctrl->returnToParent($this);
201  }
+ Here is the call graph for this function:

◆ setForeignGlossary()

ilGlossaryForeignTermCollectorGUI::setForeignGlossary ( )

Definition at line 122 of file class.ilGlossaryForeignTermCollectorGUI.php.

References $ctrl, $lng, $ref_id, and ilLanguage\txt().

122  : void
123  {
124  $ilCtrl = $this->ctrl;
125  $lng = $this->lng;
126 
127  $ref_id = $this->request->getForeignGlossaryRefId();
128 
129  if ($ref_id == $this->glossary->getRefId()) {
130  $this->tpl->setOnScreenMessage('failure', $lng->txt("glo_please_select_other_glo"), true);
131  $ilCtrl->redirect($this, "showGlossarySelector");
132  }
133 
134  $ilCtrl->redirect($this, "showTerms");
135  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:

◆ showGlossarySelector()

ilGlossaryForeignTermCollectorGUI::showGlossarySelector ( )

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

References ILIAS\Repository\lng().

105  : void
106  {
107  $this->tpl->setOnScreenMessage('info', $this->lng->txt("glo_select_source_glo"));
109  $this,
110  "showGlossarySelector",
111  $this,
112  "setForeignGlossary",
113  "fglo_ref_id"
114  );
115  $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "glo", "fold"));
116  $exp->setClickableTypes(array("glo"));
117  if (!$exp->handleCommand()) {
118  $this->tpl->setContent($exp->getHTML());
119  }
120  }
+ Here is the call graph for this function:

◆ showTerms()

ilGlossaryForeignTermCollectorGUI::showTerms ( )

Definition at line 137 of file class.ilGlossaryForeignTermCollectorGUI.php.

137  : void
138  {
139  $table = $this->table_manager->getGlossaryForeignTermTable(
140  $this->glossary,
141  $this->foreign_glossary
142  )->getComponent();
143 
144  $this->tpl->setContent($this->ui_ren->render($table));
145  }

Field Documentation

◆ $ctrl

ilCtrl ilGlossaryForeignTermCollectorGUI::$ctrl
protected

Definition at line 32 of file class.ilGlossaryForeignTermCollectorGUI.php.

Referenced by setForeignGlossary().

◆ $fglo_ref_id

int ilGlossaryForeignTermCollectorGUI::$fglo_ref_id
protected

Definition at line 31 of file class.ilGlossaryForeignTermCollectorGUI.php.

◆ $foreign_glossary

ilObjGlossary ilGlossaryForeignTermCollectorGUI::$foreign_glossary
protected

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

◆ $glossary

ilObjGlossary ilGlossaryForeignTermCollectorGUI::$glossary
protected

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

◆ $glossary_gui

ilObjGlossaryGUI ilGlossaryForeignTermCollectorGUI::$glossary_gui
protected

Definition at line 29 of file class.ilGlossaryForeignTermCollectorGUI.php.

◆ $lng

ilLanguage ilGlossaryForeignTermCollectorGUI::$lng
protected

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

Referenced by setForeignGlossary().

◆ $request

ILIAS Glossary Editing EditingGUIRequest ilGlossaryForeignTermCollectorGUI::$request
protected

Definition at line 26 of file class.ilGlossaryForeignTermCollectorGUI.php.

◆ $requested_table_glossary_foreign_term_action

string ilGlossaryForeignTermCollectorGUI::$requested_table_glossary_foreign_term_action = ""
protected

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

◆ $requested_table_glossary_foreign_term_ids

array ilGlossaryForeignTermCollectorGUI::$requested_table_glossary_foreign_term_ids = []
protected

Definition at line 42 of file class.ilGlossaryForeignTermCollectorGUI.php.

◆ $table_manager

ILIAS components ILIAS Glossary Table TableManager ilGlossaryForeignTermCollectorGUI::$table_manager
protected

Definition at line 28 of file class.ilGlossaryForeignTermCollectorGUI.php.

◆ $term_manager

ILIAS Glossary Term TermManager ilGlossaryForeignTermCollectorGUI::$term_manager
protected

Definition at line 27 of file class.ilGlossaryForeignTermCollectorGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilGlossaryForeignTermCollectorGUI::$tpl
protected

Definition at line 34 of file class.ilGlossaryForeignTermCollectorGUI.php.

◆ $ui_ren

ILIAS UI Renderer ilGlossaryForeignTermCollectorGUI::$ui_ren
protected

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

◆ $user

ilObjUser ilGlossaryForeignTermCollectorGUI::$user
protected

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


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