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