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

Collects terms (reference or copy) from other glossaries. More...

+ Collaboration diagram for ilGlossaryForeignTermCollectorGUI:

Public Member Functions

 executeCommand ()
 Execute command. More...
 
 showGlossarySelector ()
 Add level resource. More...
 
 setForeignGlossary ()
 Save level resource. More...
 
 showTerms ()
 Show Terms. More...
 
 copyTerms ()
 Copy terms. More...
 
 referenceTerms ()
 Reference terms. More...
 

Static Public Member Functions

static getInstance (ilObjGlossaryGUI $a_glossary_gui)
 Get instance. More...
 

Protected Member Functions

 __construct (ilObjGlossaryGUI $a_glossary_gui)
 Constructor. More...
 

Protected Attributes

 $glossary_gui
 
 $glossary
 
 $fglo_ref_id
 
 $ctrl
 
 $lng
 
 $tpl
 
 $user
 

Detailed Description

Collects terms (reference or copy) from other glossaries.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilGlossaryForeignTermCollectorGUI::__construct ( ilObjGlossaryGUI  $a_glossary_gui)
protected

Constructor.

Parameters
ilObjGlossaryGUI$a_glossary_gui

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

References $_GET, $DIC, ilObject\_lookupType(), and user().

55  {
56  global $DIC;
57 
58  $this->tpl = $DIC["tpl"];
59  $this->ctrl = $DIC->ctrl();
60  $this->lng = $DIC->language();
61  $this->user = $DIC->user();
62 
63  $this->glossary_gui = $a_glossary_gui;
64  $this->glossary = $a_glossary_gui->object;
65 
66  $this->fglo_ref_id = (int) $_GET["fglo_ref_id"];
67  if ($this->fglo_ref_id > 0 && ilObject::_lookupType($this->fglo_ref_id, true) == "glo") {
68  $this->foreign_glossary = new ilObjGlossary($this->fglo_ref_id, true);
69  }
70 
71  $this->ctrl->saveParameter($this, "fglo_ref_id");
72  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
Class ilObjGlossary.
user()
Definition: user.php:4
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

Member Function Documentation

◆ copyTerms()

ilGlossaryForeignTermCollectorGUI::copyTerms ( )

Copy terms.

Parameters

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

References $_POST, $id, ilGlossaryAct\getInstance(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and user().

161  {
162  if (!is_array($_POST["term_id"])) {
163  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
164  $this->ctrl->redirect($this, "showTerms");
165  }
166  include_once("./Modules/Glossary/classes/class.ilGlossaryAct.php");
167  $act = ilGlossaryAct::getInstance($this->glossary, $this->user);
168  foreach ($_POST["term_id"] as $id) {
169  $act->copyTerm($this->foreign_glossary, (int) $id);
170  }
171  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
172  $this->ctrl->returnToParent($this);
173  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(!array_key_exists('StateId', $_REQUEST)) $id
static getInstance(ilObjGlossary $a_glossary, ilObjUser $a_user)
Get instance.
user()
Definition: user.php:4
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

ilGlossaryForeignTermCollectorGUI::executeCommand ( )

Execute command.

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

References array.

89  {
90  $next_class = $this->ctrl->getNextClass($this);
91  $cmd = $this->ctrl->getCmd("showGlossarySelector");
92 
93  switch ($next_class) {
94  default:
95  if (in_array($cmd, array("showGlossarySelector", "setForeignGlossary", "showTerms", "copyTerms", "referenceTerms"))) {
96  $this->$cmd();
97  }
98  }
99  }
Create styles array
The data for the language used.

◆ getInstance()

static ilGlossaryForeignTermCollectorGUI::getInstance ( ilObjGlossaryGUI  $a_glossary_gui)
static

Get instance.

Parameters
ilObjGlossaryGUI$a_glossary_gui
Returns
ilGlossaryForeignTermCollectorGUI

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

Referenced by ilObjGlossaryGUI\executeCommand().

81  {
82  return new self($a_glossary_gui);
83  }
+ Here is the caller graph for this function:

◆ referenceTerms()

ilGlossaryForeignTermCollectorGUI::referenceTerms ( )

Reference terms.

Parameters

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

References $_POST, $id, array, ilGlossaryAct\getInstance(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and user().

182  {
183  if (!is_array($_POST["term_id"])) {
184  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
185  $this->ctrl->redirect($this, "showTerms");
186  }
187  include_once("./Modules/Glossary/classes/class.ilGlossaryAct.php");
188  $act = ilGlossaryAct::getInstance($this->glossary, $this->user);
189  $terms = array();
190  foreach ($_POST["term_id"] as $id) {
191  $terms[] = (int) $id;
192  }
193  $act->referenceTerms($this->foreign_glossary, $terms);
194 
195  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
196  $this->ctrl->returnToParent($this);
197  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(!array_key_exists('StateId', $_REQUEST)) $id
static getInstance(ilObjGlossary $a_glossary, ilObjUser $a_user)
Get instance.
user()
Definition: user.php:4
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ setForeignGlossary()

ilGlossaryForeignTermCollectorGUI::setForeignGlossary ( )

Save level resource.

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

References $_GET, $ctrl, $ilCtrl, $lng, and ilUtil\sendFailure().

126  {
128  $lng = $this->lng;
129 
130  $ref_id = (int) $_GET["fglo_ref_id"];
131 
132  if ($ref_id == $this->glossary->getRefId()) {
133  ilUtil::sendFailure($lng->txt("glo_please_select_other_glo"), true);
134  $ilCtrl->redirect($this, "showGlossarySelector");
135  }
136 
137  $ilCtrl->redirect($this, "showTerms");
138  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ showGlossarySelector()

ilGlossaryForeignTermCollectorGUI::showGlossarySelector ( )

Add level resource.

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

References array, and ilUtil\sendInfo().

105  {
106  ilUtil::sendInfo($this->lng->txt("glo_select_source_glo"));
107  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
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  }
Explorer for selecting repository items.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ showTerms()

ilGlossaryForeignTermCollectorGUI::showTerms ( )

Show Terms.

Parameters

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

References $t.

147  {
148  include_once("./Modules/Glossary/classes/class.ilGlossaryForeignTermTableGUI.php");
149  $t = new ilGlossaryForeignTermTableGUI($this, "showTerms", $this->foreign_glossary);
150 
151  $this->tpl->setContent($t->getHTML());
152  }
TableGUI class for collecting foreign terms.

Field Documentation

◆ $ctrl

ilGlossaryForeignTermCollectorGUI::$ctrl
protected

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

Referenced by setForeignGlossary().

◆ $fglo_ref_id

ilGlossaryForeignTermCollectorGUI::$fglo_ref_id
protected

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

◆ $glossary

ilGlossaryForeignTermCollectorGUI::$glossary
protected

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

◆ $glossary_gui

ilGlossaryForeignTermCollectorGUI::$glossary_gui
protected

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

◆ $lng

ilGlossaryForeignTermCollectorGUI::$lng
protected

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

Referenced by setForeignGlossary().

◆ $tpl

ilGlossaryForeignTermCollectorGUI::$tpl
protected

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

◆ $user

ilGlossaryForeignTermCollectorGUI::$user
protected

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


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