ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilPCMediaObjectGUI Class Reference

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

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

Public Member Functions

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

 checkFixSize ()
 
- 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
 
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 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 = "" 
)

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

References $DIC, ilPageContentGUI\$pc_id, ilPageContentGUI\$request, ILIAS\MetaData\Repository\Validation\Data\__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().

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 
57  $request = $DIC
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)
global $DIC
Definition: feed.php:28
getHierIdsForPCIds(array $a_pc_ids)
Get hier ids for a set of pc ids.
__construct(VocabulariesInterface $vocabularies)
+ 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 1451 of file class.ilPCMediaObjectGUI.php.

References ilPageContentGUI\$chars, ilPageContentGUI\$style, ilObject\_lookupType(), and ilObjStyleSheet\getCharacteristics().

Referenced by MediaObjectStyleSelector\getStyleSelector().

1451  : array
1452  {
1453  $chars = self::_getStandardCharacteristics();
1454  if ($a_style_id > 0 &&
1455  ilObject::_lookupType($a_style_id) == "sty") {
1456  $style = new ilObjStyleSheet($a_style_id);
1457  $chars = $style->getCharacteristics("media_cont");
1458  $new_chars = array();
1459  foreach ($chars as $char) {
1460  if (($chars[$char] ?? "") != "") { // keep lang vars for standard chars
1461  $new_chars[$char] = $chars[$char];
1462  } else {
1463  $new_chars[$char] = $char;
1464  }
1465  asort($new_chars);
1466  }
1467  $chars = $new_chars;
1468  }
1469  return $chars;
1470  }
getCharacteristics(string $a_type="", bool $a_no_hidden=false, bool $a_include_core=true)
Get characteristics.
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ centerAlign()

ilPCMediaObjectGUI::centerAlign ( )

align media object to center

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

References ilPageContentGUI\updateAndReturn().

1165  : void
1166  {
1167  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1168  $std_alias_item->setHorizontalAlign("Center");
1169  $this->updateAndReturn();
1170  }
+ Here is the call graph for this function:

◆ changeObjectReference()

ilPCMediaObjectGUI::changeObjectReference ( )

Change object reference.

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\$sub_command, $tabs, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\clearCommandButtons(), ilPageContentGUI\displayValidationError(), ilPropertyFormGUI\getHTML(), getTabs(), insertFromPool(), poolSelection(), selectPool(), ilFormGUI\setFormAction(), and ilLanguage\txt().

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

◆ checkFixSize()

ilPCMediaObjectGUI::checkFixSize ( )
protected

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

References ILIAS\Repository\lng().

Referenced by getEnabledMapAreas().

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

◆ checkStyleSelection()

ilPCMediaObjectGUI::checkStyleSelection ( )

Checks whether style selection shoudl be available or not.

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

References ilPageContentGUI\$chars, and ilPageContentGUI\getCharacteristics().

Referenced by getTabs().

1215  : bool
1216  {
1217  // check whether there is more than one style class
1218  $chars = $this->getCharacteristics();
1219 
1220  if (count($chars) > 1 ||
1221  ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media")) {
1222  return true;
1223  }
1224  return false;
1225  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyToClipboard()

ilPCMediaObjectGUI::copyToClipboard ( )

copy media object to clipboard

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

References $user, ilObjUser\addObjectToClipboard(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

1153  : void
1154  {
1155  $ilUser = $this->user;
1156 
1157  $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1158  $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
1159  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1160  }
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
+ Here is the call graph for this function:

◆ create()

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

create new media object in dom and update page in db

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

References ilPageContentGUI\$content_obj, ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\$pc_id, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilPageContentGUI\getPage(), insert(), ilMediaPoolItem\lookupForeignId(), ilPageContentGUI\redirectToParent(), ilPageContentGUI\setHierId(), and ilLanguage\txt().

Referenced by createNewObjectReference().

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

◆ createNewObjectReference()

ilPCMediaObjectGUI::createNewObjectReference ( )

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

(keep all instance parameters)

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

References create().

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

◆ edit()

ilPCMediaObjectGUI::edit ( )

edit properties form

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

References ILIAS\Repository\ctrl().

589  : void
590  {
591  if ($this->content_obj->checkInstanceEditing()) {
592  $this->ctrl->redirect($this, "editAlias");
593  }
594  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
595  }
+ Here is the call graph for this function:

◆ editAlias()

ilPCMediaObjectGUI::editAlias ( )

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

References ilPageContentGUI\$tpl, getAliasValues(), initAliasForm(), and ilGlobalTemplateInterface\setContent().

Referenced by saveAliasProperties().

597  : void
598  {
599  $tpl = $this->tpl;
600 
601  $this->initAliasForm();
602  $this->getAliasValues();
603  $tpl->setContent($this->form_gui->getHTML());
604  }
initAliasForm()
Init alias form.
getAliasValues()
Put alias values into form.
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editStyle()

ilPCMediaObjectGUI::editStyle ( )

Edit Style.

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

References ilPageContentGUI\$chars, ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPageContentGUI\displayValidationError(), ilPageContentGUI\getCharacteristics(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), ilPageContentGUI\setCharacteristics(), ilGlobalTemplateInterface\setContent(), ilFormGUI\setFormAction(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

Referenced by saveStyle().

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

◆ getAliasValues()

ilPCMediaObjectGUI::getAliasValues ( )

Put alias values into form.

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

References ilPageContentGUI\$lng, and ilLanguage\txt().

Referenced by editAlias().

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

◆ getEnabledMapAreas()

◆ getHeader()

ilPCMediaObjectGUI::getHeader ( )

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

References $header.

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

◆ getStyleInput()

ilPCMediaObjectGUI::getStyleInput ( )

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

References ilPageContentGUI\$chars, ilPageContentGUI\getCharacteristics(), and ILIAS\Repository\lng().

1309  {
1310  // characteristic selection
1311  $char_prop = new ilAdvSelectInputGUI(
1312  $this->lng->txt("cont_characteristic"),
1313  "characteristic"
1314  );
1315 
1316  $selected = $this->content_obj->getClass();
1317  if ($selected == "") {
1318  $selected = "MediaContainer";
1319  }
1320 
1321  $chars = $this->getCharacteristics();
1322  if (is_object($this->content_obj)) {
1323  if (($chars[$selected] ?? "") == "" && ($this->content_obj->getClass() != "")) {
1324  $chars = array_merge(
1325  array($this->content_obj->getClass() => $this->content_obj->getClass()),
1326  $chars
1327  );
1328  }
1329  }
1330 
1331  foreach ($chars as $k => $char) {
1332  $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1333  $char . '</div>';
1334  $char_prop->addOption($k, $char, $html);
1335  }
1336 
1337  $char_prop->setValue($selected);
1338 
1339  return $char_prop;
1340  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getSubCmd()

ilPCMediaObjectGUI::getSubCmd ( )

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

References $sub_cmd.

Referenced by insertFromPool().

100  : string
101  {
102  return $this->sub_cmd;
103  }
+ Here is the caller graph for this function:

◆ getTabs()

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

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

References ilPageContentGUI\$ctrl, $DIC, ilPageContentGUI\$lng, $tabs, ilTabsGUI\addTarget(), checkStyleSelection(), getEnabledMapAreas(), and ilLanguage\txt().

Referenced by changeObjectReference(), getEnabledMapAreas(), insert(), insertFromPool(), and poolSelection().

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

◆ initAliasForm()

ilPCMediaObjectGUI::initAliasForm ( )

Init alias form.

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

References ilPageContentGUI\$ctrl, $lm_set, ilPageContentGUI\$lng, ilSubEnabledFormPropertyGUI\addSubItem(), ilRadioOption\addSubItem(), ILIAS\Repository\lng(), ilWidthHeightInputGUI\setSupportConstraintsProps(), and ilLanguage\txt().

Referenced by editAlias(), and saveAliasProperties().

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

◆ insert()

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

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

References ilPageContentGUI\$ctrl, $form, ilPageContentGUI\$lng, ilPageContentGUI\$sub_command, $tabs, ilPageContentGUI\$tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\clearCommandButtons(), ilPageContentGUI\displayValidationError(), ilPropertyFormGUI\getHTML(), getTabs(), insertFromPool(), poolSelection(), selectPool(), ilGlobalTemplateInterface\setContent(), ilFormGUI\setFormAction(), and ilLanguage\txt().

Referenced by create().

201  : void {
202  $ilTabs = $this->tabs;
203  $tpl = $this->tpl;
204  $ilCtrl = $this->ctrl;
205  $lng = $this->lng;
206 
208 
209  if (in_array($sub_command, ["insertNew", "insertFromPool"])) {
210  $this->edit_repo->setSubCmd($sub_command);
211  }
212 
213  if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
214  $sub_command = $this->edit_repo->getSubCmd();
215  }
216 
217  switch ($sub_command) {
218  case "insertFromPool":
219  $this->insertFromPool();
220  break;
221 
222  case "poolSelection":
223  $this->poolSelection();
224  break;
225 
226  case "selectPool":
227  $this->selectPool();
228  break;
229 
230  case "insertNew":
231  default:
232  $this->getTabs(true);
233  $ilTabs->setSubTabActive("cont_new_mob");
234 
235  if ($a_input_error) {
236  $form = $this->form;
237  } else {
238  $mob_gui = new ilObjMediaObjectGUI("");
239  $mob_gui->initForm("create");
240  $form = $mob_gui->getForm();
241  }
242  $form->setFormAction($ilCtrl->getFormAction($this, "create_mob"));
244  $form->addCommandButton("create_mob", $lng->txt("save"));
245  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
246 
247  $this->displayValidationError();
248 
250 
251  break;
252  }
253  }
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...
getTabs(bool $a_create=false, bool $a_change_obj_ref=false)
setContent(string $a_html)
Sets content for standard template.
setFormAction(string $a_formaction)
ilGlobalTemplateInterface $tpl
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
Editing User Interface for MediaObjects within LMs (see ILIAS DTD)
poolSelection(bool $a_change_obj_ref=false)
Pool Selection.
insertFromPool(bool $a_change_obj_ref=false)
Insert media object from pool.
selectPool(bool $a_change_obj_ref=false)
Select concrete pool.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromPool()

ilPCMediaObjectGUI::insertFromPool ( bool  $a_change_obj_ref = false)

Insert media object from pool.

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

References $access, ilPageContentGUI\$ctrl, Vendor\Package\$f, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, $ui, ilObject\_lookupObjId(), ilObject\_lookupType(), getSubCmd(), getTabs(), ilMediaPoolTableGUI\IL_MEP_SELECT, ilMediaPoolTableGUI\IL_MEP_SELECT_SINGLE, ilLanguage\loadLanguageModule(), poolSelection(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

Referenced by changeObjectReference(), and insert().

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

◆ leftAlign()

ilPCMediaObjectGUI::leftAlign ( )

align media object to left

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

References ilPageContentGUI\updateAndReturn().

1175  : void
1176  {
1177  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1178  $std_alias_item->setHorizontalAlign("Left");
1179  $this->updateAndReturn();
1180  }
+ Here is the call graph for this function:

◆ leftFloatAlign()

ilPCMediaObjectGUI::leftFloatAlign ( )

align media object to left, floating text

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

References ilPageContentGUI\updateAndReturn().

1195  : void
1196  {
1197  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1198  $std_alias_item->setHorizontalAlign("LeftFloat");
1199  $this->updateAndReturn();
1200  }
+ Here is the call graph for this function:

◆ poolSelection()

ilPCMediaObjectGUI::poolSelection ( bool  $a_change_obj_ref = false)

Pool Selection.

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

References ilPageContentGUI\$ctrl, $tabs, ilPageContentGUI\$tpl, getTabs(), and ilGlobalTemplateInterface\setContent().

Referenced by changeObjectReference(), insert(), and insertFromPool().

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

◆ rightAlign()

ilPCMediaObjectGUI::rightAlign ( )

align media object to right

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

References ilPageContentGUI\updateAndReturn().

1185  : void
1186  {
1187  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1188  $std_alias_item->setHorizontalAlign("Right");
1189  $this->updateAndReturn();
1190  }
+ Here is the call graph for this function:

◆ rightFloatAlign()

ilPCMediaObjectGUI::rightFloatAlign ( )

align media object to right, floating text

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

References ilPageContentGUI\updateAndReturn().

1205  : void
1206  {
1207  $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1208  $std_alias_item->setHorizontalAlign("RightFloat");
1209  $this->updateAndReturn();
1210  }
+ Here is the call graph for this function:

◆ saveAliasProperties()

ilPCMediaObjectGUI::saveAliasProperties ( )

save table properties in db and return to page edit screen

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

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

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

◆ saveStyle()

ilPCMediaObjectGUI::saveStyle ( )

Save Style.

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

References ILIAS\Repository\ctrl(), and editStyle().

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

◆ selectObjectReference()

ilPCMediaObjectGUI::selectObjectReference ( )

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

(keep all instance parameters)

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilMediaPoolItem\lookupForeignId(), and ilLanguage\txt().

491  : void
492  {
493  $ilCtrl = $this->ctrl;
494  $lng = $this->lng;
495  $ids = $this->request->getIntArray("id");
496  if (count($ids) == 1) {
497  $fid = ilMediaPoolItem::lookupForeignId($ids[0]);
498  $this->content_obj->readMediaObject($fid);
499  $this->content_obj->updateObjectReference();
500  $this->updated = $this->pg_obj->update();
501  } else {
502  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_select_max_one_item"), true);
503  $ilCtrl->redirect($this, "changeObjectReference");
504  }
505  $ilCtrl->redirect($this, "editAlias");
506  }
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...
static lookupForeignId(int $a_id)
+ Here is the call graph for this function:

◆ selectPool()

ilPCMediaObjectGUI::selectPool ( bool  $a_change_obj_ref = false)

Select concrete pool.

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

References ilPageContentGUI\$ctrl, and ilCtrl\setParameter().

Referenced by changeObjectReference(), and insert().

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

◆ setEnabledMapAreas()

ilPCMediaObjectGUI::setEnabledMapAreas ( bool  $a_enabledmapareas)

Set Enable map areas.

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

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

◆ setHeader()

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

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

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

106  : void
107  {
108  $this->header = $a_title;
109  }
+ Here is the call graph for this function:

◆ setSubCmd()

ilPCMediaObjectGUI::setSubCmd ( string  $a_val)

Set table sub command.

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

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

Field Documentation

◆ $access

ilAccessHandler ilPCMediaObjectGUI::$access
protected

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

Referenced by insertFromPool().

◆ $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.

Referenced by insert().

◆ $form_gui

ilPropertyFormGUI ilPCMediaObjectGUI::$form_gui
protected

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

Referenced by saveAliasProperties().

◆ $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

◆ $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.

Referenced by insertFromPool().

◆ $user

ilObjUser ilPCMediaObjectGUI::$user
protected

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

Referenced by copyToClipboard().


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