ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 

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 24 of file class.ilEditClipboardGUI.php.

References $_GET, $ilCtrl, $lng, and array.

25  {
26  global $lng, $ilCtrl;
27 
28  $this->multiple = false;
29  $this->page_back_title = $lng->txt("cont_back");
30  if ($_GET["returnCommand"] != "")
31  {
32  $this->mode = "getObject";
33  }
34  else
35  {
36  $this->mode = "";
37  }
38 
39  $ilCtrl->setParameter($this, "returnCommand",
40  rawurlencode($_GET["returnCommand"]));
41 
42  $ilCtrl->saveParameter($this, array("clip_item_id"));
43  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17

Member Function Documentation

◆ _getSelectedIDs()

static ilEditClipboardGUI::_getSelectedIDs ( )
static

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

References $_SESSION.

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

211  {
212  return $_SESSION["ilEditClipboard_mob_id"];
213  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ executeCommand()

ilEditClipboardGUI::executeCommand ( )

execute command

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

References $_GET, $cmd, $ilCtrl, $ilUser, $lng, and $ret.

49  {
50  global $ilUser, $ilCtrl, $ilTabs, $lng;
51 
52  $next_class = $ilCtrl->getNextClass($this);
53  $cmd = $ilCtrl->getCmd();
54 
55  switch($next_class)
56  {
57  case "ilobjmediaobjectgui":
58  $ilCtrl->setReturn($this, "view");
59  $ilTabs->clearTargets();
60  $ilTabs->setBackTarget($lng->txt("back"),
61  $ilCtrl->getLinkTarget($this, "view"));
62  $mob_gui = new ilObjMediaObjectGUI("", $_GET["clip_item_id"],false, false);
63  $mob_gui->setTabs();
64  $ret = $ilCtrl->forwardCommand($mob_gui);
65  switch($cmd)
66  {
67  case "save":
68  $ilUser->addObjectToClipboard($ret->getId(), "mob", $ret->getTitle());
69  $ilCtrl->redirect($this, "view");
70  break;
71  }
72  break;
73 
74  default:
75  $ret = $this->$cmd();
76  break;
77  }
78 
79  return $ret;
80  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
Class ilObjMediaObjectGUI.
global $lng
Definition: privfeed.php:17
$ret
Definition: parser.php:6

◆ getInsertButtonTitle()

ilEditClipboardGUI::getInsertButtonTitle ( )

Get Insert Button Title.

Returns
string Insert Button Title

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

References $lng.

114  {
115  global $lng;
116 
117  if ($this->insertbuttontitle == "")
118  {
119  return $lng->txt("insert");
120  }
121 
122  return $this->insertbuttontitle;
123  }
global $lng
Definition: privfeed.php:17

◆ getMultipleSelections()

ilEditClipboardGUI::getMultipleSelections ( )

check wether multiple selections are enabled

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

Referenced by insert().

94  {
95  return $this->multiple;
96  }
+ Here is the caller graph for this function:

◆ getObject()

ilEditClipboardGUI::getObject ( )

get Object

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

References view().

148  {
149  $this->mode = "getObject";
150  $this->view();
151  }
+ 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 239 of file class.ilEditClipboardGUI.php.

References $ilCtrl.

Referenced by setTabs().

240  {
241  global $ilCtrl;
242 
243  // back to upper context
244  $tabs_gui->setBackTarget($this->page_back_title,
245  $ilCtrl->getParentReturn($this));
246  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ insert()

ilEditClipboardGUI::insert ( )

insert

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

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

189  {
190  global $ilias, $lng;
191 
192  // check number of objects
193  if (!isset($_POST["id"]))
194  {
195  $ilias->raiseError($lng->txt("no_checkbox"),$ilias->error_obj->MESSAGE);
196  }
197 
198  if (!$this->getMultipleSelections())
199  {
200  if(count($_POST["id"]) > 1)
201  {
202  $ilias->raiseError($lng->txt("cont_select_max_one_item"),$ilias->error_obj->MESSAGE);
203  }
204  }
205 
206  $_SESSION["ilEditClipboard_mob_id"] = $_POST["id"];
207  ilUtil::redirect($_GET["returnCommand"]);
208  }
$_SESSION["AccountId"]
$_GET["client_id"]
getMultipleSelections()
check wether multiple selections are enabled
global $lng
Definition: privfeed.php:17
static redirect($a_script)
http redirect to other script
$_POST["username"]
+ Here is the call graph for this function:

◆ remove()

ilEditClipboardGUI::remove ( )

remove item from clipboard

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

References $_POST, $ilCtrl, $ilUser, and $lng.

158  {
159  global $ilias, $ilUser, $lng, $ilCtrl;
160 
161  // check number of objects
162  if (!isset($_POST["id"]))
163  {
164  $ilias->raiseError($lng->txt("no_checkbox"),$ilias->error_obj->MESSAGE);
165  }
166 
167  foreach($_POST["id"] AS $obj_id)
168  {
169  $id = explode(":", $obj_id);
170  if ($id[0] == "mob")
171  {
172  $ilUser->removeObjectFromClipboard($id[1], "mob");
173  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
174  $mob = new ilObjMediaObject($id[1]);
175  $mob->delete(); // this method don't delete, if mob is used elsewhere
176  }
177  if ($id[0] == "incl")
178  {
179  $ilUser->removeObjectFromClipboard($id[1], "incl");
180  }
181  }
182  $ilCtrl->redirect($this, "view");
183  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
Class ilObjMediaObject.
global $lng
Definition: privfeed.php:17
$_POST["username"]

◆ setInsertButtonTitle()

ilEditClipboardGUI::setInsertButtonTitle (   $a_insertbuttontitle)

Set Insert Button Title.

Parameters
string$a_insertbuttontitleInsert Button Title

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

104  {
105  $this->insertbuttontitle = $a_insertbuttontitle;
106  }

◆ setMultipleSelections()

ilEditClipboardGUI::setMultipleSelections (   $a_multiple = true)

set, if multiple selections are enabled

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

86  {
87  $this->multiple = $a_multiple;
88  }

◆ setPageBackTitle()

ilEditClipboardGUI::setPageBackTitle (   $a_title)

Set title for back link.

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

230  {
231  $this->page_back_title = $a_title;
232  }

◆ setTabs()

ilEditClipboardGUI::setTabs ( )

output tabs

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

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

219  {
220  global $ilTabs, $lng, $tpl;
221 
222  $tpl->setTitle($lng->txt("clipboard"));
223  $this->getTabs($ilTabs);
224  }
global $tpl
Definition: ilias.php:8
global $lng
Definition: privfeed.php:17
getTabs(&$tabs_gui)
adds tabs to tab gui object
+ Here is the call graph for this function:

◆ view()

ilEditClipboardGUI::view ( )

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

References $ilCtrl, $ilUser, $lng, $tpl, and ilLinkButton\getInstance().

Referenced by getObject().

129  {
130  global $tree, $ilUser, $ilCtrl, $lng, $tpl, $ilToolbar;
131 
132  include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
133  $but = ilLinkButton::getInstance();
134  $but->setUrl($ilCtrl->getLinkTargetByClass("ilobjmediaobjectgui", "create"));
135  $but->setCaption("cont_create_mob");
136  $ilToolbar->addButtonInstance($but);
137 
138  include_once("./Services/Clipboard/classes/class.ilClipboardTableGUI.php");
139  $table_gui = new ilClipboardTableGUI($this, "view");
140  $tpl->setContent($table_gui->getHTML());
141  }
TableGUI clipboard items.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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