ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
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 (string $return_cmd="")
 
 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

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 ( string  $return_cmd = "")

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

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

References $DIC, $lng, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\UI\examples\MainControls\SystemInfo\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 231 of file class.ilEditClipboardGUI.php.

231 : array
232 {
233 global $DIC;
234 $clipboard_manager = $DIC->mediaPool()
235 ->internal()
236 ->domain()
237 ->clipboard();
238
239 return $clipboard_manager->getIds();
240 }
ILIAS MediaPool Clipboard ClipboardManager $clipboard_manager

References $clipboard_manager, and $DIC.

Referenced by ilObjMediaPoolGUI\insertFromClipboard(), and ilPageEditorGUI\insertFromClipboard().

+ Here is the caller graph for this function:

◆ executeCommand()

ilEditClipboardGUI::executeCommand ( )

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

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

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

+ Here is the call graph for this function:

◆ getInsertButtonTitle()

ilEditClipboardGUI::getInsertButtonTitle ( )

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

139 : string
140 {
142
143 if ($this->insertbuttontitle === "") {
144 return $lng->txt("insert");
145 }
146
148 }

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

+ Here is the call graph for this function:

◆ getMultipleSelections()

ilEditClipboardGUI::getMultipleSelections ( )

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

129 : bool
130 {
131 return $this->multiple;
132 }

References $multiple.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getObject()

ilEditClipboardGUI::getObject ( )

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

166 : void
167 {
168 $this->mode = "getObject";
169 $this->view();
170 }

References view().

+ Here is the call graph for this function:

◆ getTabs()

ilEditClipboardGUI::getTabs (   $tabs_gui)

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

257 : void
258 {
259 $ilCtrl = $this->ctrl;
260
261 // back to upper context
262 $tabs_gui->setBackTarget(
263 $this->page_back_title,
264 $ilCtrl->getParentReturn($this)
265 );
266 }

References $ctrl.

Referenced by setTabs().

+ Here is the caller graph for this function:

◆ insert()

ilEditClipboardGUI::insert ( )

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

205 : void
206 {
208
210 if ($this->requested_pcid !== "") {
211 $return .= "&pc_id=" . $this->requested_pcid;
212 }
213
214 $ids = $this->request->getItemIds();
215
216 // check number of objects
217 if (count($ids) === 0) {
218 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
219 ilUtil::redirect($return);
220 }
221
222 if (!$this->getMultipleSelections() && count($ids) > 1) {
223 $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_select_max_one_item"), true);
224 ilUtil::redirect($return);
225 }
226
227 $this->clipboard_manager->setIds($ids);
228 ilUtil::redirect($return);
229 }
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 176 of file class.ilEditClipboardGUI.php.

176 : void
177 {
180 $ilCtrl = $this->ctrl;
181
182 // check number of objects
183 $ids = $this->request->getItemIds();
184
185 if (count($ids) === 0) {
186 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
187 $ilCtrl->redirect($this, "view");
188 }
189
190 foreach ($ids as $obj_id) {
191 $id = explode(":", $obj_id);
192 if ($id[0] === "mob") {
193 $ilUser->removeObjectFromClipboard($id[1], "mob");
194 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
195 $mob = new ilObjMediaObject($id[1]);
196 $mob->delete(); // this method don't delete, if mob is used elsewhere
197 }
198 if ($id[0] === "incl") {
199 $ilUser->removeObjectFromClipboard($id[1], "incl");
200 }
201 }
202 $ilCtrl->redirect($this, "view");
203 }
$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, $ilUser, $lng, $user, ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setInsertButtonTitle()

ilEditClipboardGUI::setInsertButtonTitle ( string  $a_insertbuttontitle)

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

134 : void
135 {
136 $this->insertbuttontitle = $a_insertbuttontitle;
137 }

◆ setMultipleSelections()

ilEditClipboardGUI::setMultipleSelections ( bool  $a_multiple = true)

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

124 : void
125 {
126 $this->multiple = $a_multiple;
127 }

References ILIAS\UI\examples\MainControls\SystemInfo\multiple().

+ Here is the call graph for this function:

◆ setPageBackTitle()

ilEditClipboardGUI::setPageBackTitle ( string  $a_title)

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

252 : void
253 {
254 $this->page_back_title = $a_title;
255 }

◆ setTabs()

ilEditClipboardGUI::setTabs ( )

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

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

References $lng, $tabs, $tpl, getTabs(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ view()

ilEditClipboardGUI::view ( )

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

150 : void
151 {
152 $ilCtrl = $this->ctrl;
154 $ilToolbar = $this->toolbar;
155
157 $but->setUrl($ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "create"));
158 $but->setCaption("cont_create_mob");
159 $ilToolbar->addButtonInstance($but);
160
161 $table_gui = new ilClipboardTableGUI($this, "view");
162 $tpl->setContent($table_gui->getHTML());
163 }
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, ilLinkButton\getInstance(), and ilGlobalTemplateInterface\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 31 of file class.ilEditClipboardGUI.php.

Referenced by _getSelectedIDs().

◆ $ctrl

ilCtrl ilEditClipboardGUI::$ctrl
protected

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

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

◆ $insertbuttontitle

string ilEditClipboardGUI::$insertbuttontitle = ""
protected

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

Referenced by getInsertButtonTitle().

◆ $lng

ilLanguage ilEditClipboardGUI::$lng
protected

◆ $mode

string ilEditClipboardGUI::$mode = ""

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

◆ $multiple

bool ilEditClipboardGUI::$multiple = false
protected

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

Referenced by getMultipleSelections().

◆ $page_back_title

string ilEditClipboardGUI::$page_back_title = ""
protected

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

◆ $request

ILIAS MediaPool Clipboard ClipboardGUIRequest ilEditClipboardGUI::$request
protected

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

◆ $requested_clip_item_id

int ilEditClipboardGUI::$requested_clip_item_id = 0
protected

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

◆ $requested_pcid

string ilEditClipboardGUI::$requested_pcid = ""
protected

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

Referenced by insert().

◆ $requested_return_cmd

string ilEditClipboardGUI::$requested_return_cmd = ""
protected

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

Referenced by insert().

◆ $tabs

ilTabsGUI ilEditClipboardGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $toolbar

ilToolbarGUI ilEditClipboardGUI::$toolbar
protected

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

Referenced by view().

◆ $tpl

ilGlobalTemplateInterface ilEditClipboardGUI::$tpl
protected

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

Referenced by setTabs(), and view().

◆ $tree

ilTree ilEditClipboardGUI::$tree
protected

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

◆ $user

ilObjUser ilEditClipboardGUI::$user
protected

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

Referenced by executeCommand(), and remove().


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