ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilEditClipboardGUI 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 ilEditClipboardGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 setMultipleSelections (bool $a_multiple=true)
 
 getMultipleSelections ()
 
 setInsertButtonTitle (string $a_insertbuttontitle)
 
 getInsertButtonTitle ()
 
 view ()
 
 getObject ()
 
 remove ()
 remove item from clipboard More...
 
 insert ()
 
 setTabs ()
 
 setPageBackTitle (string $a_title)
 
 getTabs ($tabs_gui)
 

Static Public Member Functions

static _getSelectedIDs ()
 

Data Fields

string $mode = ""
 

Protected Attributes

ILIAS MediaPool InternalGUIService $gui
 
string $page_back_title = ""
 
bool $multiple = false
 
ILIAS MediaPool Clipboard ClipboardGUIRequest $request
 
ILIAS MediaPool Clipboard ClipboardManager $clipboard_manager
 
string $insertbuttontitle = ""
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilTree $tree
 
ilGlobalTemplateInterface $tpl
 
ilToolbarGUI $toolbar
 
string $requested_return_cmd = ""
 
int $requested_clip_item_id = 0
 
string $requested_pcid = ""
 

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 Clipboard for editing

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilEditClipboardGUI: ilObjMediaObjectGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilEditClipboardGUI::__construct ( )

Definition at line 46 of file class.ilEditClipboardGUI.php.

47 {
48 global $DIC;
49
50 $this->lng = $DIC->language();
51 $this->ctrl = $DIC->ctrl();
52 $this->user = $DIC->user();
53 $this->tabs = $DIC->tabs();
54 $this->tree = $DIC->repositoryTree();
55 $this->tpl = $DIC["tpl"];
56 $this->toolbar = $DIC->toolbar();
57 $lng = $DIC->language();
58 $ilCtrl = $DIC->ctrl();
59
60 $this->request = $DIC->mediaPool()
61 ->internal()
62 ->gui()
63 ->clipboard()
64 ->request();
65
66 $this->multiple = false;
67 $this->page_back_title = $lng->txt("cont_back");
68 $this->requested_return_cmd = $this->request->getReturnCmd();
69 $this->requested_clip_item_id = $this->request->getItemId();
70 $this->requested_pcid = $this->request->getPCId();
71 $this->clipboard_manager = $DIC->mediaPool()
72 ->internal()
73 ->domain()
74 ->clipboard();
75
76 if ($this->requested_return_cmd !== "") {
77 $this->mode = "getObject";
78 } else {
79 $this->mode = "";
80 }
81
82 $ilCtrl->setParameter(
83 $this,
84 "returnCommand",
85 rawurlencode($this->requested_return_cmd)
86 );
87
88 $ilCtrl->saveParameter($this, array("clip_item_id", "pcid"));
89 $this->gui = $DIC->mediaPool()->internal()->gui();
90 }
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...
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\UI\examples\Input\Field\File\multiple(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getSelectedIDs()

static ilEditClipboardGUI::_getSelectedIDs ( )
static

Definition at line 236 of file class.ilEditClipboardGUI.php.

236 : array
237 {
238 global $DIC;
239 $clipboard_manager = $DIC->mediaPool()
240 ->internal()
241 ->domain()
242 ->clipboard();
243
244 return $clipboard_manager->getIds();
245 }
ILIAS MediaPool Clipboard ClipboardManager $clipboard_manager

References $clipboard_manager, and $DIC.

Referenced by ILIAS\MediaPool\MediaPoolManager\copySelectedFromEditClipboard(), and ilPageEditorGUI\insertFromClipboard().

+ Here is the caller graph for this function:

◆ executeCommand()

ilEditClipboardGUI::executeCommand ( )

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

92 : void
93 {
94 $ilUser = $this->user;
95 $ilCtrl = $this->ctrl;
96 $ilTabs = $this->tabs;
98
99 $next_class = $ilCtrl->getNextClass($this);
100 $cmd = $ilCtrl->getCmd();
101 switch ($next_class) {
102 case "ilobjmediaobjectgui":
103 $ilCtrl->setReturn($this, "view");
104 $ilTabs->clearTargets();
105 $ilTabs->setBackTarget(
106 $lng->txt("back"),
107 $ilCtrl->getLinkTarget($this, "view")
108 );
109 $mob_gui = new ilObjMediaObjectGUI("", $this->requested_clip_item_id, false, false);
110 $mob_gui->setTabs();
111 $ilCtrl->forwardCommand($mob_gui);
112 switch ($cmd) {
113 case "save":
114 $ilUser->addObjectToClipboard(
115 $mob_gui->getObject()->getId(),
116 "mob",
117 $mob_gui->getObject()->getTitle()
118 );
119 $ilCtrl->redirect($this, "view");
120 break;
121 }
122 break;
123
124 default:
125 $this->$cmd();
126 break;
127 }
128 }
Editing User Interface for MediaObjects within LMs (see ILIAS DTD)

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

+ Here is the call graph for this function:

◆ getInsertButtonTitle()

ilEditClipboardGUI::getInsertButtonTitle ( )

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

145 : string
146 {
148
149 if ($this->insertbuttontitle === "") {
150 return $lng->txt("insert");
151 }
152
154 }

References $insertbuttontitle, $lng, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getMultipleSelections()

ilEditClipboardGUI::getMultipleSelections ( )

Definition at line 135 of file class.ilEditClipboardGUI.php.

135 : bool
136 {
137 return $this->multiple;
138 }

References $multiple.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getObject()

ilEditClipboardGUI::getObject ( )

Definition at line 172 of file class.ilEditClipboardGUI.php.

172 : void
173 {
174 $this->mode = "getObject";
175 $this->view();
176 }

References view().

+ Here is the call graph for this function:

◆ getTabs()

ilEditClipboardGUI::getTabs (   $tabs_gui)

Definition at line 262 of file class.ilEditClipboardGUI.php.

262 : void
263 {
264 $ilCtrl = $this->ctrl;
265
266 // back to upper context
267 $tabs_gui->setBackTarget(
268 $this->page_back_title,
269 $ilCtrl->getParentReturn($this)
270 );
271 }

References $ctrl.

Referenced by setTabs().

+ Here is the caller graph for this function:

◆ insert()

ilEditClipboardGUI::insert ( )

Definition at line 210 of file class.ilEditClipboardGUI.php.

210 : void
211 {
213
215 if ($this->requested_pcid !== "") {
216 $return .= "&pc_id=" . $this->requested_pcid;
217 }
218
219 $ids = $this->request->getItemIds();
220
221 // check number of objects
222 if (count($ids) === 0) {
223 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
224 ilUtil::redirect($return);
225 }
226
227 if (!$this->getMultipleSelections() && count($ids) > 1) {
228 $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_select_max_one_item"), true);
229 ilUtil::redirect($return);
230 }
231
232 $this->clipboard_manager->setIds($ids);
233 ilUtil::redirect($return);
234 }
static redirect(string $a_script)

References $lng, $requested_pcid, $requested_return_cmd, getMultipleSelections(), ilUtil\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ remove()

ilEditClipboardGUI::remove ( )

remove item from clipboard

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

182 : void
183 {
184 $ilUser = $this->user;
186 $ilCtrl = $this->ctrl;
187
188 // check number of objects
189 $ids = $this->request->getItemIds();
190
191 if (count($ids) === 0) {
192 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
193 $ilCtrl->redirect($this, "view");
194 }
195
196 foreach ($ids as $obj_id) {
197 $id = explode(":", $obj_id);
198 if ($id[0] === "mob") {
199 $ilUser->removeObjectFromClipboard($id[1], "mob");
200 $mob = new ilObjMediaObject($id[1]);
201 $mob->delete(); // this method don't delete, if mob is used elsewhere
202 }
203 if ($id[0] === "incl") {
204 $ilUser->removeObjectFromClipboard($id[1], "incl");
205 }
206 }
207 $ilCtrl->redirect($this, "view");
208 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

References $ctrl, $id, $lng, $user, ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setInsertButtonTitle()

ilEditClipboardGUI::setInsertButtonTitle ( string  $a_insertbuttontitle)

Definition at line 140 of file class.ilEditClipboardGUI.php.

140 : void
141 {
142 $this->insertbuttontitle = $a_insertbuttontitle;
143 }

◆ setMultipleSelections()

ilEditClipboardGUI::setMultipleSelections ( bool  $a_multiple = true)

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

130 : void
131 {
132 $this->multiple = $a_multiple;
133 }

References ILIAS\UI\examples\Input\Field\File\multiple().

+ Here is the call graph for this function:

◆ setPageBackTitle()

ilEditClipboardGUI::setPageBackTitle ( string  $a_title)

Definition at line 257 of file class.ilEditClipboardGUI.php.

257 : void
258 {
259 $this->page_back_title = $a_title;
260 }

◆ setTabs()

ilEditClipboardGUI::setTabs ( )

Definition at line 247 of file class.ilEditClipboardGUI.php.

247 : void
248 {
249 $ilTabs = $this->tabs;
252
253 $tpl->setTitle($lng->txt("clipboard"));
254 $this->getTabs($ilTabs);
255 }
ilGlobalTemplateInterface $tpl
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References $lng, $tabs, $tpl, getTabs(), ILIAS\UICore\GlobalTemplate\setTitle(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ view()

ilEditClipboardGUI::view ( )

Definition at line 156 of file class.ilEditClipboardGUI.php.

156 : void
157 {
158 $ilCtrl = $this->ctrl;
160 $ilToolbar = $this->toolbar;
161
162 $this->gui->button(
163 $this->lng->txt("cont_create_mob"),
164 $ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "create")
165 )->toToolbar();
166
167 $table_gui = new ilClipboardTableGUI($this, "view");
168 $tpl->setContent($table_gui->getHTML());
169 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.

References $ctrl, $toolbar, $tpl, ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by getObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $clipboard_manager

ILIAS MediaPool Clipboard ClipboardManager ilEditClipboardGUI::$clipboard_manager
protected

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

Referenced by _getSelectedIDs().

◆ $ctrl

ilCtrl ilEditClipboardGUI::$ctrl
protected

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

Referenced by executeCommand(), getTabs(), remove(), and view().

◆ $gui

ILIAS MediaPool InternalGUIService ilEditClipboardGUI::$gui
protected

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

◆ $insertbuttontitle

string ilEditClipboardGUI::$insertbuttontitle = ""
protected

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

Referenced by getInsertButtonTitle().

◆ $lng

ilLanguage ilEditClipboardGUI::$lng
protected

◆ $mode

string ilEditClipboardGUI::$mode = ""

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

◆ $multiple

bool ilEditClipboardGUI::$multiple = false
protected

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

Referenced by getMultipleSelections().

◆ $page_back_title

string ilEditClipboardGUI::$page_back_title = ""
protected

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

◆ $request

ILIAS MediaPool Clipboard ClipboardGUIRequest ilEditClipboardGUI::$request
protected

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

◆ $requested_clip_item_id

int ilEditClipboardGUI::$requested_clip_item_id = 0
protected

Definition at line 43 of file class.ilEditClipboardGUI.php.

◆ $requested_pcid

string ilEditClipboardGUI::$requested_pcid = ""
protected

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

Referenced by insert().

◆ $requested_return_cmd

string ilEditClipboardGUI::$requested_return_cmd = ""
protected

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

Referenced by insert().

◆ $tabs

ilTabsGUI ilEditClipboardGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $toolbar

ilToolbarGUI ilEditClipboardGUI::$toolbar
protected

Definition at line 40 of file class.ilEditClipboardGUI.php.

Referenced by view().

◆ $tpl

ilGlobalTemplateInterface ilEditClipboardGUI::$tpl
protected

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

Referenced by setTabs(), and view().

◆ $tree

ilTree ilEditClipboardGUI::$tree
protected

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

◆ $user

ilObjUser ilEditClipboardGUI::$user
protected

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

Referenced by executeCommand(), and remove().


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