ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCMediaObjectGUI Class Reference

Class ilPCMediaObjectGUI. More...

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

Public Member Functions

 ilPCMediaObjectGUI ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 
 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
 ilPageContentGUI ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor 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
 
 $ilias
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- 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$

ilPCMediaObjectGUI: ilObjMediaObjectGUI, ilPCImageMapEditorGUI

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

Member Function Documentation

◆ centerAlign()

ilPCMediaObjectGUI::centerAlign ( )

align media object to center

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

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

1103  {
1104  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
1105  $this->content_obj->getPcId());
1106  $std_alias_item->setHorizontalAlign("Center");
1107  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1108  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1109  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ changeObjectReference()

ilPCMediaObjectGUI::changeObjectReference ( )

Change object reference.

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

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

203  {
204  global $ilTabs, $ilCtrl, $lng;
205 
206  if ($_GET["subCmd"] == "insertNew")
207  {
208  $_SESSION["cont_media_insert"] = "insertNew";
209  }
210  if ($_GET["subCmd"] == "insertFromPool")
211  {
212  $_SESSION["cont_media_insert"] = "insertFromPool";
213  }
214 
215  if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "")
216  {
217  $_GET["subCmd"] = $_SESSION["cont_media_insert"];
218  }
219 
220  switch ($_GET["subCmd"])
221  {
222  case "insertFromPool":
223  $this->insertFromPool(true);
224  break;
225 
226  case "poolSelection":
227  $this->poolSelection(true);
228  break;
229 
230  case "selectPool":
231  $this->selectPool(true);
232  break;
233 
234  case "insertNew":
235  default:
236  $ilCtrl->setParameter($this, "subCmd", "changeObjectReference");
237  $this->getTabs($ilTabs, true, true);
238  $ilTabs->setSubTabActive("cont_new_mob");
239 
240  $this->displayValidationError();
241 
242  $mob_gui = new ilObjMediaObjectGUI("");
243  $mob_gui->initForm("create");
244  $form = $mob_gui->getForm();
245  $form->setFormAction($ilCtrl->getFormAction($this));
246  $form->clearCommandButtons();
247  $form->addCommandButton("createNewObjectReference", $lng->txt("save"));
248  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
249  $this->tpl->setContent($form->getHTML());
250  }
251  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
poolSelection($a_change_obj_ref=false)
Pool Selection.
$_GET["client_id"]
insertFromPool($a_change_obj_ref=false)
Insert media object from pool.
global $ilCtrl
Definition: ilias.php:18
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
add tabs to ilTabsGUI object
displayValidationError()
display validation errors
selectPool($a_change_obj_ref=false)
Select concrete pool.
Class ilObjMediaObjectGUI.
+ Here is the call graph for this function:

◆ checkStyleSelection()

ilPCMediaObjectGUI::checkStyleSelection ( )

Checks whether style selection shoudl be available or not.

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

References ilPageContentGUI\getCharacteristics().

Referenced by getTabs().

1163  {
1164  // check whether there is more than one style class
1165  $chars = $this->getCharacteristics();
1166 
1167  if (count($chars) > 1 ||
1168  ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media"))
1169  {
1170  return true;
1171  }
1172  return false;
1173  }
getCharacteristics()
Get characteristics.
+ 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 1091 of file class.ilPCMediaObjectGUI.php.

References ilUtil\sendSuccess().

1092  {
1093  $this->ilias->account->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType()
1094  , $this->content_obj->getMediaObject()->getTitle());
1095  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
1096  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1097  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ 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 422 of file class.ilPCMediaObjectGUI.php.

References $_GET, $_POST, ilPageContentGUI\$content_obj, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\getPage(), insert(), ilMediaPoolItem\lookupForeignId(), ilUtil\sendSuccess(), ilPageContentGUI\setHierId(), and ilObjMediaObjectGUI\setObjectPerCreationForm().

Referenced by createNewObjectReference().

423  {
424  global $ilCtrl, $lng;
425 
426  if ($_GET["subCmd"] == "insertFromPool")
427  {
428  if (is_array($_POST["id"]))
429  {
430  for($i = count($_POST["id"]) - 1; $i>=0; $i--)
431  {
432  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
433  $fid = ilMediaPoolItem::lookupForeignId($_POST["id"][$i]);
434  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
435  $this->content_obj = new ilPCMediaObject($this->getPage());
436  $this->content_obj->readMediaObject($fid);
437  $this->content_obj->createAlias($this->pg_obj, $_GET["hier_id"], $this->pc_id);
438  }
439  $this->updated = $this->pg_obj->update();
440  }
441 
442  $ilCtrl->returnToParent($this);
443  }
444 
445  // check form input
446  $mob_gui = new ilObjMediaObjectGUI("");
447  $mob_gui->initForm("create");
448 
449  if (!$mob_gui->checkFormInput())
450  {
451  $this->form = $mob_gui->getForm();
452  $this->insert("edpost", "create_mob", true);
453  return;
454  }
455  // create dummy object in db (we need an id)
456  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
457  if ($a_change_obj_ref != true)
458  {
459  $this->content_obj = new ilPCMediaObject($this->getPage());
460  }
461  $this->content_obj->createMediaObject();
462  $media_obj = $this->content_obj->getMediaObject();
463 
464  include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
466 
467  if ($a_create_alias)
468  {
469  // need a pcmediaobject here
470  //$this->node = $this->createPageContentNode();
471 
472  $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
473  $this->updated = $this->pg_obj->update();
474  if ($this->updated === true)
475  {
476  $this->pg_obj->stripHierIDs();
477  $this->pg_obj->addHierIDs();
478  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
479  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
480  $this->content_obj->setHierId($this->content_obj->readHierId());
481  $this->setHierId($this->content_obj->readHierId());
482  $this->content_obj->setPCId($this->content_obj->readPCId());
483  ilUtil::sendSuccess($lng->txt("saved_media_object"), true);
484  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
485 
486  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
487  }
488  else
489  {
490  $this->insert();
491  }
492  }
493  else
494  {
495  if ($a_change_obj_ref == true)
496  {
497  $this->content_obj->updateObjectReference();
498  $this->updated = $this->pg_obj->update();
499  $this->ctrl->redirect($this, "editAlias");
500  }
501  return $this->content_obj;
502  }
503  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static setObjectPerCreationForm($a_mob)
Set media object values from creation form.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
insert($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
Insert new media object form.
static lookupForeignId($a_id)
Lookup Foreign Id.
Class ilObjMediaObjectGUI.
Class ilPCMediaObject.
setHierId($a_hier_id)
get hierarchical id in dom object
+ 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 389 of file class.ilPCMediaObjectGUI.php.

References create().

390  {
391  $this->create(false, true);
392  }
& create($a_create_alias=true, $a_change_obj_ref=false)
create new media object in dom and update page in db
+ Here is the call graph for this function:

◆ editAlias()

ilPCMediaObjectGUI::editAlias ( )

edit properties form

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

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

Referenced by saveAliasProperties().

510  {
511  global $tpl;
512 
513  $this->initAliasForm();
514  $this->getAliasValues();
515  $tpl->setContent($this->form_gui->getHTML());
516  }
initAliasForm()
Init alias form.
getAliasValues()
Put alias values into form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editStyle()

ilPCMediaObjectGUI::editStyle ( )

Edit Style.

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

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

Referenced by saveStyle().

1179  {
1180  global $ilCtrl, $tpl, $lng;
1181 
1182  $this->displayValidationError();
1183 
1184  // edit form
1185  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1186  $form = new ilPropertyFormGUI();
1187  $form->setFormAction($ilCtrl->getFormAction($this));
1188  $form->setTitle($this->lng->txt("cont_edit_style"));
1189 
1190  // characteristic selection
1191  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
1192  $char_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"),
1193  "characteristic");
1194 
1195  $chars = $this->getCharacteristics();
1196  if (is_object($this->content_obj))
1197  {
1198  if ($chars[$a_seleted_value] == "" && ($this->content_obj->getClass() != ""))
1199  {
1200  $chars = array_merge(
1201  array($this->content_obj->getClass() => $this->content_obj->getClass()),
1202  $chars);
1203  }
1204  }
1205 
1206  $selected = $this->content_obj->getClass();
1207  if ($selected == "")
1208  {
1209  $selected = "MediaContainer";
1210  }
1211 
1212  foreach ($chars as $k => $char)
1213  {
1214  $html = '<table class="ilc_media_cont_'.$k.'"><tr><td>'.
1215  $char.'</td></tr></table>';
1216  $char_prop->addOption($k, $char, $html);
1217  }
1218 
1219  $char_prop->setValue($selected);
1220  $form->addItem($char_prop);
1221 
1222  // save button
1223  $form->addCommandButton("saveStyle", $lng->txt("save"));
1224 
1225  $html = $form->getHTML();
1226  $tpl->setContent($html);
1227  return $ret;
1228  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
displayValidationError()
display validation errors
getCharacteristics()
Get characteristics.
This class represents an advanced selection list property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilPCMediaObjectGUI::executeCommand ( )

execute command

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

References $cmd, ilPageContentGUI\$lng, $ret, ilPageContentGUI\$tpl, ilPageContentGUI\getCharacteristicsOfCurrentStyle(), getEnabledMapAreas(), ilUtil\getImagePath(), getTabs(), and ilObjMediaObjectGUI\setBackTitle().

73  {
74  global $tpl, $lng, $ilTabs;
75 
76  $this->getCharacteristicsOfCurrentStyle("media_cont"); // scorm-2004
77 
78  // get next class that processes or forwards current command
79  $next_class = $this->ctrl->getNextClass($this);
80 
81  // get current command
82  $cmd = $this->ctrl->getCmd();
83 
84  if (is_object ($this->content_obj))
85  {
86  $tpl->setTitleIcon(ilUtil::getImagePath("icon_mob_b.png"));
87  $this->getTabs($this->tabs_gui);
88 
89  $mob = $this->content_obj->getMediaObject();
90  if (is_object($mob))
91  {
92  $tpl->setVariable("HEADER", $lng->txt("mob").": ".
93  $this->content_obj->getMediaObject()->getTitle());
94  $mob_gui =& new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(),false, false);
95  $mob_gui->setBackTitle($this->page_back_title);
96  $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
97  $mob_gui->getTabs($this->tabs_gui);
98  }
99  }
100  else
101  {
102  }
103 
104  switch($next_class)
105  {
106  case "ilobjmediaobjectgui":
107  include_once ("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
108  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mob_b.png"));
109  $this->tpl->setTitle($this->lng->txt("mob").": ".
110  $this->content_obj->getMediaObject()->getTitle());
111  $mob_gui =& new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(),false, false);
112  $mob_gui->setBackTitle($this->page_back_title);
113  $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
114  $ret =& $this->ctrl->forwardCommand($mob_gui);
115  break;
116 
117  // instance image map editing
118  case "ilpcimagemapeditorgui":
119  require_once("./Services/COPage/classes/class.ilPCImageMapEditorGUI.php");
120  $ilTabs->setTabActive("cont_inst_map_areas");
121  $image_map_edit = new ilPCImageMapEditorGUI($this->content_obj,
122  $this->pg_obj);
123  $ret = $this->ctrl->forwardCommand($image_map_edit);
124  $tpl->setContent($ret);
125  break;
126 
127  default:
128  $ret =& $this->$cmd();
129  break;
130  }
131 
132  return $ret;
133  }
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
$cmd
Definition: sahs_server.php:35
setBackTitle($a_title)
set title for back tab
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
add tabs to ilTabsGUI object
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
User interface class for page content map editor.
Class ilObjMediaObjectGUI.
getEnabledMapAreas()
Get Enable map areas.
+ Here is the call graph for this function:

◆ getAliasValues()

ilPCMediaObjectGUI::getAliasValues ( )

Put alias values into form.

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

References ilPageContentGUI\$lng, ilObjMediaObject\_useAutoStartParameterOnly(), ilMediaAliasItem\getCaption(), ilMediaAliasItem\getHeight(), ilPageContentGUI\getHierId(), ilMediaAliasItem\getParameterString(), ilMediaAliasItem\getTextRepresentation(), and ilMediaAliasItem\getWidth().

Referenced by editAlias().

769  {
770  global $lng;
771 
772  // standard view resource
773  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
774  $this->content_obj->getPcId());
775  $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
776 
777  $values["title"] = $this->content_obj->getMediaObject()->getTitle();
778  $values["st_location"] = $std_item->getLocation();
779  $values["st_format"] = $std_item->getFormat();
780 
781  // size
782  $values["st_width_height"]["width"] = $std_alias_item->getWidth();
783  $values["st_width_height"]["height"] = $std_alias_item->getHeight();
784  $values["st_width_height"]["constr_prop"] = true;
785 
786  // caption
787  $values["st_caption"] = $std_alias_item->getCaption();
788  if (trim($std_item->getCaption()) == "")
789  {
790  $values["def_caption"] = "<i>".$lng->txt("cont_no_caption")."</i>";
791  }
792  else
793  {
794  $values["def_caption"] = $std_item->getCaption();
795  }
796 
797  // text representation
798  $values["st_text_representation"] = $std_alias_item->getTextRepresentation();
799  if (trim($std_item->getTextRepresentation()) == "")
800  {
801  $values["def_text_representation"] = "<i>".$lng->txt("cont_no_text")."</i>";
802  }
803  else
804  {
805  $values["def_text_representation"] = $std_item->getTextRepresentation();
806  }
807 
808  // parameters / autostart
809  if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(),
810  $std_item->getFormat())) // autostart
811  {
812  $par = $std_alias_item->getParameters();
813  if ($par["autostart"] == "true")
814  {
815  $values["st_autostart"] = true;
816  }
817  }
818  else // parameters
819  {
820  $values["st_parameters"] = $std_alias_item->getParameterString();
821  }
822 
823  // size
824  $values["st_derive_size"] = $std_alias_item->definesSize()
825  ? "n"
826  : "y";
827  if ($values["st_derive_size"] == "y")
828  {
829  $values["st_width_height"]["width"] = $std_item->getWidth();
830  $values["st_width_height"]["height"] = $std_item->getHeight();
831  }
832  $values["st_derive_caption"] = $std_alias_item->definesCaption()
833  ? "n"
834  : "y";
835  $values["st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
836  ? "n"
837  : "y";
838  $values["st_derive_parameters"] = $std_alias_item->definesParameters()
839  ? "n"
840  : "y";
841  if (trim($std_item->getParameterString()) == "")
842  {
843  $values["def_parameters"] = "<i>".$lng->txt("cont_no_parameters")."</i>";
844  }
845  else
846  {
847  $values["def_parameters"] = $std_item->getParameterString();
848  }
849 
850  // fullscreen properties
851  if($this->content_obj->getMediaObject()->hasFullScreenItem())
852  {
853  $full_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen",
854  $this->content_obj->getPcId());
855  $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
856 
857  $values["fullscreen"] = "n";
858  if ($full_alias_item->exists())
859  {
860  $values["fullscreen"] = "y";
861  }
862 
863  $values["full_location"] = $full_item->getLocation();
864  $values["full_format"] = $full_item->getFormat();
865  $values["full_width_height"]["width"] = $full_alias_item->getWidth();
866  $values["full_width_height"]["height"] = $full_alias_item->getHeight();
867  $values["full_width_height"]["constr_prop"] = true;
868  $values["full_caption"] = $full_alias_item->getCaption();
869  if (trim($full_item->getCaption()) == "")
870  {
871  $values["full_def_caption"] = "<i>".$lng->txt("cont_no_caption")."</i>";
872  }
873  else
874  {
875  $values["full_def_caption"] = $full_item->getCaption();
876  }
877  $values["full_text_representation"] = $full_alias_item->getTextRepresentation();
878  if (trim($full_item->getTextRepresentation()) == "")
879  {
880  $values["full_def_text_representation"] = "<i>".$lng->txt("cont_no_text")."</i>";
881  }
882  else
883  {
884  $values["full_def_text_representation"] = $full_item->getTextRepresentation();
885  }
886  $values["full_parameters"] = $full_alias_item->getParameterString();
887  $values["full_derive_size"] = $full_alias_item->definesSize()
888  ? "n"
889  : "y";
890  if ($values["full_derive_size"] == "y")
891  {
892  $values["full_width_height"]["width"] = $full_item->getWidth();
893  $values["full_width_height"]["height"] = $full_item->getHeight();
894  }
895  $values["full_derive_caption"] = $full_alias_item->definesCaption()
896  ? "n"
897  : "y";
898  $values["full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
899  ? "n"
900  : "y";
901 
902  // parameters
903  if (ilObjMediaObject::_useAutoStartParameterOnly($full_item->getLocation(),
904  $full_item->getFormat())) // autostart
905  {
906  $par = $full_alias_item->getParameters();
907  if ($par["autostart"] == "true")
908  {
909  $values["full_autostart"] = true;
910  }
911  }
912  else // parameters
913  {
914  $values["full_parameters"] = $full_alias_item->getParameterString();
915  }
916 
917  $values["full_derive_parameters"] = $full_alias_item->definesParameters()
918  ? "n"
919  : "y";
920  if (trim($full_item->getParameterString()) == "")
921  {
922  $values["full_def_parameters"] = "<i>".$lng->txt("cont_no_parameters")."</i>";
923  }
924  else
925  {
926  $values["full_def_parameters"] = $full_item->getParameterString();
927  }
928 
929  }
930 
931  $this->form_gui->setValuesByArray($values);
932  }
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
getTextRepresentation()
Get TextRepresentation.
getParameterString()
Get all parameters as string.
static _useAutoStartParameterOnly($a_loc, $a_format)
Check whether only autostart parameter should be supported (instead of parameters input field...
+ 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 64 of file class.ilPCMediaObjectGUI.php.

Referenced by executeCommand(), and getTabs().

65  {
66  return $this->enabledmapareas;
67  }
+ Here is the caller graph for this function:

◆ getHeader()

ilPCMediaObjectGUI::getHeader ( )

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

References $header.

45  {
46  return $this->header;
47  }

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

References $cmd, $ilCtrl, checkStyleSelection(), and getEnabledMapAreas().

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

1255  {
1256  global $ilCtrl, $ilTabs;
1257 
1258  if (!$a_create)
1259  {
1260  if ($this->checkStyleSelection())
1261  {
1262  $ilTabs->addTarget("cont_style",
1263  $ilCtrl->getLinkTarget($this, "editStyle"), "editStyle",
1264  get_class($this));
1265  }
1266 
1267  $ilTabs->addTarget("cont_mob_inst_prop",
1268  $ilCtrl->getLinkTarget($this, "editAlias"), "editAlias",
1269  get_class($this));
1270 
1271  if ($this->getEnabledMapAreas())
1272  {
1273  $st_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1274  if (is_object($st_item))
1275  {
1276  $format = $st_item->getFormat();
1277  if (substr($format, 0, 5) == "image")
1278  {
1279  $ilTabs->addTarget("cont_inst_map_areas",
1280  $ilCtrl->getLinkTargetByClass("ilpcimagemapeditorgui", "editMapAreas"), array(),
1281  "ilpcimagemapeditorgui");
1282  }
1283  }
1284  }
1285  }
1286  else
1287  {
1288  if ($a_change_obj_ref)
1289  {
1290  $cmd = "changeObjectReference";
1291  }
1292  else
1293  {
1294  $cmd = "insert";
1295  }
1296 
1297  $ilCtrl->setParameter($this, "subCmd", "insertNew");
1298  $ilTabs->addSubTabTarget("cont_new_mob",
1299  $ilCtrl->getLinkTarget($this, $cmd), $cmd);
1300 
1301  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
1302  $ilTabs->addSubTabTarget("cont_mob_from_media_pool",
1303  $ilCtrl->getLinkTarget($this, $cmd), $cmd);
1304  $ilCtrl->setParameter($this, "subCmd", "");
1305  }
1306  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
checkStyleSelection()
Checks whether style selection shoudl be available or not.
getEnabledMapAreas()
Get Enable map areas.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilPCMediaObjectGUI()

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

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

References $ilCtrl, and ilPageContentGUI\setCharacteristics().

27  {
28  global $ilCtrl;
29 
30  $this->ctrl =& $ilCtrl;
31 
32 //echo "constructor target:".$_SESSION["il_map_il_target"].":<br>";
33  parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
34 
35  $this->setCharacteristics(array("Media" => $this->lng->txt("cont_Media")));
36 
37  }
global $ilCtrl
Definition: ilias.php:18
setCharacteristics($a_chars)
Set Characteristics.
+ Here is the call graph for this function:

◆ initAliasForm()

ilPCMediaObjectGUI::initAliasForm ( )

Init alias form.

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

References $ilCtrl, $lm_set, ilPageContentGUI\$lng, ilObjMediaObject\_getSimpleMimeTypes(), ilObjMediaObject\_useAutoStartParameterOnly(), ilSubEnabledFormPropertyGUI\addSubItem(), ilRadioOption\addSubItem(), ilMediaAliasItem\getHeight(), ilPageContentGUI\getHierId(), ilMediaAliasItem\getParameters(), and ilWidthHeightInputGUI\setConstrainProportions().

Referenced by editAlias().

522  {
523  global $lng, $ilCtrl;
524 
525  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
526 
527  $this->form_gui = new ilPropertyFormGUI();
528 
529  // standard view resource
530  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
531  $this->content_obj->getPcId());
532  $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
533 
534  // title, location and format
535  $title = new ilNonEditableValueGUI($lng->txt("title"), "title");
536  $this->form_gui->addItem($title);
537  $loc = new ilNonEditableValueGUI(
538  $this->lng->txt("cont_".strtolower($std_item->getLocationType())), "st_location");
539  $this->form_gui->addItem($loc);
540  $format = new ilNonEditableValueGUI(
541  $this->lng->txt("cont_format"), "st_format");
542  $this->form_gui->addItem($format);
543 
544  // standard size
545  $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "st_derive_size");
546  $op1 = new ilRadioOption($lng->txt("cont_default").
547  " (".$std_item->getWidth()." x ".$std_item->getHeight().")", "y");
548  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
549  $radio_size->addOption($op1);
550 
551  // width height
552  include_once("./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
553  $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width").
554  " / ".$lng->txt("cont_height"), "st_width_height");
555  $width_height->setConstrainProportions(true);
556  $op2->addSubItem($width_height);
557 
558  $radio_size->addOption($op2);
559  $this->form_gui->addItem($radio_size);
560 
561  // standard caption
562  $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "st_derive_caption");
563  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
564  $def_cap = new ilNonEditableValueGUI("", "def_caption");
565  $op1->addSubItem($def_cap);
566  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
567  $rad_caption->addOption($op1);
568 
569  $caption = new ilTextAreaInputGUI("", "st_caption");
570  $caption->setCols(30);
571  $caption->setRows(2);
572  $op2->addSubItem($caption);
573 
574  /*$caption = new ilTextInputGUI("", "st_caption");
575  $caption->setSize(40);
576  $caption->setMaxLength(200);
577  $op2->addSubItem($caption);*/
578  $rad_caption->addOption($op2);
579  $this->form_gui->addItem($rad_caption);
580 
581  // standard text representation
582  if (substr($std_item->getFormat(), 0, 5) == "image")
583  {
584  $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "st_derive_text_representation");
585  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
586  $def_tr = new ilNonEditableValueGUI("", "def_text_representation");
587  $op1->addSubItem($def_tr);
588  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
589  $tr = new ilTextAreaInputGUI("", "st_text_representation");
590  $tr->setCols(30);
591  $tr->setRows(2);
592  $rad_tr->addOption($op1);
593  $op2->addSubItem($tr);
594  $rad_tr->addOption($op2);
595  $this->form_gui->addItem($rad_tr);
596  $rad_tr->setInfo($lng->txt("text_repr_info"));
597  }
598 
599  // standard parameters
600  if (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes()))
601  {
602  if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(),
603  $std_item->getFormat())) // autostart
604  {
605  $par = $std_item->getParameters();
606  $def_str = ($par["autostart"] == "true")
607  ? " (".$lng->txt("yes").")"
608  : " (".$lng->txt("no").")";
609  $rad_auto = new ilRadioGroupInputGUI($lng->txt("cont_autostart"),
610  "st_derive_parameters");
611  $op1 = new ilRadioOption($lng->txt("cont_default").$def_str, "y");
612  $rad_auto->addOption($op1);
613  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
614  $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "st_autostart");
615  $op2->addSubItem($auto);
616  $rad_auto->addOption($op2);
617  $this->form_gui->addItem($rad_auto);
618  }
619  else // parameters
620  {
621  $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "st_derive_parameters");
622  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
623  $def_par = new ilNonEditableValueGUI("", "def_parameters");
624  $op1->addSubItem($def_par);
625  $rad_parameters->addOption($op1);
626  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
627  $par = new ilTextAreaInputGUI("", "st_parameters");
628  $par->setRows(5);
629  $par->setCols(50);
630  $op2->addSubItem($par);
631  $rad_parameters->addOption($op2);
632  $this->form_gui->addItem($rad_parameters);
633  }
634  }
635 
636  // fullscreen view
637  if($this->content_obj->getMediaObject()->hasFullScreenItem())
638  {
639  $full_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen",
640  $this->content_obj->getPcId());
641  $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
642 
643  $fs_sec = new ilFormSectionHeaderGUI();
644  $fs_sec->setTitle($lng->txt("cont_fullscreen"));
645  $this->form_gui->addItem($fs_sec);
646 
647 
648  // resource
649  $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "fullscreen");
650  $op1 = new ilRadioOption($lng->txt("cont_none"), "n");
651  $radio_prop->addOption($op1);
652  $op2 = new ilRadioOption($this->lng->txt("cont_".strtolower($full_item->getLocationType())).": ".
653  $full_item->getLocation(), "y");
654  $radio_prop->addOption($op2);
655  $this->form_gui->addItem($radio_prop);
656 
657  // format
658  $format = new ilNonEditableValueGUI(
659  $this->lng->txt("cont_format"), "full_format");
660  $this->form_gui->addItem($format);
661 
662  // full size
663  $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_derive_size");
664  $op1 = new ilRadioOption($lng->txt("cont_default").
665  " (".$full_item->getWidth()." x ".$full_item->getHeight().")", "y");
666  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
667  $radio_size->addOption($op1);
668 
669  // width height
670  include_once("./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
671  $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width").
672  " / ".$lng->txt("cont_height"), "full_width_height");
673  $width_height->setConstrainProportions(true);
674  $op2->addSubItem($width_height);
675 
676  $radio_size->addOption($op2);
677  $this->form_gui->addItem($radio_size);
678 
679  // fullscreen caption
680  $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "full_derive_caption");
681  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
682  $def_cap = new ilNonEditableValueGUI("", "full_def_caption");
683  $op1->addSubItem($def_cap);
684  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
685  $rad_caption->addOption($op1);
686 
687  $caption = new ilTextAreaInputGUI("", "full_caption");
688  $caption->setCols(30);
689  $caption->setRows(2);
690  $op2->addSubItem($caption);
691 
692  /*$caption = new ilTextInputGUI("", "full_caption");
693  $caption->setSize(40);
694  $caption->setMaxLength(200);
695  $op2->addSubItem($caption);*/
696  $rad_caption->addOption($op2);
697  $this->form_gui->addItem($rad_caption);
698 
699  // fullscreen text representation
700  if (substr($full_item->getFormat(), 0, 5) == "image")
701  {
702  $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "full_derive_text_representation");
703  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
704  $def_tr = new ilNonEditableValueGUI("", "full_def_text_representation");
705  $op1->addSubItem($def_tr);
706  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
707  $tr = new ilTextAreaInputGUI("", "full_text_representation");
708  $tr->setCols(30);
709  $tr->setRows(2);
710  $rad_tr->addOption($op1);
711  $op2->addSubItem($tr);
712  $rad_tr->addOption($op2);
713  $this->form_gui->addItem($rad_tr);
714  $rad_tr->setInfo($lng->txt("text_repr_info"));
715  }
716 
717  // fullscreen parameters
718  if (!in_array($full_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes()))
719  {
720  if (ilObjMediaObject::_useAutoStartParameterOnly($full_item->getLocation(),
721  $full_item->getFormat())) // autostart
722  {
723  $par = $full_item->getParameters();
724  $def_str = ($par["autostart"] == "true")
725  ? " (".$lng->txt("yes").")"
726  : " (".$lng->txt("no").")";
727  $rad_auto = new ilRadioGroupInputGUI($lng->txt("cont_autostart"),
728  "full_derive_parameters");
729  $op1 = new ilRadioOption($lng->txt("cont_default").$def_str, "y");
730  $rad_auto->addOption($op1);
731  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
732  $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "full_autostart");
733  $op2->addSubItem($auto);
734  $rad_auto->addOption($op2);
735  $this->form_gui->addItem($rad_auto);
736  }
737  else // parameters
738  {
739  $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "full_derive_parameters");
740  $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
741  $def_par = new ilNonEditableValueGUI("", "full_def_parameters");
742  $op1->addSubItem($def_par);
743  $rad_parameters->addOption($op1);
744  $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
745  $par = new ilTextAreaInputGUI("", "full_parameters");
746  $par->setRows(5);
747  $par->setCols(50);
748  $op2->addSubItem($par);
749  $rad_parameters->addOption($op2);
750  $this->form_gui->addItem($rad_parameters);
751  }
752  }
753  }
754 
755  $this->form_gui->setTitle($lng->txt("cont_edit_mob_alias_prop"));
756  $this->form_gui->addCommandButton("saveAliasProperties", $lng->txt("save"));
757  $lm_set = new ilSetting("lm");
758  if ($lm_set->get("replace_mob_feature"))
759  {
760  $this->form_gui->addCommandButton("changeObjectReference", $lng->txt("cont_change_object_reference"));
761  }
762  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
763  }
This class represents an option in a radio group.
ILIAS Setting Class.
This class represents a property form user interface.
This class represents a section header in a property form.
getHierId()
get hierarchical id in dom object
This class represents a checkbox property in a property form.
Class ilMediaAliasItem.
setConstrainProportions($a_constrainproportions)
Set Constrain Proportions.
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
getParameters()
Get all parameters as array.
This class represents a width/height item in a property form.
$lm_set
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
static _useAutoStartParameterOnly($a_loc, $a_format)
Check whether only autostart parameter should be supported (instead of parameters input field...
static _getSimpleMimeTypes()
Get simple mime types that deactivate parameter property files tab in ILIAS.
+ 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 138 of file class.ilPCMediaObjectGUI.php.

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

Referenced by create().

139  {
140  global $ilTabs, $tpl, $ilCtrl, $lng;
141 
142  if ($_GET["subCmd"] == "insertNew")
143  {
144  $_SESSION["cont_media_insert"] = "insertNew";
145  }
146  if ($_GET["subCmd"] == "insertFromPool")
147  {
148  $_SESSION["cont_media_insert"] = "insertFromPool";
149  }
150 
151  if (($_GET["subCmd"] == "") && $_SESSION["cont_media_insert"] != "")
152  {
153  $_GET["subCmd"] = $_SESSION["cont_media_insert"];
154  }
155 
156  switch ($_GET["subCmd"])
157  {
158  case "insertFromPool":
159  $this->insertFromPool();
160  break;
161 
162  case "poolSelection":
163  $this->poolSelection();
164  break;
165 
166  case "selectPool":
167  $this->selectPool();
168  break;
169 
170  case "insertNew":
171  default:
172  $this->getTabs($ilTabs, true);
173  $ilTabs->setSubTabActive("cont_new_mob");
174 
175  include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
176  if ($a_input_error)
177  {
178  $form = $this->form;
179  }
180  else
181  {
182  $mob_gui = new ilObjMediaObjectGUI("");
183  $mob_gui->initForm("create");
184  $form = $mob_gui->getForm();
185  }
186  $form->setFormAction($ilCtrl->getFormAction($this, "create_mob"));
187  $form->clearCommandButtons();
188  $form->addCommandButton("create_mob", $lng->txt("save"));
189  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
190 
191  $this->displayValidationError();
192 
193  $tpl->setContent($form->getHTML());
194 
195  break;
196  }
197  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
poolSelection($a_change_obj_ref=false)
Pool Selection.
$_GET["client_id"]
insertFromPool($a_change_obj_ref=false)
Insert media object from pool.
global $ilCtrl
Definition: ilias.php:18
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
add tabs to ilTabsGUI object
displayValidationError()
display validation errors
selectPool($a_change_obj_ref=false)
Select concrete pool.
Class ilObjMediaObjectGUI.
+ 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 256 of file class.ilPCMediaObjectGUI.php.

References $_SESSION, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), getTabs(), ilMediaPoolTableGUI\IL_MEP_SELECT, ilMediaPoolTableGUI\IL_MEP_SELECT_SINGLE, and poolSelection().

Referenced by changeObjectReference(), and insert().

257  {
258  global $ilCtrl, $ilAccess, $ilTabs, $tpl, $lng, $ilToolbar;
259 
260 
261  if ($_SESSION["cont_media_pool"] != "" &&
262  $ilAccess->checkAccess("write", "", $_SESSION["cont_media_pool"])
263  && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_media_pool"])) == "mep")
264  {
265  $tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
266  $tpl->setCurrentBlock("btn_cell");
267  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
268  if ($a_change_obj_ref)
269  {
270  $tpl->setVariable("BTN_LINK",
271  $ilCtrl->getLinkTarget($this, "changeObjectReference"));
272  }
273  else
274  {
275  $tpl->setVariable("BTN_LINK",
276  $ilCtrl->getLinkTarget($this, "insert"));
277  }
278  $ilCtrl->setParameter($this, "subCmd", "");
279  $tpl->setVariable("BTN_TXT", $lng->txt("cont_switch_to_media_pool"));
280  $tpl->parseCurrentBlock();
281 
282  $this->getTabs($ilTabs, true, $a_change_obj_ref);
283  $ilTabs->setSubTabActive("cont_mob_from_media_pool");
284 
285  include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
286  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
287  $pool = new ilObjMediaPool($_SESSION["cont_media_pool"]);
288  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
289  $tcmd = ($a_change_obj_ref)
290  ? "changeObjectReference"
291  : "insert";
292  $tmode = ($a_change_obj_ref)
295  $mpool_table = new ilMediaPoolTableGUI($this, $tcmd, $pool, "mep_folder",
296  $tmode);
297 
298  $tpl->setContent($mpool_table->getHTML());
299  }
300  else
301  {
302  $this->poolSelection($a_change_obj_ref);
303  }
304  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
poolSelection($a_change_obj_ref=false)
Pool Selection.
global $ilCtrl
Definition: ilias.php:18
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
add tabs to ilTabsGUI object
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Media pool object.
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leftAlign()

ilPCMediaObjectGUI::leftAlign ( )

align media object to left

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

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

1115  {
1116  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
1117  $this->content_obj->getPcId());
1118  $std_alias_item->setHorizontalAlign("Left");
1119  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1120  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1121  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ leftFloatAlign()

ilPCMediaObjectGUI::leftFloatAlign ( )

align media object to left, floating text

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

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

1139  {
1140  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
1141  $this->content_obj->getPcId());
1142  $std_alias_item->setHorizontalAlign("LeftFloat");
1143  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1144  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1145  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ poolSelection()

ilPCMediaObjectGUI::poolSelection (   $a_change_obj_ref = false)

Pool Selection.

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

References $_GET, $ilCtrl, ilPageContentGUI\$tpl, getTabs(), and IL_FM_POSITIVE.

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

329  {
330  global $ilCtrl, $tree, $tpl, $ilTabs;
331 
332  $this->getTabs($ilTabs, true, $a_change_obj_ref);
333  $ilTabs->setSubTabActive("cont_mob_from_media_pool");
334 
335  include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
336 
337  if ($a_change_obj_ref)
338  {
339  $exp = new ilPoolSelectorGUI($this->ctrl->getLinkTarget($this, "changeObjectReference"));
340  }
341  else
342  {
343  $exp = new ilPoolSelectorGUI($this->ctrl->getLinkTarget($this, "insert"));
344  }
345  if ($_GET["expand"] == "")
346  {
347  $expanded = $tree->readRootId();
348  }
349  else
350  {
351  $expanded = $_GET["expand"];
352  }
353  $exp->setExpand($expanded);
354 
355  $exp->setTargetGet("sel_id");
356  $this->ctrl->setParameter($this, "target_type", $a_type);
357  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
358  if ($a_change_obj_ref)
359  {
360  $exp->setParamsGet($this->ctrl->getParameterArray($this, "changeObjectReference"));
361  }
362  else
363  {
364  $exp->setParamsGet($this->ctrl->getParameterArray($this, "insert"));
365  }
366 
367  // filter
368  $exp->setFiltered(true);
369  $exp->setFilterMode(IL_FM_POSITIVE);
370  $exp->addFilter("root");
371  $exp->addFilter("cat");
372  $exp->addFilter("grp");
373  $exp->addFilter("fold");
374  $exp->addFilter("crs");
375  $exp->addFilter("mep");
376 
377  $sel_types = array('mep');
378 
379  $exp->setOutput(0);
380 
381  $tpl->setContent($exp->getOutput());
382  }
$_GET["client_id"]
const IL_FM_POSITIVE
global $ilCtrl
Definition: ilias.php:18
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
add tabs to ilTabsGUI object
Select media pool for adding objects into pages.
+ 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 1126 of file class.ilPCMediaObjectGUI.php.

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

1127  {
1128  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
1129  $this->content_obj->getPcId());
1130  $std_alias_item->setHorizontalAlign("Right");
1131  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1132  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1133  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ rightFloatAlign()

ilPCMediaObjectGUI::rightFloatAlign ( )

align media object to right, floating text

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

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

1151  {
1152  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
1153  $this->content_obj->getPcId());
1154  $std_alias_item->setHorizontalAlign("RightFloat");
1155  $_SESSION["il_pg_error"] = $this->pg_obj->update();
1156  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1157  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ 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 937 of file class.ilPCMediaObjectGUI.php.

References $_POST, ilObjMediaObject\_useAutoStartParameterOnly(), ilMediaAliasItem\delete(), ilMediaAliasItem\deriveCaption(), ilMediaAliasItem\deriveParameters(), ilMediaAliasItem\deriveSize(), ilMediaAliasItem\deriveTextRepresentation(), editAlias(), ilMediaAliasItem\exists(), ilUtil\extractParameterString(), ilPageContentGUI\getHierId(), ilMediaAliasItem\insert(), ilMediaAliasItem\setCaption(), ilMediaAliasItem\setHeight(), ilMediaAliasItem\setParameters(), ilMediaAliasItem\setTextRepresentation(), ilMediaAliasItem\setWidth(), and ilUtil\stripSlashes().

938  {
939  $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
940  $this->content_obj->getPcId());
941  $full_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen",
942  $this->content_obj->getPcId());
943  $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
944  $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
945 
946  // standard size
947  if($_POST["st_derive_size"] == "y")
948  {
949  $std_alias_item->deriveSize();
950  }
951  else
952  {
953  $std_alias_item->setWidth(ilUtil::stripSlashes($_POST["st_width_height"]["width"]));
954  $std_alias_item->setHeight(ilUtil::stripSlashes($_POST["st_width_height"]["height"]));
955  }
956 
957  // standard caption
958  if($_POST["st_derive_caption"] == "y")
959  {
960  $std_alias_item->deriveCaption();
961  }
962  else
963  {
964  $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["st_caption"]));
965  }
966 
967  // text representation
968  if($_POST["st_derive_text_representation"] == "y")
969  {
970  $std_alias_item->deriveTextRepresentation();
971  }
972  else
973  {
974  $std_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["st_text_representation"]));
975  }
976 
977  // standard parameters
978  if($_POST["st_derive_parameters"] == "y")
979  {
980  $std_alias_item->deriveParameters();
981  }
982  else
983  {
984  if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(),
985  $std_item->getFormat())) // autostart
986  {
987  if ($_POST["st_autostart"])
988  {
989  $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
990  }
991  else
992  {
993  $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
994  }
995  }
996  else // parameters
997  {
998  $std_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["st_parameters"]))));
999  }
1000  }
1001 
1002  if($this->content_obj->getMediaObject()->hasFullscreenItem())
1003  {
1004  if ($_POST["fullscreen"] == "y")
1005  {
1006  if (!$full_alias_item->exists())
1007  {
1008  $full_alias_item->insert();
1009  }
1010 
1011  // fullscreen size
1012  if($_POST["full_derive_size"] == "y")
1013  {
1014  $full_alias_item->deriveSize();
1015  }
1016  else
1017  {
1018  $full_alias_item->setWidth(ilUtil::stripSlashes($_POST["full_width_height"]["width"]));
1019  $full_alias_item->setHeight(ilUtil::stripSlashes($_POST["full_width_height"]["height"]));
1020  }
1021 
1022  // fullscreen caption
1023  if($_POST["full_derive_caption"] == "y")
1024  {
1025  $full_alias_item->deriveCaption();
1026  }
1027  else
1028  {
1029  $full_alias_item->setCaption(ilUtil::stripSlashes($_POST["full_caption"]));
1030  }
1031 
1032  // fullscreen text representation
1033  if($_POST["full_derive_text_representation"] == "y")
1034  {
1035  $full_alias_item->deriveTextRepresentation();
1036  }
1037  else
1038  {
1039  $full_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["full_text_representation"]));
1040  }
1041 
1042  // fullscreen parameters
1043  if($_POST["full_derive_parameters"] == "y")
1044  {
1045  $full_alias_item->deriveParameters();
1046  }
1047  else
1048  {
1049  if (ilObjMediaObject::_useAutoStartParameterOnly($full_item->getLocation(),
1050  $full_item->getFormat())) // autostart
1051  {
1052  if ($_POST["full_autostart"])
1053  {
1054  $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
1055  }
1056  else
1057  {
1058  $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
1059  }
1060  }
1061  else
1062  {
1063  $full_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["full_parameters"]))));
1064  }
1065  }
1066  }
1067  else
1068  {
1069  if ($full_alias_item->exists())
1070  {
1071  $full_alias_item->delete();
1072  }
1073  }
1074  }
1075 
1076  $this->updated = $this->pg_obj->update();
1077  if ($this->updated === true)
1078  {
1079  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1080  }
1081  else
1082  {
1083  $this->pg_obj->addHierIDs();
1084  $this->editAlias();
1085  }
1086  }
$_POST['username']
Definition: cron.php:12
setCaption($a_caption)
Set Caption.
insert()
inserts new node in dom
getHierId()
get hierarchical id in dom object
deriveSize()
derive size from object (-> width and height attributes are removed from layout element) ...
Class ilMediaAliasItem.
deriveCaption()
derive caption from object (-> caption element is removed from media alias item)
deriveTextRepresentation()
derive TextRepresentation from object (-> TextRepresentation element is removed from media alias item...
setHeight($a_height)
Set Height.
editAlias()
edit properties form
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
deriveParameters()
derive parameters from object (-> all parameter elements are removed from media alias item) ...
exists()
check if item node exists
static _useAutoStartParameterOnly($a_loc, $a_format)
Check whether only autostart parameter should be supported (instead of parameters input field...
delete()
delete full item node from dom
setWidth($a_width)
Set width.
static extractParameterString($a_parstr)
extracts parameter value pairs from a string into an array
setParameters($a_par_array)
set parameter
setTextRepresentation($a_text_representation)
Set TextRepresentation.
+ Here is the call graph for this function:

◆ saveStyle()

ilPCMediaObjectGUI::saveStyle ( )

Save Style.

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

References $_POST, and editStyle().

1234  {
1235  $this->content_obj->setClass($_POST["characteristic"]);
1236  $this->updated = $this->pg_obj->update();
1237  if ($this->updated === true)
1238  {
1239  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
1240  }
1241  else
1242  {
1243  $this->pg_obj->addHierIDs();
1244  $this->editStyle();
1245  }
1246  }
$_POST['username']
Definition: cron.php:12
+ 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 398 of file class.ilPCMediaObjectGUI.php.

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

399  {
400  global $ilCtrl, $lng;
401  if (is_array($_POST["id"]) && count($_POST["id"]) == 1)
402  {
403  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
404  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
405  $fid = ilMediaPoolItem::lookupForeignId($_POST["id"][0]);
406  $this->content_obj->readMediaObject($fid);
407  $this->content_obj->updateObjectReference();
408  $this->updated = $this->pg_obj->update();
409  }
410  else
411  {
412  ilUtil::sendInfo($lng->txt("cont_select_max_one_item"), true);
413  $ilCtrl->redirect($this, "changeObjectReference");
414 
415  }
416  $ilCtrl->redirect($this, "editAlias");
417  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static lookupForeignId($a_id)
Lookup Foreign Id.
+ Here is the call graph for this function:

◆ selectPool()

ilPCMediaObjectGUI::selectPool (   $a_change_obj_ref = false)

Select concrete pool.

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

References $_GET, $_SESSION, and $ilCtrl.

Referenced by changeObjectReference(), and insert().

310  {
311  global $ilCtrl;
312 
313  $_SESSION["cont_media_pool"] = $_GET["pool_ref_id"];
314  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
315  if ($a_change_obj_ref)
316  {
317  $ilCtrl->redirect($this, "changeObjectReference");
318  }
319  else
320  {
321  $ilCtrl->redirect($this, "insert");
322  }
323  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ 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 54 of file class.ilPCMediaObjectGUI.php.

55  {
56  $this->enabledmapareas = $a_enabledmapareas;
57  }

◆ setHeader()

ilPCMediaObjectGUI::setHeader (   $a_title = "")

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

40  {
41  $this->header = $a_title;
42  }

Field Documentation

◆ $ctrl

ilPCMediaObjectGUI::$ctrl

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

◆ $header

ilPCMediaObjectGUI::$header

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

Referenced by getHeader().


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