ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPCMediaObjectGUI Class Reference

Class ilPCMediaObjectGUI. More...

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

Public Member Functions

 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor @access public. 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...
 
 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...
 
 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...
 
 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...
 

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
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 

Protected Attributes

 $tabs
 
 $access
 
 $toolbar
 
 $user
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- 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 (   $a_pg_obj,
  $a_content_obj,
  $a_hier_id = 0,
  $a_pc_id = "" 
)

Constructor @access public.

Reimplemented from ilPageContentGUI.

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

47 {
48 global $DIC;
49
50 $this->tpl = $DIC["tpl"];
51 $this->lng = $DIC->language();
52 $this->tabs = $DIC->tabs();
53 $this->access = $DIC->access();
54 $this->toolbar = $DIC->toolbar();
55 $this->user = $DIC->user();
56 $ilCtrl = $DIC->ctrl();
57
58 $this->ctrl = $ilCtrl;
59 // var_dump($_POST);
60 //ilUtil::printBacktrace(10); exit;
61 //echo "constructor target:".$_SESSION["il_map_il_target"].":<br>";
62 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
63
64 $this->setCharacteristics(array(
65 "MediaContainer" => $this->lng->txt("cont_Media"),
66 "MediaContainerMax50" => "MediaContainerMax50",
67 "MediaContainerFull100" => "MediaContainerFull100"
68 ));
69 }
user()
Definition: user.php:4
setCharacteristics($a_chars)
Set Characteristics.
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, $ilCtrl, ilPageContentGUI\setCharacteristics(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ centerAlign()

ilPCMediaObjectGUI::centerAlign ( )

align media object to center

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

1092 {
1093 $std_alias_item = new ilMediaAliasItem(
1094 $this->dom,
1095 $this->getHierId(),
1096 "Standard",
1097 $this->content_obj->getPcId()
1098 );
1099 $std_alias_item->setHorizontalAlign("Center");
1100 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1101 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1102 }
$_SESSION["AccountId"]
Class ilMediaAliasItem.
getHierId()
get hierarchical id in dom object

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ changeObjectReference()

ilPCMediaObjectGUI::changeObjectReference ( )

Change object reference.

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

233 {
234 $ilTabs = $this->tabs;
237
238 if ($_GET["subCmd"] == "insertNew") {
239 $_SESSION["cont_media_insert"] = "insertNew";
240 }
241 if ($_GET["subCmd"] == "insertFromPool") {
242 $_SESSION["cont_media_insert"] = "insertFromPool";
243 }
244
245 if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "") {
246 $_GET["subCmd"] = $_SESSION["cont_media_insert"];
247 }
248
249 switch ($_GET["subCmd"]) {
250 case "insertFromPool":
251 $this->insertFromPool(true);
252 break;
253
254 case "poolSelection":
255 $this->poolSelection(true);
256 break;
257
258 case "selectPool":
259 $this->selectPool(true);
260 break;
261
262 case "insertNew":
263 default:
264 $ilCtrl->setParameter($this, "subCmd", "changeObjectReference");
265 $this->getTabs($ilTabs, true, true);
266 $ilTabs->setSubTabActive("cont_new_mob");
267
268 $this->displayValidationError();
269
270 $mob_gui = new ilObjMediaObjectGUI("");
271 $mob_gui->initForm("create");
272 $form = $mob_gui->getForm();
273 $form->setFormAction($ilCtrl->getFormAction($this));
274 $form->clearCommandButtons();
275 $form->addCommandButton("createNewObjectReference", $lng->txt("save"));
276 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
277 $this->tpl->setContent($form->getHTML());
278 }
279 }
$_GET["client_id"]
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
if(isset($_POST['submit'])) $form

References $_GET, $_SESSION, $ctrl, $form, $ilCtrl, 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 285 of file class.ilPCMediaObjectGUI.php.

286 {
287 $std_alias_item = new ilMediaAliasItem(
288 $this->dom,
289 $this->getHierId(),
290 "Standard",
291 $this->content_obj->getPcId()
292 );
293 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
294
295 $ok = false;
296 if (($std_alias_item->getWidth() != "" && $std_alias_item->getHeight() != "")) {
297 $ok = true;
298 }
299 if ($std_alias_item->getWidth() == "" && $std_alias_item->getHeight() == ""
300 && $std_item->getWidth() != "" && $std_item->getHeight() != "") {
301 $ok = true;
302 }
303
304 if (!$ok) {
305 ilUtil::sendFailure($this->lng->txt("mob_no_fixed_size_map_editing"));
306 }
307 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $ok, ilPageContentGUI\getHierId(), 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 1171 of file class.ilPCMediaObjectGUI.php.

1172 {
1173 // check whether there is more than one style class
1174 $chars = $this->getCharacteristics();
1175
1176 if (count($chars) > 1 ||
1177 ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media")) {
1178 return true;
1179 }
1180 return false;
1181 }
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 1079 of file class.ilPCMediaObjectGUI.php.

1080 {
1082
1083 $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1084 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
1085 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1086 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$ilUser
Definition: imgupload.php:18

References $ilUser, $user, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

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

455 {
458
459 if ($_GET["subCmd"] == "insertFromPool") {
460 if (is_array($_POST["id"])) {
461 for ($i = count($_POST["id"]) - 1; $i>=0; $i--) {
462 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
464 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
465 $this->content_obj = new ilPCMediaObject($this->getPage());
466 $this->content_obj->readMediaObject($fid);
467 $this->content_obj->createAlias($this->pg_obj, $_GET["hier_id"], $this->pc_id);
468 }
469 $this->updated = $this->pg_obj->update();
470 }
471
472 $ilCtrl->returnToParent($this);
473 }
474
475 // check form input
476 $mob_gui = new ilObjMediaObjectGUI("");
477 $mob_gui->initForm("create");
478
479 if (!$mob_gui->checkFormInput()) {
480 $this->form = $mob_gui->getForm();
481 $this->insert("edpost", "create_mob", true);
482 return;
483 }
484 // create dummy object in db (we need an id)
485 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
486 if ($a_change_obj_ref != true) {
487 $this->content_obj = new ilPCMediaObject($this->getPage());
488 }
489 $this->content_obj->createMediaObject();
490 $media_obj = $this->content_obj->getMediaObject();
491
492 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
494
495 if ($a_create_alias) {
496 // need a pcmediaobject here
497 //$this->node = $this->createPageContentNode();
498
499 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
500 $this->updated = $this->pg_obj->update();
501 if ($this->updated === true) {
502 $this->pg_obj->stripHierIDs();
503 $this->pg_obj->addHierIDs();
504 $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
505 $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
506 $this->content_obj->setHierId($this->content_obj->readHierId());
507 $this->setHierId($this->content_obj->readHierId());
508 $this->content_obj->setPCId($this->content_obj->readPCId());
509 ilUtil::sendSuccess($lng->txt("saved_media_object"), true);
510 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
511
512 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
513 } else {
514 $this->insert();
515 }
516 } else {
517 if ($a_change_obj_ref == true) {
518 $this->content_obj->updateObjectReference();
519 $this->updated = $this->pg_obj->update();
520 $this->ctrl->redirect($this, "editAlias");
521 }
522 return $this->content_obj;
523 }
524 }
$_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.
setHierId($a_hier_id)
get hierarchical id in dom object
$i
Definition: disco.tpl.php:19

References $_GET, $_POST, ilPageContentGUI\$content_obj, $ctrl, $i, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\getPage(), insert(), ilMediaPoolItem\lookupForeignId(), ilUtil\sendSuccess(), 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 424 of file class.ilPCMediaObjectGUI.php.

425 {
426 $this->create(false, true);
427 }
& 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:

◆ editAlias()

ilPCMediaObjectGUI::editAlias ( )

edit properties form

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

531 {
533
534 $this->initAliasForm();
535 $this->getAliasValues();
536 $tpl->setContent($this->form_gui->getHTML());
537 }
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 1186 of file class.ilPCMediaObjectGUI.php.

1187 {
1189 $tpl = $this->tpl;
1190 $lng = $this->lng;
1191
1192 $this->displayValidationError();
1193
1194 // edit form
1195 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1196 $form = new ilPropertyFormGUI();
1197 $form->setFormAction($ilCtrl->getFormAction($this));
1198 $form->setTitle($this->lng->txt("cont_edit_style"));
1199
1200 // characteristic selection
1201 require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
1202 $char_prop = new ilAdvSelectInputGUI(
1203 $this->lng->txt("cont_characteristic"),
1204 "characteristic"
1205 );
1206
1207 $chars = $this->getCharacteristics();
1208 if (is_object($this->content_obj)) {
1209 if ($chars[$a_seleted_value] == "" && ($this->content_obj->getClass() != "")) {
1210 $chars = array_merge(
1211 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1212 $chars
1213 );
1214 }
1215 }
1216
1217 $selected = $this->content_obj->getClass();
1218 if ($selected == "") {
1219 $selected = "MediaContainer";
1220 }
1221
1222 foreach ($chars as $k => $char) {
1223 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1224 $char . '</div>';
1225 $char_prop->addOption($k, $char, $html);
1226 }
1227
1228 $char_prop->setValue($selected);
1229 $form->addItem($char_prop);
1230
1231 // save button
1232 $form->addCommandButton("saveStyle", $lng->txt("save"));
1233
1234 $html = $form->getHTML();
1235 $tpl->setContent($html);
1236 return $ret;
1237 }
This class represents an advanced selection list property in a property form.
This class represents a property form user interface.
$html
Definition: example_001.php:87
$ret
Definition: parser.php:6

References $ctrl, $form, $html, $ilCtrl, 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 104 of file class.ilPCMediaObjectGUI.php.

105 {
108 $ilTabs = $this->tabs;
109
110 $this->getCharacteristicsOfCurrentStyle("media_cont"); // scorm-2004
111
112 // get next class that processes or forwards current command
113 $next_class = $this->ctrl->getNextClass($this);
114
115 // get current command
116 $cmd = $this->ctrl->getCmd();
117
118 if (is_object($this->content_obj)) {
119 $this->tpl->clearHeader();
120 $tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
121 $this->getTabs($this->tabs_gui);
122
123 $mob = $this->content_obj->getMediaObject();
124 if (is_object($mob)) {
125 $tpl->setVariable("HEADER", $lng->txt("mob") . ": " .
126 $this->content_obj->getMediaObject()->getTitle());
127 $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
128 $mob_gui->setBackTitle($this->page_back_title);
129 $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
130 $mob_gui->getTabs($this->tabs_gui);
131 }
132 } else {
133 }
134
135 switch ($next_class) {
136 case "ilobjmediaobjectgui":
137 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
138 $this->tpl->clearHeader();
139 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
140 $this->tpl->setTitle($this->lng->txt("mob") . ": " .
141 $this->content_obj->getMediaObject()->getTitle());
142 $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
143 $mob_gui->setBackTitle($this->page_back_title);
144 $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
145 $ret = $this->ctrl->forwardCommand($mob_gui);
146 break;
147
148 // instance image map editing
149 case "ilpcimagemapeditorgui":
150 require_once("./Services/COPage/classes/class.ilPCImageMapEditorGUI.php");
151 $ilTabs->setTabActive("cont_inst_map_areas");
152 $image_map_edit = new ilPCImageMapEditorGUI(
153 $this->content_obj,
154 $this->pg_obj
155 );
156 $ret = $this->ctrl->forwardCommand($image_map_edit);
157 $tpl->setContent($ret);
158 $this->checkFixSize();
159 break;
160
161 default:
162 $ret = $this->$cmd();
163 break;
164 }
165
166 return $ret;
167 }
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 806 of file class.ilPCMediaObjectGUI.php.

807 {
809
810 // standard view resource
811 $std_alias_item = new ilMediaAliasItem(
812 $this->dom,
813 $this->getHierId(),
814 "Standard",
815 $this->content_obj->getPcId()
816 );
817 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
818
819 $values["title"] = $this->content_obj->getMediaObject()->getTitle();
820 $values["st_location"] = $std_item->getLocation();
821 $values["st_format"] = $std_item->getFormat();
822
823 // size
824 $values["st_width_height"]["width"] = $std_alias_item->getWidth();
825 $values["st_width_height"]["height"] = $std_alias_item->getHeight();
826 $values["st_width_height"]["constr_prop"] = true;
827
828 // caption
829 $values["st_caption"] = $std_alias_item->getCaption();
830 if (trim($std_item->getCaption()) == "") {
831 $values["def_caption"] = "<i>" . $lng->txt("cont_no_caption") . "</i>";
832 } else {
833 $values["def_caption"] = $std_item->getCaption();
834 }
835
836 // text representation
837 $values["st_text_representation"] = $std_alias_item->getTextRepresentation();
838 if (trim($std_item->getTextRepresentation()) == "") {
839 $values["def_text_representation"] = "<i>" . $lng->txt("cont_no_text") . "</i>";
840 } else {
841 $values["def_text_representation"] = $std_item->getTextRepresentation();
842 }
843
844 // parameters / autostart
846 $std_item->getLocation(),
847 $std_item->getFormat()
848 )) { // autostart
849 $par = $std_alias_item->getParameters();
850 if ($par["autostart"] == "true") {
851 $values["st_autostart"] = true;
852 }
853 } else { // parameters
854 $values["st_parameters"] = $std_alias_item->getParameterString();
855 }
856
857 // size
858 $values["st_derive_size"] = $std_alias_item->definesSize()
859 ? "n"
860 : "y";
861 if ($values["st_derive_size"] == "y") {
862 $values["st_width_height"]["width"] = $std_item->getWidth();
863 $values["st_width_height"]["height"] = $std_item->getHeight();
864 }
865 $values["st_derive_caption"] = $std_alias_item->definesCaption()
866 ? "n"
867 : "y";
868 $values["st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
869 ? "n"
870 : "y";
871 $values["st_derive_parameters"] = $std_alias_item->definesParameters()
872 ? "n"
873 : "y";
874 if (trim($std_item->getParameterString()) == "") {
875 $values["def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
876 } else {
877 $values["def_parameters"] = $std_item->getParameterString();
878 }
879
880 // fullscreen properties
881 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
882 $full_alias_item = new ilMediaAliasItem(
883 $this->dom,
884 $this->getHierId(),
885 "Fullscreen",
886 $this->content_obj->getPcId()
887 );
888 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
889
890 $values["fullscreen"] = "n";
891 if ($full_alias_item->exists()) {
892 $values["fullscreen"] = "y";
893 }
894
895 $values["full_location"] = $full_item->getLocation();
896 $values["full_format"] = $full_item->getFormat();
897 $values["full_width_height"]["width"] = $full_alias_item->getWidth();
898 $values["full_width_height"]["height"] = $full_alias_item->getHeight();
899 $values["full_width_height"]["constr_prop"] = true;
900 $values["full_caption"] = $full_alias_item->getCaption();
901 if (trim($full_item->getCaption()) == "") {
902 $values["full_def_caption"] = "<i>" . $lng->txt("cont_no_caption") . "</i>";
903 } else {
904 $values["full_def_caption"] = $full_item->getCaption();
905 }
906 $values["full_text_representation"] = $full_alias_item->getTextRepresentation();
907 if (trim($full_item->getTextRepresentation()) == "") {
908 $values["full_def_text_representation"] = "<i>" . $lng->txt("cont_no_text") . "</i>";
909 } else {
910 $values["full_def_text_representation"] = $full_item->getTextRepresentation();
911 }
912 $values["full_parameters"] = $full_alias_item->getParameterString();
913 $values["full_derive_size"] = $full_alias_item->definesSize()
914 ? "n"
915 : "y";
916 if ($values["full_derive_size"] == "y") {
917 $values["full_width_height"]["width"] = $full_item->getWidth();
918 $values["full_width_height"]["height"] = $full_item->getHeight();
919 }
920 $values["full_derive_caption"] = $full_alias_item->definesCaption()
921 ? "n"
922 : "y";
923 $values["full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
924 ? "n"
925 : "y";
926
927 // parameters
929 $full_item->getLocation(),
930 $full_item->getFormat()
931 )) { // autostart
932 $par = $full_alias_item->getParameters();
933 if ($par["autostart"] == "true") {
934 $values["full_autostart"] = true;
935 }
936 } else { // parameters
937 $values["full_parameters"] = $full_alias_item->getParameterString();
938 }
939
940 $values["full_derive_parameters"] = $full_alias_item->definesParameters()
941 ? "n"
942 : "y";
943 if (trim($full_item->getParameterString()) == "") {
944 $values["full_def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
945 } else {
946 $values["full_def_parameters"] = $full_item->getParameterString();
947 }
948 }
949
950 $this->form_gui->setValuesByArray($values);
951 }
static _useAutoStartParameterOnly($a_loc, $a_format)
Check whether only autostart parameter should be supported (instead of parameters input field.

References ilPageContentGUI\$lng, ilObjMediaObject\_useAutoStartParameterOnly(), and ilPageContentGUI\getHierId().

Referenced by editAlias().

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

◆ getEnabledMapAreas()

ilPCMediaObjectGUI::getEnabledMapAreas ( )

Get Enable map areas.

Returns
boolean Enable map areas

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

97 {
98 return $this->enabledmapareas;
99 }

Referenced by executeCommand(), and getTabs().

+ Here is the caller graph for this function:

◆ getHeader()

ilPCMediaObjectGUI::getHeader ( )

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

References $header.

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

1261 {
1263 $ilTabs = $this->tabs;
1264
1265 if (!$a_create) {
1266 if ($this->checkStyleSelection()) {
1267 $ilTabs->addTarget(
1268 "cont_style",
1269 $ilCtrl->getLinkTarget($this, "editStyle"),
1270 "editStyle",
1271 get_class($this)
1272 );
1273 }
1274
1275 $ilTabs->addTarget(
1276 "cont_mob_inst_prop",
1277 $ilCtrl->getLinkTarget($this, "editAlias"),
1278 "editAlias",
1279 get_class($this)
1280 );
1281
1282 if ($this->getEnabledMapAreas()) {
1283 $st_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1284 if (is_object($st_item)) {
1285 $format = $st_item->getFormat();
1286 if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg"))) {
1287 $ilTabs->addTarget(
1288 "cont_inst_map_areas",
1289 $ilCtrl->getLinkTargetByClass("ilpcimagemapeditorgui", "editMapAreas"),
1290 array(),
1291 "ilpcimagemapeditorgui"
1292 );
1293 }
1294 }
1295 }
1296 } else {
1297 if ($a_change_obj_ref) {
1298 $cmd = "changeObjectReference";
1299 } else {
1300 $cmd = "insert";
1301 }
1302
1303 $ilCtrl->setParameter($this, "subCmd", "insertNew");
1304 $ilTabs->addSubTabTarget(
1305 "cont_new_mob",
1306 $ilCtrl->getLinkTarget($this, $cmd),
1307 $cmd
1308 );
1309
1310 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
1311 $ilTabs->addSubTabTarget(
1312 "cont_mob_from_media_pool",
1313 $ilCtrl->getLinkTarget($this, $cmd),
1314 $cmd
1315 );
1316 $ilCtrl->setParameter($this, "subCmd", "");
1317 }
1318 }
checkStyleSelection()
Checks whether style selection shoudl be available or not.
$format
Definition: metadata.php:141

References $ctrl, $format, $ilCtrl, $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 542 of file class.ilPCMediaObjectGUI.php.

543 {
546
547 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
548
549 $this->form_gui = new ilPropertyFormGUI();
550
551 // standard view resource
552 $std_alias_item = new ilMediaAliasItem(
553 $this->dom,
554 $this->getHierId(),
555 "Standard",
556 $this->content_obj->getPcId()
557 );
558 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
559
560 // title, location and format
561 $title = new ilNonEditableValueGUI($lng->txt("title"), "title");
562 $this->form_gui->addItem($title);
563 $loc = new ilNonEditableValueGUI(
564 $this->lng->txt("cont_" . strtolower($std_item->getLocationType())),
565 "st_location"
566 );
567 $this->form_gui->addItem($loc);
569 $this->lng->txt("cont_format"),
570 "st_format"
571 );
572 $this->form_gui->addItem($format);
573
574 // standard size
575 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "st_derive_size");
576 $orig_size = $std_item->getOriginalSize();
577 $add_str = ($orig_size["width"] != "" && $orig_size["height"] != "")
578 ? " (" . $orig_size["width"] . " x " . $orig_size["height"] . ")"
579 : "";
580 $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
581 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
582 $radio_size->addOption($op1);
583
584 // width height
585 include_once("./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
586 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
587 " / " . $lng->txt("cont_height"), "st_width_height");
588 $width_height->setConstrainProportions(true);
589 $op2->addSubItem($width_height);
590
591 $radio_size->addOption($op2);
592 $this->form_gui->addItem($radio_size);
593
594 // standard caption
595 $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "st_derive_caption");
596 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
597 $def_cap = new ilNonEditableValueGUI("", "def_caption");
598 $op1->addSubItem($def_cap);
599 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
600 $rad_caption->addOption($op1);
601
602 $caption = new ilTextAreaInputGUI("", "st_caption");
603 $caption->setCols(30);
604 $caption->setRows(2);
605 $op2->addSubItem($caption);
606
607 /*$caption = new ilTextInputGUI("", "st_caption");
608 $caption->setSize(40);
609 $caption->setMaxLength(200);
610 $op2->addSubItem($caption);*/
611 $rad_caption->addOption($op2);
612 $this->form_gui->addItem($rad_caption);
613
614 // standard text representation
615 if (substr($std_item->getFormat(), 0, 5) == "image") {
616 $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "st_derive_text_representation");
617 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
618 $def_tr = new ilNonEditableValueGUI("", "def_text_representation");
619 $op1->addSubItem($def_tr);
620 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
621 $tr = new ilTextAreaInputGUI("", "st_text_representation");
622 $tr->setCols(30);
623 $tr->setRows(2);
624 $rad_tr->addOption($op1);
625 $op2->addSubItem($tr);
626 $rad_tr->addOption($op2);
627 $this->form_gui->addItem($rad_tr);
628 $rad_tr->setInfo($lng->txt("text_repr_info"));
629 }
630
631 // standard parameters
632 if (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) {
634 $std_item->getLocation(),
635 $std_item->getFormat()
636 )) { // autostart
637 $par = $std_item->getParameters();
638 $def_str = ($par["autostart"] == "true")
639 ? " (" . $lng->txt("yes") . ")"
640 : " (" . $lng->txt("no") . ")";
641 $rad_auto = new ilRadioGroupInputGUI(
642 $lng->txt("cont_autostart"),
643 "st_derive_parameters"
644 );
645 $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
646 $rad_auto->addOption($op1);
647 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
648 $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "st_autostart");
649 $op2->addSubItem($auto);
650 $rad_auto->addOption($op2);
651 $this->form_gui->addItem($rad_auto);
652 } else { // parameters
653 $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "st_derive_parameters");
654 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
655 $def_par = new ilNonEditableValueGUI("", "def_parameters");
656 $op1->addSubItem($def_par);
657 $rad_parameters->addOption($op1);
658 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
659 $par = new ilTextAreaInputGUI("", "st_parameters");
660 $par->setRows(5);
661 $par->setCols(50);
662 $op2->addSubItem($par);
663 $rad_parameters->addOption($op2);
664 $this->form_gui->addItem($rad_parameters);
665 }
666 }
667
668 // fullscreen view
669 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
670 $full_alias_item = new ilMediaAliasItem(
671 $this->dom,
672 $this->getHierId(),
673 "Fullscreen",
674 $this->content_obj->getPcId()
675 );
676 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
677
678 $fs_sec = new ilFormSectionHeaderGUI();
679 $fs_sec->setTitle($lng->txt("cont_fullscreen"));
680 $this->form_gui->addItem($fs_sec);
681
682
683 // resource
684 $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "fullscreen");
685 $op1 = new ilRadioOption($lng->txt("cont_none"), "n");
686 $radio_prop->addOption($op1);
687 $op2 = new ilRadioOption($this->lng->txt("cont_" . strtolower($full_item->getLocationType())) . ": " .
688 $full_item->getLocation(), "y");
689 $radio_prop->addOption($op2);
690 $this->form_gui->addItem($radio_prop);
691
692 // format
694 $this->lng->txt("cont_format"),
695 "full_format"
696 );
697 $this->form_gui->addItem($format);
698
699 // full size
700 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_derive_size");
701 $fw_size = $std_item->getOriginalSize();
702 $add_str = ($fw_size["width"] != "" && $fw_size["height"] != "")
703 ? " (" . $fw_size["width"] . " x " . $fw_size["height"] . ")"
704 : "";
705 $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
706 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
707 $radio_size->addOption($op1);
708
709 // width height
710 include_once("./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
711 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
712 " / " . $lng->txt("cont_height"), "full_width_height");
713 $width_height->setConstrainProportions(true);
714 $op2->addSubItem($width_height);
715
716 $radio_size->addOption($op2);
717 $this->form_gui->addItem($radio_size);
718
719 // fullscreen caption
720 $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "full_derive_caption");
721 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
722 $def_cap = new ilNonEditableValueGUI("", "full_def_caption");
723 $op1->addSubItem($def_cap);
724 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
725 $rad_caption->addOption($op1);
726
727 $caption = new ilTextAreaInputGUI("", "full_caption");
728 $caption->setCols(30);
729 $caption->setRows(2);
730 $op2->addSubItem($caption);
731
732 /*$caption = new ilTextInputGUI("", "full_caption");
733 $caption->setSize(40);
734 $caption->setMaxLength(200);
735 $op2->addSubItem($caption);*/
736 $rad_caption->addOption($op2);
737 $this->form_gui->addItem($rad_caption);
738
739 // fullscreen text representation
740 if (substr($full_item->getFormat(), 0, 5) == "image") {
741 $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "full_derive_text_representation");
742 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
743 $def_tr = new ilNonEditableValueGUI("", "full_def_text_representation");
744 $op1->addSubItem($def_tr);
745 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
746 $tr = new ilTextAreaInputGUI("", "full_text_representation");
747 $tr->setCols(30);
748 $tr->setRows(2);
749 $rad_tr->addOption($op1);
750 $op2->addSubItem($tr);
751 $rad_tr->addOption($op2);
752 $this->form_gui->addItem($rad_tr);
753 $rad_tr->setInfo($lng->txt("text_repr_info"));
754 }
755
756 // fullscreen parameters
757 if (!in_array($full_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) {
759 $full_item->getLocation(),
760 $full_item->getFormat()
761 )) { // autostart
762 $par = $full_item->getParameters();
763 $def_str = ($par["autostart"] == "true")
764 ? " (" . $lng->txt("yes") . ")"
765 : " (" . $lng->txt("no") . ")";
766 $rad_auto = new ilRadioGroupInputGUI(
767 $lng->txt("cont_autostart"),
768 "full_derive_parameters"
769 );
770 $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
771 $rad_auto->addOption($op1);
772 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
773 $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "full_autostart");
774 $op2->addSubItem($auto);
775 $rad_auto->addOption($op2);
776 $this->form_gui->addItem($rad_auto);
777 } else { // parameters
778 $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "full_derive_parameters");
779 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
780 $def_par = new ilNonEditableValueGUI("", "full_def_parameters");
781 $op1->addSubItem($def_par);
782 $rad_parameters->addOption($op1);
783 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
784 $par = new ilTextAreaInputGUI("", "full_parameters");
785 $par->setRows(5);
786 $par->setCols(50);
787 $op2->addSubItem($par);
788 $rad_parameters->addOption($op2);
789 $this->form_gui->addItem($rad_parameters);
790 }
791 }
792 }
793
794 $this->form_gui->setTitle($lng->txt("cont_edit_mob_alias_prop"));
795 $this->form_gui->addCommandButton("saveAliasProperties", $lng->txt("save"));
796 $lm_set = new ilSetting("lm");
797 if ($lm_set->get("replace_mob_feature")) {
798 $this->form_gui->addCommandButton("changeObjectReference", $lng->txt("cont_change_object_reference"));
799 }
800 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
801 }
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
This class represents a non editable value in a property form.
static _getSimpleMimeTypes()
Get simple mime types that deactivate parameter property files tab in ILIAS.
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, $ilCtrl, $lm_set, ilPageContentGUI\$lng, $title, ilObjMediaObject\_getSimpleMimeTypes(), ilObjMediaObject\_useAutoStartParameterOnly(), and ilPageContentGUI\getHierId().

Referenced by editAlias().

+ 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 
)

Insert new media object form.

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

173 {
174 $ilTabs = $this->tabs;
178
179 if ($_GET["subCmd"] == "insertNew") {
180 $_SESSION["cont_media_insert"] = "insertNew";
181 }
182 if ($_GET["subCmd"] == "insertFromPool") {
183 $_SESSION["cont_media_insert"] = "insertFromPool";
184 }
185
186 if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "") {
187 $_GET["subCmd"] = $_SESSION["cont_media_insert"];
188 }
189
190 switch ($_GET["subCmd"]) {
191 case "insertFromPool":
192 $this->insertFromPool();
193 break;
194
195 case "poolSelection":
196 $this->poolSelection();
197 break;
198
199 case "selectPool":
200 $this->selectPool();
201 break;
202
203 case "insertNew":
204 default:
205 $this->getTabs($ilTabs, true);
206 $ilTabs->setSubTabActive("cont_new_mob");
207
208 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
209 if ($a_input_error) {
211 } else {
212 $mob_gui = new ilObjMediaObjectGUI("");
213 $mob_gui->initForm("create");
214 $form = $mob_gui->getForm();
215 }
216 $form->setFormAction($ilCtrl->getFormAction($this, "create_mob"));
217 $form->clearCommandButtons();
218 $form->addCommandButton("create_mob", $lng->txt("save"));
219 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
220
221 $this->displayValidationError();
222
223 $tpl->setContent($form->getHTML());
224
225 break;
226 }
227 }

References $_GET, $_SESSION, $ctrl, $form, $ilCtrl, 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 312 of file class.ilPCMediaObjectGUI.php.

313 {
315 $ilAccess = $this->access;
316 $ilTabs = $this->tabs;
319 $ilToolbar = $this->toolbar;
320
321 if ($_SESSION["cont_media_pool"] != "" &&
322 $ilAccess->checkAccess("write", "", $_SESSION["cont_media_pool"])
323 && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_media_pool"])) == "mep") {
324 $html = "";
325 $tb = new ilToolbarGUI();
326
327 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
328 if ($a_change_obj_ref) {
329 $tb->addButton(
330 $lng->txt("cont_switch_to_media_pool"),
331 $ilCtrl->getLinkTarget($this, "changeObjectReference")
332 );
333 } else {
334 $tb->addButton(
335 $lng->txt("cont_switch_to_media_pool"),
336 $ilCtrl->getLinkTarget($this, "insert")
337 );
338 }
339 $ilCtrl->setParameter($this, "subCmd", "");
340
341 $html = $tb->getHTML();
342
343 $this->getTabs($ilTabs, true, $a_change_obj_ref);
344 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
345
346 include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
347 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
348 $pool = new ilObjMediaPool($_SESSION["cont_media_pool"]);
349 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
350 $tcmd = ($a_change_obj_ref)
351 ? "changeObjectReference"
352 : "insert";
353 $tmode = ($a_change_obj_ref)
356 $mpool_table = new ilMediaPoolTableGUI(
357 $this,
358 $tcmd,
359 $pool,
360 "mep_folder",
361 $tmode
362 );
363
364 $html.= $mpool_table->getHTML();
365
366 $tpl->setContent($html);
367 } else {
368 $this->poolSelection($a_change_obj_ref);
369 }
370 }
TableGUI class for recent changes in wiki.
Media pool object.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type

References $_SESSION, $access, $ctrl, $html, $ilCtrl, ilPageContentGUI\$lng, $tabs, $toolbar, ilPageContentGUI\$tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), 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 1107 of file class.ilPCMediaObjectGUI.php.

1108 {
1109 $std_alias_item = new ilMediaAliasItem(
1110 $this->dom,
1111 $this->getHierId(),
1112 "Standard",
1113 $this->content_obj->getPcId()
1114 );
1115 $std_alias_item->setHorizontalAlign("Left");
1116 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1117 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1118 }

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ leftFloatAlign()

ilPCMediaObjectGUI::leftFloatAlign ( )

align media object to left, floating text

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

1140 {
1141 $std_alias_item = new ilMediaAliasItem(
1142 $this->dom,
1143 $this->getHierId(),
1144 "Standard",
1145 $this->content_obj->getPcId()
1146 );
1147 $std_alias_item->setHorizontalAlign("LeftFloat");
1148 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1149 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1150 }

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ poolSelection()

ilPCMediaObjectGUI::poolSelection (   $a_change_obj_ref = false)

Pool Selection.

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

392 {
394 $ilTabs = $this->tabs;
396
397 $this->getTabs($ilTabs, true, $a_change_obj_ref);
398 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
399
400 include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
401
402 if ($a_change_obj_ref) {
403 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
404 $exp = new ilPoolSelectorGUI($this, "changeObjectReference", $this, "changeObjectReference");
405 } else {
406 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
407 $exp = new ilPoolSelectorGUI($this, "insert");
408 }
409
410 // filter
411 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
412 $exp->setClickableTypes(array('mep'));
413
414 if (!$exp->handleCommand()) {
415 $tpl->setContent($exp->getHTML());
416 }
417 }
Select media pool for adding objects into pages.

References $ctrl, $ilCtrl, $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 1123 of file class.ilPCMediaObjectGUI.php.

1124 {
1125 $std_alias_item = new ilMediaAliasItem(
1126 $this->dom,
1127 $this->getHierId(),
1128 "Standard",
1129 $this->content_obj->getPcId()
1130 );
1131 $std_alias_item->setHorizontalAlign("Right");
1132 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1133 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1134 }

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ rightFloatAlign()

ilPCMediaObjectGUI::rightFloatAlign ( )

align media object to right, floating text

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

1156 {
1157 $std_alias_item = new ilMediaAliasItem(
1158 $this->dom,
1159 $this->getHierId(),
1160 "Standard",
1161 $this->content_obj->getPcId()
1162 );
1163 $std_alias_item->setHorizontalAlign("RightFloat");
1164 $_SESSION["il_pg_error"] = $this->pg_obj->update();
1165 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1166 }

References $_SESSION, and ilPageContentGUI\getHierId().

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

957 {
958 $std_alias_item = new ilMediaAliasItem(
959 $this->dom,
960 $this->getHierId(),
961 "Standard",
962 $this->content_obj->getPcId()
963 );
964 $full_alias_item = new ilMediaAliasItem(
965 $this->dom,
966 $this->getHierId(),
967 "Fullscreen",
968 $this->content_obj->getPcId()
969 );
970 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
971 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
972
973 // standard size
974 if ($_POST["st_derive_size"] == "y") {
975 $std_alias_item->deriveSize();
976 } else {
977 $std_alias_item->setWidth(ilUtil::stripSlashes($_POST["st_width_height"]["width"]));
978 $std_alias_item->setHeight(ilUtil::stripSlashes($_POST["st_width_height"]["height"]));
979 }
980
981 // standard caption
982 if ($_POST["st_derive_caption"] == "y") {
983 $std_alias_item->deriveCaption();
984 } else {
985 $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["st_caption"]));
986 }
987
988 // text representation
989 if ($_POST["st_derive_text_representation"] == "y") {
990 $std_alias_item->deriveTextRepresentation();
991 } else {
992 $std_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["st_text_representation"]));
993 }
994
995 // standard parameters
996 if ($_POST["st_derive_parameters"] == "y") {
997 $std_alias_item->deriveParameters();
998 } else {
1000 $std_item->getLocation(),
1001 $std_item->getFormat()
1002 )) { // autostart
1003 if ($_POST["st_autostart"]) {
1004 $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
1005 } else {
1006 $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
1007 }
1008 } else { // parameters
1009 $std_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["st_parameters"]))));
1010 }
1011 }
1012
1013 if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1014 if ($_POST["fullscreen"] == "y") {
1015 if (!$full_alias_item->exists()) {
1016 $full_alias_item->insert();
1017 }
1018
1019 // fullscreen size
1020 if ($_POST["full_derive_size"] == "y") {
1021 $full_alias_item->deriveSize();
1022 } else {
1023 $full_alias_item->setWidth(ilUtil::stripSlashes($_POST["full_width_height"]["width"]));
1024 $full_alias_item->setHeight(ilUtil::stripSlashes($_POST["full_width_height"]["height"]));
1025 }
1026
1027 // fullscreen caption
1028 if ($_POST["full_derive_caption"] == "y") {
1029 $full_alias_item->deriveCaption();
1030 } else {
1031 $full_alias_item->setCaption(ilUtil::stripSlashes($_POST["full_caption"]));
1032 }
1033
1034 // fullscreen text representation
1035 if ($_POST["full_derive_text_representation"] == "y") {
1036 $full_alias_item->deriveTextRepresentation();
1037 } else {
1038 $full_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["full_text_representation"]));
1039 }
1040
1041 // fullscreen parameters
1042 if ($_POST["full_derive_parameters"] == "y") {
1043 $full_alias_item->deriveParameters();
1044 } else {
1046 $full_item->getLocation(),
1047 $full_item->getFormat()
1048 )) { // autostart
1049 if ($_POST["full_autostart"]) {
1050 $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
1051 } else {
1052 $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
1053 }
1054 } else {
1055 $full_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["full_parameters"]))));
1056 }
1057 }
1058 } else {
1059 if ($full_alias_item->exists()) {
1060 $full_alias_item->delete();
1061 }
1062 }
1063 }
1064
1065 $this->updated = $this->pg_obj->update();
1066 if ($this->updated === true) {
1067 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1068 $this->ctrl->redirect($this, "editAlias");
1069 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1070 } else {
1071 $this->pg_obj->addHierIDs();
1072 $this->editAlias();
1073 }
1074 }
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, ilObjMediaObject\_useAutoStartParameterOnly(), editAlias(), ilUtil\extractParameterString(), ilPageContentGUI\getHierId(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveStyle()

ilPCMediaObjectGUI::saveStyle ( )

Save Style.

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

1243 {
1244 $this->content_obj->setClass($_POST["characteristic"]);
1245 $this->updated = $this->pg_obj->update();
1246 if ($this->updated === true) {
1247 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1248 } else {
1249 $this->pg_obj->addHierIDs();
1250 $this->editStyle();
1251 }
1252 }

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

434 {
437 if (is_array($_POST["id"]) && count($_POST["id"]) == 1) {
438 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
439 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
441 $this->content_obj->readMediaObject($fid);
442 $this->content_obj->updateObjectReference();
443 $this->updated = $this->pg_obj->update();
444 } else {
445 ilUtil::sendInfo($lng->txt("cont_select_max_one_item"), true);
446 $ilCtrl->redirect($this, "changeObjectReference");
447 }
448 $ilCtrl->redirect($this, "editAlias");
449 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_POST, $ctrl, $ilCtrl, 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 375 of file class.ilPCMediaObjectGUI.php.

376 {
378
379 $_SESSION["cont_media_pool"] = $_GET["pool_ref_id"];
380 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
381 if ($a_change_obj_ref) {
382 $ilCtrl->redirect($this, "changeObjectReference");
383 } else {
384 $ilCtrl->redirect($this, "insert");
385 }
386 }

References $_GET, $_SESSION, $ctrl, and $ilCtrl.

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

87 {
88 $this->enabledmapareas = $a_enabledmapareas;
89 }

◆ setHeader()

ilPCMediaObjectGUI::setHeader (   $a_title = "")

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

72 {
73 $this->header = $a_title;
74 }

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

Referenced by getHeader().

◆ $tabs

ilPCMediaObjectGUI::$tabs
protected

◆ $toolbar

ilPCMediaObjectGUI::$toolbar
protected

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