ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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

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 ilEditClipboardGUI: ilObjMediaObjectGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilEditClipboardGUI::__construct ( )

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

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

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

Member Function Documentation

◆ _getSelectedIDs()

static ilEditClipboardGUI::_getSelectedIDs ( )
static

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

References $DIC.

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

235  : array
236  {
237  global $DIC;
238  $clipboard_manager = $DIC->mediaPool()
239  ->internal()
240  ->domain()
241  ->clipboard();
242 
243  return $clipboard_manager->getIds();
244  }
global $DIC
Definition: feed.php:28
ILIAS MediaPool Clipboard ClipboardManager $clipboard_manager
+ Here is the caller graph for this function:

◆ executeCommand()

ilEditClipboardGUI::executeCommand ( )

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

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

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

◆ getInsertButtonTitle()

ilEditClipboardGUI::getInsertButtonTitle ( )

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

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

143  : string
144  {
145  $lng = $this->lng;
146 
147  if ($this->insertbuttontitle === "") {
148  return $lng->txt("insert");
149  }
150 
152  }
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...
+ Here is the call graph for this function:

◆ getMultipleSelections()

ilEditClipboardGUI::getMultipleSelections ( )

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

References $multiple.

Referenced by insert().

133  : bool
134  {
135  return $this->multiple;
136  }
+ Here is the caller graph for this function:

◆ getObject()

ilEditClipboardGUI::getObject ( )

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

References view().

170  : void
171  {
172  $this->mode = "getObject";
173  $this->view();
174  }
+ Here is the call graph for this function:

◆ getTabs()

ilEditClipboardGUI::getTabs (   $tabs_gui)

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

References $ctrl.

Referenced by setTabs().

261  : void
262  {
263  $ilCtrl = $this->ctrl;
264 
265  // back to upper context
266  $tabs_gui->setBackTarget(
267  $this->page_back_title,
268  $ilCtrl->getParentReturn($this)
269  );
270  }
+ Here is the caller graph for this function:

◆ insert()

ilEditClipboardGUI::insert ( )

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

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

209  : void
210  {
211  $lng = $this->lng;
212 
213  $return = $this->requested_return_cmd;
214  if ($this->requested_pcid !== "") {
215  $return .= "&pc_id=" . $this->requested_pcid;
216  }
217 
218  $ids = $this->request->getItemIds();
219 
220  // check number of objects
221  if (count($ids) === 0) {
222  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
223  ilUtil::redirect($return);
224  }
225 
226  if (!$this->getMultipleSelections() && count($ids) > 1) {
227  $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_select_max_one_item"), true);
228  ilUtil::redirect($return);
229  }
230 
231  $this->clipboard_manager->setIds($ids);
232  ilUtil::redirect($return);
233  }
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...
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ remove()

ilEditClipboardGUI::remove ( )

remove item from clipboard

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

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

180  : void
181  {
183  $lng = $this->lng;
184  $ilCtrl = $this->ctrl;
185 
186  // check number of objects
187  $ids = $this->request->getItemIds();
188 
189  if (count($ids) === 0) {
190  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
191  $ilCtrl->redirect($this, "view");
192  }
193 
194  foreach ($ids as $obj_id) {
195  $id = explode(":", $obj_id);
196  if ($id[0] === "mob") {
197  $ilUser->removeObjectFromClipboard($id[1], "mob");
198  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
199  $mob = new ilObjMediaObject($id[1]);
200  $mob->delete(); // this method don't delete, if mob is used elsewhere
201  }
202  if ($id[0] === "incl") {
203  $ilUser->removeObjectFromClipboard($id[1], "incl");
204  }
205  }
206  $ilCtrl->redirect($this, "view");
207  }
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
$ilUser
Definition: imgupload.php:34
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ setInsertButtonTitle()

ilEditClipboardGUI::setInsertButtonTitle ( string  $a_insertbuttontitle)

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

138  : void
139  {
140  $this->insertbuttontitle = $a_insertbuttontitle;
141  }

◆ setMultipleSelections()

ilEditClipboardGUI::setMultipleSelections ( bool  $a_multiple = true)

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

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

128  : void
129  {
130  $this->multiple = $a_multiple;
131  }
+ Here is the call graph for this function:

◆ setPageBackTitle()

ilEditClipboardGUI::setPageBackTitle ( string  $a_title)

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

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

◆ setTabs()

ilEditClipboardGUI::setTabs ( )

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

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

246  : void
247  {
248  $ilTabs = $this->tabs;
249  $lng = $this->lng;
250  $tpl = $this->tpl;
251 
252  $tpl->setTitle($lng->txt("clipboard"));
253  $this->getTabs($ilTabs);
254  }
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...
ilGlobalTemplateInterface $tpl
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
+ Here is the call graph for this function:

◆ view()

ilEditClipboardGUI::view ( )

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

References $ctrl, $toolbar, $tpl, ilLinkButton\getInstance(), and ilGlobalTemplateInterface\setContent().

Referenced by getObject().

154  : void
155  {
156  $ilCtrl = $this->ctrl;
157  $tpl = $this->tpl;
158  $ilToolbar = $this->toolbar;
159 
160  $but = ilLinkButton::getInstance();
161  $but->setUrl($ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "create"));
162  $but->setCaption("cont_create_mob");
163  $ilToolbar->addButtonInstance($but);
164 
165  $table_gui = new ilClipboardTableGUI($this, "view");
166  $tpl->setContent($table_gui->getHTML());
167  }
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.
ilGlobalTemplateInterface $tpl
+ 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.

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