ILIAS  Release_4_0_x_branch Revision 61816
 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  default:
277  $this->prepareOutput();
278  $cmd = $this->ctrl->getCmd("frameset");
279  $this->$cmd();
280  if (!$this->getCreationMode())
281  {
282  $this->tpl->show();
283  }
284  break;
285  }
286  }
287 
288 
289  function createMediaObject()
290  {
291  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
292  }
293 
294  // for admin compatiblity
295  function view()
296  {
297  $this->viewObject();
298  }
299 
305  public function initEditForm($a_mode = "edit", $a_new_type = "")
306  {
307  global $lng, $ilCtrl;
308 
309  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
310  $this->form = new ilPropertyFormGUI();
311  if ($a_mode != "edit")
312  {
313  $this->form->setTarget("_top");
314  }
315 
316  // title
317  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
318  $ti->setMaxLength(128);
319  $ti->setSize(40);
320  $ti->setRequired(true);
321  $this->form->addItem($ti);
322 
323  // description
324  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
325  $ta->setCols(40);
326  $ta->setRows(2);
327  $this->form->addItem($ta);
328 
329  if ($a_mode == "edit")
330  {
331  // default width
332  $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
333  $ni->setMinValue(0);
334  $ni->setMaxLength(5);
335  $ni->setSize(5);
336  $this->form->addItem($ni);
337 
338  // default height
339  $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
340  $ni->setMinValue(0);
341  $ni->setMaxLength(5);
342  $ni->setSize(5);
343  $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
344  $this->form->addItem($ni);
345  }
346 
347  // save and cancel commands
348  if ($a_mode == "create")
349  {
350  $this->form->addCommandButton("save", $lng->txt($a_new_type."_add"));
351  $this->form->addCommandButton("cancelCreation", $lng->txt("cancel"));
352  $this->form->setTitle($lng->txt($a_new_type."_new"));
353  }
354  else
355  {
356  $this->form->addCommandButton("update", $lng->txt("save"));
357  //$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
358  $this->form->setTitle($lng->txt("edit"));
359  }
360 
361  $this->form->setFormAction($ilCtrl->getFormAction($this));
362 
363  }
364 
368  function getEditFormValues()
369  {
370  $values["title"] = $this->object->getTitle();
371  $values["desc"] = $this->object->getDescription();
372  if ($this->object->getDefaultWidth() > 0)
373  {
374  $values["default_width"] = $this->object->getDefaultWidth();
375  }
376  if ($this->object->getDefaultHeight() > 0)
377  {
378  $values["default_height"] = $this->object->getDefaultHeight();
379  }
380  $this->form->setValuesByArray($values);
381  }
382 
387  function afterSave($newObj)
388  {
389  // always send a message
390  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
391 
392  //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
393  ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId()."&cmd=edit");
394  }
395 
401  function editObject()
402  {
403  global $ilAccess, $tree, $tpl;
404 
405  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
406  {
407  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
408  }
409 
410  // edit button
411  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
412 
414  }
415 
419  function edit()
420  {
421  $this->editObject();
422 // $this->tpl->show();
423  }
424 
428  protected function cancel()
429  {
430  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
431  }
432 
436  function update()
437  {
438  global $ilAccess;
439 
440  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
441  {
442  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
443  }
444 
445  $this->updateObject();
446  }
447 
453  function updateObject()
454  {
455  global $lng, $tpl;
456 
457  $this->initEditForm("edit");
458  if ($this->form->checkInput())
459  {
460  $this->object->setTitle($_POST["title"]);
461  $this->object->setDescription($_POST["desc"]);
462  $this->object->setDefaultWidth($_POST["default_width"]);
463  $this->object->setDefaultHeight($_POST["default_height"]);
464  $this->update = $this->object->update();
465  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
466  $this->afterUpdate();
467  return;
468  }
469  $this->form->setValuesByPost();
470  $tpl->setContent($this->form->getHtml());
471  }
472 
473  function afterUpdate()
474  {
475  $this->ctrl->redirect($this, "edit");
476  }
477 
481  function listMedia()
482  {
483  global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl;
484 
485  $ilCtrl->setParameter($this, "mep_mode", "listMedia");
486 
487  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
488  {
489  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
490  }
491  $ilTabs->setTabActive("objs_fold");
492  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
493  $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
494  $tpl->setContent($mep_table_gui->getHTML());
495 // $this->tpl->show();
496  }
497 
501  function allMedia()
502  {
503  global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl;
504 
505  $ilCtrl->setParameter($this, "mep_mode", "allMedia");
506 
507  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
508  {
509  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
510  }
511  $ilTabs->setTabActive("mep_all_mobs");
512  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
513  $mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
514  "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
515  $tpl->setContent($mep_table_gui->getHTML());
516 // $this->tpl->show();
517  }
518 
522  function applyFilter()
523  {
524  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
525  $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
526  "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
527  $mtab->writeFilterToSession();
528  $mtab->resetOffset();
529  $this->allMedia();
530  }
531 
535  function resetFilter()
536  {
537  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
538  $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
539  "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
540  $mtab->resetFilter();
541  $mtab->resetOffset();
542  $this->allMedia();
543  }
544 
548  function getTemplate()
549  {
550  $this->tpl->getStandardTemplate();
551  }
552 
553 
557  function getParentFolderId()
558  {
559  if ($_GET["mepitem_id"] == "")
560  {
561  return "";
562  }
563  $par_id = $this->object->tree->getParentId($_GET["mepitem_id"]);
564  if ($par_id != $this->object->tree->getRootId())
565  {
566  return $par_id;
567  }
568  else
569  {
570  return "";
571  }
572  }
573 
578 /*
579  function showUpperIcon()
580  {
581  global $tpl;
582 
583  if ($this->ctrl->getCmd() == "explorer")
584  {
585  return;
586  }
587 
588  parent::showUpperIcon();
589 
590  $mep_tree =& $this->object->getTree();
591  if ($_GET["obj_id"] != "" && $_GET["obj_id"] != $mep_tree->getRootId())
592  {
593  $this->ctrl->setParameter($this, "obj_id",
594  $this->getParentFolderId());
595  $tpl->setUpperIcon($this->ctrl->getLinkTarget($this, "listMedia"));
596  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
597  }
598  }
599 */
600 
606  function frameset()
607  {
608  include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
609  $fs_gui = new ilFramesetGUI();
610  $fs_gui->setMainFrameName("content");
611  $fs_gui->setSideFrameName("tree");
612  $fs_gui->setMainFrameSource(
613  $this->ctrl->getLinkTarget($this, "listMedia"));
614  $this->ctrl->setParameter($this, "expand", "1");
615  $fs_gui->setSideFrameSource(
616  $this->ctrl->getLinkTarget($this, "explorer"));
617  $fs_gui->setFramesetTitle($this->object->getTitle());
618  $fs_gui->show();
619  exit;
620  }
621 
628  {
629  include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
630  $fs_gui = new ilFramesetGUI();
631  $fs_gui->setMainFrameName("content");
632  $fs_gui->setSideFrameName("tree");
633  $fs_gui->setMainFrameSource(
634  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
635  $this->ctrl->setParameter($this, "expand", "1");
636  $fs_gui->setSideFrameSource(
637  $this->ctrl->getLinkTarget($this, "explorer"));
638  $fs_gui->setFramesetTitle($this->object->getTitle());
639  $fs_gui->show();
640  exit;
641  }
642 
646  function explorer()
647  {
648  global $ilAccess, $ilCtrl;
649 
650  $ilCtrl->setParameter($this, "obj_id", "");
651  $ilCtrl->setParameter($this, "mepitem_id", "");
652 
653  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()) ||
654  !$ilAccess->checkAccess("write", "", $this->object->getRefId()))
655  {
656  return;
657  }
658 
659  require_once ("./Modules/MediaPool/classes/class.ilMediaPoolExplorer.php");
660  $exp = new ilMediaPoolExplorer($this->ctrl->getLinkTarget($this, "listMedia"), $this->object);
661  $exp->setUseStandardFrame(true);
662  $exp->setTargetGet("mepitem_id");
663  $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "explorer"));
664  $exp->setTitle($this->lng->txt("cont_mep_structure"));
665 
666  $exp->addFilter("dummy");
667  $exp->addFilter("fold");
668  $exp->setFiltered(true);
669  $exp->setFilterMode(IL_FM_POSITIVE);
670 
671 
672  if ($_GET["mepexpand"] == "")
673  {
674  $mep_tree =& $this->object->getTree();
675  $expanded = $mep_tree->readRootId();
676  }
677  else
678  {
679  $expanded = $_GET["mepexpand"];
680  }
681 
682  $exp->setExpand($expanded);
683 
684  // build html-output
685  $exp->setOutput(0);
686  $output = $exp->getOutput();
687  echo $output;
688  exit;
689 /* $this->tpl->setCurrentBlock("content");
690  $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_mep_structure"));
691  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
692  $this->tpl->setVariable("EXPLORER",$output);
693  $this->ctrl->setParameter($this, "mepexpand", $_GET["mepexpand"]);
694  $this->tpl->setVariable("ACTION",
695  $this->ctrl->getLinkTarget($this, "explorer"));
696  $this->tpl->parseCurrentBlock();
697  $this->tpl->show(false);
698 */
699  }
700 
704  function showMedia()
705  {
706  global $ilAccess;
707 
708  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
709  {
710  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
711  }
712 
713  $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
714  include_once("Services/Style/classes/class.ilObjStyleSheet.php");
715  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
716  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
718 
719  //$int_links = $page_object->getInternalLinks();
720  $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
721 
722  // later
723  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
724 
725  $link_xlm = "";
726 
727  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
728  $media_obj =& new ilObjMediaObject($_GET["mob_id"]);
729 
730  $xml = "<dummy>";
731  // todo: we get always the first alias now (problem if mob is used multiple
732  // times in page)
733  $xml.= $media_obj->getXML(IL_MODE_ALIAS);
734  $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
735  $xml.= $link_xml;
736  $xml.="</dummy>";
737 
738  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
739  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
740  $xh = xslt_create();
741 
742  $wb_path = ilUtil::getWebspaceDir("output");
743 
744  $mode = ($_GET["cmd"] != "showMedia")
745  ? "fullscreen"
746  : "media";
747  $enlarge_path = ilUtil::getImagePath("enlarge.gif", false, "output");
748  $fullscreen_link =
749  $this->ctrl->getLinkTarget($this, "showFullscreen");
750  $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
751  'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
752  'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
753  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
754  echo xslt_error($xh);
755  xslt_free($xh);
756 
757  // unmask user html
758  $this->tpl->setVariable("MEDIA_CONTENT", $output);
759 
760  $this->tpl->parseCurrentBlock();
761 // $this->tpl->show();
762  }
763 
767  function showFullscreen()
768  {
769  $this->showMedia();
770  }
771 
775  function confirmRemove()
776  {
777  global $ilAccess, $ilCtrl, $lng;
778 
779  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
780  {
781  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
782  }
783 
784  if(!isset($_POST["id"]))
785  {
786  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
787  }
788 
789  //$this->prepareOutput();
790 
791  // SAVE POST VALUES
792  $_SESSION["ilMepRemove"] = $_POST["id"];
793 
794  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.confirm_deletion.html", "Modules/MediaPool");
795 
796  ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
797 
798  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
799 
800  // BEGIN TABLE HEADER
801  $this->tpl->setCurrentBlock("table_header");
802  $this->tpl->setVariable("TEXT",$this->lng->txt("objects"));
803  $this->tpl->parseCurrentBlock();
804 
805  // BEGIN TABLE DATA
806  $counter = 0;
807  foreach($_POST["id"] as $obj_id)
808  {
811 
812  // check whether page can be removed
813  if ($type == "pg")
814  {
815  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
816  $usages = ilPageContentUsage::getUsages("incl", $obj_id);
817  if (count($usages) > 0)
818  {
819  ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
820  $ilCtrl->redirect($this, "listMedia");
821  }
822  }
823 
824  $this->tpl->setCurrentBlock("table_row");
825  $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
826  $this->tpl->setVariable("TEXT_CONTENT", $title);
827  $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_".$type.".gif"));
828  $this->tpl->parseCurrentBlock();
829  }
830 
831  // cancel/confirm button
832  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
833  $buttons = array( "cancelRemove" => $this->lng->txt("cancel"),
834  "remove" => $this->lng->txt("confirm"));
835  foreach ($buttons as $name => $value)
836  {
837  $this->tpl->setCurrentBlock("operation_btn");
838  $this->tpl->setVariable("BTN_NAME",$name);
839  $this->tpl->setVariable("BTN_VALUE",$value);
840  $this->tpl->parseCurrentBlock();
841  }
842 // $this->tpl->show();
843  }
844 
848  function openClipboard()
849  {
850  global $ilCtrl, $ilAccess;
851 
852  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
853  {
854  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
855  }
856 
857  $ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
858  rawurlencode($ilCtrl->getLinkTarget($this,
859  "insertFromClipboard")));
860  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
861  }
862 
863 
868  {
869  global $ilAccess;
870 
871  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
872  {
873  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
874  }
875 
876  include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
878  $not_inserted = array();
879  if (is_array($ids))
880  {
881  foreach ($ids as $id2)
882  {
883  $id = explode(":", $id2);
884  $type = $id[0];
885  $id = $id[1];
886 
887  if ($type == "mob") // media object
888  {
889  if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
890  {
891  $not_inserted[] = ilObject::_lookupTitle($id)." [".
892  $id."]";
893  }
894  else
895  {
896  $item = new ilMediaPoolItem();
897  $item->setType("mob");
898  $item->setForeignId($id);
899  $item->setTitle(ilObject::_lookupTitle($id));
900  $item->create();
901  if ($item->getId() > 0)
902  {
903  $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
904  }
905  }
906  }
907  if ($type == "incl") // content snippet
908  {
909  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
910  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
911  if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
912  {
913  $not_inserted[] = ilMediaPoolPage::lookupTitle($id)." [".
914  $id."]";
915  }
916  else
917  {
918  $original = new ilMediaPoolPage($id);
919 
920  // copy the page into the pool
921  $item = new ilMediaPoolItem();
922  $item->setType("pg");
923  $item->setTitle(ilMediaPoolItem::lookupTitle($id));
924  $item->create();
925  if ($item->getId() > 0)
926  {
927  $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
928 
929  // create page
930  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
931  $page = new ilMediaPoolPage();
932  $page->setId($item->getId());
933  $page->create();
934 
935  // copy content
936  $page->setXMLContent($original->copyXMLContent());
937  $page->buildDom();
938  $page->update();
939  }
940  }
941  }
942  }
943  }
944  if (count($not_inserted) > 0)
945  {
946  ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist")."<br>".
947  implode($not_inserted,"<br>"), true);
948  }
949  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
950  }
951 
952 
956  function cancelRemove()
957  {
958  session_unregister("ilMepRemove");
959  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
960  }
961 
965  function remove()
966  {
967  global $ilAccess;
968 
969  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
970  {
971  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
972  }
973 
974  foreach($_SESSION["ilMepRemove"] as $obj_id)
975  {
976  $this->object->deleteChild($obj_id);
977  }
978 
979  ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"),true);
980  session_unregister("ilMepRemove");
981  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
982  }
983 
984 
988  function copyToClipboard()
989  {
990  global $ilUser, $ilAccess;
991 
992  $this->checkPermission("write");
993 
994  if(!isset($_POST["id"]))
995  {
996  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
997  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
998  }
999 
1000  foreach ($_POST["id"] as $obj_id)
1001  {
1003  if ($type == "fold")
1004  {
1005  ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
1006  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1007  }
1008  }
1009  foreach ($_POST["id"] as $obj_id)
1010  {
1011  $fid = ilMediaPoolItem::lookupForeignId($obj_id);
1013  if ($type == "mob")
1014  {
1015  $ilUser->addObjectToClipboard($fid, "mob", "");
1016  }
1017  if ($type == "pg")
1018  {
1019  $ilUser->addObjectToClipboard($obj_id, "incl", "");
1020  }
1021  }
1022  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"),true);
1023  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1024  }
1025 
1029  function addLocatorItems()
1030  {
1031  global $ilLocator;
1032 
1033  if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer")
1034  {
1035  $tree =& $this->object->getTree();
1036  $obj_id = ($_GET["mepitem_id"] == "")
1037  ? $tree->getRootId()
1038  : $_GET["mepitem_id"];
1039  $path = $tree->getPathFull($obj_id);
1040  foreach($path as $node)
1041  {
1042  if ($node["child"] == $tree->getRootId())
1043  {
1044  $this->ctrl->setParameter($this, "mepitem_id", "");
1045  $link = $this->ctrl->getLinkTarget($this, "listMedia");
1046  $title = $this->object->getTitle();
1047  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1048  $ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
1049  }
1050  else
1051  {
1052  $this->ctrl->setParameter($this, "mepitem_id", $node["child"]);
1053  $link = $this->ctrl->getLinkTarget($this, "listMedia");
1054  $title = $node["title"];
1055  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1056  $ilLocator->addItem($title, $link);
1057  }
1058  }
1059  }
1060  }
1061 
1065 
1069  function createFolderForm()
1070  {
1071  global $ilAccess, $tpl;
1072 
1073  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
1074  {
1075  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1076  }
1077 
1078  $this->initFolderForm("create");
1079  $tpl->setContent($this->form->getHTML());
1080 
1081 /* $folder_gui =& new ilObjFolderGUI("", 0, false, false);
1082  $this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $_GET["obj_id"]);
1083  $folder_gui->setFormAction("save",
1084  $this->ctrl->getFormActionByClass("ilobjfoldergui"));
1085  $folder_gui->createObject();*/
1086 // $this->tpl->show();
1087  }
1088 
1095  function editFolder()
1096  {
1097  global $tpl;
1098 
1099  $this->initFolderForm();
1100  $this->getFolderValues();
1101  $tpl->setContent($this->form->getHTML());
1102  }
1103 
1107  public function getFolderValues()
1108  {
1109  $values = array();
1110 
1111  $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1112 
1113  $this->form->setValuesByArray($values);
1114  }
1115 
1119  public function saveFolder()
1120  {
1121  global $tpl, $lng, $ilCtrl;
1122 
1123  $this->initFolderForm("create");
1124  if ($this->form->checkInput())
1125  {
1126  // perform save
1127  $mep_item = new ilMediaPoolItem();
1128  $mep_item->setTitle($_POST["title"]);
1129  $mep_item->setType("fold");
1130  $mep_item->create();
1131  if ($mep_item->getId() > 0)
1132  {
1133  $tree = $this->object->getTree();
1134  $parent = $_GET["mepitem_id"] > 0
1135  ? $_GET["mepitem_id"]
1136  : $tree->getRootId();
1137  $this->object->insertInTree($mep_item->getId(), $parent);
1138  ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
1139  }
1140 
1141  $ilCtrl->redirect($this, "listMedia");
1142  }
1143 
1144  $this->form->setValuesByPost();
1145  $tpl->setContent($this->form->getHtml());
1146  }
1147 
1151  function updateFolder()
1152  {
1153  global $lng, $ilCtrl, $tpl;
1154 
1155  $this->initFolderForm("edit");
1156  if ($this->form->checkInput())
1157  {
1158  $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1159  $item->setTitle($_POST["title"]);
1160  $item->update();
1161  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1162  $ilCtrl->setParameter($this, "mepitem_id",
1163  $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1164  $ilCtrl->redirect($this, "listMedia");
1165  }
1166 
1167  $this->form->setValuesByPost();
1168  $tpl->setContent($this->form->getHtml());
1169  }
1170 
1176  public function initFolderForm($a_mode = "edit")
1177  {
1178  global $lng, $ilCtrl;
1179 
1180  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1181  $this->form = new ilPropertyFormGUI();
1182 
1183  // desc
1184  $ti = new ilTextInputGUI($lng->txt("title"), "title");
1185  $ti->setMaxLength(128);
1186  $ti->setRequired(true);
1187  $this->form->addItem($ti);
1188 
1189  // save and cancel commands
1190  if ($a_mode == "create")
1191  {
1192  $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1193  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1194  $this->form->setTitle($lng->txt("mep_new_folder"));
1195  }
1196  else
1197  {
1198  $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1199  $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1200  $this->form->setTitle($lng->txt("mep_edit_folder"));
1201  }
1202 
1203  $this->form->setFormAction($ilCtrl->getFormAction($this));
1204  }
1205 
1210  {
1211  global $ilCtrl;
1212  $ilCtrl->setParameter($this, "mepitem_id",
1213  $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1214  $ilCtrl->redirect($this, "listMedia");
1215  }
1216 
1220  function cancelSave()
1221  {
1222  global $ilCtrl;
1223  $ilCtrl->redirect($this, "listMedia");
1224  }
1225 
1229 
1234  {
1235  global $tpl;
1236  $this->initMediaPoolPageForm("create");
1237  $tpl->setContent($this->form->getHTML());
1238  }
1239 
1247  {
1248  global $tpl;
1249 
1250  $this->setMediaPoolPageTabs();
1251 
1252  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1253  $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1254  $mep_page_gui->getTabs();
1255 
1256  $this->initMediaPoolPageForm("edit");
1257  $this->getMediaPoolPageValues();
1258  $tpl->setContent($this->form->getHTML());
1259  }
1260 
1264  public function saveMediaPoolPage()
1265  {
1266  global $tpl, $lng, $ilCtrl;
1267 
1268  $this->initMediaPoolPageForm("create");
1269  if ($this->form->checkInput())
1270  {
1271  // create media pool item
1272  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1273  $item = new ilMediaPoolItem();
1274  $item->setTitle($_POST["title"]);
1275  $item->setType("pg");
1276  $item->create();
1277 
1278  if ($item->getId() > 0)
1279  {
1280  // put in tree
1281  $tree = $this->object->getTree();
1282  $parent = $_GET["mepitem_id"] > 0
1283  ? $_GET["mepitem_id"]
1284  : $tree->getRootId();
1285  $this->object->insertInTree($item->getId(), $parent);
1286 
1287  // create page
1288  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1289  $page = new ilMediaPoolPage();
1290  $page->setId($item->getId());
1291  $page->create();
1292 
1293  ilUtil::sendSuccess($lng->txt("mep_page_created"), true);
1294  }
1295  $ilCtrl->redirect($this, "listMedia");
1296  }
1297 
1298  $this->form->setValuesByPost();
1299  $tpl->setContent($this->form->getHtml());
1300  }
1301 
1306  {
1307  global $lng, $ilCtrl, $tpl;
1308 
1309  $this->initMediaPoolPageForm("edit");
1310  if ($this->form->checkInput())
1311  {
1312  $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1313  $item->setTitle($_POST["title"]);
1314  $item->update();
1315  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1316  $ilCtrl->redirect($this, "editMediaPoolPage");
1317  }
1318 
1319  $this->form->setValuesByPost();
1320  $tpl->setContent($this->form->getHtml());
1321  }
1327  public function initMediaPoolPageForm($a_mode = "edit")
1328  {
1329  global $lng, $ilCtrl;
1330 
1331  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1332  $this->form = new ilPropertyFormGUI();
1333 
1334  // title
1335  $ti = new ilTextInputGUI($lng->txt("title"), "title");
1336  $ti->setMaxLength(128);
1337  $ti->setRequired(true);
1338  $this->form->addItem($ti);
1339 
1340  // save and cancel commands
1341  if ($a_mode == "create")
1342  {
1343  $this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
1344  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1345  $this->form->setTitle($lng->txt("mep_new_content_snippet"));
1346  }
1347  else
1348  {
1349  $this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
1350  $this->form->setTitle($lng->txt("mep_edit_content_snippet"));
1351  }
1352 
1353  $this->form->setFormAction($ilCtrl->getFormAction($this));
1354  }
1355 
1359  public function getMediaPoolPageValues()
1360  {
1361  $values = array();
1362 
1363  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1364  $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1365 
1366  $this->form->setValuesByArray($values);
1367  }
1368 
1376  {
1377  global $ilTabs, $ilCtrl, $lng;
1378 
1379  $ilTabs->clearTargets();
1380  //$ilTabs->addTab("mep_pg_prop", $lng->txt("mep_page_properties"),
1381  // $ilCtrl->getLinkTarget($this, "editMediaPoolPage"));
1382  $ilTabs->addTarget("mep_page_properties", $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
1383  "editMediaPoolPage", get_class($this));
1384  $ilTabs->addTarget("cont_usage", $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
1385  "showMediaPoolPageUsages", get_class($this));
1386  $ilCtrl->setParameter($this, "mepitem_id", $this->object->tree->getParentId($_GET["mepitem_id"]));
1387  $ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
1388  $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1389  }
1390 
1395  {
1396  global $ilTabs, $ilCtrl, $lng, $tpl;
1397 
1398  $this->setMediaPoolPageTabs();
1399 
1400  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1401  $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1402  $mep_page_gui->getTabs();
1403 
1404  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1405  $page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
1406 
1407  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1408  $table = new ilMediaPoolPageUsagesTableGUI($this, "showMediaPoolPageUsages", $page);
1409 
1410  $tpl->setContent($table->getHTML());
1411 
1412  }
1413 
1414 
1418 
1422  function setTabs()
1423  {
1424  global $ilAccess, $ilTabs, $ilCtrl;
1425 
1426  if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1427  $ilAccess->checkAccess('write', '', $this->ref_id))
1428  {
1429  $ilTabs->addTarget("objs_fold", $this->ctrl->getLinkTarget($this, ""),
1430  "listMedia", "", "_top");
1431 
1432  $ilCtrl->setParameter($this, "mepitem_id", "");
1433  $ilTabs->addTarget("mep_all_mobs", $this->ctrl->getLinkTarget($this, "allMedia"),
1434  "allMedia", "", "_top");
1435  $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1436  }
1437 
1438  // info tab
1439  if ($ilAccess->checkAccess('visible', '', $this->ref_id))
1440  {
1441  $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
1442  || strtolower($_GET["cmdClass"]) == "ilnotegui")
1443  ? true
1444  : false;
1445  //echo "-$force_active-";
1446  $ilTabs->addTarget("info_short",
1447  $this->ctrl->getLinkTargetByClass(
1448  array("ilobjmediapoolgui", "ilinfoscreengui"), "showSummary"),
1449  array("showSummary", "infoScreen"),
1450  "", "", $force_active);
1451  }
1452 
1453  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1454  {
1455  $ilTabs->addTarget("edit_properties", $this->ctrl->getLinkTarget($this, "edit"),
1456  "edit", array("", "ilobjmediapoolgui"));
1457  }
1458 
1459  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1460  {
1461  $ilTabs->addTarget("perm_settings",
1462  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1463  }
1464 
1465  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1466  {
1467  $ilTabs->addTarget("clipboard", $this->ctrl->getLinkTarget($this, "openClipboard"),
1468  "view", "ileditclipboardgui");
1469  }
1470  }
1471 
1472 
1476  function _goto($a_target)
1477  {
1478  global $ilAccess, $ilErr, $lng;
1479 
1480  if ($ilAccess->checkAccess("read", "", $a_target))
1481  {
1482  $_GET["cmd"] = "frameset";
1483  $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1484  $_GET["ref_id"] = $a_target;
1485  include("ilias.php");
1486  exit;
1487  } else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1488  {
1489  $_GET["cmd"] = "frameset";
1490  $_GET["target"] = "";
1491  $_GET["ref_id"] = ROOT_FOLDER_ID;
1492  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1493  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
1494  include("repository.php");
1495  exit;
1496  }
1497 
1498  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1499  }
1500 
1506  function infoScreenObject()
1507  {
1508  $this->ctrl->setCmd("showSummary");
1509  $this->ctrl->setCmdClass("ilinfoscreengui");
1510  $this->infoScreen();
1511  }
1512 
1516  function infoScreen()
1517  {
1518  global $ilAccess;
1519 
1520  if (!$ilAccess->checkAccess("visible", "", $this->ref_id))
1521  {
1522  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1523  }
1524 
1525  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1526  $info = new ilInfoScreenGUI($this);
1527 
1528  $info->enablePrivateNotes();
1529 
1530  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1531  {
1532  //$info->enableNews();
1533  }
1534 
1535  // no news editing for files, just notifications
1536 // $info->enableNewsEditing(false);
1537  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1538  {
1539 // $news_set = new ilSetting("news");
1540 // $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1541 
1542 // if ($enable_internal_rss)
1543 // {
1544 // $info->setBlockProperty("news", "settings", true);
1545 // $info->setBlockProperty("news", "public_notifications_option", true);
1546 // }
1547  }
1548 
1549 
1550  // standard meta data
1551  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
1552 
1553  // forward the command
1554  $this->ctrl->forwardCommand($info);
1555 
1556 // $this->tpl->show();
1557  }
1558 
1559 }
1560 ?>