27 protected \ILIAS\MediaPool\InternalGUIService
$gui;
31 protected \ILIAS\MediaPool\Clipboard\ClipboardGUIRequest
$request;
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();
60 $this->request = $DIC->mediaPool()
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()
76 if ($this->requested_return_cmd !==
"") {
77 $this->mode =
"getObject";
82 $ilCtrl->setParameter(
85 rawurlencode($this->requested_return_cmd)
88 $ilCtrl->saveParameter($this, array(
"clip_item_id",
"pcid"));
89 $this->gui = $DIC->mediaPool()->internal()->gui();
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(
107 $ilCtrl->getLinkTarget($this,
"view")
111 $ilCtrl->forwardCommand($mob_gui);
114 $ilUser->addObjectToClipboard(
115 $mob_gui->getObject()->getId(),
117 $mob_gui->getObject()->getTitle()
119 $ilCtrl->redirect($this,
"view");
142 $this->insertbuttontitle = $a_insertbuttontitle;
149 if ($this->insertbuttontitle ===
"") {
150 return $lng->
txt(
"insert");
163 $this->
lng->txt(
"cont_create_mob"),
164 $ilCtrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"create")
174 $this->mode =
"getObject";
182 public function remove():
void 189 $ids = $this->request->getItemIds();
191 if (count($ids) === 0) {
192 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"no_checkbox"),
true);
196 foreach ($ids as $obj_id) {
197 $id = explode(
":", $obj_id);
198 if (
$id[0] ===
"mob") {
199 $ilUser->removeObjectFromClipboard(
$id[1],
"mob");
203 if (
$id[0] ===
"incl") {
204 $ilUser->removeObjectFromClipboard(
$id[1],
"incl");
207 $ilCtrl->redirect($this,
"view");
215 if ($this->requested_pcid !==
"") {
219 $ids = $this->request->getItemIds();
222 if (count($ids) === 0) {
223 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"no_checkbox"),
true);
228 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"cont_select_max_one_item"),
true);
232 $this->clipboard_manager->setIds($ids);
239 $clipboard_manager = $DIC->mediaPool()
244 return $clipboard_manager->getIds();
259 $this->page_back_title = $a_title;
267 $tabs_gui->setBackTarget(
268 $this->page_back_title,
269 $ilCtrl->getParentReturn($this)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
setInsertButtonTitle(string $a_insertbuttontitle)
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
string $requested_return_cmd
setMultipleSelections(bool $a_multiple=true)
multiple()
description: > This example show how the UI-Elements itself looks like.
ILIAS MediaPool Clipboard ClipboardGUIRequest $request
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
string $insertbuttontitle
int $requested_clip_item_id
ilGlobalTemplateInterface $tpl
setPageBackTitle(string $a_title)
static redirect(string $a_script)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ILIAS MediaPool InternalGUIService $gui
ILIAS MediaPool Clipboard ClipboardManager $clipboard_manager