ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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.

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 {
69 $this->foreign_glossary = new ilObjGlossary($this->fglo_ref_id, true);
70 }
71
72 $this->ctrl->saveParameter($this, "fglo_ref_id");
73 }
user()
Definition: user.php:4
$_GET["client_id"]
Class ilObjGlossary.
static _lookupType($a_id, $a_reference=false)
lookup object type
global $DIC

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

+ Here is the call graph for this function:

Member Function Documentation

◆ copyTerms()

ilGlossaryForeignTermCollectorGUI::copyTerms ( )

Copy terms.

Parameters

return

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

160 {
161 if(!is_array($_POST["term_id"]))
162 {
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 {
170 $act->copyTerm($this->foreign_glossary, (int) $id);
171 }
172 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
173 $this->ctrl->returnToParent($this);
174 }
$_POST["username"]
static getInstance(ilObjGlossary $a_glossary, ilObjUser $a_user)
Get instance.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

+ Here is the call graph for this function:

◆ executeCommand()

ilGlossaryForeignTermCollectorGUI::executeCommand ( )

Execute command.

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

90 {
91 $next_class = $this->ctrl->getNextClass($this);
92 $cmd = $this->ctrl->getCmd("showGlossarySelector");
93
94 switch ($next_class)
95 {
96 default:
97 if (in_array($cmd, array("showGlossarySelector", "setForeignGlossary", "showTerms", "copyTerms", "referenceTerms")))
98 {
99 $this->$cmd();
100 }
101 }
102 }
$cmd
Definition: sahs_server.php:35

References $cmd.

◆ getInstance()

static ilGlossaryForeignTermCollectorGUI::getInstance ( ilObjGlossaryGUI  $a_glossary_gui)
static

Get instance.

Parameters
ilObjGlossaryGUI$a_glossary_gui
Returns
ilGlossaryForeignTermCollectorGUI

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

82 {
83 return new self($a_glossary_gui);
84 }

Referenced by ilObjGlossaryGUI\executeCommand().

+ Here is the caller graph for this function:

◆ referenceTerms()

ilGlossaryForeignTermCollectorGUI::referenceTerms ( )

Reference terms.

Parameters

return

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

183 {
184 if(!is_array($_POST["term_id"]))
185 {
186 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
187 $this->ctrl->redirect($this, "showTerms");
188 }
189 include_once("./Modules/Glossary/classes/class.ilGlossaryAct.php");
190 $act = ilGlossaryAct::getInstance($this->glossary, $this->user);
191 $terms = array();
192 foreach ($_POST["term_id"] as $id)
193 {
194 $terms[] = (int) $id;
195
196 }
197 $act->referenceTerms($this->foreign_glossary, $terms);
198
199 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
200 $this->ctrl->returnToParent($this);
201 }

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

+ Here is the call graph for this function:

◆ setForeignGlossary()

ilGlossaryForeignTermCollectorGUI::setForeignGlossary ( )

Save level resource.

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

125 {
126 global $ilCtrl, $lng;
127
128 $ref_id = (int) $_GET["fglo_ref_id"];
129
130 if ($ref_id == $this->glossary->getRefId())
131 {
132 ilUtil::sendFailure($lng->txt("glo_please_select_other_glo"), true);
133 $ilCtrl->redirect($this, "showGlossarySelector");
134 }
135
136 $ilCtrl->redirect($this, "showTerms");
137 }
global $ilCtrl
Definition: ilias.php:18
$ref_id
Definition: sahs_server.php:39

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

+ Here is the call graph for this function:

◆ showGlossarySelector()

ilGlossaryForeignTermCollectorGUI::showGlossarySelector ( )

Add level resource.

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

108 {
109 ilUtil::sendInfo($this->lng->txt("glo_select_source_glo"));
110 include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
111 $exp = new ilRepositorySelectorExplorerGUI($this, "showGlossarySelector",
112 $this, "setForeignGlossary", "fglo_ref_id");
113 $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "glo", "fold"));
114 $exp->setClickableTypes(array("glo"));
115 if (!$exp->handleCommand())
116 {
117 $this->tpl->setContent($exp->getHTML());
118 }
119 }
Explorer for selecting repository items.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ showTerms()

ilGlossaryForeignTermCollectorGUI::showTerms ( )

Show Terms.

Parameters

return

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

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

References $t.

Field Documentation

◆ $ctrl

ilGlossaryForeignTermCollectorGUI::$ctrl
protected

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

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