ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 (string $a_post_cmd="edpost", string $a_submit_cmd="", bool $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 ()
 
 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
 
array bool null $updated = null
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 

Protected Member Functions

 insert_applyFilter ()
 
 insert_resetFilter ()
 
 checkFixSize ()
 
 getDefaultSize (ilMediaItem $media_item)
 Get the size inherited from the media object defaults. More...
 
- 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
 
ILIAS MediaPool InternalGUIService $media_pool_gui
 
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 41 of file class.ilPCMediaObjectGUI.php.

46 {
47 global $DIC;
48
49 $this->tpl = $DIC["tpl"];
50 $this->lng = $DIC->language();
51 $this->tabs = $DIC->tabs();
52 $this->access = $DIC->access();
53 $this->toolbar = $DIC->toolbar();
54 $this->user = $DIC->user();
55 $ilCtrl = $DIC->ctrl();
56 $this->ui = $DIC->ui();
57 $this->media_pool_gui = $DIC->mediaPool()->internal()->gui();
58
60 ->copage()
61 ->internal()
62 ->gui()
63 ->pc()
64 ->editRequest();
65
66 $this->media_type = $DIC->mediaObjects()
67 ->internal()
68 ->domain()
69 ->mediaType();
70
71 $pc_id = $request->getPCId();
72 if ($pc_id != "" && $a_hier_id == "") {
73 $hier_ids = $a_pg_obj->getHierIdsForPCIds([$pc_id]);
74 $a_hier_id = $hier_ids[$pc_id] ?? "";
75 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
76 }
77
78 $this->pool_view = "folder";
79
80 $pv = $request->getString("pool_view");
81 if (in_array($pv, array("folder", "all"))) {
82 $this->pool_view = $pv;
83 }
84
85 $this->ctrl = $ilCtrl;
86
87 $this->ctrl->saveParameter($this, ["pool_view", "pcid"]);
88
89 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
90
91 $this->setCharacteristics(self::_getStandardCharacteristics());
92 }
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 1443 of file class.ilPCMediaObjectGUI.php.

1443 : array
1444 {
1445 $chars = self::_getStandardCharacteristics();
1446 if ($a_style_id > 0 &&
1447 ilObject::_lookupType($a_style_id) == "sty") {
1448 $style = new ilObjStyleSheet($a_style_id);
1449 $chars = $style->getCharacteristics("media_cont");
1450 $new_chars = array();
1451 foreach ($chars as $char) {
1452 if (($chars[$char] ?? "") != "") { // keep lang vars for standard chars
1453 $new_chars[$char] = $chars[$char];
1454 } else {
1455 $new_chars[$char] = $char;
1456 }
1457 }
1458 $chars = $new_chars;
1459 }
1460 return $chars;
1461 }
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 1157 of file class.ilPCMediaObjectGUI.php.

1157 : void
1158 {
1159 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1160 $std_alias_item->setHorizontalAlign("Center");
1161 $this->updateAndReturn();
1162 }

◆ changeObjectReference()

ilPCMediaObjectGUI::changeObjectReference ( )

Change object reference.

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

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

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

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

1207 : bool
1208 {
1209 // check whether there is more than one style class
1210 $chars = $this->getCharacteristics();
1211
1212 if (count($chars) > 1 ||
1213 ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media")) {
1214 return true;
1215 }
1216 return false;
1217 }

◆ copyToClipboard()

ilPCMediaObjectGUI::copyToClipboard ( )

copy media object to clipboard

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

1145 : void
1146 {
1147 $ilUser = $this->user;
1148
1149 $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1150 $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
1151 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1152 }
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 504 of file class.ilPCMediaObjectGUI.php.

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

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

475 : void
476 {
477 $this->create(false, true);
478 }
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 581 of file class.ilPCMediaObjectGUI.php.

581 : void
582 {
583 if ($this->content_obj->checkInstanceEditing()) {
584 $this->ctrl->redirect($this, "editAlias");
585 }
586 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
587 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editAlias()

ilPCMediaObjectGUI::editAlias ( )

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

589 : void
590 {
592
593 $this->initAliasForm();
594 $this->getAliasValues();
595 $tpl->setContent($this->form_gui->getHTML());
596 }
initAliasForm()
Init alias form.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References ILIAS\News\Common\Table\$tpl, and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ editStyle()

ilPCMediaObjectGUI::editStyle ( )

Edit Style.

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

1222 : void
1223 {
1224 $a_seleted_value = "";
1225
1226 $ilCtrl = $this->ctrl;
1227 $tpl = $this->tpl;
1228 $lng = $this->lng;
1229 $this->displayValidationError();
1230
1231 // edit form
1232 $form = new ilPropertyFormGUI();
1233 $form->setFormAction($ilCtrl->getFormAction($this));
1234 $form->setTitle($this->lng->txt("cont_edit_style"));
1235 // characteristic selection
1236 $char_prop = new ilRadioGroupInputGUI(
1237 $this->lng->txt("cont_characteristic"),
1238 "characteristic"
1239 );
1240
1241
1242 $chars = $this->getCharacteristics();
1243 if (is_object($this->content_obj)) {
1244 if (($chars[$a_seleted_value] ?? "") === "" && ($this->content_obj->getClass() !== "")) {
1245 $chars = array_merge(
1246 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1247 $chars
1248 );
1249 }
1250 }
1251
1252 $selected = $this->content_obj->getClass();
1253 if ($selected == "") {
1254 $selected = "MediaContainer";
1255 }
1256
1257 $options = [];
1258 foreach ($chars as $k => $char) {
1259 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1260 $char . '</div>';
1261 //$char_prop->addOption($k, $char, $html);
1262 $options[$k] = $char;
1263 $ro = new ilRadioOption($html, $k);
1264 $char_prop->addOption($ro);
1265 }
1266 //$char_prop->setOptions($options);
1267
1268 $char_prop->setValue($selected);
1269 $form->addItem($char_prop);
1270
1271
1272 // caption style
1273 $cap_style = new ilSelectInputGUI(
1274 $this->lng->txt("cont_caption_style"),
1275 "caption_style"
1276 );
1277 //$this->setBasicTableCellStyles();
1278 $this->setCharacteristics([]);
1279 $this->getCharacteristicsOfCurrentStyle(["media_caption"]);
1280 $chars = $this->getCharacteristics();
1281 $options = $chars;
1282 $cap_style->setOptions($options);
1283
1284 if (count($options) > 0) {
1285 $current_value = $this->content_obj->getCaptionClass() ?: "MediaCaption";
1286 $cap_style->setValue($current_value);
1287 $form->addItem($cap_style);
1288 }
1289
1290 // save button
1291 $form->addCommandButton("saveStyle", $lng->txt("save"));
1292
1293 $html = $form->getHTML();
1294 $tpl->setContent($html);
1295 }
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 property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.

References $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\News\Common\Table\$tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), ilFormGUI\setFormAction(), and ilPropertyFormGUI\setTitle().

+ Here is the call graph for this function:

◆ getAliasValues()

ilPCMediaObjectGUI::getAliasValues ( )

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

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

References $lng.

◆ getDefaultSize()

ilPCMediaObjectGUI::getDefaultSize ( ilMediaItem  $media_item)
protected

Get the size inherited from the media object defaults.

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

860 : ?array
861 {
862 if ($media_item->getWidth() !== "" || $media_item->getHeight() !== "") {
863 return [
864 "width" => $media_item->getWidth(),
865 "height" => $media_item->getHeight()
866 ];
867 }
868
869 return $media_item->getOriginalSize();
870 }

References ilMediaItem\getHeight(), ilMediaItem\getOriginalSize(), and ilMediaItem\getWidth().

+ Here is the call graph for this function:

◆ getEnabledMapAreas()

ilPCMediaObjectGUI::getEnabledMapAreas ( )

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

136 : bool
137 {
139 }

References $enabledmapareas.

◆ getHeader()

ilPCMediaObjectGUI::getHeader ( )

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

123 : string
124 {
125 return $this->header;
126 }

References $header.

◆ getStyleInput()

ilPCMediaObjectGUI::getStyleInput ( )

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

1298 {
1299 // characteristic selection
1300 $char_prop = new ilRadioGroupInputGUI(
1301 $this->lng->txt("cont_characteristic"),
1302 "characteristic"
1303 );
1304
1305 $selected = $this->content_obj->getClass();
1306 if ($selected == "") {
1307 $selected = "MediaContainer";
1308 }
1309
1310 $chars = $this->getCharacteristics();
1311 if (is_object($this->content_obj)) {
1312 if (($chars[$selected] ?? "") == "" && ($this->content_obj->getClass() != "")) {
1313 $chars = array_merge(
1314 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1315 $chars
1316 );
1317 }
1318 }
1319
1320 $options = [];
1321 foreach ($chars as $k => $char) {
1322 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1323 $char . '</div>';
1324 $options[$k] = $char;
1325 $ro = new ilRadioOption($html, $k);
1326 $char_prop->addOption($ro);
1327 }
1328 //$char_prop->setOptions($options);
1329 $char_prop->setValue($selected);
1330
1331 return $char_prop;
1332 }

References ILIAS\UI\Implementation\Component\Input\Field\$options, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getSubCmd()

ilPCMediaObjectGUI::getSubCmd ( )

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

112 : string
113 {
114 return $this->sub_cmd;
115 }

References $sub_cmd.

◆ getTabs()

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

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

1358 : void {
1359 $ilCtrl = $this->ctrl;
1360 $ilTabs = $this->tabs;
1361
1362 if (!$a_create) {
1363 if ($this->checkStyleSelection()) {
1364 $ilTabs->addTarget(
1365 "cont_style",
1366 $ilCtrl->getLinkTarget($this, "editStyle"),
1367 "editStyle",
1368 get_class($this)
1369 );
1370 }
1371
1372 if ($this->content_obj->checkInstanceEditing()) {
1373 $ilTabs->addTarget(
1374 "cont_mob_inst_prop",
1375 $ilCtrl->getLinkTarget($this, "editAlias"),
1376 "editAlias",
1377 get_class($this)
1378 );
1379
1380 if ($this->getEnabledMapAreas()) {
1381 $st_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1382 if (is_object($st_item)) {
1383 $format = $st_item->getFormat();
1384 if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg"))) {
1385 $ilTabs->addTarget(
1386 "cont_inst_map_areas",
1387 $ilCtrl->getLinkTargetByClass("ilpcimagemapeditorgui", "editMapAreas"),
1388 array(),
1389 "ilpcimagemapeditorgui"
1390 );
1391 }
1392 }
1393 }
1394 }
1395 } else {
1396 if ($a_change_obj_ref) {
1397 $cmd = "changeObjectReference";
1398 } else {
1399 $cmd = "insert";
1400 }
1401
1402 if ($a_change_obj_ref) {
1403 $ilCtrl->setParameter($this, "subCmd", "insertNew");
1404 $ilTabs->addSubTabTarget(
1405 "cont_new_mob",
1406 $ilCtrl->getLinkTarget($this, $cmd),
1407 $cmd
1408 );
1409
1410 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
1411 $ilTabs->addSubTabTarget(
1412 "cont_mob_from_media_pool",
1413 $ilCtrl->getLinkTarget($this, $cmd),
1414 $cmd
1415 );
1416 $ilCtrl->setParameter($this, "subCmd", "");
1417 }
1418 }
1419 }
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 601 of file class.ilPCMediaObjectGUI.php.

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

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

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

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

94 : void
95 {
96 $this->insert();
97 }

References insert().

+ Here is the call graph for this function:

◆ insert_resetFilter()

ilPCMediaObjectGUI::insert_resetFilter ( )
protected

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

99 : void
100 {
101 $this->insert();
102 }

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

340 : void
341 {
342 $ilCtrl = $this->ctrl;
343 $ilAccess = $this->access;
344 $ilTabs = $this->tabs;
347 $ui = $this->ui;
348
349 if ($this->edit_repo->getMediaPool() > 0 &&
350 $ilAccess->checkAccess("write", "", $this->edit_repo->getMediaPool())
351 && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getMediaPool())) == "mep") {
352 $html = "";
353 $tb = new ilToolbarGUI();
354
355 // button: select pool
356 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
357 if ($a_change_obj_ref) {
358 $tb->addButton(
359 $lng->txt("cont_switch_to_media_pool"),
360 $ilCtrl->getLinkTarget($this, "changeObjectReference")
361 );
362 } else {
363 $tb->addButton(
364 $lng->txt("cont_switch_to_media_pool"),
365 $ilCtrl->getLinkTarget($this, "insert")
366 );
367 }
368 $ilCtrl->setParameter($this, "subCmd", "");
369
370 // view mode: pool view (folders/all media objects)
371 $f = $ui->factory();
372 $tcmd = ($a_change_obj_ref)
373 ? "changeObjectReference"
374 : "insert";
375 $lng->loadLanguageModule("mep");
376 $ilCtrl->setParameter($this, "pool_view", "folder");
377 $actions[$lng->txt("folders")] = $ilCtrl->getLinkTarget($this, $tcmd);
378 $ilCtrl->setParameter($this, "pool_view", "all");
379 $actions[$lng->txt("mep_all_mobs")] = $ilCtrl->getLinkTarget($this, $tcmd);
380 $ilCtrl->setParameter($this, "pool_view", $this->pool_view);
381 $aria_label = $lng->txt("cont_change_pool_view");
382 $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == "folder")
383 ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
384 $tb->addSeparator();
385 $tb->addComponent($view_control);
386
387 $html = $tb->getHTML();
388
389 $this->getTabs(true, $a_change_obj_ref);
390 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
391
392 $pool = new ilObjMediaPool($this->edit_repo->getMediaPool());
393 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
394 $tcmd = ($a_change_obj_ref)
395 ? "changeObjectReference"
396 : "insert";
397 $tmode = ($a_change_obj_ref)
398 ? "selectsingle"
399 : "select";
400
401 $table_builder = $this->media_pool_gui->mediaPoolTableBuilder(
402 $pool,
403 "mep_folder",
404 $tmode,
405 $this->pool_view == "all",
406 $this->pool_view == "all" ? "insert_applyFilter" : null,
407 $this->pool_view == "all" ? "insert_resetFilter" : null,
408 $tmode === "selectsingle" ? "selectObjectReference" : "create",
409 $this,
410 $tcmd
411 );
412
413 if ($table_builder->getTable()->handleCommand()) {
414 return;
415 }
416 $html .= $table_builder->render();
417
418 $tpl->setContent($html);
419 } else {
420 $this->poolSelection($a_change_obj_ref);
421 }
422 }
loadLanguageModule(string $a_module)
Load language module.
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, ILIAS\News\Common\Table\$tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ leftAlign()

ilPCMediaObjectGUI::leftAlign ( )

align media object to left

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

1167 : void
1168 {
1169 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1170 $std_alias_item->setHorizontalAlign("Left");
1171 $this->updateAndReturn();
1172 }

◆ leftFloatAlign()

ilPCMediaObjectGUI::leftFloatAlign ( )

align media object to left, floating text

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

1187 : void
1188 {
1189 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1190 $std_alias_item->setHorizontalAlign("LeftFloat");
1191 $this->updateAndReturn();
1192 }

◆ poolSelection()

ilPCMediaObjectGUI::poolSelection ( bool  $a_change_obj_ref = false)

Pool Selection.

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

446 : void {
448 $ilTabs = $this->tabs;
449 $ilCtrl = $this->ctrl;
450
451 $this->getTabs(true, $a_change_obj_ref);
452 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
453
454 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
455 if ($a_change_obj_ref) {
456 $exp = new ilPoolSelectorGUI($this, "changeObjectReference", $this, "changeObjectReference");
457 } else {
458 $exp = new ilPoolSelectorGUI($this, "insert");
459 }
460
461 // filter
462 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
463 $exp->setClickableTypes(array('mep'));
464
465 if (!$exp->handleCommand()) {
466 $tpl->setContent($exp->getHTML());
467 }
468 }
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 1177 of file class.ilPCMediaObjectGUI.php.

1177 : void
1178 {
1179 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1180 $std_alias_item->setHorizontalAlign("Right");
1181 $this->updateAndReturn();
1182 }

◆ rightFloatAlign()

ilPCMediaObjectGUI::rightFloatAlign ( )

align media object to right, floating text

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

1197 : void
1198 {
1199 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1200 $std_alias_item->setHorizontalAlign("RightFloat");
1201 $this->updateAndReturn();
1202 }

◆ saveAliasProperties()

ilPCMediaObjectGUI::saveAliasProperties ( )

save table properties in db and return to page edit screen

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

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

1337 : void
1338 {
1339 $this->content_obj->setClass(
1340 $this->request->getString("characteristic")
1341 );
1342 $this->content_obj->setCaptionClass(
1343 $this->request->getString("caption_style")
1344 );
1345
1346 $this->updated = $this->pg_obj->update();
1347 if ($this->updated === true) {
1348 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1349 } else {
1350 $this->pg_obj->addHierIDs();
1351 $this->editStyle();
1352 }
1353 }

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

484 : void
485 {
486 $ilCtrl = $this->ctrl;
488 $ids = $this->request->getIntArray("id");
489 if (count($ids) == 1) {
490 $fid = ilMediaPoolItem::lookupForeignId($ids[0]);
491 $this->content_obj->readMediaObject($fid);
492 $this->content_obj->updateObjectReference();
493 $this->updated = $this->pg_obj->update();
494 } else {
495 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_select_max_one_item"), true);
496 $ilCtrl->redirect($this, "changeObjectReference");
497 }
498 $ilCtrl->redirect($this, "editAlias");
499 }

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

429 : void {
430 $ilCtrl = $this->ctrl;
431
432 $this->edit_repo->setMediaPool($this->request->getInt("pool_ref_id"));
433 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
434 if ($a_change_obj_ref) {
435 $ilCtrl->redirect($this, "changeObjectReference");
436 } else {
437 $ilCtrl->redirect($this, "insert");
438 }
439 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc

◆ setEnabledMapAreas()

ilPCMediaObjectGUI::setEnabledMapAreas ( bool  $a_enabledmapareas)

Set Enable map areas.

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

131 : void
132 {
133 $this->enabledmapareas = $a_enabledmapareas;
134 }

◆ setHeader()

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

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

118 : void
119 {
120 $this->header = $a_title;
121 }

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

107 : void
108 {
109 $this->sub_cmd = $a_val;
110 }

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

Referenced by getHeader().

◆ $media_pool_gui

ILIAS MediaPool InternalGUIService ilPCMediaObjectGUI::$media_pool_gui
protected

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

◆ $media_type

ILIAS MediaObjects MediaType MediaTypeManager ilPCMediaObjectGUI::$media_type
protected

Definition at line 39 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 36 of file class.ilPCMediaObjectGUI.php.

◆ $sub_cmd

string ilPCMediaObjectGUI::$sub_cmd = ""
protected

Definition at line 38 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: