ILIAS  release_8 Revision v8.24
ilPCMediaObjectGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPCMediaObjectGUI:
+ Collaboration diagram for ilPCMediaObjectGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 setSubCmd (string $a_val)
 Set table sub command. More...
 
 getSubCmd ()
 
 setHeader (string $a_title="")
 
 getHeader ()
 
 setEnabledMapAreas (bool $a_enabledmapareas)
 Set Enable map areas. More...
 
 getEnabledMapAreas ()
 
 insert ( $a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
 
 changeObjectReference ()
 Change object reference. More...
 
 insertFromPool (bool $a_change_obj_ref=false)
 Insert media object from pool. More...
 
 selectPool (bool $a_change_obj_ref=false)
 Select concrete pool. More...
 
 poolSelection (bool $a_change_obj_ref=false)
 Pool Selection. More...
 
 createNewObjectReference ()
 Create new media object and replace currrent media item with it. More...
 
 selectObjectReference ()
 Create new media object and replace currrent media item with it. More...
 
 create (bool $a_create_alias=true, bool $a_change_obj_ref=false)
 create new media object in dom and update page in db More...
 
 edit ()
 edit properties form More...
 
 editAlias ()
 
 initAliasForm ()
 Init alias form. More...
 
 getAliasValues ()
 Put alias values into form. More...
 
 saveAliasProperties ()
 save table properties in db and return to page edit screen More...
 
 copyToClipboard ()
 copy media object to clipboard More...
 
 centerAlign ()
 align media object to center More...
 
 leftAlign ()
 align media object to left More...
 
 rightAlign ()
 align media object to right More...
 
 leftFloatAlign ()
 align media object to left, floating text More...
 
 rightFloatAlign ()
 align media object to right, floating text More...
 
 checkStyleSelection ()
 Checks whether style selection shoudl be available or not. More...
 
 editStyle ()
 Edit Style. More...
 
 getStyleInput ()
 
 saveStyle ()
 Save Style. More...
 
 getTabs (bool $a_create=false, bool $a_change_obj_ref=false)
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 

Static Public Member Functions

static _getCharacteristics (int $a_style_id)
 Get characteristics. More...
 
- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 

Data Fields

string $header = ""
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
php4DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 

Protected Member Functions

 checkFixSize ()
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 

Protected Attributes

ilPropertyFormGUI $form
 
ilPropertyFormGUI $form_gui
 
string $page_back_title = ""
 
bool $enabledmapareas = false
 
ilTabsGUI $tabs
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ilObjUser $user
 
ILIAS DI UIServices $ui
 
string $pool_view = ""
 
string $sub_cmd = ""
 
ILIAS MediaObjects MediaType MediaTypeManager $media_type
 
- Protected Attributes inherited from ilPageContentGUI
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Editing User Interface for MediaObjects within LMs (see ILIAS DTD)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilPCMediaObjectGUI: ilObjMediaObjectGUI, ilPCImageMapEditorGUI

Definition at line 24 of file class.ilPCMediaObjectGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCMediaObjectGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Reimplemented from ilPageContentGUI.

Definition at line 40 of file class.ilPCMediaObjectGUI.php.

45 {
46 global $DIC;
47
48 $this->tpl = $DIC["tpl"];
49 $this->lng = $DIC->language();
50 $this->tabs = $DIC->tabs();
51 $this->access = $DIC->access();
52 $this->toolbar = $DIC->toolbar();
53 $this->user = $DIC->user();
54 $ilCtrl = $DIC->ctrl();
55 $this->ui = $DIC->ui();
56
58 ->copage()
59 ->internal()
60 ->gui()
61 ->pc()
62 ->editRequest();
63
64 $this->media_type = $DIC->mediaObjects()
65 ->internal()
66 ->domain()
67 ->mediaType();
68
69 $pc_id = $request->getPCId();
70 if ($pc_id != "" && $a_hier_id == "") {
71 $hier_ids = $a_pg_obj->getHierIdsForPCIds([$pc_id]);
72 $a_hier_id = $hier_ids[$pc_id] ?? "";
73 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
74 }
75
76 $this->pool_view = "folder";
77
78 $pv = $request->getString("pool_view");
79 if (in_array($pv, array("folder", "all"))) {
80 $this->pool_view = $pv;
81 }
82
83 $this->ctrl = $ilCtrl;
84
85 $this->ctrl->saveParameter($this, ["pool_view", "pcid"]);
86
87 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
88
89 $this->setCharacteristics(self::_getStandardCharacteristics());
90 }
setCharacteristics(array $a_chars)
getHierIdsForPCIds(array $a_pc_ids)
Get hier ids for a set of pc ids.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilPageContentGUI\$pc_id, ilPageContentGUI\$request, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilPageObject\getHierIdsForPCIds(), ILIAS\Repository\lng(), ilPageContentGUI\setCharacteristics(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getCharacteristics()

static ilPCMediaObjectGUI::_getCharacteristics ( int  $a_style_id)
static

Get characteristics.

Definition at line 1449 of file class.ilPCMediaObjectGUI.php.

1449 : array
1450 {
1451 $chars = self::_getStandardCharacteristics();
1452 if ($a_style_id > 0 &&
1453 ilObject::_lookupType($a_style_id) == "sty") {
1454 $style = new ilObjStyleSheet($a_style_id);
1455 $chars = $style->getCharacteristics("media_cont");
1456 $new_chars = array();
1457 foreach ($chars as $char) {
1458 if (($chars[$char] ?? "") != "") { // keep lang vars for standard chars
1459 $new_chars[$char] = $chars[$char];
1460 } else {
1461 $new_chars[$char] = $char;
1462 }
1463 asort($new_chars);
1464 }
1465 $chars = $new_chars;
1466 }
1467 return $chars;
1468 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCharacteristics(string $a_type="", bool $a_no_hidden=false, bool $a_include_core=true)
Get characteristics.
static _lookupType(int $id, bool $reference=false)

References ilObject\_lookupType().

+ Here is the call graph for this function:

◆ centerAlign()

ilPCMediaObjectGUI::centerAlign ( )

align media object to center

Definition at line 1163 of file class.ilPCMediaObjectGUI.php.

1163 : void
1164 {
1165 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1166 $std_alias_item->setHorizontalAlign("Center");
1167 $this->updateAndReturn();
1168 }

◆ changeObjectReference()

ilPCMediaObjectGUI::changeObjectReference ( )

Change object reference.

Definition at line 258 of file class.ilPCMediaObjectGUI.php.

258 : void
259 {
260 $ilTabs = $this->tabs;
261 $ilCtrl = $this->ctrl;
263
265
266 if (in_array($sub_command, ["insertNew", "insertFromPool"])) {
267 $this->edit_repo->setSubCmd($sub_command);
268 }
269
270 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
271 $sub_command = $this->edit_repo->getSubCmd();
272 }
273
274 switch ($sub_command) {
275 case "insertFromPool":
276 $this->insertFromPool(true);
277 break;
278
279 case "poolSelection":
280 $this->poolSelection(true);
281 break;
282
283 case "selectPool":
284 $this->selectPool(true);
285 break;
286
287 case "insertNew":
288 default:
289 $ilCtrl->setParameter($this, "subCmd", "changeObjectReference");
290 $this->getTabs(true, true);
291 $ilTabs->setSubTabActive("cont_new_mob");
292
293 $this->displayValidationError();
294
295 $mob_gui = new ilObjMediaObjectGUI("");
296 $mob_gui->initForm("create");
297 $form = $mob_gui->getForm();
298 $form->setFormAction($ilCtrl->getFormAction($this));
300 $form->addCommandButton("createNewObjectReference", $lng->txt("save"));
301 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
302 $this->tpl->setContent($form->getHTML());
303 }
304 }
setFormAction(string $a_formaction)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Editing User Interface for MediaObjects within LMs (see ILIAS DTD)
insertFromPool(bool $a_change_obj_ref=false)
Insert media object from pool.
getTabs(bool $a_create=false, bool $a_change_obj_ref=false)
poolSelection(bool $a_change_obj_ref=false)
Pool Selection.
selectPool(bool $a_change_obj_ref=false)
Select concrete pool.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")

References $lng, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\clearCommandButtons(), ilPropertyFormGUI\getHTML(), and ilFormGUI\setFormAction().

+ Here is the call graph for this function:

◆ checkFixSize()

ilPCMediaObjectGUI::checkFixSize ( )
protected

Definition at line 306 of file class.ilPCMediaObjectGUI.php.

306 : void
307 {
308 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
309 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
310
311 $ok = false;
312 if (($std_alias_item->getWidth() != "" && $std_alias_item->getHeight() != "")) {
313 $ok = true;
314 }
315 if ($std_alias_item->getWidth() == "" && $std_alias_item->getHeight() == ""
316 && $std_item->getWidth() != "" && $std_item->getHeight() != "") {
317 $ok = true;
318 }
319
320 if (!$ok) {
321 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("mob_no_fixed_size_map_editing"));
322 }
323 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ checkStyleSelection()

ilPCMediaObjectGUI::checkStyleSelection ( )

Checks whether style selection shoudl be available or not.

Definition at line 1213 of file class.ilPCMediaObjectGUI.php.

1213 : bool
1214 {
1215 // check whether there is more than one style class
1216 $chars = $this->getCharacteristics();
1217
1218 if (count($chars) > 1 ||
1219 ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media")) {
1220 return true;
1221 }
1222 return false;
1223 }

◆ copyToClipboard()

ilPCMediaObjectGUI::copyToClipboard ( )

copy media object to clipboard

Definition at line 1151 of file class.ilPCMediaObjectGUI.php.

1151 : void
1152 {
1154
1155 $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1156 $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
1157 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1158 }
$ilUser
Definition: imgupload.php:34

References $ilUser, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ create()

ilPCMediaObjectGUI::create ( bool  $a_create_alias = true,
bool  $a_change_obj_ref = false 
)

create new media object in dom and update page in db

Definition at line 511 of file class.ilPCMediaObjectGUI.php.

514 : ?ilPCMediaObject {
515 $ilCtrl = $this->ctrl;
517
518 if ($this->sub_command == "insertFromPool") {
519 $ids = $this->request->getIntArray("id");
520 for ($i = count($ids) - 1; $i >= 0; $i--) {
522 $this->content_obj = new ilPCMediaObject($this->getPage());
523 $this->content_obj->readMediaObject($fid);
524 $this->content_obj->createAlias(
525 $this->pg_obj,
526 $this->request->getHierId(),
527 $this->pc_id
528 );
529 }
530 $this->updated = $this->pg_obj->update();
531
532 $this->redirectToParent($this->request->getHierId());
533 }
534
535 // check form input
536 $mob_gui = new ilObjMediaObjectGUI("");
537 $mob_gui->initForm("create");
538
539 if (!$mob_gui->checkFormInput()) {
540 $this->form = $mob_gui->getForm();
541 $this->insert("edpost", "create_mob", true);
542 return null;
543 }
544 // create dummy object in db (we need an id)
545 if ($a_change_obj_ref != true) {
546 $this->content_obj = new ilPCMediaObject($this->getPage());
547 }
548 $this->content_obj->createMediaObject();
549 $media_obj = $this->content_obj->getMediaObject();
550
551 $mob_gui->setObjectPerCreationForm($media_obj);
552
553 if ($a_create_alias) {
554 // need a pcmediaobject here
555 //$this->node = $this->createPageContentNode();
556
557 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
558 $this->updated = $this->pg_obj->update();
559 if ($this->updated === true) {
560 $this->pg_obj->stripHierIDs();
561 $this->pg_obj->addHierIDs();
562 $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
563 $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
564 $this->content_obj->setHierId($this->content_obj->readHierId());
565 $this->setHierId($this->content_obj->readHierId());
566 $this->content_obj->setPcId($this->content_obj->readPCId());
567 $this->tpl->setOnScreenMessage('success', $lng->txt("saved_media_object"), true);
568 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
569
570 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
571 } else {
572 $this->insert();
573 }
574 } else {
575 if ($a_change_obj_ref == true) {
576 $this->content_obj->updateObjectReference();
577 $this->updated = $this->pg_obj->update();
578 $this->ctrl->redirect($this, "editAlias");
579 }
580 return $this->content_obj;
581 }
582 return null;
583 }
static lookupForeignId(int $a_id)
insert( $a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
Class ilPCMediaObject Media content object (see ILIAS DTD)
redirectToParent(string $hier_id="")
setHierId(string $a_hier_id)
set hierarchical id in dom object
$i
Definition: metadata.php:41
form( $class_path, string $cmd)

References $i, and ilMediaPoolItem\lookupForeignId().

+ Here is the call graph for this function:

◆ createNewObjectReference()

ilPCMediaObjectGUI::createNewObjectReference ( )

Create new media object and replace currrent media item with it.

(keep all instance parameters)

Definition at line 482 of file class.ilPCMediaObjectGUI.php.

482 : void
483 {
484 $this->create(false, true);
485 }
create(bool $a_create_alias=true, bool $a_change_obj_ref=false)
create new media object in dom and update page in db

◆ edit()

ilPCMediaObjectGUI::edit ( )

edit properties form

Definition at line 589 of file class.ilPCMediaObjectGUI.php.

589 : void
590 {
591 if ($this->content_obj->checkInstanceEditing()) {
592 $this->ctrl->redirect($this, "editAlias");
593 }
594 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
595 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editAlias()

ilPCMediaObjectGUI::editAlias ( )

Definition at line 597 of file class.ilPCMediaObjectGUI.php.

597 : void
598 {
600
601 $this->initAliasForm();
602 $this->getAliasValues();
603 $tpl->setContent($this->form_gui->getHTML());
604 }
initAliasForm()
Init alias form.
getAliasValues()
Put alias values into form.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References $tpl.

◆ editStyle()

ilPCMediaObjectGUI::editStyle ( )

Edit Style.

Definition at line 1228 of file class.ilPCMediaObjectGUI.php.

1228 : void
1229 {
1230 $a_seleted_value = "";
1231
1232 $ilCtrl = $this->ctrl;
1233 $tpl = $this->tpl;
1234 $lng = $this->lng;
1235
1236 $this->displayValidationError();
1237
1238 // edit form
1239 $form = new ilPropertyFormGUI();
1240 $form->setFormAction($ilCtrl->getFormAction($this));
1241 $form->setTitle($this->lng->txt("cont_edit_style"));
1242
1243 // characteristic selection
1244 $char_prop = new ilAdvSelectInputGUI(
1245 $this->lng->txt("cont_characteristic"),
1246 "characteristic"
1247 );
1248
1249 $chars = $this->getCharacteristics();
1250 if (is_object($this->content_obj)) {
1251 if (($chars[$a_seleted_value] ?? "") === "" && ($this->content_obj->getClass() !== "")) {
1252 $chars = array_merge(
1253 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1254 $chars
1255 );
1256 }
1257 }
1258
1259 $selected = $this->content_obj->getClass();
1260 if ($selected == "") {
1261 $selected = "MediaContainer";
1262 }
1263
1264 foreach ($chars as $k => $char) {
1265 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1266 $char . '</div>';
1267 $char_prop->addOption($k, $char, $html);
1268 }
1269
1270 $char_prop->setValue($selected);
1271 $form->addItem($char_prop);
1272
1273
1274 // caption style
1275 $cap_style = new ilAdvSelectInputGUI(
1276 $this->lng->txt("cont_caption_style"),
1277 "caption_style"
1278 );
1279 //$this->setBasicTableCellStyles();
1280 $this->setCharacteristics([]);
1281 $this->getCharacteristicsOfCurrentStyle(["media_caption"]);
1282 $chars = $this->getCharacteristics();
1283 $options = $chars;
1284 //$options = array_merge(array("" => $this->lng->txt("none")), $chars);
1285 foreach ($options as $k => $option) {
1286 $html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . '">' .
1287 $option . '</td></tr></table>';
1288 $cap_style->addOption($k, $option, $html);
1289 }
1290
1291 if (count($options) > 0) {
1292 $current_value = $this->content_obj->getCaptionClass() ?: "MediaCaption";
1293 $cap_style->setValue($current_value);
1294 $form->addItem($cap_style);
1295 }
1296
1297
1298
1299 // save button
1300 $form->addCommandButton("saveStyle", $lng->txt("save"));
1301
1302 $html = $form->getHTML();
1303 $tpl->setContent($html);
1304 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
This class represents a property form user interface.

References $lng, $tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), and ilPropertyFormGUI\setTitle().

+ Here is the call graph for this function:

◆ getAliasValues()

ilPCMediaObjectGUI::getAliasValues ( )

Put alias values into form.

Definition at line 868 of file class.ilPCMediaObjectGUI.php.

868 : void
869 {
871
872 // standard view resource
873 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
874 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
875
876 $values["title"] = $this->content_obj->getMediaObject()->getTitle();
877 $values["st_location"] = $std_item->getLocation();
878 $values["st_format"] = $std_item->getFormat();
879
880 // size
881 if ($std_alias_item->definesSize()) {
882 $values["st_width_height"]["width"] = $std_alias_item->getWidth();
883 $values["st_width_height"]["height"] = $std_alias_item->getHeight();
884 $values["st_width_height"]["constr_prop"] = true;
885 } else {
886 if ($std_item->getWidth() !== "" || $std_item->getHeight() !== "") {
887 $values["st_width_height"]["width"] = $std_item->getWidth();
888 $values["st_width_height"]["height"] = $std_item->getHeight();
889 $values["st_width_height"]["constr_prop"] = true;
890 } else {
891 $orig_size = $std_item->getOriginalSize();
892 if (!is_null($orig_size)) {
893 $values["st_width_height"]["width"] = $orig_size["width"];
894 $values["st_width_height"]["height"] = $orig_size["height"];
895 $values["st_width_height"]["constr_prop"] = true;
896 }
897 }
898 }
899
900 // caption
901 $values["st_caption"] = $std_alias_item->getCaption();
902 if (trim($std_item->getCaption()) == "") {
903 $values["def_caption"] = $lng->txt("cont_no_caption");
904 } else {
905 $values["def_caption"] = $std_item->getCaption();
906 }
907
908 // text representation
909 $values["st_text_representation"] = $std_alias_item->getTextRepresentation();
910 if (trim($std_item->getTextRepresentation()) == "") {
911 $values["def_text_representation"] = $lng->txt("cont_no_text");
912 } else {
913 $values["def_text_representation"] = $std_item->getTextRepresentation();
914 }
915
916 // parameters / autostart
917 if ($this->media_type->usesAutoStartParameterOnly(
918 $std_item->getLocation(),
919 $std_item->getFormat()
920 )) { // autostart
921 /*
922 $par = $std_alias_item->getParameters();
923 if ($par["autostart"] == "true") {
924 $values["st_autostart"] = true;
925 }*/
926 } else { // parameters
927 $values["st_parameters"] = $std_alias_item->getParameterString();
928 }
929
930 // size
931 $values["st_derive_size"] = $std_alias_item->definesSize()
932 ? "n"
933 : "y";
934 $values["st_derive_caption"] = $std_alias_item->definesCaption()
935 ? "n"
936 : "y";
937 $values["st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
938 ? "n"
939 : "y";
940 $values["st_derive_parameters"] = $std_alias_item->definesParameters()
941 ? "n"
942 : "y";
943 if (trim($std_item->getParameterString()) == "") {
944 $values["def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
945 } else {
946 $values["def_parameters"] = $std_item->getParameterString();
947 }
948
949 // fullscreen properties
950 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
951 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
952 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
953
954 $values["fullscreen"] = "n";
955 if ($full_alias_item->exists()) {
956 $values["fullscreen"] = "y";
957 }
958
959 $values["full_location"] = $full_item->getLocation();
960 $values["full_format"] = $full_item->getFormat();
961
962 if ($full_alias_item->definesSize()) {
963 $values["full_width_height"]["width"] = $full_alias_item->getWidth();
964 $values["full_width_height"]["height"] = $full_alias_item->getHeight();
965 $values["full_width_height"]["constr_prop"] = true;
966 } else {
967 if ($full_item->getWidth() !== "" || $full_item->getHeight() !== "") {
968 $values["full_width_height"]["width"] = $full_item->getWidth();
969 $values["full_width_height"]["height"] = $full_item->getHeight();
970 $values["full_width_height"]["constr_prop"] = true;
971 } else {
972 $orig_full_size = $full_item->getOriginalSize();
973 if (!is_null($orig_full_size)) {
974 $values["full_width_height"]["width"] = $orig_full_size["width"];
975 $values["full_width_height"]["height"] = $orig_full_size["height"];
976 $values["full_width_height"]["constr_prop"] = true;
977 }
978 }
979 }
980 $values["full_caption"] = $full_alias_item->getCaption();
981 if (trim($full_item->getCaption()) == "") {
982 $values["full_def_caption"] = $lng->txt("cont_no_caption");
983 } else {
984 $values["full_def_caption"] = $full_item->getCaption();
985 }
986 $values["full_text_representation"] = $full_alias_item->getTextRepresentation();
987 if (trim($full_item->getTextRepresentation()) == "") {
988 $values["full_def_text_representation"] = $lng->txt("cont_no_text");
989 } else {
990 $values["full_def_text_representation"] = $full_item->getTextRepresentation();
991 }
992 $values["full_parameters"] = $full_alias_item->getParameterString();
993 $values["full_derive_size"] = $full_alias_item->definesSize()
994 ? "n"
995 : "y";
996 $values["full_derive_caption"] = $full_alias_item->definesCaption()
997 ? "n"
998 : "y";
999 $values["full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
1000 ? "n"
1001 : "y";
1002
1003 // parameters
1004 if ($this->media_type->usesAutoStartParameterOnly(
1005 $full_item->getLocation(),
1006 $full_item->getFormat()
1007 )) { // autostart
1008 /*
1009 $par = $full_alias_item->getParameters();
1010 if ($par["autostart"] == "true") {
1011 $values["full_autostart"] = true;
1012 }*/
1013 } else { // parameters
1014 $values["full_parameters"] = $full_alias_item->getParameterString();
1015 }
1016
1017 $values["full_derive_parameters"] = $full_alias_item->definesParameters()
1018 ? "n"
1019 : "y";
1020 if (trim($full_item->getParameterString()) == "") {
1021 $values["full_def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
1022 } else {
1023 $values["full_def_parameters"] = $full_item->getParameterString();
1024 }
1025 }
1026 $this->form_gui->setValuesByArray($values, true);
1027 }

References $lng.

◆ getEnabledMapAreas()

ilPCMediaObjectGUI::getEnabledMapAreas ( )

Definition at line 124 of file class.ilPCMediaObjectGUI.php.

124 : bool
125 {
127 }

References $enabledmapareas.

◆ getHeader()

ilPCMediaObjectGUI::getHeader ( )

Definition at line 111 of file class.ilPCMediaObjectGUI.php.

111 : string
112 {
113 return $this->header;
114 }

References $header.

◆ getStyleInput()

ilPCMediaObjectGUI::getStyleInput ( )

Definition at line 1306 of file class.ilPCMediaObjectGUI.php.

1307 {
1308 // characteristic selection
1309 $char_prop = new ilAdvSelectInputGUI(
1310 $this->lng->txt("cont_characteristic"),
1311 "characteristic"
1312 );
1313
1314 $selected = $this->content_obj->getClass();
1315 if ($selected == "") {
1316 $selected = "MediaContainer";
1317 }
1318
1319 $chars = $this->getCharacteristics();
1320 if (is_object($this->content_obj)) {
1321 if (($chars[$selected] ?? "") == "" && ($this->content_obj->getClass() != "")) {
1322 $chars = array_merge(
1323 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1324 $chars
1325 );
1326 }
1327 }
1328
1329 foreach ($chars as $k => $char) {
1330 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1331 $char . '</div>';
1332 $char_prop->addOption($k, $char, $html);
1333 }
1334
1335 $char_prop->setValue($selected);
1336
1337 return $char_prop;
1338 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getSubCmd()

ilPCMediaObjectGUI::getSubCmd ( )

Definition at line 100 of file class.ilPCMediaObjectGUI.php.

100 : string
101 {
102 return $this->sub_cmd;
103 }

References $sub_cmd.

◆ getTabs()

ilPCMediaObjectGUI::getTabs ( bool  $a_create = false,
bool  $a_change_obj_ref = false 
)

Definition at line 1361 of file class.ilPCMediaObjectGUI.php.

1364 : void {
1365 $ilCtrl = $this->ctrl;
1366 $ilTabs = $this->tabs;
1367
1368 if (!$a_create) {
1369 if ($this->checkStyleSelection()) {
1370 $ilTabs->addTarget(
1371 "cont_style",
1372 $ilCtrl->getLinkTarget($this, "editStyle"),
1373 "editStyle",
1374 get_class($this)
1375 );
1376 }
1377
1378 if ($this->content_obj->checkInstanceEditing()) {
1379 $ilTabs->addTarget(
1380 "cont_mob_inst_prop",
1381 $ilCtrl->getLinkTarget($this, "editAlias"),
1382 "editAlias",
1383 get_class($this)
1384 );
1385
1386 if ($this->getEnabledMapAreas()) {
1387 $st_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1388 if (is_object($st_item)) {
1389 $format = $st_item->getFormat();
1390 if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg"))) {
1391 $ilTabs->addTarget(
1392 "cont_inst_map_areas",
1393 $ilCtrl->getLinkTargetByClass("ilpcimagemapeditorgui", "editMapAreas"),
1394 array(),
1395 "ilpcimagemapeditorgui"
1396 );
1397 }
1398 }
1399 }
1400 }
1401 } else {
1402 if ($a_change_obj_ref) {
1403 $cmd = "changeObjectReference";
1404 } else {
1405 $cmd = "insert";
1406 }
1407
1408 if ($a_change_obj_ref) {
1409 $ilCtrl->setParameter($this, "subCmd", "insertNew");
1410 $ilTabs->addSubTabTarget(
1411 "cont_new_mob",
1412 $ilCtrl->getLinkTarget($this, $cmd),
1413 $cmd
1414 );
1415
1416 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
1417 $ilTabs->addSubTabTarget(
1418 "cont_mob_from_media_pool",
1419 $ilCtrl->getLinkTarget($this, $cmd),
1420 $cmd
1421 );
1422 $ilCtrl->setParameter($this, "subCmd", "");
1423 }
1424 }
1425 }
checkStyleSelection()
Checks whether style selection shoudl be available or not.
addTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
$format
Definition: metadata.php:235

References $format.

◆ initAliasForm()

ilPCMediaObjectGUI::initAliasForm ( )

Init alias form.

Definition at line 609 of file class.ilPCMediaObjectGUI.php.

609 : void
610 {
612 $ilCtrl = $this->ctrl;
613
614 $this->form_gui = new ilPropertyFormGUI();
615
616 // standard view resource
617 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
618
619 // title, location and format
620 $title = new ilNonEditableValueGUI($lng->txt("title"), "title");
621 $this->form_gui->addItem($title);
622 $loc = new ilNonEditableValueGUI(
623 $this->lng->txt("cont_" . strtolower($std_item->getLocationType())),
624 "st_location"
625 );
626 $this->form_gui->addItem($loc);
628 $this->lng->txt("cont_format"),
629 "st_format"
630 );
631 $this->form_gui->addItem($format);
632
633 // standard size
634 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "st_derive_size");
635 $orig_size = $std_item->getOriginalSize();
636 $add_str = (!is_null($orig_size))
637 ? " (" . $orig_size["width"] . " x " . $orig_size["height"] . ")"
638 : "";
639 $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
640 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
641 $radio_size->addOption($op1);
642
643 // width height
644 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
645 " / " . $lng->txt("cont_height"), "st_width_height");
646 if (is_int(strpos($std_item->getFormat(), "image"))
647 && $std_item->getLocationType() === "LocalFile") {
648 $width_height->setSupportConstraintsProps(true);
649 $width_height->setConstrainProportions(true);
650 }
651 $op2->addSubItem($width_height);
652
653 $radio_size->addOption($op2);
654 $this->form_gui->addItem($radio_size);
655
656 // standard caption
657 $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "st_derive_caption");
658 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
659 $def_cap = new ilNonEditableValueGUI("", "def_caption");
660 $op1->addSubItem($def_cap);
661 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
662 $rad_caption->addOption($op1);
663
664 $caption = new ilTextAreaInputGUI("", "st_caption");
665 $caption->setCols(30);
666 $caption->setRows(2);
667 $op2->addSubItem($caption);
668
669 /*$caption = new ilTextInputGUI("", "st_caption");
670 $caption->setSize(40);
671 $caption->setMaxLength(200);
672 $op2->addSubItem($caption);*/
673 $rad_caption->addOption($op2);
674 $this->form_gui->addItem($rad_caption);
675
676 // standard text representation
677 if ($this->media_type->usesAltTextProperty($std_item->getFormat())) {
678 $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "st_derive_text_representation");
679 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
680 $def_tr = new ilNonEditableValueGUI("", "def_text_representation");
681 $op1->addSubItem($def_tr);
682 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
683 $tr = new ilTextAreaInputGUI("", "st_text_representation");
684 $tr->setCols(30);
685 $tr->setRows(2);
686 $rad_tr->addOption($op1);
687 $op2->addSubItem($tr);
688 $rad_tr->addOption($op2);
689 $this->form_gui->addItem($rad_tr);
690 $rad_tr->setInfo($lng->txt("text_repr_info"));
691 }
692
693 // standard parameters
694 if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
695 if ($this->media_type->usesAutoStartParameterOnly(
696 $std_item->getLocation(),
697 $std_item->getFormat()
698 )) { // autostart
699 /*
700 $par = $std_item->getParameters();
701 $def_str = ($par["autostart"] == "true")
702 ? " (" . $lng->txt("yes") . ")"
703 : " (" . $lng->txt("no") . ")";
704 $rad_auto = new ilRadioGroupInputGUI(
705 $lng->txt("cont_autostart"),
706 "st_derive_parameters"
707 );
708 $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
709 $rad_auto->addOption($op1);
710 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
711 $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "st_autostart");
712 $op2->addSubItem($auto);
713 $rad_auto->addOption($op2);
714 $this->form_gui->addItem($rad_auto);*/
715 } else { // parameters
716 $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "st_derive_parameters");
717 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
718 $def_par = new ilNonEditableValueGUI("", "def_parameters");
719 $op1->addSubItem($def_par);
720 $rad_parameters->addOption($op1);
721 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
722 $par = new ilTextAreaInputGUI("", "st_parameters");
723 $par->setRows(5);
724 $par->setCols(50);
725 $op2->addSubItem($par);
726 $rad_parameters->addOption($op2);
727 $this->form_gui->addItem($rad_parameters);
728 }
729 }
730
731 // fullscreen view
732 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
733 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
734
735 $fs_sec = new ilFormSectionHeaderGUI();
736 $fs_sec->setTitle($lng->txt("cont_fullscreen"));
737 $this->form_gui->addItem($fs_sec);
738
739
740 // resource
741 $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "fullscreen");
742 $op1 = new ilRadioOption($lng->txt("cont_none"), "n");
743 $radio_prop->addOption($op1);
744 $op2 = new ilRadioOption($this->lng->txt("cont_" . strtolower($full_item->getLocationType())) . ": " .
745 $full_item->getLocation(), "y");
746 $radio_prop->addOption($op2);
747 $this->form_gui->addItem($radio_prop);
748
749 // format
751 $this->lng->txt("cont_format"),
752 "full_format"
753 );
754 $this->form_gui->addItem($format);
755
756 // full size
757 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_derive_size");
758 $fw_size = $std_item->getOriginalSize();
759 $add_str = (!is_null($fw_size))
760 ? " (" . $fw_size["width"] . " x " . $fw_size["height"] . ")"
761 : "";
762 $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
763 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
764 $radio_size->addOption($op1);
765
766 // width height
767 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
768 " / " . $lng->txt("cont_height"), "full_width_height");
769 if (is_int(strpos($full_item->getFormat(), "image"))
770 && $full_item->getLocationType() === "LocalFile") {
771 $width_height->setSupportConstraintsProps(true);
772 $width_height->setConstrainProportions(true);
773 }
774 $op2->addSubItem($width_height);
775
776 $radio_size->addOption($op2);
777 $this->form_gui->addItem($radio_size);
778
779 // fullscreen caption
780 $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "full_derive_caption");
781 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
782 $def_cap = new ilNonEditableValueGUI("", "full_def_caption");
783 $op1->addSubItem($def_cap);
784 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
785 $rad_caption->addOption($op1);
786
787 $caption = new ilTextAreaInputGUI("", "full_caption");
788 $caption->setCols(30);
789 $caption->setRows(2);
790 $op2->addSubItem($caption);
791
792 /*$caption = new ilTextInputGUI("", "full_caption");
793 $caption->setSize(40);
794 $caption->setMaxLength(200);
795 $op2->addSubItem($caption);*/
796 $rad_caption->addOption($op2);
797 $this->form_gui->addItem($rad_caption);
798
799 // fullscreen text representation
800 if (substr($full_item->getFormat(), 0, 5) == "image") {
801 $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "full_derive_text_representation");
802 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
803 $def_tr = new ilNonEditableValueGUI("", "full_def_text_representation");
804 $op1->addSubItem($def_tr);
805 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
806 $tr = new ilTextAreaInputGUI("", "full_text_representation");
807 $tr->setCols(30);
808 $tr->setRows(2);
809 $rad_tr->addOption($op1);
810 $op2->addSubItem($tr);
811 $rad_tr->addOption($op2);
812 $this->form_gui->addItem($rad_tr);
813 $rad_tr->setInfo($lng->txt("text_repr_info"));
814 }
815
816 // fullscreen parameters
817 if ($this->media_type->usesParameterProperty($full_item->getFormat())) {
818 if ($this->media_type->usesAutoStartParameterOnly(
819 $full_item->getLocation(),
820 $full_item->getFormat()
821 )) { // autostart
822 /*
823 $par = $full_item->getParameters();
824 $def_str = ($par["autostart"] == "true")
825 ? " (" . $lng->txt("yes") . ")"
826 : " (" . $lng->txt("no") . ")";
827 $rad_auto = new ilRadioGroupInputGUI(
828 $lng->txt("cont_autostart"),
829 "full_derive_parameters"
830 );
831 $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
832 $rad_auto->addOption($op1);
833 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
834 $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "full_autostart");
835 $op2->addSubItem($auto);
836 $rad_auto->addOption($op2);
837 $this->form_gui->addItem($rad_auto);*/
838 } else { // parameters
839 $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "full_derive_parameters");
840 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
841 $def_par = new ilNonEditableValueGUI("", "full_def_parameters");
842 $op1->addSubItem($def_par);
843 $rad_parameters->addOption($op1);
844 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
845 $par = new ilTextAreaInputGUI("", "full_parameters");
846 $par->setRows(5);
847 $par->setCols(50);
848 $op2->addSubItem($par);
849 $rad_parameters->addOption($op2);
850 $this->form_gui->addItem($rad_parameters);
851 }
852 }
853 }
854
855 $this->form_gui->setTitle($lng->txt("cont_edit_mob_alias_prop"));
856 $this->form_gui->addCommandButton("saveAliasProperties", $lng->txt("save"));
857 $lm_set = new ilSetting("lm");
858 if ($lm_set->get("replace_mob_feature")) {
859 $this->form_gui->addCommandButton("changeObjectReference", $lng->txt("cont_change_object_reference"));
860 }
861 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
862 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$lm_set

References $format, $lm_set, $lng, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ insert()

ilPCMediaObjectGUI::insert (   $a_post_cmd = "edpost",
  $a_submit_cmd = "create_mob",
  $a_input_error = false 
)

Definition at line 197 of file class.ilPCMediaObjectGUI.php.

201 : void {
202 $ilTabs = $this->tabs;
204 $ilCtrl = $this->ctrl;
206
208
209 if (in_array($sub_command, ["insertNew", "insertFromPool"])) {
210 $this->edit_repo->setSubCmd($sub_command);
211 }
212
213 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
214 $sub_command = $this->edit_repo->getSubCmd();
215 }
216
217 switch ($sub_command) {
218 case "insertFromPool":
219 $this->insertFromPool();
220 break;
221
222 case "poolSelection":
223 $this->poolSelection();
224 break;
225
226 case "selectPool":
227 $this->selectPool();
228 break;
229
230 case "insertNew":
231 default:
232 $this->getTabs(true);
233 $ilTabs->setSubTabActive("cont_new_mob");
234
235 if ($a_input_error) {
237 } else {
238 $mob_gui = new ilObjMediaObjectGUI("");
239 $mob_gui->initForm("create");
240 $form = $mob_gui->getForm();
241 }
242 $form->setFormAction($ilCtrl->getFormAction($this, "create_mob"));
244 $form->addCommandButton("create_mob", $lng->txt("save"));
245 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
246
247 $this->displayValidationError();
248
250
251 break;
252 }
253 }

References ilPageContentGUI\$sub_command.

◆ insertFromPool()

ilPCMediaObjectGUI::insertFromPool ( bool  $a_change_obj_ref = false)

Insert media object from pool.

Definition at line 328 of file class.ilPCMediaObjectGUI.php.

328 : void
329 {
330 $ilCtrl = $this->ctrl;
331 $ilAccess = $this->access;
332 $ilTabs = $this->tabs;
335 $ui = $this->ui;
336
337 if ($this->edit_repo->getMediaPool() > 0 &&
338 $ilAccess->checkAccess("write", "", $this->edit_repo->getMediaPool())
339 && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getMediaPool())) == "mep") {
340 $html = "";
341 $tb = new ilToolbarGUI();
342
343 // button: select pool
344 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
345 if ($a_change_obj_ref) {
346 $tb->addButton(
347 $lng->txt("cont_switch_to_media_pool"),
348 $ilCtrl->getLinkTarget($this, "changeObjectReference")
349 );
350 } else {
351 $tb->addButton(
352 $lng->txt("cont_switch_to_media_pool"),
353 $ilCtrl->getLinkTarget($this, "insert")
354 );
355 }
356 $ilCtrl->setParameter($this, "subCmd", "");
357
358 // view mode: pool view (folders/all media objects)
359 $f = $ui->factory();
360 $tcmd = ($a_change_obj_ref)
361 ? "changeObjectReference"
362 : "insert";
363 $lng->loadLanguageModule("mep");
364 $ilCtrl->setParameter($this, "pool_view", "folder");
365 $actions[$lng->txt("folders")] = $ilCtrl->getLinkTarget($this, $tcmd);
366 $ilCtrl->setParameter($this, "pool_view", "all");
367 $actions[$lng->txt("mep_all_mobs")] = $ilCtrl->getLinkTarget($this, $tcmd);
368 $ilCtrl->setParameter($this, "pool_view", $this->pool_view);
369 $aria_label = $lng->txt("cont_change_pool_view");
370 $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == "folder")
371 ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
372 $tb->addSeparator();
373 $tb->addComponent($view_control);
374
375 $html = $tb->getHTML();
376
377 $this->getTabs(true, $a_change_obj_ref);
378 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
379
380 $pool = new ilObjMediaPool($this->edit_repo->getMediaPool());
381 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
382 $tcmd = ($a_change_obj_ref)
383 ? "changeObjectReference"
384 : "insert";
385 $tmode = ($a_change_obj_ref)
388
389 // handle table sub commands and get the table
390 if ($this->getSubCmd() == "applyFilter") {
391 $mpool_table = new ilMediaPoolTableGUI(
392 $this,
393 $tcmd,
394 $pool,
395 "mep_folder",
396 $tmode,
397 $this->pool_view == "all"
398 );
399 $mpool_table->resetOffset();
400 $mpool_table->writeFilterToSession();
401 }
402 if ($this->getSubCmd() == "resetFilter") {
403 $mpool_table = new ilMediaPoolTableGUI(
404 $this,
405 $tcmd,
406 $pool,
407 "mep_folder",
408 $tmode,
409 $this->pool_view == "all"
410 );
411 $mpool_table->resetOffset();
412 $mpool_table->resetFilter();
413 }
414 $mpool_table = new ilMediaPoolTableGUI(
415 $this,
416 $tcmd,
417 $pool,
418 "mep_folder",
419 $tmode,
420 $this->pool_view == "all"
421 );
422
423 $html .= $mpool_table->getHTML();
424
425 $tpl->setContent($html);
426 } else {
427 $this->poolSelection($a_change_obj_ref);
428 }
429 }
loadLanguageModule(string $a_module)
Load language module.
TableGUI class for recent changes in wiki.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References Vendor\Package\$f, $lng, $tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), ilMediaPoolTableGUI\IL_MEP_SELECT, and ilMediaPoolTableGUI\IL_MEP_SELECT_SINGLE.

+ Here is the call graph for this function:

◆ leftAlign()

ilPCMediaObjectGUI::leftAlign ( )

align media object to left

Definition at line 1173 of file class.ilPCMediaObjectGUI.php.

1173 : void
1174 {
1175 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1176 $std_alias_item->setHorizontalAlign("Left");
1177 $this->updateAndReturn();
1178 }

◆ leftFloatAlign()

ilPCMediaObjectGUI::leftFloatAlign ( )

align media object to left, floating text

Definition at line 1193 of file class.ilPCMediaObjectGUI.php.

1193 : void
1194 {
1195 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1196 $std_alias_item->setHorizontalAlign("LeftFloat");
1197 $this->updateAndReturn();
1198 }

◆ poolSelection()

ilPCMediaObjectGUI::poolSelection ( bool  $a_change_obj_ref = false)

Pool Selection.

Definition at line 451 of file class.ilPCMediaObjectGUI.php.

453 : void {
455 $ilTabs = $this->tabs;
456 $ilCtrl = $this->ctrl;
457
458 $this->getTabs(true, $a_change_obj_ref);
459 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
460
461 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
462 if ($a_change_obj_ref) {
463 $exp = new ilPoolSelectorGUI($this, "changeObjectReference", $this, "changeObjectReference");
464 } else {
465 $exp = new ilPoolSelectorGUI($this, "insert");
466 }
467
468 // filter
469 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
470 $exp->setClickableTypes(array('mep'));
471
472 if (!$exp->handleCommand()) {
473 $tpl->setContent($exp->getHTML());
474 }
475 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ rightAlign()

ilPCMediaObjectGUI::rightAlign ( )

align media object to right

Definition at line 1183 of file class.ilPCMediaObjectGUI.php.

1183 : void
1184 {
1185 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1186 $std_alias_item->setHorizontalAlign("Right");
1187 $this->updateAndReturn();
1188 }

◆ rightFloatAlign()

ilPCMediaObjectGUI::rightFloatAlign ( )

align media object to right, floating text

Definition at line 1203 of file class.ilPCMediaObjectGUI.php.

1203 : void
1204 {
1205 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1206 $std_alias_item->setHorizontalAlign("RightFloat");
1207 $this->updateAndReturn();
1208 }

◆ saveAliasProperties()

ilPCMediaObjectGUI::saveAliasProperties ( )

save table properties in db and return to page edit screen

Definition at line 1032 of file class.ilPCMediaObjectGUI.php.

1032 : void
1033 {
1034 $this->initAliasForm();
1036 $form->checkInput();
1037
1038 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1039 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
1040 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1041 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
1042
1043 // standard size
1044 if ($form->getInput("st_derive_size") == "y") {
1045 $std_alias_item->deriveSize();
1046 } else {
1047 $size = $this->request->getStringArray("st_width_height");
1048 $std_alias_item->setWidth($size["width"]);
1049 $std_alias_item->setHeight($size["height"]);
1050 }
1051
1052 // standard caption
1053 if ($form->getInput("st_derive_caption") == "y") {
1054 $std_alias_item->deriveCaption();
1055 } else {
1056 $std_alias_item->setCaption($form->getInput("st_caption"));
1057 }
1058
1059 // text representation
1060 if ($form->getInput("st_derive_text_representation") == "y") {
1061 $std_alias_item->deriveTextRepresentation();
1062 } else {
1063 $std_alias_item->setTextRepresentation(
1064 $form->getInput("st_text_representation")
1065 );
1066 }
1067
1068 // standard parameters
1069 if ($form->getInput("st_derive_parameters") == "y") {
1070 $std_alias_item->deriveParameters();
1071 } else {
1072 if ($this->media_type->usesAutoStartParameterOnly(
1073 $std_item->getLocation(),
1074 $std_item->getFormat()
1075 )) { // autostart
1076 //
1077 } else { // parameters
1078 $std_alias_item->setParameters(
1080 utf8_decode($form->getInput("st_parameters"))
1081 )
1082 );
1083 }
1084 }
1085
1086 if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1087 if ($form->getInput("fullscreen") == "y") {
1088 if (!$full_alias_item->exists()) {
1089 $full_alias_item->insert();
1090 }
1091
1092 // fullscreen size
1093 if ($form->getInput("full_derive_size") == "y") {
1094 $full_alias_item->deriveSize();
1095 } else {
1096 $full_size = $this->request->getStringArray("full_width_height");
1097 $full_alias_item->setWidth($full_size["width"]);
1098 $full_alias_item->setHeight($full_size["height"]);
1099 }
1100
1101 // fullscreen caption
1102 if ($form->getInput("full_derive_caption") == "y") {
1103 $full_alias_item->deriveCaption();
1104 } else {
1105 $full_alias_item->setCaption($form->getInput("full_caption"));
1106 }
1107
1108 // fullscreen text representation
1109 if ($form->getInput("full_derive_text_representation") == "y") {
1110 $full_alias_item->deriveTextRepresentation();
1111 } else {
1112 $full_alias_item->setTextRepresentation(
1113 $form->getInput("full_text_representation")
1114 );
1115 }
1116
1117 // fullscreen parameters
1118 if ($form->getInput("full_derive_parameters") == "y") {
1119 $full_alias_item->deriveParameters();
1120 } else {
1121 if ($this->media_type->usesAutoStartParameterOnly(
1122 $full_item->getLocation(),
1123 $full_item->getFormat()
1124 )) { // autostart
1125 //
1126 } else {
1127 $full_alias_item->setParameters(ilUtil::extractParameterString(utf8_decode($form->getInput("full_parameters"))));
1128 }
1129 }
1130 } else {
1131 if ($full_alias_item->exists()) {
1132 $full_alias_item->delete();
1133 }
1134 }
1135 }
1136
1137 $this->updated = $this->pg_obj->update();
1138 if ($this->updated === true) {
1139 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1140 $this->ctrl->redirect($this, "editAlias");
1141 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1142 } else {
1143 $this->pg_obj->addHierIDs();
1144 $this->editAlias();
1145 }
1146 }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
static extractParameterString(string $a_parstr)

References ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilUtil\extractParameterString(), ilPropertyFormGUI\getInput(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ saveStyle()

ilPCMediaObjectGUI::saveStyle ( )

Save Style.

Definition at line 1343 of file class.ilPCMediaObjectGUI.php.

1343 : void
1344 {
1345 $this->content_obj->setClass(
1346 $this->request->getString("characteristic")
1347 );
1348 $this->content_obj->setCaptionClass(
1349 $this->request->getString("caption_style")
1350 );
1351
1352 $this->updated = $this->pg_obj->update();
1353 if ($this->updated === true) {
1354 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1355 } else {
1356 $this->pg_obj->addHierIDs();
1357 $this->editStyle();
1358 }
1359 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ selectObjectReference()

ilPCMediaObjectGUI::selectObjectReference ( )

Create new media object and replace currrent media item with it.

(keep all instance parameters)

Definition at line 491 of file class.ilPCMediaObjectGUI.php.

491 : void
492 {
493 $ilCtrl = $this->ctrl;
495 $ids = $this->request->getIntArray("id");
496 if (count($ids) == 1) {
497 $fid = ilMediaPoolItem::lookupForeignId($ids[0]);
498 $this->content_obj->readMediaObject($fid);
499 $this->content_obj->updateObjectReference();
500 $this->updated = $this->pg_obj->update();
501 } else {
502 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_select_max_one_item"), true);
503 $ilCtrl->redirect($this, "changeObjectReference");
504 }
505 $ilCtrl->redirect($this, "editAlias");
506 }

References $lng, and ilMediaPoolItem\lookupForeignId().

+ Here is the call graph for this function:

◆ selectPool()

ilPCMediaObjectGUI::selectPool ( bool  $a_change_obj_ref = false)

Select concrete pool.

Definition at line 434 of file class.ilPCMediaObjectGUI.php.

436 : void {
437 $ilCtrl = $this->ctrl;
438
439 $this->edit_repo->setMediaPool($this->request->getInt("pool_ref_id"));
440 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
441 if ($a_change_obj_ref) {
442 $ilCtrl->redirect($this, "changeObjectReference");
443 } else {
444 $ilCtrl->redirect($this, "insert");
445 }
446 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc

◆ setEnabledMapAreas()

ilPCMediaObjectGUI::setEnabledMapAreas ( bool  $a_enabledmapareas)

Set Enable map areas.

Definition at line 119 of file class.ilPCMediaObjectGUI.php.

119 : void
120 {
121 $this->enabledmapareas = $a_enabledmapareas;
122 }

◆ setHeader()

ilPCMediaObjectGUI::setHeader ( string  $a_title = "")

Definition at line 106 of file class.ilPCMediaObjectGUI.php.

106 : void
107 {
108 $this->header = $a_title;
109 }

◆ setSubCmd()

ilPCMediaObjectGUI::setSubCmd ( string  $a_val)

Set table sub command.

Definition at line 95 of file class.ilPCMediaObjectGUI.php.

95 : void
96 {
97 $this->sub_cmd = $a_val;
98 }

Field Documentation

◆ $access

ilAccessHandler ilPCMediaObjectGUI::$access
protected

Definition at line 31 of file class.ilPCMediaObjectGUI.php.

◆ $enabledmapareas

bool ilPCMediaObjectGUI::$enabledmapareas = false
protected

Definition at line 29 of file class.ilPCMediaObjectGUI.php.

Referenced by getEnabledMapAreas().

◆ $form

ilPropertyFormGUI ilPCMediaObjectGUI::$form
protected

Definition at line 26 of file class.ilPCMediaObjectGUI.php.

◆ $form_gui

ilPropertyFormGUI ilPCMediaObjectGUI::$form_gui
protected

Definition at line 27 of file class.ilPCMediaObjectGUI.php.

◆ $header

string ilPCMediaObjectGUI::$header = ""

Definition at line 36 of file class.ilPCMediaObjectGUI.php.

Referenced by getHeader().

◆ $media_type

ILIAS MediaObjects MediaType MediaTypeManager ilPCMediaObjectGUI::$media_type
protected

Definition at line 38 of file class.ilPCMediaObjectGUI.php.

◆ $page_back_title

string ilPCMediaObjectGUI::$page_back_title = ""
protected

Definition at line 28 of file class.ilPCMediaObjectGUI.php.

◆ $pool_view

string ilPCMediaObjectGUI::$pool_view = ""
protected

Definition at line 35 of file class.ilPCMediaObjectGUI.php.

◆ $sub_cmd

string ilPCMediaObjectGUI::$sub_cmd = ""
protected

Definition at line 37 of file class.ilPCMediaObjectGUI.php.

Referenced by getSubCmd().

◆ $tabs

ilTabsGUI ilPCMediaObjectGUI::$tabs
protected

Definition at line 30 of file class.ilPCMediaObjectGUI.php.

◆ $toolbar

ilToolbarGUI ilPCMediaObjectGUI::$toolbar
protected

Definition at line 32 of file class.ilPCMediaObjectGUI.php.

◆ $ui

ILIAS DI UIServices ilPCMediaObjectGUI::$ui
protected

Definition at line 34 of file class.ilPCMediaObjectGUI.php.

◆ $user

ilObjUser ilPCMediaObjectGUI::$user
protected

Definition at line 33 of file class.ilPCMediaObjectGUI.php.


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