ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilPCMediaObjectGUI.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 require_once("./Services/COPage/classes/class.ilPageContentGUI.php");
5 require_once("./Services/COPage/classes/class.ilMediaAliasItem.php");
6 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
7 
20 // Todo: extend ilObjMediaObjectGUI !?
22 {
26  protected $tabs;
27 
31  protected $access;
32 
36  protected $toolbar;
37 
41  protected $user;
42 
46  protected $ui;
47 
51  protected $pool_view;
52 
53  public $header;
54  public $ctrl;
55 
59  protected $sub_cmd;
60 
64  protected $media_type;
65 
66  public function __construct(ilPageObject $a_pg_obj, $a_content_obj, $a_hier_id = 0, $a_pc_id = "")
67  {
68  global $DIC;
69 
70  $this->tpl = $DIC["tpl"];
71  $this->lng = $DIC->language();
72  $this->tabs = $DIC->tabs();
73  $this->access = $DIC->access();
74  $this->toolbar = $DIC->toolbar();
75  $this->user = $DIC->user();
76  $ilCtrl = $DIC->ctrl();
77  $this->ui = $DIC->ui();
78 
79  $this->media_type = new ILIAS\MediaObjects\MediaType\MediaType();
80 
81  if ($_GET["pcid"] != "" && $a_hier_id == "") {
82  $hier_ids = $a_pg_obj->getHierIdsForPCIds([$_GET["pcid"]]);
83  $a_hier_id = $hier_ids[$_GET["pcid"]];
84  $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
85  }
86 
87  $this->pool_view = "folder";
88  if (in_array($_GET["pool_view"], array("folder", "all"))) {
89  $this->pool_view = $_GET["pool_view"];
90  }
91 
92  $this->ctrl = $ilCtrl;
93 
94  $this->ctrl->saveParameter($this, ["pool_view", "pcid"]);
95 
96  // var_dump($_POST);
97  //ilUtil::printBacktrace(10); exit;
98  //echo "constructor target:".$_SESSION["il_map_il_target"].":<br>";
99  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
100 
101  $this->setCharacteristics(self::_getStandardCharacteristics());
102  }
103 
109  public function setSubCmd($a_val)
110  {
111  $this->sub_cmd = $a_val;
112  }
113 
119  public function getSubCmd()
120  {
121  return $this->sub_cmd;
122  }
123 
124 
125  public function setHeader($a_title = "")
126  {
127  $this->header = $a_title;
128  }
129 
130  public function getHeader()
131  {
132  return $this->header;
133  }
134 
140  public function setEnabledMapAreas($a_enabledmapareas)
141  {
142  $this->enabledmapareas = $a_enabledmapareas;
143  }
144 
150  public function getEnabledMapAreas()
151  {
152  return $this->enabledmapareas;
153  }
154 
158  public function executeCommand()
159  {
160  $tpl = $this->tpl;
161  $lng = $this->lng;
162  $ilTabs = $this->tabs;
163 
164  $this->getCharacteristicsOfCurrentStyle("media_cont"); // scorm-2004
165 
166  // get next class that processes or forwards current command
167  $next_class = $this->ctrl->getNextClass($this);
168 
169  // get current command
170  $cmd = $this->ctrl->getCmd();
171  if (is_object($this->content_obj)) {
172  //$this->tpl->clearHeader();
173  $tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
174  $this->getTabs($this->tabs_gui);
175 
176  $mob = $this->content_obj->getMediaObject();
177  if (is_object($mob)) {
178  $tpl->setTitle($lng->txt("mob") . ": " .
179  $this->content_obj->getMediaObject()->getTitle());
180  $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
181  $mob_gui->setBackTitle($this->page_back_title);
182  $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
183  $mob_gui->getTabs($this->tabs_gui);
184  }
185  } else {
186  }
187 
188  switch ($next_class) {
189  case "ilobjmediaobjectgui":
190  include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
191  //$this->tpl->clearHeader();
192  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
193  $this->tpl->setTitle($this->lng->txt("mob") . ": " .
194  $this->content_obj->getMediaObject()->getTitle());
195  $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
196  $mob_gui->setBackTitle($this->page_back_title);
197  $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
198  $ret = $this->ctrl->forwardCommand($mob_gui);
199  break;
200 
201  // instance image map editing
202  case "ilpcimagemapeditorgui":
203  require_once("./Services/COPage/classes/class.ilPCImageMapEditorGUI.php");
204  $ilTabs->setTabActive("cont_inst_map_areas");
205  $image_map_edit = new ilPCImageMapEditorGUI(
206  $this->content_obj,
207  $this->pg_obj
208  );
209  $ret = $this->ctrl->forwardCommand($image_map_edit);
210  $tpl->setContent($ret);
211  $this->checkFixSize();
212  break;
213 
214  default:
215  $ret = $this->$cmd();
216  break;
217  }
218 
219  return $ret;
220  }
221 
225  public function insert($a_post_cmd = "edpost", $a_submit_cmd = "create_mob", $a_input_error = false)
226  {
227  $ilTabs = $this->tabs;
228  $tpl = $this->tpl;
229  $ilCtrl = $this->ctrl;
230  $lng = $this->lng;
231 
232  if ($_GET["subCmd"] == "insertNew") {
233  $_SESSION["cont_media_insert"] = "insertNew";
234  }
235  if ($_GET["subCmd"] == "insertFromPool") {
236  $_SESSION["cont_media_insert"] = "insertFromPool";
237  }
238 
239  if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "") {
240  $_GET["subCmd"] = $_SESSION["cont_media_insert"];
241  }
242 
243  switch ($_GET["subCmd"]) {
244  case "insertFromPool":
245  $this->insertFromPool();
246  break;
247 
248  case "poolSelection":
249  $this->poolSelection();
250  break;
251 
252  case "selectPool":
253  $this->selectPool();
254  break;
255 
256  case "insertNew":
257  default:
258  $this->getTabs($ilTabs, true);
259  $ilTabs->setSubTabActive("cont_new_mob");
260 
261  include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
262  if ($a_input_error) {
263  $form = $this->form;
264  } else {
265  $mob_gui = new ilObjMediaObjectGUI("");
266  $mob_gui->initForm("create");
267  $form = $mob_gui->getForm();
268  }
269  $form->setFormAction($ilCtrl->getFormAction($this, "create_mob"));
270  $form->clearCommandButtons();
271  $form->addCommandButton("create_mob", $lng->txt("save"));
272  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
273 
274  $this->displayValidationError();
275 
276  $tpl->setContent($form->getHTML());
277 
278  break;
279  }
280  }
281 
285  public function changeObjectReference()
286  {
287  $ilTabs = $this->tabs;
288  $ilCtrl = $this->ctrl;
289  $lng = $this->lng;
290 
291  if ($_GET["subCmd"] == "insertNew") {
292  $_SESSION["cont_media_insert"] = "insertNew";
293  }
294  if ($_GET["subCmd"] == "insertFromPool") {
295  $_SESSION["cont_media_insert"] = "insertFromPool";
296  }
297 
298  if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "") {
299  $_GET["subCmd"] = $_SESSION["cont_media_insert"];
300  }
301 
302  switch ($_GET["subCmd"]) {
303  case "insertFromPool":
304  $this->insertFromPool(true);
305  break;
306 
307  case "poolSelection":
308  $this->poolSelection(true);
309  break;
310 
311  case "selectPool":
312  $this->selectPool(true);
313  break;
314 
315  case "insertNew":
316  default:
317  $ilCtrl->setParameter($this, "subCmd", "changeObjectReference");
318  $this->getTabs($ilTabs, true, true);
319  $ilTabs->setSubTabActive("cont_new_mob");
320 
321  $this->displayValidationError();
322 
323  $mob_gui = new ilObjMediaObjectGUI("");
324  $mob_gui->initForm("create");
325  $form = $mob_gui->getForm();
326  $form->setFormAction($ilCtrl->getFormAction($this));
327  $form->clearCommandButtons();
328  $form->addCommandButton("createNewObjectReference", $lng->txt("save"));
329  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
330  $this->tpl->setContent($form->getHTML());
331  }
332  }
333 
334 
338  protected function checkFixSize()
339  {
340  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
341  $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
342 
343  $ok = false;
344  if (($std_alias_item->getWidth() != "" && $std_alias_item->getHeight() != "")) {
345  $ok = true;
346  }
347  if ($std_alias_item->getWidth() == "" && $std_alias_item->getHeight() == ""
348  && $std_item->getWidth() != "" && $std_item->getHeight() != "") {
349  $ok = true;
350  }
351 
352  if (!$ok) {
353  ilUtil::sendFailure($this->lng->txt("mob_no_fixed_size_map_editing"));
354  }
355  }
356 
360  public function insertFromPool($a_change_obj_ref = false)
361  {
362  $ilCtrl = $this->ctrl;
363  $ilAccess = $this->access;
364  $ilTabs = $this->tabs;
365  $tpl = $this->tpl;
366  $lng = $this->lng;
367  $ui = $this->ui;
368 
369  if ($_SESSION["cont_media_pool"] != "" &&
370  $ilAccess->checkAccess("write", "", $_SESSION["cont_media_pool"])
371  && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_media_pool"])) == "mep") {
372  $html = "";
373  $tb = new ilToolbarGUI();
374 
375  // button: select pool
376  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
377  if ($a_change_obj_ref) {
378  $tb->addButton(
379  $lng->txt("cont_switch_to_media_pool"),
380  $ilCtrl->getLinkTarget($this, "changeObjectReference")
381  );
382  } else {
383  $tb->addButton(
384  $lng->txt("cont_switch_to_media_pool"),
385  $ilCtrl->getLinkTarget($this, "insert")
386  );
387  }
388  $ilCtrl->setParameter($this, "subCmd", "");
389 
390  // view mode: pool view (folders/all media objects)
391  $f = $ui->factory();
392  $tcmd = ($a_change_obj_ref)
393  ? "changeObjectReference"
394  : "insert";
395  $lng->loadLanguageModule("mep");
396  $ilCtrl->setParameter($this, "pool_view", "folder");
397  $actions[$lng->txt("folders")] = $ilCtrl->getLinkTarget($this, $tcmd);
398  $ilCtrl->setParameter($this, "pool_view", "all");
399  $actions[$lng->txt("mep_all_mobs")] = $ilCtrl->getLinkTarget($this, $tcmd);
400  $ilCtrl->setParameter($this, "pool_view", $this->pool_view);
401  $aria_label = $lng->txt("cont_change_pool_view");
402  $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == "folder")
403  ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
404  $tb->addSeparator();
405  $tb->addComponent($view_control);
406 
407  $html = $tb->getHTML();
408 
409  $this->getTabs($ilTabs, true, $a_change_obj_ref);
410  $ilTabs->setSubTabActive("cont_mob_from_media_pool");
411 
412 
413 
414 
415  include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
416  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
417  $pool = new ilObjMediaPool($_SESSION["cont_media_pool"]);
418  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
419  $tcmd = ($a_change_obj_ref)
420  ? "changeObjectReference"
421  : "insert";
422  $tmode = ($a_change_obj_ref)
425 
426  // handle table sub commands and get the table
427  if ($this->getSubCmd() == "applyFilter") {
428  $mpool_table = new ilMediaPoolTableGUI(
429  $this,
430  $tcmd,
431  $pool,
432  "mep_folder",
433  $tmode,
434  $this->pool_view == "all"
435  );
436  $mpool_table->resetOffset();
437  $mpool_table->writeFilterToSession();
438  }
439  if ($this->getSubCmd() == "resetFilter") {
440  $mpool_table = new ilMediaPoolTableGUI(
441  $this,
442  $tcmd,
443  $pool,
444  "mep_folder",
445  $tmode,
446  $this->pool_view == "all"
447  );
448  $mpool_table->resetOffset();
449  $mpool_table->resetFilter();
450  }
451  $mpool_table = new ilMediaPoolTableGUI(
452  $this,
453  $tcmd,
454  $pool,
455  "mep_folder",
456  $tmode,
457  $this->pool_view == "all"
458  );
459 
460  $html .= $mpool_table->getHTML();
461 
462  $tpl->setContent($html);
463  } else {
464  $this->poolSelection($a_change_obj_ref);
465  }
466  }
467 
471  public function selectPool($a_change_obj_ref = false)
472  {
473  $ilCtrl = $this->ctrl;
474 
475  $_SESSION["cont_media_pool"] = $_GET["pool_ref_id"];
476  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
477  if ($a_change_obj_ref) {
478  $ilCtrl->redirect($this, "changeObjectReference");
479  } else {
480  $ilCtrl->redirect($this, "insert");
481  }
482  }
483 
487  public function poolSelection($a_change_obj_ref = false)
488  {
489  $tpl = $this->tpl;
490  $ilTabs = $this->tabs;
491  $ilCtrl = $this->ctrl;
492 
493  $this->getTabs($ilTabs, true, $a_change_obj_ref);
494  $ilTabs->setSubTabActive("cont_mob_from_media_pool");
495 
496  include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
497 
498  if ($a_change_obj_ref) {
499  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
500  $exp = new ilPoolSelectorGUI($this, "changeObjectReference", $this, "changeObjectReference");
501  } else {
502  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
503  $exp = new ilPoolSelectorGUI($this, "insert");
504  }
505 
506  // filter
507  $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
508  $exp->setClickableTypes(array('mep'));
509 
510  if (!$exp->handleCommand()) {
511  $tpl->setContent($exp->getHTML());
512  }
513  }
514 
515 
520  public function createNewObjectReference()
521  {
522  $this->create(false, true);
523  }
524 
529  public function selectObjectReference()
530  {
531  $ilCtrl = $this->ctrl;
532  $lng = $this->lng;
533  if (is_array($_POST["id"]) && count($_POST["id"]) == 1) {
534  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
535  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
536  $fid = ilMediaPoolItem::lookupForeignId($_POST["id"][0]);
537  $this->content_obj->readMediaObject($fid);
538  $this->content_obj->updateObjectReference();
539  $this->updated = $this->pg_obj->update();
540  } else {
541  ilUtil::sendInfo($lng->txt("cont_select_max_one_item"), true);
542  $ilCtrl->redirect($this, "changeObjectReference");
543  }
544  $ilCtrl->redirect($this, "editAlias");
545  }
546 
550  public function &create($a_create_alias = true, $a_change_obj_ref = false)
551  {
552  $ilCtrl = $this->ctrl;
553  $lng = $this->lng;
554 
555  if ($_GET["subCmd"] == "insertFromPool") {
556  if (is_array($_POST["id"])) {
557  for ($i = count($_POST["id"]) - 1; $i >= 0; $i--) {
558  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
560  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
561  $this->content_obj = new ilPCMediaObject($this->getPage());
562  $this->content_obj->readMediaObject($fid);
563  $this->content_obj->createAlias($this->pg_obj, $_GET["hier_id"], $this->pc_id);
564  }
565  $this->updated = $this->pg_obj->update();
566  }
567 
568  $this->redirectToParent($_GET["hier_id"]);
569  }
570 
571  // check form input
572  $mob_gui = new ilObjMediaObjectGUI("");
573  $mob_gui->initForm("create");
574 
575  if (!$mob_gui->checkFormInput()) {
576  $this->form = $mob_gui->getForm();
577  $this->insert("edpost", "create_mob", true);
578  return;
579  }
580  // create dummy object in db (we need an id)
581  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
582  if ($a_change_obj_ref != true) {
583  $this->content_obj = new ilPCMediaObject($this->getPage());
584  }
585  $this->content_obj->createMediaObject();
586  $media_obj = $this->content_obj->getMediaObject();
587 
588  include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
590 
591  if ($a_create_alias) {
592  // need a pcmediaobject here
593  //$this->node = $this->createPageContentNode();
594 
595  $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
596  $this->updated = $this->pg_obj->update();
597  if ($this->updated === true) {
598  $this->pg_obj->stripHierIDs();
599  $this->pg_obj->addHierIDs();
600  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
601  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
602  $this->content_obj->setHierId($this->content_obj->readHierId());
603  $this->setHierId($this->content_obj->readHierId());
604  $this->content_obj->setPCId($this->content_obj->readPCId());
605  ilUtil::sendSuccess($lng->txt("saved_media_object"), true);
606  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
607 
608  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
609  } else {
610  $this->insert();
611  }
612  } else {
613  if ($a_change_obj_ref == true) {
614  $this->content_obj->updateObjectReference();
615  $this->updated = $this->pg_obj->update();
616  $this->ctrl->redirect($this, "editAlias");
617  }
618  return $this->content_obj;
619  }
620  }
621 
622 
626  public function edit()
627  {
628  if ($this->content_obj->checkInstanceEditing()) {
629  $this->ctrl->redirect($this, "editAlias");
630  }
631  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
632  }
633 
637  public function editAlias()
638  {
639  $tpl = $this->tpl;
640 
641  $this->initAliasForm();
642  $this->getAliasValues();
643  $tpl->setContent($this->form_gui->getHTML());
644  }
645 
649  public function initAliasForm()
650  {
651  $lng = $this->lng;
652  $ilCtrl = $this->ctrl;
653 
654  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
655 
656  $this->form_gui = new ilPropertyFormGUI();
657 
658  // standard view resource
659  $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
660 
661  // title, location and format
662  $title = new ilNonEditableValueGUI($lng->txt("title"), "title");
663  $this->form_gui->addItem($title);
664  $loc = new ilNonEditableValueGUI(
665  $this->lng->txt("cont_" . strtolower($std_item->getLocationType())),
666  "st_location"
667  );
668  $this->form_gui->addItem($loc);
670  $this->lng->txt("cont_format"),
671  "st_format"
672  );
673  $this->form_gui->addItem($format);
674 
675  // standard size
676  $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "st_derive_size");
677  $orig_size = $std_item->getOriginalSize();
678  $add_str = ($orig_size["width"] != "" && $orig_size["height"] != "")
679  ? " (" . $orig_size["width"] . " x " . $orig_size["height"] . ")"
680  : "";
681  $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
682  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
683  $radio_size->addOption($op1);
684 
685  // width height
686  include_once("./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
687  $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
688  " / " . $lng->txt("cont_height"), "st_width_height");
689  $width_height->setConstrainProportions(true);
690  $op2->addSubItem($width_height);
691 
692  $radio_size->addOption($op2);
693  $this->form_gui->addItem($radio_size);
694 
695  // standard caption
696  $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "st_derive_caption");
697  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
698  $def_cap = new ilNonEditableValueGUI("", "def_caption");
699  $op1->addSubItem($def_cap);
700  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
701  $rad_caption->addOption($op1);
702 
703  $caption = new ilTextAreaInputGUI("", "st_caption");
704  $caption->setCols(30);
705  $caption->setRows(2);
706  $op2->addSubItem($caption);
707 
708  /*$caption = new ilTextInputGUI("", "st_caption");
709  $caption->setSize(40);
710  $caption->setMaxLength(200);
711  $op2->addSubItem($caption);*/
712  $rad_caption->addOption($op2);
713  $this->form_gui->addItem($rad_caption);
714 
715  // standard text representation
716  if ($this->media_type->usesAltTextProperty($std_item->getFormat())) {
717  $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "st_derive_text_representation");
718  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
719  $def_tr = new ilNonEditableValueGUI("", "def_text_representation");
720  $op1->addSubItem($def_tr);
721  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
722  $tr = new ilTextAreaInputGUI("", "st_text_representation");
723  $tr->setCols(30);
724  $tr->setRows(2);
725  $rad_tr->addOption($op1);
726  $op2->addSubItem($tr);
727  $rad_tr->addOption($op2);
728  $this->form_gui->addItem($rad_tr);
729  $rad_tr->setInfo($lng->txt("text_repr_info"));
730  }
731 
732  // standard parameters
733  if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
734  if ($this->media_type->usesAutoStartParameterOnly(
735  $std_item->getLocation(),
736  $std_item->getFormat()
737  )) { // autostart
738  /*
739  $par = $std_item->getParameters();
740  $def_str = ($par["autostart"] == "true")
741  ? " (" . $lng->txt("yes") . ")"
742  : " (" . $lng->txt("no") . ")";
743  $rad_auto = new ilRadioGroupInputGUI(
744  $lng->txt("cont_autostart"),
745  "st_derive_parameters"
746  );
747  $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
748  $rad_auto->addOption($op1);
749  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
750  $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "st_autostart");
751  $op2->addSubItem($auto);
752  $rad_auto->addOption($op2);
753  $this->form_gui->addItem($rad_auto);*/
754  } else { // parameters
755  $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "st_derive_parameters");
756  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
757  $def_par = new ilNonEditableValueGUI("", "def_parameters");
758  $op1->addSubItem($def_par);
759  $rad_parameters->addOption($op1);
760  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
761  $par = new ilTextAreaInputGUI("", "st_parameters");
762  $par->setRows(5);
763  $par->setCols(50);
764  $op2->addSubItem($par);
765  $rad_parameters->addOption($op2);
766  $this->form_gui->addItem($rad_parameters);
767  }
768  }
769 
770  // fullscreen view
771  if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
772  $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
773 
774  $fs_sec = new ilFormSectionHeaderGUI();
775  $fs_sec->setTitle($lng->txt("cont_fullscreen"));
776  $this->form_gui->addItem($fs_sec);
777 
778 
779  // resource
780  $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "fullscreen");
781  $op1 = new ilRadioOption($lng->txt("cont_none"), "n");
782  $radio_prop->addOption($op1);
783  $op2 = new ilRadioOption($this->lng->txt("cont_" . strtolower($full_item->getLocationType())) . ": " .
784  $full_item->getLocation(), "y");
785  $radio_prop->addOption($op2);
786  $this->form_gui->addItem($radio_prop);
787 
788  // format
790  $this->lng->txt("cont_format"),
791  "full_format"
792  );
793  $this->form_gui->addItem($format);
794 
795  // full size
796  $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_derive_size");
797  $fw_size = $std_item->getOriginalSize();
798  $add_str = ($fw_size["width"] != "" && $fw_size["height"] != "")
799  ? " (" . $fw_size["width"] . " x " . $fw_size["height"] . ")"
800  : "";
801  $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
802  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
803  $radio_size->addOption($op1);
804 
805  // width height
806  include_once("./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
807  $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
808  " / " . $lng->txt("cont_height"), "full_width_height");
809  $width_height->setConstrainProportions(true);
810  $op2->addSubItem($width_height);
811 
812  $radio_size->addOption($op2);
813  $this->form_gui->addItem($radio_size);
814 
815  // fullscreen caption
816  $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "full_derive_caption");
817  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
818  $def_cap = new ilNonEditableValueGUI("", "full_def_caption");
819  $op1->addSubItem($def_cap);
820  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
821  $rad_caption->addOption($op1);
822 
823  $caption = new ilTextAreaInputGUI("", "full_caption");
824  $caption->setCols(30);
825  $caption->setRows(2);
826  $op2->addSubItem($caption);
827 
828  /*$caption = new ilTextInputGUI("", "full_caption");
829  $caption->setSize(40);
830  $caption->setMaxLength(200);
831  $op2->addSubItem($caption);*/
832  $rad_caption->addOption($op2);
833  $this->form_gui->addItem($rad_caption);
834 
835  // fullscreen text representation
836  if (substr($full_item->getFormat(), 0, 5) == "image") {
837  $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "full_derive_text_representation");
838  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
839  $def_tr = new ilNonEditableValueGUI("", "full_def_text_representation");
840  $op1->addSubItem($def_tr);
841  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
842  $tr = new ilTextAreaInputGUI("", "full_text_representation");
843  $tr->setCols(30);
844  $tr->setRows(2);
845  $rad_tr->addOption($op1);
846  $op2->addSubItem($tr);
847  $rad_tr->addOption($op2);
848  $this->form_gui->addItem($rad_tr);
849  $rad_tr->setInfo($lng->txt("text_repr_info"));
850  }
851 
852  // fullscreen parameters
853  if ($this->media_type->usesParameterProperty($full_item->getFormat())) {
854  if ($this->media_type->usesAutoStartParameterOnly(
855  $full_item->getLocation(),
856  $full_item->getFormat()
857  )) { // autostart
858  /*
859  $par = $full_item->getParameters();
860  $def_str = ($par["autostart"] == "true")
861  ? " (" . $lng->txt("yes") . ")"
862  : " (" . $lng->txt("no") . ")";
863  $rad_auto = new ilRadioGroupInputGUI(
864  $lng->txt("cont_autostart"),
865  "full_derive_parameters"
866  );
867  $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
868  $rad_auto->addOption($op1);
869  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
870  $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "full_autostart");
871  $op2->addSubItem($auto);
872  $rad_auto->addOption($op2);
873  $this->form_gui->addItem($rad_auto);*/
874  } else { // parameters
875  $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "full_derive_parameters");
876  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
877  $def_par = new ilNonEditableValueGUI("", "full_def_parameters");
878  $op1->addSubItem($def_par);
879  $rad_parameters->addOption($op1);
880  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
881  $par = new ilTextAreaInputGUI("", "full_parameters");
882  $par->setRows(5);
883  $par->setCols(50);
884  $op2->addSubItem($par);
885  $rad_parameters->addOption($op2);
886  $this->form_gui->addItem($rad_parameters);
887  }
888  }
889  }
890 
891  $this->form_gui->setTitle($lng->txt("cont_edit_mob_alias_prop"));
892  $this->form_gui->addCommandButton("saveAliasProperties", $lng->txt("save"));
893  $lm_set = new ilSetting("lm");
894  if ($lm_set->get("replace_mob_feature")) {
895  $this->form_gui->addCommandButton("changeObjectReference", $lng->txt("cont_change_object_reference"));
896  }
897  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
898  }
899 
900 
904  public function getAliasValues()
905  {
906  $lng = $this->lng;
907 
908  // standard view resource
909  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
910  $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
911 
912  $values["title"] = $this->content_obj->getMediaObject()->getTitle();
913  $values["st_location"] = $std_item->getLocation();
914  $values["st_format"] = $std_item->getFormat();
915 
916  // size
917  $values["st_width_height"]["width"] = $std_alias_item->getWidth();
918  $values["st_width_height"]["height"] = $std_alias_item->getHeight();
919  $values["st_width_height"]["constr_prop"] = true;
920 
921  // caption
922  $values["st_caption"] = $std_alias_item->getCaption();
923  if (trim($std_item->getCaption()) == "") {
924  $values["def_caption"] = $lng->txt("cont_no_caption");
925  } else {
926  $values["def_caption"] = $std_item->getCaption();
927  }
928 
929  // text representation
930  $values["st_text_representation"] = $std_alias_item->getTextRepresentation();
931  if (trim($std_item->getTextRepresentation()) == "") {
932  $values["def_text_representation"] = $lng->txt("cont_no_text");
933  } else {
934  $values["def_text_representation"] = $std_item->getTextRepresentation();
935  }
936 
937  // parameters / autostart
938  if ($this->media_type->usesAutoStartParameterOnly(
939  $std_item->getLocation(),
940  $std_item->getFormat()
941  )) { // autostart
942  /*
943  $par = $std_alias_item->getParameters();
944  if ($par["autostart"] == "true") {
945  $values["st_autostart"] = true;
946  }*/
947  } else { // parameters
948  $values["st_parameters"] = $std_alias_item->getParameterString();
949  }
950 
951  // size
952  $values["st_derive_size"] = $std_alias_item->definesSize()
953  ? "n"
954  : "y";
955  if ($values["st_derive_size"] == "y") {
956  $values["st_width_height"]["width"] = $std_item->getWidth();
957  $values["st_width_height"]["height"] = $std_item->getHeight();
958  }
959  $values["st_derive_caption"] = $std_alias_item->definesCaption()
960  ? "n"
961  : "y";
962  $values["st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
963  ? "n"
964  : "y";
965  $values["st_derive_parameters"] = $std_alias_item->definesParameters()
966  ? "n"
967  : "y";
968  if (trim($std_item->getParameterString()) == "") {
969  $values["def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
970  } else {
971  $values["def_parameters"] = $std_item->getParameterString();
972  }
973 
974  // fullscreen properties
975  if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
976  $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
977  $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
978 
979  $values["fullscreen"] = "n";
980  if ($full_alias_item->exists()) {
981  $values["fullscreen"] = "y";
982  }
983 
984  $values["full_location"] = $full_item->getLocation();
985  $values["full_format"] = $full_item->getFormat();
986  $values["full_width_height"]["width"] = $full_alias_item->getWidth();
987  $values["full_width_height"]["height"] = $full_alias_item->getHeight();
988  $values["full_width_height"]["constr_prop"] = true;
989  $values["full_caption"] = $full_alias_item->getCaption();
990  if (trim($full_item->getCaption()) == "") {
991  $values["full_def_caption"] = $lng->txt("cont_no_caption");
992  } else {
993  $values["full_def_caption"] = $full_item->getCaption();
994  }
995  $values["full_text_representation"] = $full_alias_item->getTextRepresentation();
996  if (trim($full_item->getTextRepresentation()) == "") {
997  $values["full_def_text_representation"] = $lng->txt("cont_no_text");
998  } else {
999  $values["full_def_text_representation"] = $full_item->getTextRepresentation();
1000  }
1001  $values["full_parameters"] = $full_alias_item->getParameterString();
1002  $values["full_derive_size"] = $full_alias_item->definesSize()
1003  ? "n"
1004  : "y";
1005  if ($values["full_derive_size"] == "y") {
1006  $values["full_width_height"]["width"] = $full_item->getWidth();
1007  $values["full_width_height"]["height"] = $full_item->getHeight();
1008  }
1009  $values["full_derive_caption"] = $full_alias_item->definesCaption()
1010  ? "n"
1011  : "y";
1012  $values["full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
1013  ? "n"
1014  : "y";
1015 
1016  // parameters
1017  if ($this->media_type->usesAutoStartParameterOnly(
1018  $full_item->getLocation(),
1019  $full_item->getFormat()
1020  )) { // autostart
1021  /*
1022  $par = $full_alias_item->getParameters();
1023  if ($par["autostart"] == "true") {
1024  $values["full_autostart"] = true;
1025  }*/
1026  } else { // parameters
1027  $values["full_parameters"] = $full_alias_item->getParameterString();
1028  }
1029 
1030  $values["full_derive_parameters"] = $full_alias_item->definesParameters()
1031  ? "n"
1032  : "y";
1033  if (trim($full_item->getParameterString()) == "") {
1034  $values["full_def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
1035  } else {
1036  $values["full_def_parameters"] = $full_item->getParameterString();
1037  }
1038  }
1039 
1040  $this->form_gui->setValuesByArray($values);
1041  }
1042 
1046  public function saveAliasProperties()
1047  {
1048  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1049  $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
1050  $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1051  $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
1052 
1053  // standard size
1054  if ($_POST["st_derive_size"] == "y") {
1055  $std_alias_item->deriveSize();
1056  } else {
1057  $std_alias_item->setWidth(ilUtil::stripSlashes($_POST["st_width_height"]["width"]));
1058  $std_alias_item->setHeight(ilUtil::stripSlashes($_POST["st_width_height"]["height"]));
1059  }
1060 
1061  // standard caption
1062  if ($_POST["st_derive_caption"] == "y") {
1063  $std_alias_item->deriveCaption();
1064  } else {
1065  $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["st_caption"]));
1066  }
1067 
1068  // text representation
1069  if ($_POST["st_derive_text_representation"] == "y") {
1070  $std_alias_item->deriveTextRepresentation();
1071  } else {
1072  $std_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["st_text_representation"]));
1073  }
1074 
1075  // standard parameters
1076  if ($_POST["st_derive_parameters"] == "y") {
1077  $std_alias_item->deriveParameters();
1078  } else {
1079  if ($this->media_type->usesAutoStartParameterOnly(
1080  $std_item->getLocation(),
1081  $std_item->getFormat()
1082  )) { // autostart
1083  /*
1084  if ($_POST["st_autostart"]) {
1085  $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
1086  } else {
1087  $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
1088  }*/
1089  } else { // parameters
1090  $std_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["st_parameters"]))));
1091  }
1092  }
1093 
1094  if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1095  if ($_POST["fullscreen"] == "y") {
1096  if (!$full_alias_item->exists()) {
1097  $full_alias_item->insert();
1098  }
1099 
1100  // fullscreen size
1101  if ($_POST["full_derive_size"] == "y") {
1102  $full_alias_item->deriveSize();
1103  } else {
1104  $full_alias_item->setWidth(ilUtil::stripSlashes($_POST["full_width_height"]["width"]));
1105  $full_alias_item->setHeight(ilUtil::stripSlashes($_POST["full_width_height"]["height"]));
1106  }
1107 
1108  // fullscreen caption
1109  if ($_POST["full_derive_caption"] == "y") {
1110  $full_alias_item->deriveCaption();
1111  } else {
1112  $full_alias_item->setCaption(ilUtil::stripSlashes($_POST["full_caption"]));
1113  }
1114 
1115  // fullscreen text representation
1116  if ($_POST["full_derive_text_representation"] == "y") {
1117  $full_alias_item->deriveTextRepresentation();
1118  } else {
1119  $full_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["full_text_representation"]));
1120  }
1121 
1122  // fullscreen parameters
1123  if ($_POST["full_derive_parameters"] == "y") {
1124  $full_alias_item->deriveParameters();
1125  } else {
1126  if ($this->media_type->usesAutoStartParameterOnly(
1127  $full_item->getLocation(),
1128  $full_item->getFormat()
1129  )) { // autostart
1130  /*
1131  if ($_POST["full_autostart"]) {
1132  $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
1133  } else {
1134  $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
1135  }*/
1136  } else {
1137  $full_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["full_parameters"]))));
1138  }
1139  }
1140  } else {
1141  if ($full_alias_item->exists()) {
1142  $full_alias_item->delete();
1143  }
1144  }
1145  }
1146 
1147  $this->updated = $this->pg_obj->update();
1148  if ($this->updated === true) {
1149  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1150  $this->ctrl->redirect($this, "editAlias");
1151  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1152  } else {
1153  $this->pg_obj->addHierIDs();
1154  $this->editAlias();
1155  }
1156  }
1157 
1161  public function copyToClipboard()
1162  {
1163  $ilUser = $this->user;
1164 
1165  $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1166  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
1167  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1168  }
1169 
1173  public function centerAlign()
1174  {
1175  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1176  $std_alias_item->setHorizontalAlign("Center");
1177  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1178  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1179  }
1180 
1184  public function leftAlign()
1185  {
1186  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1187  $std_alias_item->setHorizontalAlign("Left");
1188  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1189  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1190  }
1191 
1195  public function rightAlign()
1196  {
1197  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1198  $std_alias_item->setHorizontalAlign("Right");
1199  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1200  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1201  }
1202 
1206  public function leftFloatAlign()
1207  {
1208  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1209  $std_alias_item->setHorizontalAlign("LeftFloat");
1210  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1211  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1212  }
1213 
1217  public function rightFloatAlign()
1218  {
1219  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1220  $std_alias_item->setHorizontalAlign("RightFloat");
1221  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1222  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1223  }
1224 
1228  public function checkStyleSelection()
1229  {
1230  // check whether there is more than one style class
1231  $chars = $this->getCharacteristics();
1232 
1233  if (count($chars) > 1 ||
1234  ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media")) {
1235  return true;
1236  }
1237  return false;
1238  }
1239 
1243  public function editStyle()
1244  {
1245  $ilCtrl = $this->ctrl;
1246  $tpl = $this->tpl;
1247  $lng = $this->lng;
1248 
1249  $this->displayValidationError();
1250 
1251  // edit form
1252  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1253  $form = new ilPropertyFormGUI();
1254  $form->setFormAction($ilCtrl->getFormAction($this));
1255  $form->setTitle($this->lng->txt("cont_edit_style"));
1256 
1257  // characteristic selection
1258  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
1259  $char_prop = new ilAdvSelectInputGUI(
1260  $this->lng->txt("cont_characteristic"),
1261  "characteristic"
1262  );
1263 
1264  $chars = $this->getCharacteristics();
1265  if (is_object($this->content_obj)) {
1266  if ($chars[$a_seleted_value] == "" && ($this->content_obj->getClass() != "")) {
1267  $chars = array_merge(
1268  array($this->content_obj->getClass() => $this->content_obj->getClass()),
1269  $chars
1270  );
1271  }
1272  }
1273 
1274  $selected = $this->content_obj->getClass();
1275  if ($selected == "") {
1276  $selected = "MediaContainer";
1277  }
1278 
1279  foreach ($chars as $k => $char) {
1280  $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1281  $char . '</div>';
1282  $char_prop->addOption($k, $char, $html);
1283  }
1284 
1285  $char_prop->setValue($selected);
1286  $form->addItem($char_prop);
1287 
1288  // save button
1289  $form->addCommandButton("saveStyle", $lng->txt("save"));
1290 
1291  $html = $form->getHTML();
1292  $tpl->setContent($html);
1293  return $ret;
1294  }
1295 
1302  {
1303  // characteristic selection
1304  $char_prop = new ilAdvSelectInputGUI(
1305  $this->lng->txt("cont_characteristic"),
1306  "characteristic"
1307  );
1308 
1309  $selected = $this->content_obj->getClass();
1310  if ($selected == "") {
1311  $selected = "MediaContainer";
1312  }
1313 
1314  $chars = $this->getCharacteristics();
1315  if (is_object($this->content_obj)) {
1316  if ($chars[$selected] == "" && ($this->content_obj->getClass() != "")) {
1317  $chars = array_merge(
1318  array($this->content_obj->getClass() => $this->content_obj->getClass()),
1319  $chars
1320  );
1321  }
1322  }
1323 
1324  foreach ($chars as $k => $char) {
1325  $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1326  $char . '</div>';
1327  $char_prop->addOption($k, $char, $html);
1328  }
1329 
1330  $char_prop->setValue($selected);
1331 
1332  return $char_prop;
1333  }
1334 
1338  public function saveStyle()
1339  {
1340  $this->content_obj->setClass($_POST["characteristic"]);
1341  $this->updated = $this->pg_obj->update();
1342  if ($this->updated === true) {
1343  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1344  } else {
1345  $this->pg_obj->addHierIDs();
1346  $this->editStyle();
1347  }
1348  }
1349 
1356  public function getTabs(&$tab_gui, $a_create = false, $a_change_obj_ref = false)
1357  {
1358  $ilCtrl = $this->ctrl;
1359  $ilTabs = $this->tabs;
1360 
1361  if (!$a_create) {
1362  if ($this->checkStyleSelection()) {
1363  $ilTabs->addTarget(
1364  "cont_style",
1365  $ilCtrl->getLinkTarget($this, "editStyle"),
1366  "editStyle",
1367  get_class($this)
1368  );
1369  }
1370 
1371  if ($this->content_obj->checkInstanceEditing()) {
1372  $ilTabs->addTarget(
1373  "cont_mob_inst_prop",
1374  $ilCtrl->getLinkTarget($this, "editAlias"),
1375  "editAlias",
1376  get_class($this)
1377  );
1378 
1379  if ($this->getEnabledMapAreas()) {
1380  $st_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1381  if (is_object($st_item)) {
1382  $format = $st_item->getFormat();
1383  if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg"))) {
1384  $ilTabs->addTarget(
1385  "cont_inst_map_areas",
1386  $ilCtrl->getLinkTargetByClass("ilpcimagemapeditorgui", "editMapAreas"),
1387  array(),
1388  "ilpcimagemapeditorgui"
1389  );
1390  }
1391  }
1392  }
1393  }
1394  } else {
1395  if ($a_change_obj_ref) {
1396  $cmd = "changeObjectReference";
1397  } else {
1398  $cmd = "insert";
1399  }
1400 
1401  if ($a_change_obj_ref) {
1402  $ilCtrl->setParameter($this, "subCmd", "insertNew");
1403  $ilTabs->addSubTabTarget(
1404  "cont_new_mob",
1405  $ilCtrl->getLinkTarget($this, $cmd),
1406  $cmd
1407  );
1408 
1409  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
1410  $ilTabs->addSubTabTarget(
1411  "cont_mob_from_media_pool",
1412  $ilCtrl->getLinkTarget($this, $cmd),
1413  $cmd
1414  );
1415  $ilCtrl->setParameter($this, "subCmd", "");
1416  }
1417  }
1418  }
1419 
1423  public static function _getStandardCharacteristics()
1424  {
1426  global $DIC;
1427 
1428  $lng = $DIC->language();
1429 
1430  return array(
1431  "MediaContainer" => $lng->txt("cont_Media"),
1432  "MediaContainerMax50" => "MediaContainerMax50",
1433  "MediaContainerFull100" => "MediaContainerFull100",
1434  "MediaContainerHighlighted" => "MediaContainerHighlighted",
1435  "MediaContainerSeparated" => "MediaContainerSeparated"
1436  );
1437  }
1438 
1442  public static function _getCharacteristics($a_style_id)
1443  {
1444  $chars = self::_getStandardCharacteristics();
1445  if ($a_style_id > 0 &&
1446  ilObject::_lookupType($a_style_id) == "sty") {
1447  $style = new ilObjStyleSheet($a_style_id);
1448  $chars = $style->getCharacteristics("media_cont");
1449  $new_chars = array();
1450  foreach ($chars as $char) {
1451  if ($chars[$char] != "") { // keep lang vars for standard chars
1452  $new_chars[$char] = $chars[$char];
1453  } else {
1454  $new_chars[$char] = $char;
1455  }
1456  asort($new_chars);
1457  }
1458  $chars = $new_chars;
1459  }
1460  return $chars;
1461  }
1462 
1463 }
static setObjectPerCreationForm($a_mob)
Set media object values from creation form.
rightAlign()
align media object to right
This class represents an option in a radio group.
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
selectObjectReference()
Create new media object and replace currrent media item with it.
rightFloatAlign()
align media object to right, floating text
poolSelection($a_change_obj_ref=false)
Pool Selection.
initAliasForm()
Init alias form.
setSubCmd($a_val)
Set table sub command.
$_SESSION["AccountId"]
This class represents a property form user interface.
$_GET["client_id"]
This class represents a section header in a property form.
edit()
edit properties form
getSubCmd()
Get table sub command.
setConstrainProportions($a_constrainproportions)
Set Constrain Proportions.
setBackTitle($a_title)
set title for back tab
__construct(ilPageObject $a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
user()
Definition: user.php:4
Class ilPCMediaObjectGUI.
insertFromPool($a_change_obj_ref=false)
Insert media object from pool.
changeObjectReference()
Change object reference.
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
add tabs to ilTabsGUI object
insert($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
Insert new media object form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static lookupForeignId($a_id)
Lookup Foreign Id.
setCharacteristics($a_chars)
Set Characteristics.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
executeCommand()
execute command
getAliasValues()
Put alias values into form.
This class represents a property in a property form.
& create($a_create_alias=true, $a_change_obj_ref=false)
create new media object in dom and update page in db
editAlias()
edit properties form
redirectToParent($hier_id="")
Redirect to parent.
addSubItem($a_item)
Add Subitem.
copyToClipboard()
copy media object to clipboard
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
checkStyleSelection()
Checks whether style selection shoudl be available or not.
static _lookupObjId($a_id)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
global $DIC
Definition: goto.php:24
displayValidationError()
display validation errors
$format
Definition: metadata.php:218
ui()
Definition: ui.php:5
checkFixSize()
Check fix size.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
User interface class for page content map editor.
setEnabledMapAreas($a_enabledmapareas)
Set Enable map areas.
This class represents a width/height item in a property form.
getCharacteristics()
Get characteristics.
static _lookupType($a_id, $a_reference=false)
lookup object type
leftAlign()
align media object to left
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
selectPool($a_change_obj_ref=false)
Select concrete pool.
Class ilObjMediaObjectGUI.
getEnabledMapAreas()
Get Enable map areas.
Media pool object.
$lm_set
This class represents a non editable value in a property form.
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
leftFloatAlign()
align media object to left, floating text
Select media pool for adding objects into pages.
Class ilObjStyleSheet.
$ret
Definition: parser.php:6
getStyleInput()
Get style input.
saveAliasProperties()
save table properties in db and return to page edit screen
static _getCharacteristics($a_style_id)
Get characteristics.
Class ilPCMediaObject.
$ilUser
Definition: imgupload.php:18
createNewObjectReference()
Create new media object and replace currrent media item with it.
This class represents an advanced selection list property in a property form.
static extractParameterString($a_parstr)
extracts parameter value pairs from a string into an array
getHierIdsForPCIds($a_pc_ids)
Get hier ids for a set of pc ids.
$_POST["username"]
centerAlign()
align media object to center
setHierId($a_hier_id)
get hierarchical id in dom object
TableGUI class for recent changes in wiki.
$i
Definition: metadata.php:24