ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilEditClipboardGUI Class Reference

Class ilEditClipboardGUI. More...

+ Collaboration diagram for ilEditClipboardGUI:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 setMultipleSelections ($a_multiple=true)
 set, if multiple selections are enabled More...
 
 getMultipleSelections ()
 check wether multiple selections are enabled More...
 
 setInsertButtonTitle ($a_insertbuttontitle)
 Set Insert Button Title. More...
 
 getInsertButtonTitle ()
 Get Insert Button Title. More...
 
 view ()
 
 getObject ()
 get Object More...
 
 remove ()
 remove item from clipboard More...
 
 insert ()
 insert More...
 
 setTabs ()
 output tabs More...
 
 setPageBackTitle ($a_title)
 Set title for back link. More...
 
 getTabs (&$tabs_gui)
 adds tabs to tab gui object More...
 

Static Public Member Functions

static _getSelectedIDs ()
 

Protected Attributes

 $lng
 
 $ctrl
 
 $user
 
 $tabs
 
 $tree
 
 $tpl
 
 $toolbar
 
 $error
 

Detailed Description

Class ilEditClipboardGUI.

Clipboard for editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ ilEditClipboardGUI: ilObjMediaObjectGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilEditClipboardGUI::__construct ( )

Constructor public.

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

References $_GET, $DIC, $ilCtrl, $lng, array, and user().

65  {
66  global $DIC;
67 
68  $this->lng = $DIC->language();
69  $this->ctrl = $DIC->ctrl();
70  $this->user = $DIC->user();
71  $this->tabs = $DIC->tabs();
72  $this->tree = $DIC->repositoryTree();
73  $this->tpl = $DIC["tpl"];
74  $this->toolbar = $DIC->toolbar();
75  $this->error = $DIC["ilErr"];
76  $lng = $DIC->language();
77  $ilCtrl = $DIC->ctrl();
78 
79  $this->multiple = false;
80  $this->page_back_title = $lng->txt("cont_back");
81  if ($_GET["returnCommand"] != "") {
82  $this->mode = "getObject";
83  } else {
84  $this->mode = "";
85  }
86 
87  $ilCtrl->setParameter(
88  $this,
89  "returnCommand",
90  rawurlencode($_GET["returnCommand"])
91  );
92 
93  $ilCtrl->saveParameter($this, array("clip_item_id"));
94  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Member Function Documentation

◆ _getSelectedIDs()

static ilEditClipboardGUI::_getSelectedIDs ( )
static

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

References $_SESSION.

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

266  {
267  return $_SESSION["ilEditClipboard_mob_id"];
268  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ executeCommand()

ilEditClipboardGUI::executeCommand ( )

execute command

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

References $_GET, $ctrl, $ilCtrl, $ilUser, $lng, $ret, $tabs, and $user.

100  {
103  $ilTabs = $this->tabs;
104  $lng = $this->lng;
105 
106  $next_class = $ilCtrl->getNextClass($this);
107  $cmd = $ilCtrl->getCmd();
108 
109  switch ($next_class) {
110  case "ilobjmediaobjectgui":
111  $ilCtrl->setReturn($this, "view");
112  $ilTabs->clearTargets();
113  $ilTabs->setBackTarget(
114  $lng->txt("back"),
115  $ilCtrl->getLinkTarget($this, "view")
116  );
117  $mob_gui = new ilObjMediaObjectGUI("", $_GET["clip_item_id"], false, false);
118  $mob_gui->setTabs();
119  $ret = $ilCtrl->forwardCommand($mob_gui);
120  switch ($cmd) {
121  case "save":
122  $ilUser->addObjectToClipboard($ret->getId(), "mob", $ret->getTitle());
123  $ilCtrl->redirect($this, "view");
124  break;
125  }
126  break;
127 
128  default:
129  $ret = $this->$cmd();
130  break;
131  }
132 
133  return $ret;
134  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
Class ilObjMediaObjectGUI.
$ret
Definition: parser.php:6

◆ getInsertButtonTitle()

ilEditClipboardGUI::getInsertButtonTitle ( )

Get Insert Button Title.

Returns
string Insert Button Title

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

References $lng.

168  {
169  $lng = $this->lng;
170 
171  if ($this->insertbuttontitle == "") {
172  return $lng->txt("insert");
173  }
174 
175  return $this->insertbuttontitle;
176  }

◆ getMultipleSelections()

ilEditClipboardGUI::getMultipleSelections ( )

check wether multiple selections are enabled

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

Referenced by insert().

148  {
149  return $this->multiple;
150  }
+ Here is the caller graph for this function:

◆ getObject()

ilEditClipboardGUI::getObject ( )

get Object

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

References view().

206  {
207  $this->mode = "getObject";
208  $this->view();
209  }
+ Here is the call graph for this function:

◆ getTabs()

ilEditClipboardGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $ctrl, and $ilCtrl.

Referenced by setTabs().

297  {
299 
300  // back to upper context
301  $tabs_gui->setBackTarget(
302  $this->page_back_title,
303  $ilCtrl->getParentReturn($this)
304  );
305  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ insert()

ilEditClipboardGUI::insert ( )

insert

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

References $_GET, $_POST, $_SESSION, $error, $ilErr, $lng, getMultipleSelections(), and ilUtil\redirect().

246  {
247  $lng = $this->lng;
249 
250  // check number of objects
251  if (!isset($_POST["id"])) {
252  $ilErr->raiseError($lng->txt("no_checkbox"), $ilErr->MESSAGE);
253  }
254 
255  if (!$this->getMultipleSelections()) {
256  if (count($_POST["id"]) > 1) {
257  $ilErr->raiseError($lng->txt("cont_select_max_one_item"), $ilErr->MESSAGE);
258  }
259  }
260 
261  $_SESSION["ilEditClipboard_mob_id"] = $_POST["id"];
262  ilUtil::redirect($_GET["returnCommand"]);
263  }
global $ilErr
Definition: raiseError.php:16
$_SESSION["AccountId"]
$_GET["client_id"]
getMultipleSelections()
check wether multiple selections are enabled
static redirect($a_script)
$_POST["username"]
+ Here is the call graph for this function:

◆ remove()

ilEditClipboardGUI::remove ( )

remove item from clipboard

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

References $_POST, $ctrl, $error, $id, $ilCtrl, $ilErr, $ilUser, $lng, and $user.

216  {
219  $lng = $this->lng;
221 
222  // check number of objects
223  if (!isset($_POST["id"])) {
224  $ilErr->raiseError($lng->txt("no_checkbox"), $ilErr->MESSAGE);
225  }
226 
227  foreach ($_POST["id"] as $obj_id) {
228  $id = explode(":", $obj_id);
229  if ($id[0] == "mob") {
230  $ilUser->removeObjectFromClipboard($id[1], "mob");
231  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
232  $mob = new ilObjMediaObject($id[1]);
233  $mob->delete(); // this method don't delete, if mob is used elsewhere
234  }
235  if ($id[0] == "incl") {
236  $ilUser->removeObjectFromClipboard($id[1], "incl");
237  }
238  }
239  $ilCtrl->redirect($this, "view");
240  }
global $ilErr
Definition: raiseError.php:16
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
Class ilObjMediaObject.
$_POST["username"]

◆ setInsertButtonTitle()

ilEditClipboardGUI::setInsertButtonTitle (   $a_insertbuttontitle)

Set Insert Button Title.

Parameters
string$a_insertbuttontitleInsert Button Title

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

158  {
159  $this->insertbuttontitle = $a_insertbuttontitle;
160  }

◆ setMultipleSelections()

ilEditClipboardGUI::setMultipleSelections (   $a_multiple = true)

set, if multiple selections are enabled

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

140  {
141  $this->multiple = $a_multiple;
142  }

◆ setPageBackTitle()

ilEditClipboardGUI::setPageBackTitle (   $a_title)

Set title for back link.

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

287  {
288  $this->page_back_title = $a_title;
289  }

◆ setTabs()

ilEditClipboardGUI::setTabs ( )

output tabs

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

References $lng, $tabs, $tpl, and getTabs().

274  {
275  $ilTabs = $this->tabs;
276  $lng = $this->lng;
277  $tpl = $this->tpl;
278 
279  $tpl->setTitle($lng->txt("clipboard"));
280  $this->getTabs($ilTabs);
281  }
getTabs(&$tabs_gui)
adds tabs to tab gui object
+ Here is the call graph for this function:

◆ view()

ilEditClipboardGUI::view ( )

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

References $ctrl, $ilCtrl, $ilUser, $lng, $toolbar, $tpl, $tree, $user, and ilLinkButton\getInstance().

Referenced by getObject().

182  {
183  $tree = $this->tree;
186  $lng = $this->lng;
187  $tpl = $this->tpl;
188  $ilToolbar = $this->toolbar;
189 
190  include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
191  $but = ilLinkButton::getInstance();
192  $but->setUrl($ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "create"));
193  $but->setCaption("cont_create_mob");
194  $ilToolbar->addButtonInstance($but);
195 
196  include_once("./Services/Clipboard/classes/class.ilClipboardTableGUI.php");
197  $table_gui = new ilClipboardTableGUI($this, "view");
198  $tpl->setContent($table_gui->getHTML());
199  }
TableGUI clipboard items.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilEditClipboardGUI::$ctrl
protected

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

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

◆ $error

ilEditClipboardGUI::$error
protected

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

Referenced by insert(), and remove().

◆ $lng

ilEditClipboardGUI::$lng
protected

◆ $tabs

ilEditClipboardGUI::$tabs
protected

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

Referenced by executeCommand(), and setTabs().

◆ $toolbar

ilEditClipboardGUI::$toolbar
protected

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

Referenced by view().

◆ $tpl

ilEditClipboardGUI::$tpl
protected

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

Referenced by setTabs(), and view().

◆ $tree

ilEditClipboardGUI::$tree
protected

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

Referenced by view().

◆ $user

ilEditClipboardGUI::$user
protected

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

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


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