ILIAS  release_7 Revision v7.30-3-g800a261c036
ilPCMediaObjectGUI Class Reference

Class ilPCMediaObjectGUI. More...

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

Public Member Functions

 __construct (ilPageObject $a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 
 setSubCmd ($a_val)
 Set table sub command. More...
 
 getSubCmd ()
 Get table sub command. More...
 
 setHeader ($a_title="")
 
 getHeader ()
 
 setEnabledMapAreas ($a_enabledmapareas)
 Set Enable map areas. More...
 
 getEnabledMapAreas ()
 Get Enable map areas. More...
 
 executeCommand ()
 execute command More...
 
 insert ($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
 Insert new media object form. More...
 
 changeObjectReference ()
 Change object reference. More...
 
 insertFromPool ($a_change_obj_ref=false)
 Insert media object from pool. More...
 
 selectPool ($a_change_obj_ref=false)
 Select concrete pool. More...
 
 poolSelection ($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 ($a_create_alias=true, $a_change_obj_ref=false)
 create new media object in dom and update page in db More...
 
 edit ()
 edit properties form More...
 
 editAlias ()
 edit properties form More...
 
 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 ()
 Get style input. More...
 
 saveStyle ()
 Save Style. More...
 
 getTabs (&$tab_gui, $a_create=false, $a_change_obj_ref=false)
 add tabs to ilTabsGUI object More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor @access public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 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 ($a_type)
 Get table templates. More...
 

Static Public Member Functions

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

Data Fields

 $header
 
 $ctrl
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 

Protected Member Functions

 checkFixSize ()
 Check fix size. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent ($hier_id="")
 Redirect to parent. More...
 
 getParentReturn ($hier_id="")
 

Protected Attributes

 $tabs
 
 $access
 
 $toolbar
 
 $user
 
 $ui
 
 $pool_view
 
 $sub_cmd
 
 $media_type
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Attributes inherited from ilPageContentGUI
static $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 $common_bb_buttons
 

Detailed Description

Class ilPCMediaObjectGUI.

Editing User Interface for MediaObjects within LMs (see ILIAS DTD)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilPCMediaObjectGUI: ilObjMediaObjectGUI, ilPCImageMapEditorGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCMediaObjectGUI::__construct ( ilPageObject  $a_pg_obj,
  $a_content_obj,
  $a_hier_id = 0,
  $a_pc_id = "" 
)

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

67 {
68 global $DIC;
69
70 $this->tpl = $DIC["tpl"];
71 $this->lng = $DIC->language();
72 $this->tabs = $DIC->tabs();
73 $this->access = $DIC->access();
74 $this->toolbar = $DIC->toolbar();
75 $this->user = $DIC->user();
76 $ilCtrl = $DIC->ctrl();
77 $this->ui = $DIC->ui();
78
79 $this->media_type = new ILIAS\MediaObjects\MediaType\MediaType();
80
81 if ($_GET["pcid"] != "" && $a_hier_id == "") {
82 $hier_ids = $a_pg_obj->getHierIdsForPCIds([$_GET["pcid"]]);
83 $a_hier_id = $hier_ids[$_GET["pcid"]];
84 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
85 }
86
87 $this->pool_view = "folder";
88 if (in_array($_GET["pool_view"], array("folder", "all"))) {
89 $this->pool_view = $_GET["pool_view"];
90 }
91
92 $this->ctrl = $ilCtrl;
93
94 $this->ctrl->saveParameter($this, ["pool_view", "pcid"]);
95
96 // var_dump($_POST);
97 //ilUtil::printBacktrace(10); exit;
98 //echo "constructor target:".$_SESSION["il_map_il_target"].":<br>";
99 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
100
101 $this->setCharacteristics(self::_getStandardCharacteristics());
102 }
user()
Definition: user.php:4
$_GET["client_id"]
setCharacteristics($a_chars)
Set Characteristics.
getHierIdsForPCIds($a_pc_ids)
Get hier ids for a set of pc ids.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
ui()
Definition: ui.php:5

References $_GET, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilPageObject\getHierIdsForPCIds(), ilPageContentGUI\setCharacteristics(), ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getCharacteristics()

static ilPCMediaObjectGUI::_getCharacteristics (   $a_style_id)
static

Get characteristics.

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

1443 {
1444 $chars = self::_getStandardCharacteristics();
1445 if ($a_style_id > 0 &&
1446 ilObject::_lookupType($a_style_id) == "sty") {
1447 $style = new ilObjStyleSheet($a_style_id);
1448 $chars = $style->getCharacteristics("media_cont");
1449 $new_chars = array();
1450 foreach ($chars as $char) {
1451 if ($chars[$char] != "") { // keep lang vars for standard chars
1452 $new_chars[$char] = $chars[$char];
1453 } else {
1454 $new_chars[$char] = $char;
1455 }
1456 asort($new_chars);
1457 }
1458 $chars = $new_chars;
1459 }
1460 return $chars;
1461 }
Class ilObjStyleSheet.
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilObject\_lookupType().

Referenced by ILIAS\COPage\Editor\Components\MediaObject\MediaObjectStyleSelector\getStyleSelector().

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

1174 {
1175 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1176 $std_alias_item->setHorizontalAlign("Center");
1177 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1178 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1179 }
$_SESSION["AccountId"]

References $_SESSION.

◆ changeObjectReference()

ilPCMediaObjectGUI::changeObjectReference ( )

Change object reference.

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

286 {
287 $ilTabs = $this->tabs;
288 $ilCtrl = $this->ctrl;
290
291 if ($_GET["subCmd"] == "insertNew") {
292 $_SESSION["cont_media_insert"] = "insertNew";
293 }
294 if ($_GET["subCmd"] == "insertFromPool") {
295 $_SESSION["cont_media_insert"] = "insertFromPool";
296 }
297
298 if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "") {
299 $_GET["subCmd"] = $_SESSION["cont_media_insert"];
300 }
301
302 switch ($_GET["subCmd"]) {
303 case "insertFromPool":
304 $this->insertFromPool(true);
305 break;
306
307 case "poolSelection":
308 $this->poolSelection(true);
309 break;
310
311 case "selectPool":
312 $this->selectPool(true);
313 break;
314
315 case "insertNew":
316 default:
317 $ilCtrl->setParameter($this, "subCmd", "changeObjectReference");
318 $this->getTabs($ilTabs, true, true);
319 $ilTabs->setSubTabActive("cont_new_mob");
320
321 $this->displayValidationError();
322
323 $mob_gui = new ilObjMediaObjectGUI("");
324 $mob_gui->initForm("create");
325 $form = $mob_gui->getForm();
326 $form->setFormAction($ilCtrl->getFormAction($this));
327 $form->clearCommandButtons();
328 $form->addCommandButton("createNewObjectReference", $lng->txt("save"));
329 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
330 $this->tpl->setContent($form->getHTML());
331 }
332 }
Class ilObjMediaObjectGUI.
insertFromPool($a_change_obj_ref=false)
Insert media object from pool.
poolSelection($a_change_obj_ref=false)
Pool Selection.
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
add tabs to ilTabsGUI object
selectPool($a_change_obj_ref=false)
Select concrete pool.
displayValidationError()
display validation errors

References $_GET, $_SESSION, $ctrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\displayValidationError(), getTabs(), insertFromPool(), poolSelection(), and selectPool().

+ Here is the call graph for this function:

◆ checkFixSize()

ilPCMediaObjectGUI::checkFixSize ( )
protected

Check fix size.

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

339 {
340 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
341 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
342
343 $ok = false;
344 if (($std_alias_item->getWidth() != "" && $std_alias_item->getHeight() != "")) {
345 $ok = true;
346 }
347 if ($std_alias_item->getWidth() == "" && $std_alias_item->getHeight() == ""
348 && $std_item->getWidth() != "" && $std_item->getHeight() != "") {
349 $ok = true;
350 }
351
352 if (!$ok) {
353 ilUtil::sendFailure($this->lng->txt("mob_no_fixed_size_map_editing"));
354 }
355 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $ok, and ilUtil\sendFailure().

Referenced by executeCommand().

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

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

References ilPageContentGUI\getCharacteristics().

Referenced by getTabs().

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

1162 {
1164
1165 $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1166 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
1167 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1168 }
$ilUser
Definition: imgupload.php:18

References $ilUser, and $user.

◆ create()

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

create new media object in dom and update page in db

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

551 {
552 $ilCtrl = $this->ctrl;
554
555 if ($_GET["subCmd"] == "insertFromPool") {
556 if (is_array($_POST["id"])) {
557 for ($i = count($_POST["id"]) - 1; $i >= 0; $i--) {
558 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
560 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
561 $this->content_obj = new ilPCMediaObject($this->getPage());
562 $this->content_obj->readMediaObject($fid);
563 $this->content_obj->createAlias($this->pg_obj, $_GET["hier_id"], $this->pc_id);
564 }
565 $this->updated = $this->pg_obj->update();
566 }
567
568 $this->redirectToParent($_GET["hier_id"]);
569 }
570
571 // check form input
572 $mob_gui = new ilObjMediaObjectGUI("");
573 $mob_gui->initForm("create");
574
575 if (!$mob_gui->checkFormInput()) {
576 $this->form = $mob_gui->getForm();
577 $this->insert("edpost", "create_mob", true);
578 return;
579 }
580 // create dummy object in db (we need an id)
581 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
582 if ($a_change_obj_ref != true) {
583 $this->content_obj = new ilPCMediaObject($this->getPage());
584 }
585 $this->content_obj->createMediaObject();
586 $media_obj = $this->content_obj->getMediaObject();
587
588 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
590
591 if ($a_create_alias) {
592 // need a pcmediaobject here
593 //$this->node = $this->createPageContentNode();
594
595 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
596 $this->updated = $this->pg_obj->update();
597 if ($this->updated === true) {
598 $this->pg_obj->stripHierIDs();
599 $this->pg_obj->addHierIDs();
600 $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
601 $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
602 $this->content_obj->setHierId($this->content_obj->readHierId());
603 $this->setHierId($this->content_obj->readHierId());
604 $this->content_obj->setPCId($this->content_obj->readPCId());
605 ilUtil::sendSuccess($lng->txt("saved_media_object"), true);
606 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
607
608 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
609 } else {
610 $this->insert();
611 }
612 } else {
613 if ($a_change_obj_ref == true) {
614 $this->content_obj->updateObjectReference();
615 $this->updated = $this->pg_obj->update();
616 $this->ctrl->redirect($this, "editAlias");
617 }
618 return $this->content_obj;
619 }
620 }
$_POST["username"]
static lookupForeignId($a_id)
Lookup Foreign Id.
static setObjectPerCreationForm($a_mob)
Set media object values from creation form.
insert($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
Insert new media object form.
Class ilPCMediaObject.
redirectToParent($hier_id="")
Redirect to parent.
setHierId($a_hier_id)
get hierarchical id in dom object
$i
Definition: metadata.php:24

References $_GET, $_POST, ilPageContentGUI\$content_obj, $ctrl, $i, ilPageContentGUI\$lng, ilPageContentGUI\getPage(), insert(), ilMediaPoolItem\lookupForeignId(), ilPageContentGUI\redirectToParent(), ilPageContentGUI\setHierId(), and ilObjMediaObjectGUI\setObjectPerCreationForm().

Referenced by createNewObjectReference().

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

521 {
522 $this->create(false, true);
523 }
& create($a_create_alias=true, $a_change_obj_ref=false)
create new media object in dom and update page in db

References create().

+ Here is the call graph for this function:

◆ edit()

ilPCMediaObjectGUI::edit ( )

edit properties form

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

627 {
628 if ($this->content_obj->checkInstanceEditing()) {
629 $this->ctrl->redirect($this, "editAlias");
630 }
631 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
632 }

◆ editAlias()

ilPCMediaObjectGUI::editAlias ( )

edit properties form

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

638 {
640
641 $this->initAliasForm();
642 $this->getAliasValues();
643 $tpl->setContent($this->form_gui->getHTML());
644 }
initAliasForm()
Init alias form.
getAliasValues()
Put alias values into form.

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

Referenced by saveAliasProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editStyle()

ilPCMediaObjectGUI::editStyle ( )

Edit Style.

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

1244 {
1245 $ilCtrl = $this->ctrl;
1246 $tpl = $this->tpl;
1247 $lng = $this->lng;
1248
1249 $this->displayValidationError();
1250
1251 // edit form
1252 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1253 $form = new ilPropertyFormGUI();
1254 $form->setFormAction($ilCtrl->getFormAction($this));
1255 $form->setTitle($this->lng->txt("cont_edit_style"));
1256
1257 // characteristic selection
1258 require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
1259 $char_prop = new ilAdvSelectInputGUI(
1260 $this->lng->txt("cont_characteristic"),
1261 "characteristic"
1262 );
1263
1264 $chars = $this->getCharacteristics();
1265 if (is_object($this->content_obj)) {
1266 if ($chars[$a_seleted_value] == "" && ($this->content_obj->getClass() != "")) {
1267 $chars = array_merge(
1268 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1269 $chars
1270 );
1271 }
1272 }
1273
1274 $selected = $this->content_obj->getClass();
1275 if ($selected == "") {
1276 $selected = "MediaContainer";
1277 }
1278
1279 foreach ($chars as $k => $char) {
1280 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1281 $char . '</div>';
1282 $char_prop->addOption($k, $char, $html);
1283 }
1284
1285 $char_prop->setValue($selected);
1286 $form->addItem($char_prop);
1287
1288 // save button
1289 $form->addCommandButton("saveStyle", $lng->txt("save"));
1290
1291 $html = $form->getHTML();
1292 $tpl->setContent($html);
1293 return $ret;
1294 }
This class represents an advanced selection list property in a property form.
This class represents a property form user interface.
$ret
Definition: parser.php:6

References $ctrl, ilPageContentGUI\$lng, $ret, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and ilPageContentGUI\getCharacteristics().

Referenced by saveStyle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCMediaObjectGUI::executeCommand ( )

execute command

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

159 {
162 $ilTabs = $this->tabs;
163
164 $this->getCharacteristicsOfCurrentStyle("media_cont"); // scorm-2004
165
166 // get next class that processes or forwards current command
167 $next_class = $this->ctrl->getNextClass($this);
168
169 // get current command
170 $cmd = $this->ctrl->getCmd();
171 if (is_object($this->content_obj)) {
172 //$this->tpl->clearHeader();
173 $tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
174 $this->getTabs($this->tabs_gui);
175
176 $mob = $this->content_obj->getMediaObject();
177 if (is_object($mob)) {
178 $tpl->setTitle($lng->txt("mob") . ": " .
179 $this->content_obj->getMediaObject()->getTitle());
180 $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
181 $mob_gui->setBackTitle($this->page_back_title);
182 $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
183 $mob_gui->getTabs($this->tabs_gui);
184 }
185 } else {
186 }
187
188 switch ($next_class) {
189 case "ilobjmediaobjectgui":
190 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
191 //$this->tpl->clearHeader();
192 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
193 $this->tpl->setTitle($this->lng->txt("mob") . ": " .
194 $this->content_obj->getMediaObject()->getTitle());
195 $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
196 $mob_gui->setBackTitle($this->page_back_title);
197 $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
198 $ret = $this->ctrl->forwardCommand($mob_gui);
199 break;
200
201 // instance image map editing
202 case "ilpcimagemapeditorgui":
203 require_once("./Services/COPage/classes/class.ilPCImageMapEditorGUI.php");
204 $ilTabs->setTabActive("cont_inst_map_areas");
205 $image_map_edit = new ilPCImageMapEditorGUI(
206 $this->content_obj,
207 $this->pg_obj
208 );
209 $ret = $this->ctrl->forwardCommand($image_map_edit);
210 $tpl->setContent($ret);
211 $this->checkFixSize();
212 break;
213
214 default:
215 $ret = $this->$cmd();
216 break;
217 }
218
219 return $ret;
220 }
User interface class for page content map editor.
getEnabledMapAreas()
Get Enable map areas.
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilPageContentGUI\$lng, $ret, $tabs, ilPageContentGUI\$tpl, checkFixSize(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), getEnabledMapAreas(), ilUtil\getImagePath(), and getTabs().

+ Here is the call graph for this function:

◆ getAliasValues()

ilPCMediaObjectGUI::getAliasValues ( )

Put alias values into form.

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

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

References ilPageContentGUI\$lng.

Referenced by editAlias().

+ Here is the caller graph for this function:

◆ getEnabledMapAreas()

ilPCMediaObjectGUI::getEnabledMapAreas ( )

Get Enable map areas.

Returns
boolean Enable map areas

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

151 {
152 return $this->enabledmapareas;
153 }

Referenced by executeCommand(), and getTabs().

+ Here is the caller graph for this function:

◆ getHeader()

ilPCMediaObjectGUI::getHeader ( )

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

References $header.

◆ getStyleInput()

ilPCMediaObjectGUI::getStyleInput ( )

Get style input.

Parameters

return

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

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

References ilPageContentGUI\getCharacteristics().

+ Here is the call graph for this function:

◆ getSubCmd()

ilPCMediaObjectGUI::getSubCmd ( )

Get table sub command.

Returns
string command

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

References $sub_cmd.

Referenced by insertFromPool().

+ Here is the caller graph for this function:

◆ getTabs()

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

add tabs to ilTabsGUI object

Parameters
object$tab_guiilTabsGUI object
boolean$a_createnew creation true/false

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

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

References $ctrl, $format, $tabs, checkStyleSelection(), and getEnabledMapAreas().

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

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

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

References $ctrl, $format, $lm_set, and ilPageContentGUI\$lng.

Referenced by editAlias().

+ Here is the caller graph for this function:

◆ insert()

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

Insert new media object form.

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

226 {
227 $ilTabs = $this->tabs;
229 $ilCtrl = $this->ctrl;
231
232 if ($_GET["subCmd"] == "insertNew") {
233 $_SESSION["cont_media_insert"] = "insertNew";
234 }
235 if ($_GET["subCmd"] == "insertFromPool") {
236 $_SESSION["cont_media_insert"] = "insertFromPool";
237 }
238
239 if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "") {
240 $_GET["subCmd"] = $_SESSION["cont_media_insert"];
241 }
242
243 switch ($_GET["subCmd"]) {
244 case "insertFromPool":
245 $this->insertFromPool();
246 break;
247
248 case "poolSelection":
249 $this->poolSelection();
250 break;
251
252 case "selectPool":
253 $this->selectPool();
254 break;
255
256 case "insertNew":
257 default:
258 $this->getTabs($ilTabs, true);
259 $ilTabs->setSubTabActive("cont_new_mob");
260
261 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
262 if ($a_input_error) {
263 $form = $this->form;
264 } else {
265 $mob_gui = new ilObjMediaObjectGUI("");
266 $mob_gui->initForm("create");
267 $form = $mob_gui->getForm();
268 }
269 $form->setFormAction($ilCtrl->getFormAction($this, "create_mob"));
270 $form->clearCommandButtons();
271 $form->addCommandButton("create_mob", $lng->txt("save"));
272 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
273
274 $this->displayValidationError();
275
276 $tpl->setContent($form->getHTML());
277
278 break;
279 }
280 }

References $_GET, $_SESSION, $ctrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), getTabs(), insertFromPool(), poolSelection(), and selectPool().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromPool()

ilPCMediaObjectGUI::insertFromPool (   $a_change_obj_ref = false)

Insert media object from pool.

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

361 {
362 $ilCtrl = $this->ctrl;
363 $ilAccess = $this->access;
364 $ilTabs = $this->tabs;
367 $ui = $this->ui;
368
369 if ($_SESSION["cont_media_pool"] != "" &&
370 $ilAccess->checkAccess("write", "", $_SESSION["cont_media_pool"])
371 && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_media_pool"])) == "mep") {
372 $html = "";
373 $tb = new ilToolbarGUI();
374
375 // button: select pool
376 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
377 if ($a_change_obj_ref) {
378 $tb->addButton(
379 $lng->txt("cont_switch_to_media_pool"),
380 $ilCtrl->getLinkTarget($this, "changeObjectReference")
381 );
382 } else {
383 $tb->addButton(
384 $lng->txt("cont_switch_to_media_pool"),
385 $ilCtrl->getLinkTarget($this, "insert")
386 );
387 }
388 $ilCtrl->setParameter($this, "subCmd", "");
389
390 // view mode: pool view (folders/all media objects)
391 $f = $ui->factory();
392 $tcmd = ($a_change_obj_ref)
393 ? "changeObjectReference"
394 : "insert";
395 $lng->loadLanguageModule("mep");
396 $ilCtrl->setParameter($this, "pool_view", "folder");
397 $actions[$lng->txt("folders")] = $ilCtrl->getLinkTarget($this, $tcmd);
398 $ilCtrl->setParameter($this, "pool_view", "all");
399 $actions[$lng->txt("mep_all_mobs")] = $ilCtrl->getLinkTarget($this, $tcmd);
400 $ilCtrl->setParameter($this, "pool_view", $this->pool_view);
401 $aria_label = $lng->txt("cont_change_pool_view");
402 $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == "folder")
403 ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
404 $tb->addSeparator();
405 $tb->addComponent($view_control);
406
407 $html = $tb->getHTML();
408
409 $this->getTabs($ilTabs, true, $a_change_obj_ref);
410 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
411
412
413
414
415 include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
416 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
417 $pool = new ilObjMediaPool($_SESSION["cont_media_pool"]);
418 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
419 $tcmd = ($a_change_obj_ref)
420 ? "changeObjectReference"
421 : "insert";
422 $tmode = ($a_change_obj_ref)
425
426 // handle table sub commands and get the table
427 if ($this->getSubCmd() == "applyFilter") {
428 $mpool_table = new ilMediaPoolTableGUI(
429 $this,
430 $tcmd,
431 $pool,
432 "mep_folder",
433 $tmode,
434 $this->pool_view == "all"
435 );
436 $mpool_table->resetOffset();
437 $mpool_table->writeFilterToSession();
438 }
439 if ($this->getSubCmd() == "resetFilter") {
440 $mpool_table = new ilMediaPoolTableGUI(
441 $this,
442 $tcmd,
443 $pool,
444 "mep_folder",
445 $tmode,
446 $this->pool_view == "all"
447 );
448 $mpool_table->resetOffset();
449 $mpool_table->resetFilter();
450 }
451 $mpool_table = new ilMediaPoolTableGUI(
452 $this,
453 $tcmd,
454 $pool,
455 "mep_folder",
456 $tmode,
457 $this->pool_view == "all"
458 );
459
460 $html .= $mpool_table->getHTML();
461
462 $tpl->setContent($html);
463 } else {
464 $this->poolSelection($a_change_obj_ref);
465 }
466 }
TableGUI class for recent changes in wiki.
Media pool object.
static _lookupObjId($a_id)
getSubCmd()
Get table sub command.

References $_SESSION, $access, $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, and poolSelection().

Referenced by changeObjectReference(), and insert().

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

1185 {
1186 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1187 $std_alias_item->setHorizontalAlign("Left");
1188 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1189 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1190 }

References $_SESSION.

◆ leftFloatAlign()

ilPCMediaObjectGUI::leftFloatAlign ( )

align media object to left, floating text

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

1207 {
1208 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1209 $std_alias_item->setHorizontalAlign("LeftFloat");
1210 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1211 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1212 }

References $_SESSION.

◆ poolSelection()

ilPCMediaObjectGUI::poolSelection (   $a_change_obj_ref = false)

Pool Selection.

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

488 {
490 $ilTabs = $this->tabs;
491 $ilCtrl = $this->ctrl;
492
493 $this->getTabs($ilTabs, true, $a_change_obj_ref);
494 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
495
496 include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
497
498 if ($a_change_obj_ref) {
499 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
500 $exp = new ilPoolSelectorGUI($this, "changeObjectReference", $this, "changeObjectReference");
501 } else {
502 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
503 $exp = new ilPoolSelectorGUI($this, "insert");
504 }
505
506 // filter
507 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
508 $exp->setClickableTypes(array('mep'));
509
510 if (!$exp->handleCommand()) {
511 $tpl->setContent($exp->getHTML());
512 }
513 }
Select media pool for adding objects into pages.

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

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

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

1196 {
1197 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1198 $std_alias_item->setHorizontalAlign("Right");
1199 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1200 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1201 }

References $_SESSION.

◆ rightFloatAlign()

ilPCMediaObjectGUI::rightFloatAlign ( )

align media object to right, floating text

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

1218 {
1219 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1220 $std_alias_item->setHorizontalAlign("RightFloat");
1221 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1222 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1223 }

References $_SESSION.

◆ saveAliasProperties()

ilPCMediaObjectGUI::saveAliasProperties ( )

save table properties in db and return to page edit screen

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

1047 {
1048 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1049 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
1050 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1051 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
1052
1053 // standard size
1054 if ($_POST["st_derive_size"] == "y") {
1055 $std_alias_item->deriveSize();
1056 } else {
1057 $std_alias_item->setWidth(ilUtil::stripSlashes($_POST["st_width_height"]["width"]));
1058 $std_alias_item->setHeight(ilUtil::stripSlashes($_POST["st_width_height"]["height"]));
1059 }
1060
1061 // standard caption
1062 if ($_POST["st_derive_caption"] == "y") {
1063 $std_alias_item->deriveCaption();
1064 } else {
1065 $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["st_caption"]));
1066 }
1067
1068 // text representation
1069 if ($_POST["st_derive_text_representation"] == "y") {
1070 $std_alias_item->deriveTextRepresentation();
1071 } else {
1072 $std_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["st_text_representation"]));
1073 }
1074
1075 // standard parameters
1076 if ($_POST["st_derive_parameters"] == "y") {
1077 $std_alias_item->deriveParameters();
1078 } else {
1079 if ($this->media_type->usesAutoStartParameterOnly(
1080 $std_item->getLocation(),
1081 $std_item->getFormat()
1082 )) { // autostart
1083 /*
1084 if ($_POST["st_autostart"]) {
1085 $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
1086 } else {
1087 $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
1088 }*/
1089 } else { // parameters
1090 $std_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["st_parameters"]))));
1091 }
1092 }
1093
1094 if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1095 if ($_POST["fullscreen"] == "y") {
1096 if (!$full_alias_item->exists()) {
1097 $full_alias_item->insert();
1098 }
1099
1100 // fullscreen size
1101 if ($_POST["full_derive_size"] == "y") {
1102 $full_alias_item->deriveSize();
1103 } else {
1104 $full_alias_item->setWidth(ilUtil::stripSlashes($_POST["full_width_height"]["width"]));
1105 $full_alias_item->setHeight(ilUtil::stripSlashes($_POST["full_width_height"]["height"]));
1106 }
1107
1108 // fullscreen caption
1109 if ($_POST["full_derive_caption"] == "y") {
1110 $full_alias_item->deriveCaption();
1111 } else {
1112 $full_alias_item->setCaption(ilUtil::stripSlashes($_POST["full_caption"]));
1113 }
1114
1115 // fullscreen text representation
1116 if ($_POST["full_derive_text_representation"] == "y") {
1117 $full_alias_item->deriveTextRepresentation();
1118 } else {
1119 $full_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["full_text_representation"]));
1120 }
1121
1122 // fullscreen parameters
1123 if ($_POST["full_derive_parameters"] == "y") {
1124 $full_alias_item->deriveParameters();
1125 } else {
1126 if ($this->media_type->usesAutoStartParameterOnly(
1127 $full_item->getLocation(),
1128 $full_item->getFormat()
1129 )) { // autostart
1130 /*
1131 if ($_POST["full_autostart"]) {
1132 $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
1133 } else {
1134 $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
1135 }*/
1136 } else {
1137 $full_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["full_parameters"]))));
1138 }
1139 }
1140 } else {
1141 if ($full_alias_item->exists()) {
1142 $full_alias_item->delete();
1143 }
1144 }
1145 }
1146
1147 $this->updated = $this->pg_obj->update();
1148 if ($this->updated === true) {
1149 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1150 $this->ctrl->redirect($this, "editAlias");
1151 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1152 } else {
1153 $this->pg_obj->addHierIDs();
1154 $this->editAlias();
1155 }
1156 }
editAlias()
edit properties form
static extractParameterString($a_parstr)
extracts parameter value pairs from a string into an array
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, editAlias(), ilUtil\extractParameterString(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveStyle()

ilPCMediaObjectGUI::saveStyle ( )

Save Style.

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

1339 {
1340 $this->content_obj->setClass($_POST["characteristic"]);
1341 $this->updated = $this->pg_obj->update();
1342 if ($this->updated === true) {
1343 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1344 } else {
1345 $this->pg_obj->addHierIDs();
1346 $this->editStyle();
1347 }
1348 }

References $_POST, and editStyle().

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

530 {
531 $ilCtrl = $this->ctrl;
533 if (is_array($_POST["id"]) && count($_POST["id"]) == 1) {
534 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
535 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
537 $this->content_obj->readMediaObject($fid);
538 $this->content_obj->updateObjectReference();
539 $this->updated = $this->pg_obj->update();
540 } else {
541 ilUtil::sendInfo($lng->txt("cont_select_max_one_item"), true);
542 $ilCtrl->redirect($this, "changeObjectReference");
543 }
544 $ilCtrl->redirect($this, "editAlias");
545 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_POST, $ctrl, ilPageContentGUI\$lng, ilMediaPoolItem\lookupForeignId(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ selectPool()

ilPCMediaObjectGUI::selectPool (   $a_change_obj_ref = false)

Select concrete pool.

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

472 {
473 $ilCtrl = $this->ctrl;
474
475 $_SESSION["cont_media_pool"] = $_GET["pool_ref_id"];
476 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
477 if ($a_change_obj_ref) {
478 $ilCtrl->redirect($this, "changeObjectReference");
479 } else {
480 $ilCtrl->redirect($this, "insert");
481 }
482 }

References $_GET, $_SESSION, and $ctrl.

Referenced by changeObjectReference(), and insert().

+ Here is the caller graph for this function:

◆ setEnabledMapAreas()

ilPCMediaObjectGUI::setEnabledMapAreas (   $a_enabledmapareas)

Set Enable map areas.

Parameters
boolean$a_enabledmapareasEnable map areas

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

141 {
142 $this->enabledmapareas = $a_enabledmapareas;
143 }

◆ setHeader()

ilPCMediaObjectGUI::setHeader (   $a_title = "")

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

126 {
127 $this->header = $a_title;
128 }

◆ setSubCmd()

ilPCMediaObjectGUI::setSubCmd (   $a_val)

Set table sub command.

Parameters
string$a_valcommand

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

110 {
111 $this->sub_cmd = $a_val;
112 }

Field Documentation

◆ $access

ilPCMediaObjectGUI::$access
protected

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

Referenced by insertFromPool().

◆ $ctrl

◆ $header

ilPCMediaObjectGUI::$header

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

Referenced by getHeader().

◆ $media_type

ilPCMediaObjectGUI::$media_type
protected

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

◆ $pool_view

ilPCMediaObjectGUI::$pool_view
protected

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

◆ $sub_cmd

ilPCMediaObjectGUI::$sub_cmd
protected

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

Referenced by getSubCmd().

◆ $tabs

ilPCMediaObjectGUI::$tabs
protected

◆ $toolbar

ilPCMediaObjectGUI::$toolbar
protected

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

◆ $ui

ilPCMediaObjectGUI::$ui
protected

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

Referenced by insertFromPool().

◆ $user

ilPCMediaObjectGUI::$user
protected

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

Referenced by copyToClipboard().


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