ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjMediaPoolGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Object/classes/class.ilObject2GUI.php");
5 include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
6 include_once("./Services/Table/classes/class.ilTableGUI.php");
7 include_once("./Modules/Folder/classes/class.ilObjFolderGUI.php");
8 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
9 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
10 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
11 
25 {
27 
33  function __construct($a_data,$a_id = 0,$a_call_by_reference = true, $a_prepare_output = false)
34  {
35  parent::__construct($a_id, $a_call_by_reference);
36  }
37 
41  protected function afterConstructor()
42  {
43  global $lng;
44 
45  $lng->loadLanguageModule("mep");
46 
47  if ($this->ctrl->getCmd() == "explorer")
48  {
49  $this->ctrl->saveParameter($this, array("ref_id"));
50  }
51  else
52  {
53  $this->ctrl->saveParameter($this, array("ref_id", "mepitem_id"));
54  }
55  $this->ctrl->saveParameter($this, array("mep_mode"));
56 
57  $lng->loadLanguageModule("content");
58  }
59 
63  final function getType()
64  {
65  return "mep";
66  }
67 
71  function &executeCommand()
72  {
73  global $ilTabs, $lng, $ilAccess, $tpl, $ilCtrl;
74 
75  if ($this->ctrl->getRedirectSource() == "ilinternallinkgui")
76  {
77  $this->explorer();
78  return;
79  }
80 
81  $next_class = $this->ctrl->getNextClass($this);
82  $cmd = $this->ctrl->getCmd();
83 
84  $new_type = $_POST["new_type"]
85  ? $_POST["new_type"]
86  : $_GET["new_type"];
87 
88  if ($new_type != "" && ($cmd != "confirmRemove" && $cmd != "copyToClipboard"
89  && $cmd != "pasteFromClipboard"))
90  {
91  $this->setCreationMode(true);
92  }
93 
94  if (!$this->getCreationMode())
95  {
96  $tree =& $this->object->getTree();
97  if ($_GET["mepitem_id"] == "")
98  {
99  $_GET["mepitem_id"] = $tree->getRootId();
100  }
101  }
102 
103  if ($cmd == "create")
104  {
105  switch($_POST["new_type"])
106  {
107  case "mob":
108  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
109  break;
110 
111  case "fold":
112 // todo
113  $this->ctrl->redirectByClass("ilobjfoldergui", "create");
114  break;
115  }
116  }
117 
118  switch($next_class)
119  {
120  case 'ilmediapoolpagegui':
121  $this->prepareOutput();
122  $this->setMediaPoolPageTabs();
123  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
124  $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
125 
126  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
127  {
128  $mep_page_gui->setEnableEditing(false);
129  }
130  $ret = $this->ctrl->forwardCommand($mep_page_gui);
131  if ($ret != "")
132  {
133  $tpl->setContent($ret);
134  }
135  $this->tpl->show();
136  break;
137 
138  case "ilobjmediaobjectgui":
139 
140  //$cmd.="Object";
141  if ($cmd == "create" || $cmd == "save" || $cmd == "cancel")
142  {
143  $ret_obj = $_GET["mepitem_id"];
144  $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", 0, false, false);
145  $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
146  $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
147  }
148  else
149  {
150  $ret_obj = $tree->getParentId($_GET["mepitem_id"]);
151  $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
152  $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
153  $ilTabs->setBackTarget($lng->txt("back"),
154  $this->ctrl->getLinkTarget($this,
155  $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia"));
156  }
157  if ($this->ctrl->getCmdClass() == "ilinternallinkgui")
158  {
159  $this->ctrl->setReturn($this, "explorer");
160  }
161  else
162  {
163  $this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
164  $this->ctrl->setReturn($this,
165  $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
166  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
167  }
168  $this->getTemplate();
169  $ilObjMediaObjectGUI->setTabs();
170  $this->setLocator();
171 
172  //$ret =& $ilObjMediaObjectGUI->executeCommand();
173  $ret =& $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
174 
175  switch($cmd)
176  {
177  case "save":
178  $mep_item = new ilMediaPoolItem();
179  $mep_item->setTitle($ret->getTitle());
180  $mep_item->setType("mob");
181  $mep_item->setForeignId($ret->getId());
182  $mep_item->create();
183 
184  $parent = ($_GET["mepitem_id"] == "")
185  ? $tree->getRootId()
186  : $_GET["mepitem_id"];
187  $tree->insertNode($mep_item->getId(), $parent);
188  ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
189  $_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
190  break;
191 
192  default:
193  $this->tpl->show();
194  break;
195  }
196  break;
197 
198  case "ilobjfoldergui":
199 // todo
200  $folder_gui = new ilObjFolderGUI("", 0, false, false);
201  $this->ctrl->setReturn($this, "listMedia");
202  $cmd.="Object";
203  switch($cmd)
204  {
205  case "createObject":
206  $this->prepareOutput();
207  $folder_gui =& new ilObjFolderGUI("", 0, false, false);
208  $folder_gui->setFormAction("save",
209  $this->ctrl->getFormActionByClass("ilobjfoldergui"));
210  $folder_gui->createObject();
211  $this->tpl->show();
212  break;
213 
214  case "saveObject":
215  //$folder_gui->setReturnLocation("save", $this->ctrl->getLinkTarget($this, "listMedia"));
216  $parent = ($_GET["mepitem_id"] == "")
217  ? $tree->getRootId()
218  : $_GET["mepitem_id"];
219  $folder_gui->setFolderTree($tree);
220  $folder_gui->saveObject($parent);
221  //$this->ctrl->redirect($this, "listMedia");
222  break;
223 
224  case "editObject":
225  $this->prepareOutput();
226  $folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
227  $this->ctrl->setParameter($this, "foldereditmode", "1");
228  $folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
229  $folder_gui->editObject();
230  $this->tpl->show();
231  break;
232 
233  case "updateObject":
234  $folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
235  $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
236  $this->ctrl->setReturn($this, "listMedia");
237  $folder_gui->updateObject(true); // this returns to parent
238  break;
239 
240  case "cancelObject":
241  if ($_GET["foldereditmode"])
242  {
243  $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
244  }
245  $this->ctrl->redirect($this, "listMedia");
246  break;
247  }
248  break;
249 
250  case "ileditclipboardgui":
251  $this->prepareOutput();
252  $this->ctrl->setReturn($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
253  $clip_gui = new ilEditClipboardGUI();
254  $clip_gui->setMultipleSelections(true);
255  $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
256  $ilTabs->setTabActive("clipboard");
257  //$ret =& $clip_gui->executeCommand();
258  $ret =& $this->ctrl->forwardCommand($clip_gui);
259  $this->tpl->show();
260  break;
261 
262  case 'ilinfoscreengui':
263  $this->prepareOutput();
264  $this->infoScreen();
265  $this->tpl->show();
266  break;
267 
268  case 'ilpermissiongui':
269  $this->prepareOutput();
270  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
271  $perm_gui =& new ilPermissionGUI($this);
272  $ret =& $this->ctrl->forwardCommand($perm_gui);
273  $this->tpl->show();
274  break;
275 
276  case "ilexportgui":
277  $this->prepareOutput();
278  include_once("./Services/Export/classes/class.ilExportGUI.php");
279  $exp_gui = new ilExportGUI($this);
280  $exp_gui->addFormat("xml");
281  $ret = $this->ctrl->forwardCommand($exp_gui);
282  $this->tpl->show();
283  break;
284 
285  default:
286  $this->prepareOutput();
287  $cmd = $this->ctrl->getCmd("frameset");
288  $this->$cmd();
289  if (!$this->getCreationMode())
290  {
291  $this->tpl->show();
292  }
293  break;
294  }
295  }
296 
300  function initCreationForms()
301  {
303  }
304 
305 
306  function createMediaObject()
307  {
308  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
309  }
310 
311  // for admin compatiblity
312  function view()
313  {
314  $this->viewObject();
315  }
316 
322  public function initEditForm($a_mode = "edit", $a_new_type = "")
323  {
324  global $lng, $ilCtrl;
325 
326  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
327  $this->form = new ilPropertyFormGUI();
328  if ($a_mode != "edit")
329  {
330  $this->form->setTarget("_top");
331  }
332 
333  // title
334  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
335  $ti->setMaxLength(128);
336  $ti->setSize(40);
337  $ti->setRequired(true);
338  $this->form->addItem($ti);
339 
340  // description
341  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
342  $ta->setCols(40);
343  $ta->setRows(2);
344  $this->form->addItem($ta);
345 
346  if ($a_mode == "edit")
347  {
348  // default width
349  $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
350  $ni->setMinValue(0);
351  $ni->setMaxLength(5);
352  $ni->setSize(5);
353  $this->form->addItem($ni);
354 
355  // default height
356  $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
357  $ni->setMinValue(0);
358  $ni->setMaxLength(5);
359  $ni->setSize(5);
360  $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
361  $this->form->addItem($ni);
362  }
363 
364  // save and cancel commands
365  if ($a_mode == "create")
366  {
367  $this->form->addCommandButton("save", $lng->txt($a_new_type."_add"));
368  $this->form->addCommandButton("cancelCreation", $lng->txt("cancel"));
369  $this->form->setTitle($lng->txt($a_new_type."_new"));
370  }
371  else
372  {
373  $this->form->addCommandButton("update", $lng->txt("save"));
374  //$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
375  $this->form->setTitle($lng->txt("edit"));
376  }
377 
378  $this->form->setFormAction($ilCtrl->getFormAction($this));
379 
380  }
381 
385  function getEditFormValues()
386  {
387  $values["title"] = $this->object->getTitle();
388  $values["desc"] = $this->object->getDescription();
389  if ($this->object->getDefaultWidth() > 0)
390  {
391  $values["default_width"] = $this->object->getDefaultWidth();
392  }
393  if ($this->object->getDefaultHeight() > 0)
394  {
395  $values["default_height"] = $this->object->getDefaultHeight();
396  }
397  $this->form->setValuesByArray($values);
398  }
399 
404  function afterSave($newObj)
405  {
406  // always send a message
407  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
408 
409  //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
410  ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId()."&cmd=edit");
411  }
412 
418  function editObject()
419  {
420  global $ilAccess, $tree, $tpl;
421 
422  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
423  {
424  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
425  }
426 
427  // edit button
428  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
429 
431  }
432 
436  function edit()
437  {
438  $this->editObject();
439 // $this->tpl->show();
440  }
441 
445  protected function cancel()
446  {
447  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
448  }
449 
453  function update()
454  {
455  global $ilAccess;
456 
457  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
458  {
459  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
460  }
461 
462  $this->updateObject();
463  }
464 
470  function updateObject()
471  {
472  global $lng, $tpl;
473 
474  $this->initEditForm("edit");
475  if ($this->form->checkInput())
476  {
477  $this->object->setTitle($_POST["title"]);
478  $this->object->setDescription($_POST["desc"]);
479  $this->object->setDefaultWidth($_POST["default_width"]);
480  $this->object->setDefaultHeight($_POST["default_height"]);
481  $this->update = $this->object->update();
482  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
483  $this->afterUpdate();
484  return;
485  }
486  $this->form->setValuesByPost();
487  $tpl->setContent($this->form->getHtml());
488  }
489 
490  function afterUpdate()
491  {
492  $this->ctrl->redirect($this, "edit");
493  }
494 
498  function listMedia()
499  {
500  global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl, $ilToolbar, $lng;
501 
502  $ilCtrl->setParameter($this, "mep_mode", "listMedia");
503 
504  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
505  {
506  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
507  }
508  $ilTabs->setTabActive("objs_fold");
509 
510  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
511  {
512  $ilToolbar->addButton($lng->txt("mep_create_mob"),
513  $ilCtrl->getLinkTarget($this, "createMediaObject"));
514 
515  $mset = new ilSetting("mobs");
516  if ($mset->get("mep_activate_pages"))
517  {
518  $ilToolbar->addButton($lng->txt("mep_create_content_snippet"),
519  $ilCtrl->getLinkTarget($this, "createMediaPoolPage"));
520  }
521 
522  $ilToolbar->addButton($lng->txt("mep_create_folder"),
523  $ilCtrl->getLinkTarget($this, "createFolderForm"));
524  }
525 
526  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
527  $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
528  $tpl->setContent($mep_table_gui->getHTML());
529 // $this->tpl->show();
530  }
531 
535  function allMedia()
536  {
537  global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl,$ilUser;
538 
539  $ilCtrl->setParameter($this, "mep_mode", "allMedia");
540 
541  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
542  {
543  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
544  }
545  $ilTabs->setTabActive("mep_all_mobs");
546 
547 
548  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
549  $mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
550  "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
551 
552 
553  if(isset($_GET['force_filter']) and $_GET['force_filter'])
554  {
555  $_POST['title'] = ilMediaPoolItem::lookupTitle((int) $_GET['force_filter']);
556 
557  include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
558  $tprop = new ilTablePropertiesStorage();
559  $tprop->storeProperty(
560  $mep_table_gui->getId(),
561  $ilUser->getId(),
562  'filter',
563  1
564  );
565  $mep_table_gui->resetFilter();
566  $mep_table_gui->resetOffset();
567  $mep_table_gui->writeFilterToSession();
568 
569  // Read again
570  $mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
571  "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
572  }
573 
574  $tpl->setContent($mep_table_gui->getHTML());
575 // $this->tpl->show();
576  }
577 
581  function applyFilter()
582  {
583  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
584  $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
585  "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
586  $mtab->writeFilterToSession();
587  $mtab->resetOffset();
588  $this->allMedia();
589  }
590 
594  function resetFilter()
595  {
596  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
597  $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
598  "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
599  $mtab->resetFilter();
600  $mtab->resetOffset();
601  $this->allMedia();
602  }
603 
607  function getTemplate()
608  {
609  $this->tpl->getStandardTemplate();
610  }
611 
612 
616  function getParentFolderId()
617  {
618  if ($_GET["mepitem_id"] == "")
619  {
620  return "";
621  }
622  $par_id = $this->object->tree->getParentId($_GET["mepitem_id"]);
623  if ($par_id != $this->object->tree->getRootId())
624  {
625  return $par_id;
626  }
627  else
628  {
629  return "";
630  }
631  }
632 
637 /*
638  function showUpperIcon()
639  {
640  global $tpl;
641 
642  if ($this->ctrl->getCmd() == "explorer")
643  {
644  return;
645  }
646 
647  parent::showUpperIcon();
648 
649  $mep_tree =& $this->object->getTree();
650  if ($_GET["obj_id"] != "" && $_GET["obj_id"] != $mep_tree->getRootId())
651  {
652  $this->ctrl->setParameter($this, "obj_id",
653  $this->getParentFolderId());
654  $tpl->setUpperIcon($this->ctrl->getLinkTarget($this, "listMedia"));
655  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
656  }
657  }
658 */
659 
665  function frameset()
666  {
667  include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
668  $fs_gui = new ilFramesetGUI();
669  $fs_gui->setMainFrameName("content");
670  $fs_gui->setSideFrameName("tree");
671  $fs_gui->setMainFrameSource(
672  $this->ctrl->getLinkTarget($this, "listMedia"));
673  $this->ctrl->setParameter($this, "expand", "1");
674  $fs_gui->setSideFrameSource(
675  $this->ctrl->getLinkTarget($this, "explorer"));
676  $fs_gui->setFramesetTitle($this->object->getTitle());
677  $fs_gui->show();
678  exit;
679  }
680 
687  {
688  include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
689  $fs_gui = new ilFramesetGUI();
690  $fs_gui->setMainFrameName("content");
691  $fs_gui->setSideFrameName("tree");
692  $fs_gui->setMainFrameSource(
693  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
694  $this->ctrl->setParameter($this, "expand", "1");
695  $fs_gui->setSideFrameSource(
696  $this->ctrl->getLinkTarget($this, "explorer"));
697  $fs_gui->setFramesetTitle($this->object->getTitle());
698  $fs_gui->show();
699  exit;
700  }
701 
705  function explorer()
706  {
707  global $ilAccess, $ilCtrl;
708 
709  $ilCtrl->setParameter($this, "obj_id", "");
710  $ilCtrl->setParameter($this, "mepitem_id", "");
711 
712  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()) &&
713  !$ilAccess->checkAccess("write", "", $this->object->getRefId()))
714  {
715  return;
716  }
717 
718  require_once ("./Modules/MediaPool/classes/class.ilMediaPoolExplorer.php");
719  $exp = new ilMediaPoolExplorer($this->ctrl->getLinkTarget($this, "listMedia"), $this->object);
720  $exp->setUseStandardFrame(true);
721  $exp->setTargetGet("mepitem_id");
722  $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "explorer"));
723  $exp->setTitle($this->lng->txt("cont_mep_structure"));
724 
725  $exp->addFilter("dummy");
726  $exp->addFilter("fold");
727  $exp->setFiltered(true);
728  $exp->setFilterMode(IL_FM_POSITIVE);
729 
730 
731  if ($_GET["mepexpand"] == "")
732  {
733  $mep_tree =& $this->object->getTree();
734  $expanded = $mep_tree->readRootId();
735  }
736  else
737  {
738  $expanded = $_GET["mepexpand"];
739  }
740 
741  $exp->setExpand($expanded);
742 
743  // build html-output
744  $exp->setOutput(0);
745  $output = $exp->getOutput();
746  echo $output;
747  exit;
748 /* $this->tpl->setCurrentBlock("content");
749  $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_mep_structure"));
750  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
751  $this->tpl->setVariable("EXPLORER",$output);
752  $this->ctrl->setParameter($this, "mepexpand", $_GET["mepexpand"]);
753  $this->tpl->setVariable("ACTION",
754  $this->ctrl->getLinkTarget($this, "explorer"));
755  $this->tpl->parseCurrentBlock();
756  $this->tpl->show(false);
757 */
758  }
759 
763  function showMedia()
764  {
765  global $ilAccess;
766 
767  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
768  {
769  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
770  }
771 
772  $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
773  include_once("Services/Style/classes/class.ilObjStyleSheet.php");
774  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
775  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
777 
778  //$int_links = $page_object->getInternalLinks();
779  $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
780 
781  // later
782  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
783 
784  $link_xlm = "";
785 
786  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
787  $media_obj =& new ilObjMediaObject($_GET["mob_id"]);
788 
789  $xml = "<dummy>";
790  // todo: we get always the first alias now (problem if mob is used multiple
791  // times in page)
792  $xml.= $media_obj->getXML(IL_MODE_ALIAS);
793  $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
794  $xml.= $link_xml;
795  $xml.="</dummy>";
796 
797  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
798  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
799  $xh = xslt_create();
800 
801  $wb_path = ilUtil::getWebspaceDir("output")."/";
802 
803  $mode = ($_GET["cmd"] != "showMedia")
804  ? "fullscreen"
805  : "media";
806  $enlarge_path = ilUtil::getImagePath("enlarge.gif", false, "output");
807  $fullscreen_link =
808  $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
809  $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
810  'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
811  'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
812  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
813  echo xslt_error($xh);
814  xslt_free($xh);
815  // unmask user html
816  $this->tpl->setVariable("MEDIA_CONTENT", $output);
817 
818  $this->tpl->parseCurrentBlock();
819 // $this->tpl->show();
820  }
821 
825  function showFullscreen()
826  {
827  $this->showMedia();
828  }
829 
833  function confirmRemove()
834  {
835  global $ilAccess, $ilCtrl, $lng;
836 
837  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
838  {
839  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
840  }
841 
842  if(!isset($_POST["id"]))
843  {
844  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
845  }
846 
847  //$this->prepareOutput();
848 
849  // SAVE POST VALUES
850  $_SESSION["ilMepRemove"] = $_POST["id"];
851 
852  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.confirm_deletion.html", "Modules/MediaPool");
853 
854  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
855 
856  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
857 
858  // BEGIN TABLE HEADER
859  $this->tpl->setCurrentBlock("table_header");
860  $this->tpl->setVariable("TEXT",$this->lng->txt("objects"));
861  $this->tpl->parseCurrentBlock();
862 
863  // BEGIN TABLE DATA
864  $counter = 0;
865  foreach($_POST["id"] as $obj_id)
866  {
869 
870  // check whether page can be removed
871  if ($type == "pg")
872  {
873  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
874  $usages = ilPageContentUsage::getUsages("incl", $obj_id);
875  if (count($usages) > 0)
876  {
877  ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
878  $ilCtrl->redirect($this, "listMedia");
879  }
880  }
881 
882  $this->tpl->setCurrentBlock("table_row");
883  $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
884  $this->tpl->setVariable("TEXT_CONTENT", $title);
885  $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_".$type.".gif"));
886  $this->tpl->parseCurrentBlock();
887  }
888 
889  // cancel/confirm button
890  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
891  $buttons = array( "cancelRemove" => $this->lng->txt("cancel"),
892  "remove" => $this->lng->txt("confirm"));
893  foreach ($buttons as $name => $value)
894  {
895  $this->tpl->setCurrentBlock("operation_btn");
896  $this->tpl->setVariable("BTN_NAME",$name);
897  $this->tpl->setVariable("BTN_VALUE",$value);
898  $this->tpl->parseCurrentBlock();
899  }
900 // $this->tpl->show();
901  }
902 
906  function openClipboard()
907  {
908  global $ilCtrl, $ilAccess;
909 
910  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
911  {
912  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
913  }
914 
915  $ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
916  rawurlencode($ilCtrl->getLinkTarget($this,
917  "insertFromClipboard", "", false, false)));
918  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
919  }
920 
921 
926  {
927  global $ilAccess;
928 
929  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
930  {
931  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
932  }
933 
934  include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
936  $not_inserted = array();
937  if (is_array($ids))
938  {
939  foreach ($ids as $id2)
940  {
941  $id = explode(":", $id2);
942  $type = $id[0];
943  $id = $id[1];
944 
945  if ($type == "mob") // media object
946  {
947  if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
948  {
949  $not_inserted[] = ilObject::_lookupTitle($id)." [".
950  $id."]";
951  }
952  else
953  {
954  $item = new ilMediaPoolItem();
955  $item->setType("mob");
956  $item->setForeignId($id);
957  $item->setTitle(ilObject::_lookupTitle($id));
958  $item->create();
959  if ($item->getId() > 0)
960  {
961  $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
962  }
963  }
964  }
965  if ($type == "incl") // content snippet
966  {
967  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
968  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
969  if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
970  {
971  $not_inserted[] = ilMediaPoolPage::lookupTitle($id)." [".
972  $id."]";
973  }
974  else
975  {
976  $original = new ilMediaPoolPage($id);
977 
978  // copy the page into the pool
979  $item = new ilMediaPoolItem();
980  $item->setType("pg");
981  $item->setTitle(ilMediaPoolItem::lookupTitle($id));
982  $item->create();
983  if ($item->getId() > 0)
984  {
985  $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
986 
987  // create page
988  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
989  $page = new ilMediaPoolPage();
990  $page->setId($item->getId());
991  $page->create();
992 
993  // copy content
994  $page->setXMLContent($original->copyXMLContent());
995  $page->buildDom();
996  $page->update();
997  }
998  }
999  }
1000  }
1001  }
1002  if (count($not_inserted) > 0)
1003  {
1004  ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist")."<br>".
1005  implode($not_inserted,"<br>"), true);
1006  }
1007  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1008  }
1009 
1010 
1014  function cancelRemove()
1015  {
1016  session_unregister("ilMepRemove");
1017  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1018  }
1019 
1023  function remove()
1024  {
1025  global $ilAccess;
1026 
1027  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
1028  {
1029  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1030  }
1031 
1032  foreach($_SESSION["ilMepRemove"] as $obj_id)
1033  {
1034  $this->object->deleteChild($obj_id);
1035  }
1036 
1037  ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"),true);
1038  session_unregister("ilMepRemove");
1039  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1040  }
1041 
1042 
1046  function copyToClipboard()
1047  {
1048  global $ilUser, $ilAccess;
1049 
1050  $this->checkPermission("write");
1051 
1052  if(!isset($_POST["id"]))
1053  {
1054  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1055  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1056  }
1057 
1058  foreach ($_POST["id"] as $obj_id)
1059  {
1061  if ($type == "fold")
1062  {
1063  ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
1064  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1065  }
1066  }
1067  foreach ($_POST["id"] as $obj_id)
1068  {
1069  $fid = ilMediaPoolItem::lookupForeignId($obj_id);
1071  if ($type == "mob")
1072  {
1073  $ilUser->addObjectToClipboard($fid, "mob", "");
1074  }
1075  if ($type == "pg")
1076  {
1077  $ilUser->addObjectToClipboard($obj_id, "incl", "");
1078  }
1079  }
1080  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"),true);
1081  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1082  }
1083 
1087  function addLocatorItems()
1088  {
1089  global $ilLocator;
1090 
1091  if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer")
1092  {
1093  $tree =& $this->object->getTree();
1094  $obj_id = ($_GET["mepitem_id"] == "")
1095  ? $tree->getRootId()
1096  : $_GET["mepitem_id"];
1097  $path = $tree->getPathFull($obj_id);
1098  foreach($path as $node)
1099  {
1100  if ($node["child"] == $tree->getRootId())
1101  {
1102  $this->ctrl->setParameter($this, "mepitem_id", "");
1103  $link = $this->ctrl->getLinkTarget($this, "listMedia");
1104  $title = $this->object->getTitle();
1105  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1106  $ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
1107  }
1108  else
1109  {
1110  $this->ctrl->setParameter($this, "mepitem_id", $node["child"]);
1111  $link = $this->ctrl->getLinkTarget($this, "listMedia");
1112  $title = $node["title"];
1113  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1114  $ilLocator->addItem($title, $link);
1115  }
1116  }
1117  }
1118  }
1119 
1123 
1127  function createFolderForm()
1128  {
1129  global $ilAccess, $tpl;
1130 
1131  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
1132  {
1133  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1134  }
1135 
1136  $this->initFolderForm("create");
1137  $tpl->setContent($this->form->getHTML());
1138 
1139 /* $folder_gui =& new ilObjFolderGUI("", 0, false, false);
1140  $this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $_GET["obj_id"]);
1141  $folder_gui->setFormAction("save",
1142  $this->ctrl->getFormActionByClass("ilobjfoldergui"));
1143  $folder_gui->createObject();*/
1144 // $this->tpl->show();
1145  }
1146 
1153  function editFolder()
1154  {
1155  global $tpl;
1156 
1157  $this->initFolderForm();
1158  $this->getFolderValues();
1159  $tpl->setContent($this->form->getHTML());
1160  }
1161 
1165  public function getFolderValues()
1166  {
1167  $values = array();
1168 
1169  $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1170 
1171  $this->form->setValuesByArray($values);
1172  }
1173 
1177  public function saveFolder()
1178  {
1179  global $tpl, $lng, $ilCtrl;
1180 
1181  $this->initFolderForm("create");
1182  if ($this->form->checkInput())
1183  {
1184  if ($this->object->createFolder($_POST["title"], (int) $_GET["mepitem_id"]))
1185  {
1186  ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
1187  }
1188  $ilCtrl->redirect($this, "listMedia");
1189  }
1190 
1191  $this->form->setValuesByPost();
1192  $tpl->setContent($this->form->getHtml());
1193  }
1194 
1198  function updateFolder()
1199  {
1200  global $lng, $ilCtrl, $tpl;
1201 
1202  $this->initFolderForm("edit");
1203  if ($this->form->checkInput())
1204  {
1205  $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1206  $item->setTitle($_POST["title"]);
1207  $item->update();
1208  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1209  $ilCtrl->setParameter($this, "mepitem_id",
1210  $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1211  $ilCtrl->redirect($this, "listMedia");
1212  }
1213 
1214  $this->form->setValuesByPost();
1215  $tpl->setContent($this->form->getHtml());
1216  }
1217 
1223  public function initFolderForm($a_mode = "edit")
1224  {
1225  global $lng, $ilCtrl;
1226 
1227  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1228  $this->form = new ilPropertyFormGUI();
1229 
1230  // desc
1231  $ti = new ilTextInputGUI($lng->txt("title"), "title");
1232  $ti->setMaxLength(128);
1233  $ti->setRequired(true);
1234  $this->form->addItem($ti);
1235 
1236  // save and cancel commands
1237  if ($a_mode == "create")
1238  {
1239  $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1240  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1241  $this->form->setTitle($lng->txt("mep_new_folder"));
1242  }
1243  else
1244  {
1245  $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1246  $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1247  $this->form->setTitle($lng->txt("mep_edit_folder"));
1248  }
1249 
1250  $this->form->setFormAction($ilCtrl->getFormAction($this));
1251  }
1252 
1257  {
1258  global $ilCtrl;
1259  $ilCtrl->setParameter($this, "mepitem_id",
1260  $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1261  $ilCtrl->redirect($this, "listMedia");
1262  }
1263 
1267  function cancelSave()
1268  {
1269  global $ilCtrl;
1270  $ilCtrl->redirect($this, "listMedia");
1271  }
1272 
1276 
1281  {
1282  global $tpl;
1283  $this->initMediaPoolPageForm("create");
1284  $tpl->setContent($this->form->getHTML());
1285  }
1286 
1294  {
1295  global $tpl;
1296 
1297  $this->setMediaPoolPageTabs();
1298 
1299  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1300  $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1301  $mep_page_gui->getTabs();
1302 
1303  $this->initMediaPoolPageForm("edit");
1304  $this->getMediaPoolPageValues();
1305  $tpl->setContent($this->form->getHTML());
1306  }
1307 
1311  public function saveMediaPoolPage()
1312  {
1313  global $tpl, $lng, $ilCtrl;
1314 
1315  $this->initMediaPoolPageForm("create");
1316  if ($this->form->checkInput())
1317  {
1318  // create media pool item
1319  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1320  $item = new ilMediaPoolItem();
1321  $item->setTitle($_POST["title"]);
1322  $item->setType("pg");
1323  $item->create();
1324 
1325  if ($item->getId() > 0)
1326  {
1327  // put in tree
1328  $tree = $this->object->getTree();
1329  $parent = $_GET["mepitem_id"] > 0
1330  ? $_GET["mepitem_id"]
1331  : $tree->getRootId();
1332  $this->object->insertInTree($item->getId(), $parent);
1333 
1334  // create page
1335  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1336  $page = new ilMediaPoolPage();
1337  $page->setId($item->getId());
1338  $page->create();
1339 
1340  ilUtil::sendSuccess($lng->txt("mep_page_created"), true);
1341  }
1342  $ilCtrl->redirect($this, "listMedia");
1343  }
1344 
1345  $this->form->setValuesByPost();
1346  $tpl->setContent($this->form->getHtml());
1347  }
1348 
1353  {
1354  global $lng, $ilCtrl, $tpl;
1355 
1356  $this->initMediaPoolPageForm("edit");
1357  if ($this->form->checkInput())
1358  {
1359  $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1360  $item->setTitle($_POST["title"]);
1361  $item->update();
1362  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1363  $ilCtrl->redirect($this, "editMediaPoolPage");
1364  }
1365 
1366  $this->form->setValuesByPost();
1367  $tpl->setContent($this->form->getHtml());
1368  }
1374  public function initMediaPoolPageForm($a_mode = "edit")
1375  {
1376  global $lng, $ilCtrl;
1377 
1378  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1379  $this->form = new ilPropertyFormGUI();
1380 
1381  // title
1382  $ti = new ilTextInputGUI($lng->txt("title"), "title");
1383  $ti->setMaxLength(128);
1384  $ti->setRequired(true);
1385  $this->form->addItem($ti);
1386 
1387  // save and cancel commands
1388  if ($a_mode == "create")
1389  {
1390  $this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
1391  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1392  $this->form->setTitle($lng->txt("mep_new_content_snippet"));
1393  }
1394  else
1395  {
1396  $this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
1397  $this->form->setTitle($lng->txt("mep_edit_content_snippet"));
1398  }
1399 
1400  $this->form->setFormAction($ilCtrl->getFormAction($this));
1401  }
1402 
1406  public function getMediaPoolPageValues()
1407  {
1408  $values = array();
1409 
1410  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1411  $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1412 
1413  $this->form->setValuesByArray($values);
1414  }
1415 
1423  {
1424  global $ilTabs, $ilCtrl, $lng;
1425 
1426  $ilTabs->clearTargets();
1427  //$ilTabs->addTab("mep_pg_prop", $lng->txt("mep_page_properties"),
1428  // $ilCtrl->getLinkTarget($this, "editMediaPoolPage"));
1429  $ilTabs->addTarget("mep_page_properties", $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
1430  "editMediaPoolPage", get_class($this));
1431  $ilTabs->addTarget("cont_usage", $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
1432  "showMediaPoolPageUsages", get_class($this));
1433  $ilCtrl->setParameter($this, "mepitem_id", $this->object->tree->getParentId($_GET["mepitem_id"]));
1434  $ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
1435  $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1436  }
1437 
1442  {
1443  global $ilTabs, $ilCtrl, $lng, $tpl;
1444 
1445  $this->setMediaPoolPageTabs();
1446 
1447  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1448  $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1449  $mep_page_gui->getTabs();
1450 
1451  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1452  $page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
1453 
1454  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1455  $table = new ilMediaPoolPageUsagesTableGUI($this, "showMediaPoolPageUsages", $page);
1456 
1457  $tpl->setContent($table->getHTML());
1458 
1459  }
1460 
1461 
1465 
1469  function setTabs()
1470  {
1471  global $ilAccess, $ilTabs, $ilCtrl;
1472 
1473  if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1474  $ilAccess->checkAccess('write', '', $this->ref_id))
1475  {
1476  $ilTabs->addTarget("objs_fold", $this->ctrl->getLinkTarget($this, ""),
1477  "listMedia", "", "_top");
1478 
1479  $ilCtrl->setParameter($this, "mepitem_id", "");
1480  $ilTabs->addTarget("mep_all_mobs", $this->ctrl->getLinkTarget($this, "allMedia"),
1481  "allMedia", "", "_top");
1482  $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1483  }
1484 
1485  // info tab
1486  if ($ilAccess->checkAccess('visible', '', $this->ref_id))
1487  {
1488  $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
1489  || strtolower($_GET["cmdClass"]) == "ilnotegui")
1490  ? true
1491  : false;
1492  //echo "-$force_active-";
1493  $ilTabs->addTarget("info_short",
1494  $this->ctrl->getLinkTargetByClass(
1495  array("ilobjmediapoolgui", "ilinfoscreengui"), "showSummary"),
1496  array("showSummary", "infoScreen"),
1497  "", "", $force_active);
1498  }
1499 
1500  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1501  {
1502  $ilTabs->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"),
1503  "edit", array("", "ilobjmediapoolgui"));
1504  }
1505 
1506  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1507  {
1508  $ilTabs->addTarget("clipboard", $this->ctrl->getLinkTarget($this, "openClipboard"),
1509  "view", "ileditclipboardgui");
1510  }
1511 
1512  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1513  {
1514  $ilTabs->addTarget("export", $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1515  "", "ilexportgui");
1516  }
1517 
1518  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1519  {
1520  $ilTabs->addTarget("perm_settings",
1521  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1522  }
1523 
1524  }
1525 
1526 
1530  function _goto($a_target)
1531  {
1532  global $ilAccess, $ilErr, $lng;
1533 
1534  $targets = explode('_',$a_target);
1535  if(count((array) $targets) > 1)
1536  {
1537  $ref_id = $targets[0];
1538  $subitem_id = $targets[1];
1539  }
1540  else
1541  {
1542  $ref_id = $targets[0];
1543  }
1544 
1545  if ($ilAccess->checkAccess("read", "", $ref_id))
1546  {
1547  $_GET["cmd"] = "frameset";
1548  $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1549  $_GET["ref_id"] = $ref_id;
1550  $_GET['mepitem_id'] = $subitem_id;
1551  include("ilias.php");
1552  exit;
1553  }
1554  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1555  {
1556  $_GET["cmd"] = "frameset";
1557  $_GET["target"] = "";
1558  $_GET["ref_id"] = ROOT_FOLDER_ID;
1559  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1560  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
1561  include("repository.php");
1562  exit;
1563  }
1564 
1565  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1566  }
1567 
1573  function infoScreenObject()
1574  {
1575  $this->ctrl->setCmd("showSummary");
1576  $this->ctrl->setCmdClass("ilinfoscreengui");
1577  $this->infoScreen();
1578  }
1579 
1583  function infoScreen()
1584  {
1585  global $ilAccess;
1586 
1587  if (!$ilAccess->checkAccess("visible", "", $this->ref_id))
1588  {
1589  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1590  }
1591 
1592  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1593  $info = new ilInfoScreenGUI($this);
1594 
1595  $info->enablePrivateNotes();
1596 
1597  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1598  {
1599  //$info->enableNews();
1600  }
1601 
1602  // no news editing for files, just notifications
1603 // $info->enableNewsEditing(false);
1604  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1605  {
1606 // $news_set = new ilSetting("news");
1607 // $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1608 
1609 // if ($enable_internal_rss)
1610 // {
1611 // $info->setBlockProperty("news", "settings", true);
1612 // $info->setBlockProperty("news", "public_notifications_option", true);
1613 // }
1614  }
1615 
1616 
1617  // standard meta data
1618  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
1619 
1620  // forward the command
1621  $this->ctrl->forwardCommand($info);
1622 
1623 // $this->tpl->show();
1624  }
1625 
1626 }
1627 ?>