ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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="", $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 ()
 
 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 = ""
 
DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 

Protected Member Functions

 insert_applyFilter ()
 
 insert_resetFilter ()
 
 checkFixSize ()
 
 create_mob ()
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

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
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 1461 of file class.ilPCMediaObjectGUI.php.

1461 : array
1462 {
1463 $chars = self::_getStandardCharacteristics();
1464 if ($a_style_id > 0 &&
1465 ilObject::_lookupType($a_style_id) == "sty") {
1466 $style = new ilObjStyleSheet($a_style_id);
1467 $chars = $style->getCharacteristics("media_cont");
1468 $new_chars = array();
1469 foreach ($chars as $char) {
1470 if (($chars[$char] ?? "") != "") { // keep lang vars for standard chars
1471 $new_chars[$char] = $chars[$char];
1472 } else {
1473 $new_chars[$char] = $char;
1474 }
1475 asort($new_chars);
1476 }
1477 $chars = $new_chars;
1478 }
1479 return $chars;
1480 }
Class ilObjStyleSheet.
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 1179 of file class.ilPCMediaObjectGUI.php.

1179 : void
1180 {
1181 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1182 $std_alias_item->setHorizontalAlign("Center");
1183 $this->updateAndReturn();
1184 }

◆ changeObjectReference()

ilPCMediaObjectGUI::changeObjectReference ( )

Change object reference.

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

268 : void
269 {
270 $ilTabs = $this->tabs;
271 $ilCtrl = $this->ctrl;
273
275
276 if (in_array($sub_command, ["insertNew", "insertFromPool"])) {
277 $this->edit_repo->setSubCmd($sub_command);
278 }
279
280 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
281 $sub_command = $this->edit_repo->getSubCmd();
282 }
283
284 switch ($sub_command) {
285 case "insertFromPool":
286 $this->insertFromPool(true);
287 break;
288
289 case "poolSelection":
290 $this->poolSelection(true);
291 break;
292
293 case "selectPool":
294 $this->selectPool(true);
295 break;
296
297 case "insertNew":
298 default:
299 $ilCtrl->setParameter($this, "subCmd", "changeObjectReference");
300 $this->getTabs(true, true);
301 $ilTabs->setSubTabActive("cont_new_mob");
302
303 $this->displayValidationError();
304
305 $mob_gui = new ilObjMediaObjectGUI("");
306 $mob_gui->initForm("create");
307 $form = $mob_gui->getForm();
308 $form->setFormAction($ilCtrl->getFormAction($this));
310 $form->addCommandButton("createNewObjectReference", $lng->txt("save"));
311 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
312 $this->tpl->setContent($form->getHTML());
313 }
314 }
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 316 of file class.ilPCMediaObjectGUI.php.

316 : void
317 {
318 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
319 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
320
321 $ok = false;
322 if (($std_alias_item->getWidth() != "" && $std_alias_item->getHeight() != "")) {
323 $ok = true;
324 }
325 if ($std_alias_item->getWidth() == "" && $std_alias_item->getHeight() == ""
326 && $std_item->getWidth() != "" && $std_item->getHeight() != "") {
327 $ok = true;
328 }
329
330 if (!$ok) {
331 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("mob_no_fixed_size_map_editing"));
332 }
333 }

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 1229 of file class.ilPCMediaObjectGUI.php.

1229 : bool
1230 {
1231 // check whether there is more than one style class
1232 $chars = $this->getCharacteristics();
1233
1234 if (count($chars) > 1 ||
1235 ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media")) {
1236 return true;
1237 }
1238 return false;
1239 }

◆ copyToClipboard()

ilPCMediaObjectGUI::copyToClipboard ( )

copy media object to clipboard

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

1167 : void
1168 {
1169 $ilUser = $this->user;
1170
1171 $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1172 $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
1173 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1174 }
addObjectToClipboard(int $a_item_id, string $a_type, string $a_title, int $a_parent=0, string $a_time='', int $a_order_nr=0)
add an item to user's personal clipboard

References 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 521 of file class.ilPCMediaObjectGUI.php.

524 : ?ilPCMediaObject {
525 $ilCtrl = $this->ctrl;
527
528 if ($this->sub_command == "insertFromPool") {
529 $ids = $this->request->getIntArray("id");
530 for ($i = count($ids) - 1; $i >= 0; $i--) {
531 $fid = ilMediaPoolItem::lookupForeignId($ids[$i]);
532 $this->content_obj = new ilPCMediaObject($this->getPage());
533 $this->content_obj->readMediaObject($fid);
534 $this->content_obj->createAlias(
535 $this->pg_obj,
536 $this->request->getHierId(),
537 $this->pc_id
538 );
539 }
540 $this->updated = $this->pg_obj->update();
541
542 $this->redirectToParent($this->request->getHierId());
543 }
544
545 // check form input
546 $mob_gui = new ilObjMediaObjectGUI("");
547 $mob_gui->initForm("create");
548
549 if (!$mob_gui->checkFormInput()) {
550 $this->form = $mob_gui->getForm();
551 $this->insert("edpost", "", true);
552 return null;
553 }
554 // create dummy object in db (we need an id)
555 if ($a_change_obj_ref != true) {
556 $this->content_obj = new ilPCMediaObject($this->getPage());
557 }
558 $this->content_obj->createMediaObject();
559 $media_obj = $this->content_obj->getMediaObject();
560
561 $mob_gui->setObjectPerCreationForm($media_obj);
562
563 if ($a_create_alias) {
564 // need a pcmediaobject here
565 //$this->node = $this->createPageContentNode();
566
567 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
568 $this->updated = $this->pg_obj->update();
569 if ($this->updated === true) {
570 $this->pg_obj->stripHierIDs();
571 $this->pg_obj->addHierIDs();
572 $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
573 $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
574 $this->content_obj->setHierId($this->content_obj->readHierId());
575 $this->setHierId($this->content_obj->readHierId());
576 $this->content_obj->setPcId($this->content_obj->readPCId());
577 $this->tpl->setOnScreenMessage('success', $lng->txt("saved_media_object"), true);
578 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
579
580 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
581 } else {
582 $this->insert();
583 }
584 } else {
585 if ($a_change_obj_ref == true) {
586 $this->content_obj->updateObjectReference();
587 $this->updated = $this->pg_obj->update();
588 $this->ctrl->redirect($this, "editAlias");
589 }
590 return $this->content_obj;
591 }
592 return null;
593 }
static lookupForeignId(int $a_id)
insert( $a_post_cmd="edpost", $a_submit_cmd="", $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
form( $class_path, string $cmd, string $submit_caption="")

References ilMediaPoolItem\lookupForeignId().

+ Here is the call graph for this function:

◆ create_mob()

ilPCMediaObjectGUI::create_mob ( )
protected

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

595 : void
596 {
597 $this->create();
598 }
create(bool $a_create_alias=true, bool $a_change_obj_ref=false)
create new media object in dom and update page in db

◆ createNewObjectReference()

ilPCMediaObjectGUI::createNewObjectReference ( )

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

(keep all instance parameters)

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

492 : void
493 {
494 $this->create(false, true);
495 }

◆ edit()

ilPCMediaObjectGUI::edit ( )

edit properties form

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

603 : void
604 {
605 if ($this->content_obj->checkInstanceEditing()) {
606 $this->ctrl->redirect($this, "editAlias");
607 }
608 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
609 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editAlias()

ilPCMediaObjectGUI::editAlias ( )

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

611 : void
612 {
614
615 $this->initAliasForm();
616 $this->getAliasValues();
617 $tpl->setContent($this->form_gui->getHTML());
618 }
initAliasForm()
Init alias form.
getAliasValues()
Put alias values into form.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

◆ editStyle()

ilPCMediaObjectGUI::editStyle ( )

Edit Style.

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

1244 : void
1245 {
1246 $a_seleted_value = "";
1247
1248 $ilCtrl = $this->ctrl;
1249 $tpl = $this->tpl;
1250 $lng = $this->lng;
1251 $this->displayValidationError();
1252
1253 // edit form
1254 $form = new ilPropertyFormGUI();
1255 $form->setFormAction($ilCtrl->getFormAction($this));
1256 $form->setTitle($this->lng->txt("cont_edit_style"));
1257 // characteristic selection
1258 $char_prop = new ilSelectInputGUI(
1259 $this->lng->txt("cont_characteristic"),
1260 "characteristic"
1261 );
1262
1263 $chars = $this->getCharacteristics();
1264 if (is_object($this->content_obj)) {
1265 if (($chars[$a_seleted_value] ?? "") === "" && ($this->content_obj->getClass() !== "")) {
1266 $chars = array_merge(
1267 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1268 $chars
1269 );
1270 }
1271 }
1272
1273 $selected = $this->content_obj->getClass();
1274 if ($selected == "") {
1275 $selected = "MediaContainer";
1276 }
1277
1278 $options = [];
1279 foreach ($chars as $k => $char) {
1280 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1281 $char . '</div>';
1282 //$char_prop->addOption($k, $char, $html);
1283 $options[$k] = $char;
1284 }
1285 $char_prop->setOptions($options);
1286
1287 $char_prop->setValue($selected);
1288 $form->addItem($char_prop);
1289
1290
1291 // caption style
1292 $cap_style = new ilSelectInputGUI(
1293 $this->lng->txt("cont_caption_style"),
1294 "caption_style"
1295 );
1296 //$this->setBasicTableCellStyles();
1297 $this->setCharacteristics([]);
1298 $this->getCharacteristicsOfCurrentStyle(["media_caption"]);
1299 $chars = $this->getCharacteristics();
1300 $options = $chars;
1301 $cap_style->setOptions($options);
1302
1303 if (count($options) > 0) {
1304 $current_value = $this->content_obj->getCaptionClass() ?: "MediaCaption";
1305 $cap_style->setValue($current_value);
1306 $form->addItem($cap_style);
1307 }
1308
1309 // save button
1310 $form->addCommandButton("saveStyle", $lng->txt("save"));
1311
1312 $html = $form->getHTML();
1313 $tpl->setContent($html);
1314 }
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
This class represents a property form user interface.
This class represents a selection list property in a property form.

References $lng, 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 882 of file class.ilPCMediaObjectGUI.php.

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

References $lng.

◆ getEnabledMapAreas()

ilPCMediaObjectGUI::getEnabledMapAreas ( )

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

134 : bool
135 {
137 }

References $enabledmapareas.

◆ getHeader()

ilPCMediaObjectGUI::getHeader ( )

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

121 : string
122 {
123 return $this->header;
124 }

References $header.

◆ getStyleInput()

ilPCMediaObjectGUI::getStyleInput ( )

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

1317 {
1318 // characteristic selection
1319 $char_prop = new ilSelectInputGUI(
1320 $this->lng->txt("cont_characteristic"),
1321 "characteristic"
1322 );
1323
1324 $selected = $this->content_obj->getClass();
1325 if ($selected == "") {
1326 $selected = "MediaContainer";
1327 }
1328
1329 $chars = $this->getCharacteristics();
1330 if (is_object($this->content_obj)) {
1331 if (($chars[$selected] ?? "") == "" && ($this->content_obj->getClass() != "")) {
1332 $chars = array_merge(
1333 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1334 $chars
1335 );
1336 }
1337 }
1338
1339 $options = [];
1340 foreach ($chars as $k => $char) {
1341 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1342 $char . '</div>';
1343 //$char_prop->addOption($k, $char, $html);
1344 $options[$k] = $char;
1345 }
1346 $char_prop->setOptions($options);
1347 $char_prop->setValue($selected);
1348
1349 return $char_prop;
1350 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getSubCmd()

ilPCMediaObjectGUI::getSubCmd ( )

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

110 : string
111 {
112 return $this->sub_cmd;
113 }

References $sub_cmd.

◆ getTabs()

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

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

1376 : void {
1377 $ilCtrl = $this->ctrl;
1378 $ilTabs = $this->tabs;
1379
1380 if (!$a_create) {
1381 if ($this->checkStyleSelection()) {
1382 $ilTabs->addTarget(
1383 "cont_style",
1384 $ilCtrl->getLinkTarget($this, "editStyle"),
1385 "editStyle",
1386 get_class($this)
1387 );
1388 }
1389
1390 if ($this->content_obj->checkInstanceEditing()) {
1391 $ilTabs->addTarget(
1392 "cont_mob_inst_prop",
1393 $ilCtrl->getLinkTarget($this, "editAlias"),
1394 "editAlias",
1395 get_class($this)
1396 );
1397
1398 if ($this->getEnabledMapAreas()) {
1399 $st_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1400 if (is_object($st_item)) {
1401 $format = $st_item->getFormat();
1402 if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg"))) {
1403 $ilTabs->addTarget(
1404 "cont_inst_map_areas",
1405 $ilCtrl->getLinkTargetByClass("ilpcimagemapeditorgui", "editMapAreas"),
1406 array(),
1407 "ilpcimagemapeditorgui"
1408 );
1409 }
1410 }
1411 }
1412 }
1413 } else {
1414 if ($a_change_obj_ref) {
1415 $cmd = "changeObjectReference";
1416 } else {
1417 $cmd = "insert";
1418 }
1419
1420 if ($a_change_obj_ref) {
1421 $ilCtrl->setParameter($this, "subCmd", "insertNew");
1422 $ilTabs->addSubTabTarget(
1423 "cont_new_mob",
1424 $ilCtrl->getLinkTarget($this, $cmd),
1425 $cmd
1426 );
1427
1428 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
1429 $ilTabs->addSubTabTarget(
1430 "cont_mob_from_media_pool",
1431 $ilCtrl->getLinkTarget($this, $cmd),
1432 $cmd
1433 );
1434 $ilCtrl->setParameter($this, "subCmd", "");
1435 }
1436 }
1437 }
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)

◆ initAliasForm()

ilPCMediaObjectGUI::initAliasForm ( )

Init alias form.

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

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

References $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 = "",
  $a_input_error = false 
)

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

211 : void {
212 $ilTabs = $this->tabs;
214 $ilCtrl = $this->ctrl;
216
218
219 if (in_array($sub_command, ["insertNew", "insertFromPool"])) {
220 $this->edit_repo->setSubCmd($sub_command);
221 }
222
223 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
224 $sub_command = $this->edit_repo->getSubCmd();
225 }
226
227 switch ($sub_command) {
228 case "insertFromPool":
229 $this->insertFromPool();
230 break;
231
232 case "poolSelection":
233 $this->poolSelection();
234 break;
235
236 case "selectPool":
237 $this->selectPool();
238 break;
239
240 case "insertNew":
241 default:
242 $this->getTabs(true);
243 $ilTabs->setSubTabActive("cont_new_mob");
244
245 if ($a_input_error) {
247 } else {
248 $mob_gui = new ilObjMediaObjectGUI("");
249 $mob_gui->initForm("create");
250 $form = $mob_gui->getForm();
251 }
252 $form->setFormAction($ilCtrl->getFormAction($this, "create"));
254 $form->addCommandButton("create", $lng->txt("save"));
255 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
256
257 $this->displayValidationError();
258
260
261 break;
262 }
263 }

References ilPageContentGUI\$sub_command.

Referenced by insert_applyFilter(), and insert_resetFilter().

+ Here is the caller graph for this function:

◆ insert_applyFilter()

ilPCMediaObjectGUI::insert_applyFilter ( )
protected

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

92 : void
93 {
94 $this->insert();
95 }

References insert().

+ Here is the call graph for this function:

◆ insert_resetFilter()

ilPCMediaObjectGUI::insert_resetFilter ( )
protected

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

97 : void
98 {
99 $this->insert();
100 }

References insert().

+ Here is the call graph for this function:

◆ insertFromPool()

ilPCMediaObjectGUI::insertFromPool ( bool  $a_change_obj_ref = false)

Insert media object from pool.

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

338 : void
339 {
340 $ilCtrl = $this->ctrl;
341 $ilAccess = $this->access;
342 $ilTabs = $this->tabs;
345 $ui = $this->ui;
346
347 if ($this->edit_repo->getMediaPool() > 0 &&
348 $ilAccess->checkAccess("write", "", $this->edit_repo->getMediaPool())
349 && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getMediaPool())) == "mep") {
350 $html = "";
351 $tb = new ilToolbarGUI();
352
353 // button: select pool
354 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
355 if ($a_change_obj_ref) {
356 $tb->addButton(
357 $lng->txt("cont_switch_to_media_pool"),
358 $ilCtrl->getLinkTarget($this, "changeObjectReference")
359 );
360 } else {
361 $tb->addButton(
362 $lng->txt("cont_switch_to_media_pool"),
363 $ilCtrl->getLinkTarget($this, "insert")
364 );
365 }
366 $ilCtrl->setParameter($this, "subCmd", "");
367
368 // view mode: pool view (folders/all media objects)
369 $f = $ui->factory();
370 $tcmd = ($a_change_obj_ref)
371 ? "changeObjectReference"
372 : "insert";
373 $lng->loadLanguageModule("mep");
374 $ilCtrl->setParameter($this, "pool_view", "folder");
375 $actions[$lng->txt("folders")] = $ilCtrl->getLinkTarget($this, $tcmd);
376 $ilCtrl->setParameter($this, "pool_view", "all");
377 $actions[$lng->txt("mep_all_mobs")] = $ilCtrl->getLinkTarget($this, $tcmd);
378 $ilCtrl->setParameter($this, "pool_view", $this->pool_view);
379 $aria_label = $lng->txt("cont_change_pool_view");
380 $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == "folder")
381 ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
382 $tb->addSeparator();
383 $tb->addComponent($view_control);
384
385 $html = $tb->getHTML();
386
387 $this->getTabs(true, $a_change_obj_ref);
388 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
389
390 $pool = new ilObjMediaPool($this->edit_repo->getMediaPool());
391 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
392 $tcmd = ($a_change_obj_ref)
393 ? "changeObjectReference"
394 : "insert";
395 $tmode = ($a_change_obj_ref)
398
399 // handle table sub commands and get the table
400 if ($this->getSubCmd() == "applyFilter") {
401 $mpool_table = new ilMediaPoolTableGUI(
402 $this,
403 $tcmd,
404 $pool,
405 "mep_folder",
406 $tmode,
407 $this->pool_view == "all"
408 );
409 $mpool_table->resetOffset();
410 $mpool_table->writeFilterToSession();
411 }
412 if ($this->getSubCmd() == "resetFilter") {
413 $mpool_table = new ilMediaPoolTableGUI(
414 $this,
415 $tcmd,
416 $pool,
417 "mep_folder",
418 $tmode,
419 $this->pool_view == "all"
420 );
421 $mpool_table->resetOffset();
422 $mpool_table->resetFilter();
423 }
424 $mpool_table = new ilMediaPoolTableGUI(
425 $this,
426 $tcmd,
427 $pool,
428 "mep_folder",
429 $tmode,
430 $this->pool_view == "all"
431 );
432
433 $html .= $mpool_table->getHTML();
434
435 $tpl->setContent($html);
436 } else {
437 $this->poolSelection($a_change_obj_ref);
438 }
439 }
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, 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 1189 of file class.ilPCMediaObjectGUI.php.

1189 : void
1190 {
1191 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1192 $std_alias_item->setHorizontalAlign("Left");
1193 $this->updateAndReturn();
1194 }

◆ leftFloatAlign()

ilPCMediaObjectGUI::leftFloatAlign ( )

align media object to left, floating text

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

1209 : void
1210 {
1211 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1212 $std_alias_item->setHorizontalAlign("LeftFloat");
1213 $this->updateAndReturn();
1214 }

◆ poolSelection()

ilPCMediaObjectGUI::poolSelection ( bool  $a_change_obj_ref = false)

Pool Selection.

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

463 : void {
465 $ilTabs = $this->tabs;
466 $ilCtrl = $this->ctrl;
467
468 $this->getTabs(true, $a_change_obj_ref);
469 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
470
471 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
472 if ($a_change_obj_ref) {
473 $exp = new ilPoolSelectorGUI($this, "changeObjectReference", $this, "changeObjectReference");
474 } else {
475 $exp = new ilPoolSelectorGUI($this, "insert");
476 }
477
478 // filter
479 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
480 $exp->setClickableTypes(array('mep'));
481
482 if (!$exp->handleCommand()) {
483 $tpl->setContent($exp->getHTML());
484 }
485 }
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 1199 of file class.ilPCMediaObjectGUI.php.

1199 : void
1200 {
1201 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1202 $std_alias_item->setHorizontalAlign("Right");
1203 $this->updateAndReturn();
1204 }

◆ rightFloatAlign()

ilPCMediaObjectGUI::rightFloatAlign ( )

align media object to right, floating text

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

1219 : void
1220 {
1221 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1222 $std_alias_item->setHorizontalAlign("RightFloat");
1223 $this->updateAndReturn();
1224 }

◆ saveAliasProperties()

ilPCMediaObjectGUI::saveAliasProperties ( )

save table properties in db and return to page edit screen

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

1048 : void
1049 {
1050 $this->initAliasForm();
1052 $form->checkInput();
1053
1054 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1055 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
1056 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1057 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
1058
1059 // standard size
1060 if ($form->getInput("st_derive_size") == "y") {
1061 $std_alias_item->deriveSize();
1062 } else {
1063 $size = $this->request->getStringArray("st_width_height");
1064 $std_alias_item->setWidth($size["width"]);
1065 $std_alias_item->setHeight($size["height"]);
1066 }
1067
1068 // standard caption
1069 if ($form->getInput("st_derive_caption") == "y") {
1070 $std_alias_item->deriveCaption();
1071 } else {
1072 $std_alias_item->setCaption($form->getInput("st_caption"));
1073 }
1074
1075 // text representation
1076 if ($form->getInput("st_derive_text_representation") == "y") {
1077 $std_alias_item->deriveTextRepresentation();
1078 } else {
1079 $std_alias_item->setTextRepresentation(
1080 $form->getInput("st_text_representation")
1081 );
1082 }
1083
1084 // standard parameters
1085 if ($form->getInput("st_derive_parameters") == "y") {
1086 $std_alias_item->deriveParameters();
1087 } else {
1088 if ($this->media_type->usesAutoStartParameterOnly(
1089 $std_item->getLocation(),
1090 $std_item->getFormat()
1091 )) { // autostart
1092 //
1093 } else { // parameters
1094 $std_alias_item->setParameters(
1096 $form->getInput("st_parameters")
1097 )
1098 );
1099 }
1100 }
1101
1102 if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1103 if ($form->getInput("fullscreen") == "y") {
1104 if (!$full_alias_item->exists()) {
1105 $full_alias_item->insert();
1106 }
1107
1108 // fullscreen size
1109 if ($form->getInput("full_derive_size") == "y") {
1110 $full_alias_item->deriveSize();
1111 } else {
1112 $full_size = $this->request->getStringArray("full_width_height");
1113 $full_alias_item->setWidth($full_size["width"]);
1114 $full_alias_item->setHeight($full_size["height"]);
1115 }
1116
1117 // fullscreen caption
1118 if ($form->getInput("full_derive_caption") == "y") {
1119 $full_alias_item->deriveCaption();
1120 } else {
1121 $full_alias_item->setCaption($form->getInput("full_caption"));
1122 }
1123
1124 // fullscreen text representation
1125 if ($form->getInput("full_derive_text_representation") == "y") {
1126 $full_alias_item->deriveTextRepresentation();
1127 } else {
1128 $full_alias_item->setTextRepresentation(
1129 $form->getInput("full_text_representation")
1130 );
1131 }
1132
1133 // fullscreen parameters
1134 if ($form->getInput("full_derive_parameters") == "y") {
1135 $full_alias_item->deriveParameters();
1136 } else {
1137 if ($this->media_type->usesAutoStartParameterOnly(
1138 $full_item->getLocation(),
1139 $full_item->getFormat()
1140 )) { // autostart
1141 //
1142 } else {
1143 $full_alias_item->setParameters(ilUtil::extractParameterString($form->getInput("full_parameters")));
1144 }
1145 }
1146 } else {
1147 if ($full_alias_item->exists()) {
1148 $full_alias_item->delete();
1149 }
1150 }
1151 }
1152
1153 $this->updated = $this->pg_obj->update();
1154 if ($this->updated === true) {
1155 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1156 $this->ctrl->redirect($this, "editAlias");
1157 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1158 } else {
1159 $this->pg_obj->addHierIDs();
1160 $this->editAlias();
1161 }
1162 }
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 1355 of file class.ilPCMediaObjectGUI.php.

1355 : void
1356 {
1357 $this->content_obj->setClass(
1358 $this->request->getString("characteristic")
1359 );
1360 $this->content_obj->setCaptionClass(
1361 $this->request->getString("caption_style")
1362 );
1363
1364 $this->updated = $this->pg_obj->update();
1365 if ($this->updated === true) {
1366 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1367 } else {
1368 $this->pg_obj->addHierIDs();
1369 $this->editStyle();
1370 }
1371 }

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 501 of file class.ilPCMediaObjectGUI.php.

501 : void
502 {
503 $ilCtrl = $this->ctrl;
505 $ids = $this->request->getIntArray("id");
506 if (count($ids) == 1) {
507 $fid = ilMediaPoolItem::lookupForeignId($ids[0]);
508 $this->content_obj->readMediaObject($fid);
509 $this->content_obj->updateObjectReference();
510 $this->updated = $this->pg_obj->update();
511 } else {
512 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_select_max_one_item"), true);
513 $ilCtrl->redirect($this, "changeObjectReference");
514 }
515 $ilCtrl->redirect($this, "editAlias");
516 }

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 444 of file class.ilPCMediaObjectGUI.php.

446 : void {
447 $ilCtrl = $this->ctrl;
448
449 $this->edit_repo->setMediaPool($this->request->getInt("pool_ref_id"));
450 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
451 if ($a_change_obj_ref) {
452 $ilCtrl->redirect($this, "changeObjectReference");
453 } else {
454 $ilCtrl->redirect($this, "insert");
455 }
456 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc

◆ setEnabledMapAreas()

ilPCMediaObjectGUI::setEnabledMapAreas ( bool  $a_enabledmapareas)

Set Enable map areas.

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

129 : void
130 {
131 $this->enabledmapareas = $a_enabledmapareas;
132 }

◆ setHeader()

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

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

116 : void
117 {
118 $this->header = $a_title;
119 }

References ILIAS\UI\examples\Symbol\Glyph\Header\header().

+ Here is the call graph for this function:

◆ setSubCmd()

ilPCMediaObjectGUI::setSubCmd ( string  $a_val)

Set table sub command.

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

105 : void
106 {
107 $this->sub_cmd = $a_val;
108 }

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: