• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

content/classes/Pages/class.ilPCMediaObjectGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 require_once ("content/classes/Pages/class.ilPageContentGUI.php");
00025 //require_once ("content/classes/Pages/class.ilMediaObject.php");
00026 require_once ("content/classes/Pages/class.ilMediaAliasItem.php");
00027 require_once ("content/classes/Media/class.ilObjMediaObjectGUI.php");
00028 
00039 // Todo: extend ilObjMediaObjectGUI !?
00040 class ilPCMediaObjectGUI extends ilPageContentGUI
00041 {
00042         var $header;
00043         var $ctrl;
00044 
00045         function ilPCMediaObjectGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id = 0)
00046         {
00047                 global $ilCtrl;
00048 
00049                 $this->ctrl =& $ilCtrl;
00050 
00051 //echo "constructor target:".$_SESSION["il_map_il_target"].":<br>";
00052                 parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id);
00053         }
00054 
00055         function _forwards()
00056         {
00057                 return array();
00058         }
00059 
00060         function setHeader($a_title = "")
00061         {
00062                 $this->header = $a_title;
00063         }
00064 
00065         function getHeader()
00066         {
00067                 return $this->header;
00068         }
00069 
00070 
00074         function insert($a_post_cmd = "edpost", $a_submit_cmd = "create_mob")
00075         {
00076                 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mob_new.html", "content");
00077                 $this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_insert_mob"));
00078                 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
00079 
00080                 $this->displayValidationError();
00081 
00082                 // select fields for number of columns
00083                 $this->tpl->setVariable("TXT_STANDARD_VIEW", $this->lng->txt("cont_std_view"));
00084                 $this->tpl->setVariable("TXT_FILE", $this->lng->txt("cont_file"));
00085                 $this->tpl->setVariable("TXT_REFERENCE", $this->lng->txt("cont_reference"));
00086                 $this->tpl->setVariable("TXT_REF_HELPTEXT", $this->lng->txt("cont_ref_helptext"));
00087                 $this->tpl->setVariable("TXT_WIDTH", $this->lng->txt("cont_width"));
00088                 $this->tpl->setVariable("TXT_HEIGHT", $this->lng->txt("cont_height"));
00089                 $this->tpl->setVariable("TXT_ORIGINAL_SIZE", $this->lng->txt("cont_orig_size"));
00090                 $this->tpl->setVariable("TXT_CAPTION", $this->lng->txt("cont_caption"));
00091                 $this->tpl->setVariable("TXT_FULLSCREEN_VIEW", $this->lng->txt("cont_fullscreen"));
00092                 $this->tpl->setVariable("TXT_PARAMETER", $this->lng->txt("cont_parameter"));
00093                 $this->tpl->setVariable("TXT_RESIZE", $this->lng->txt("cont_resize_image"));
00094                 $this->tpl->setVariable("TXT_RESIZE_EXPLANATION", $this->lng->txt("cont_resize_explanation"));
00095                 $this->tpl->parseCurrentBlock();
00096 
00097                 // operations
00098                 $this->tpl->setCurrentBlock("commands");
00099                 $this->tpl->setVariable("BTN_NAME", $a_submit_cmd);
00100                 $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
00101                 $this->tpl->parseCurrentBlock();
00102 
00103         }
00104 
00108         function &create($a_create_alias = true)
00109         {
00110                 // determinte title and format
00111                 if ($_POST["standard_type"] == "File")
00112                 {
00113                         $title = $_FILES['standard_file']['name'];
00114                 }
00115                 else
00116                 {
00117                         $title = $_POST["standard_reference"];
00118                 }
00119 
00120                 // create dummy object in db (we need an id)
00121                 $this->content_obj = new ilObjMediaObject();
00122                 $dummy_meta =& new ilMetaData();
00123                 $dummy_meta->setObject($this->content_obj);
00124                 $this->content_obj->assignMetaData($dummy_meta);
00125                 $this->content_obj->setTitle($title);
00126                 $this->content_obj->setDescription("");
00127                 $this->content_obj->create();
00128 
00129                 // determine and create mob directory, move uploaded file to directory
00130                 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->content_obj->getId();
00131                 $this->content_obj->createDirectory();
00132                 $mob_dir = ilObjMediaObject::_getDirectory($this->content_obj->getId());
00133 
00134                 $media_item =& new ilMediaItem();
00135                 $this->content_obj->addMediaItem($media_item);
00136                 $media_item->setPurpose("Standard");
00137                 $meta =& $this->content_obj->getMetaData();
00138                 $meta_technical =& new ilMetaTechnical($meta);
00139 
00140                 if ($_POST["standard_type"] == "File")
00141                 {
00142                         $file = $mob_dir."/".$_FILES['standard_file']['name'];
00143                         //move_uploaded_file($_FILES['standard_file']['tmp_name'], $file);
00144                         if (!ilUtil::moveUploadedFile($_FILES['standard_file']['tmp_name'],
00145                                 $_FILES['standard_file']['name'], $file, false))
00146                         {
00147                                 $this->content_obj->delete();
00148                                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00149                                 return;
00150                         }
00151 
00152                         // get mime type
00153                         $format = ilObjMediaObject::getMimeType($file);
00154                         $location = $_FILES['standard_file']['name'];
00155 
00156                         // resize standard images
00157                         if ($_POST["standard_size"] != "original" &&
00158                                 $_POST["standard_resize"] == "y" &&
00159                                 is_int(strpos($format, "image")))
00160                         {
00161                                 $location = ilObjMediaObject::_resizeImage($file, $_POST["standard_width"],
00162                                         $_POST["standard_height"]);
00163                         }
00164 
00165                         // set real meta and object data
00166                         $media_item->setFormat($format);
00167                         $media_item->setLocation($location);
00168                         $media_item->setLocationType("LocalFile");
00169                         $meta_technical->addFormat($format);
00170                         $meta_technical->setSize($_FILES['standard_file']['size']);
00171                         $meta_technical->addLocation("LocalFile", $location);
00172                         $this->content_obj->setTitle($_FILES['standard_file']['name']);
00173                 }
00174                 else    // standard type: reference
00175                 {
00176                         $format = ilObjMediaObject::getMimeType($_POST["standard_reference"]);
00177                         $media_item->setFormat($format);
00178                         $media_item->setLocation($_POST["standard_reference"]);
00179                         $media_item->setLocationType("Reference");
00180                         $meta_technical->addFormat($format);
00181                         $meta_technical->setSize(0);
00182                         $meta_technical->addLocation("Reference", $_POST["standard_reference"]);
00183                         $this->content_obj->setTitle($_POST["standard_reference"]);
00184                 }
00185                 $meta->addTechnicalSection($meta_technical);
00186                 $this->content_obj->setDescription($format);
00187 
00188                 // determine width and height of known image types
00189                 if ($_POST["standard_size"] == "original")
00190                 {
00191                         if (ilUtil::deducibleSize($format))
00192                         {
00193                                 $size = getimagesize($file);
00194                                 $media_item->setWidth($size[0]);
00195                                 $media_item->setHeight($size[1]);
00196                         }
00197                 }
00198                 else
00199                 {
00200                         $media_item->setWidth($_POST["standard_width"]);
00201                         $media_item->setHeight($_POST["standard_height"]);
00202                 }
00203 
00204                 if ($_POST["standard_caption"] != "")
00205                 {
00206                         $media_item->setCaption($_POST["standard_caption"]);
00207                 }
00208 
00209                 if ($_POST["standard_param"] != "")
00210                 {
00211                         $media_item->setParameters(ilUtil::stripSlashes(utf8_decode($_POST["standard_param"])));
00212                 }
00213 
00214                 $media_item->setHAlign("Left");
00215 
00216                 // fullscreen view
00217                 if ($_POST["fullscreen"] == "y")
00218                 {
00219                         $media_item =& new ilMediaItem();
00220                         $this->content_obj->addMediaItem($media_item);
00221                         $media_item->setPurpose("Fullscreen");
00222 
00223                         // file
00224                         if ($_POST["full_type"] == "File")
00225                         {
00226                                 if ($_FILES['full_file']['name'] != "")
00227                                 {
00228                                         $file = $mob_dir."/".$_FILES['full_file']['name'];
00229                                         //move_uploaded_file($_FILES['full_file']['tmp_name'], $file);
00230                                         if (!ilUtil::moveUploadedFile($_FILES['full_file']['tmp_name'],
00231                                                 $_FILES['full_file']['name'], $file, false))
00232                                         {
00233                                                 $this->content_obj->delete();
00234                                                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00235                                                 return;
00236                                         }
00237                                 }
00238 
00239                                 if ($_FILES['full_file']['name'] != "" ||
00240                                                 ($_POST["full_size"] != "original" &&
00241                                                 $_POST["full_resize"] == "y" &&
00242                                                 is_int(strpos($format, "image")))
00243                                         )
00244                                 {
00245                                         // set real meta and object data
00246                                         $format = ilObjMediaObject::getMimeType($file);
00247                                         $location = $_FILES['full_file']['name'];
00248 
00249                                         // resize fullscreen images
00250                                         if ($_POST["full_size"] != "original" &&
00251                                                 $_POST["full_resize"] == "y" &&
00252                                                 is_int(strpos($format, "image")))
00253                                         {
00254                                                 $location = ilObjMediaObject::_resizeImage($file, $_POST["full_width"],
00255                                                         $_POST["full_height"]);
00256                                         }
00257                                 }
00258 
00259                                 $media_item->setFormat($format);
00260                                 $media_item->setLocation($location);
00261                                 $media_item->setLocationType("LocalFile");
00262                                 $meta_technical->addFormat($format);
00263                                 $meta_technical->setSize($meta_technical->getSize()
00264                                 + $_FILES['full_file']['size']);
00265                                 $meta_technical->addLocation("LocalFile", $location);
00266 
00267                         }
00268                         else    // reference
00269                         {
00270                                 if ($_POST["full_reference"] != "")
00271                                 {
00272                                         $format = ilObjMediaObject::getMimeType($_POST["full_reference"]);
00273                                         $media_item->setFormat($format);
00274                                         $media_item->setLocation($_POST["full_reference"]);
00275                                         $media_item->setLocationType("Reference");
00276                                         $meta_technical->addFormat($format);
00277                                         $meta_technical->addLocation("Reference", $_POST["full_reference"]);
00278                                 }
00279                         }
00280 
00281                         // determine width and height of known image types
00282                         if ($_POST["full_size"] == "original")
00283                         {
00284                                 if (ilUtil::deducibleSize($format))
00285                                 {
00286                                         $size = getimagesize($file);
00287                                         $media_item->setWidth($size[0]);
00288                                         $media_item->setHeight($size[1]);
00289                                 }
00290                         }
00291                         else
00292                         {
00293                                 $media_item->setWidth($_POST["full_width"]);
00294                                 $media_item->setHeight($_POST["full_height"]);
00295                         }
00296 
00297                         if ($_POST["full_caption"] != "")
00298                         {
00299                                 $media_item->setCaption($_POST["full_caption"]);
00300                         }
00301 
00302                         if ($_POST["full_param"] != "")
00303                         {
00304                                 $media_item->setParameters(ilUtil::stripSlashes(utf8_decode($_POST["full_param"])));
00305                         }
00306 
00307                 }
00308                 ilUtil::renameExecutables($mob_dir);
00309                 $this->content_obj->update();
00310 
00311                 if ($a_create_alias)
00312                 {
00313                         $this->content_obj->setDom($this->dom);
00314                         $this->content_obj->createAlias($this->pg_obj, $this->hier_id);
00315                         $this->updated = $this->pg_obj->update();
00316                         if ($this->updated === true)
00317                         {
00318                                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00319                         }
00320                         else
00321                         {
00322                                 $this->insert();
00323                         }
00324                 }
00325                 else
00326                 {
00327                         return $this->content_obj;
00328                 }
00329         }
00330 
00331 
00332 
00336         function editAlias()
00337         {
00338                 //add template for view button
00339                 $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
00340 
00341                 //$item_nr = $this->content_obj->getMediaItemNr("Standard");
00342                 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard");
00343                 $std_item =& $this->content_obj->getMediaItem("Standard");
00344 //echo htmlentities($this->dom->dump_node($std_alias_item->item_node));
00345                 // edit media alias template
00346                 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mob_alias_properties.html", "content");
00347                 $this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_edit_mob_alias_prop"));
00348                 $this->tpl->setVariable("TXT_STANDARD_VIEW", $this->lng->txt("cont_std_view"));
00349                 $this->tpl->setVariable("TXT_DERIVE", $this->lng->txt("cont_derive_from_obj"));
00350                 $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("cont_".$std_item->getLocationType()));
00351                 $this->tpl->setVariable("TXT_LOCATION", $std_item->getLocation());
00352                 $this->tpl->setVariable("TXT_FORMAT", $this->lng->txt("cont_format"));
00353                 $this->tpl->setVariable("VAL_FORMAT", $std_item->getFormat());
00354                 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
00355 
00356                 $this->displayValidationError();
00357 
00358                 // width
00359                 $this->tpl->setVariable("TXT_MOB_WIDTH", $this->lng->txt("cont_width"));
00360                 $this->tpl->setVariable("INPUT_MOB_WIDTH", "mob_width");
00361                 $this->tpl->setVariable("VAL_MOB_WIDTH", $std_alias_item->getWidth());
00362 
00363                 // height
00364                 $this->tpl->setVariable("TXT_MOB_HEIGHT", $this->lng->txt("cont_height"));
00365                 $this->tpl->setVariable("INPUT_MOB_HEIGHT", "mob_height");
00366                 $this->tpl->setVariable("VAL_MOB_HEIGHT", $std_alias_item->getHeight());
00367 
00368                 // caption
00369                 $this->tpl->setVariable("TXT_CAPTION", $this->lng->txt("cont_caption"));
00370                 $this->tpl->setVariable("INPUT_CAPTION", "mob_caption");
00371                 $this->tpl->setVariable("VAL_CAPTION", $std_alias_item->getCaption());
00372                 $this->tpl->parseCurrentBlock();
00373 
00374                 // parameters
00375                 $this->tpl->setVariable("TXT_PARAMETER", $this->lng->txt("cont_parameter"));
00376                 $this->tpl->setVariable("INPUT_PARAMETERS", "mob_parameters");
00377                 $this->tpl->setVariable("VAL_PARAMETERS", $std_alias_item->getParameterString());
00378                 $this->tpl->parseCurrentBlock();
00379 
00380                 // object default values
00381                 $this->tpl->setVariable("VAL_OBJ_ST_SIZE", $std_item->getWidth()." / ".$std_item->getHeight());
00382                 $this->tpl->setVariable("VAL_OBJ_ST_CAPTION", $std_item->getCaption());
00383                 $this->tpl->setVariable("VAL_OBJ_ST_PARAMETERS", $std_item->getParameterString());
00384                 if ($std_alias_item->definesSize())
00385                 {
00386                         $this->tpl->setVariable("DERIVE_ST_SIZE_N", "checked=\"1\"");
00387                 }
00388                 else
00389                 {
00390                         $this->tpl->setVariable("DERIVE_ST_SIZE_Y", "checked=\"1\"");
00391                 }
00392                 if ($std_alias_item->definesCaption())
00393                 {
00394                         $this->tpl->setVariable("DERIVE_ST_CAPTION_N", "checked=\"1\"");
00395                 }
00396                 else
00397                 {
00398                         $this->tpl->setVariable("DERIVE_ST_CAPTION_Y", "checked=\"1\"");
00399                 }
00400                 if ($std_alias_item->definesParameters())
00401                 {
00402                         $this->tpl->setVariable("DERIVE_ST_PARAMETER_N", "checked=\"1\"");
00403                 }
00404                 else
00405                 {
00406                         $this->tpl->setVariable("DERIVE_ST_PARAMETER_Y", "checked=\"1\"");
00407                 }
00408 
00409                 // fullscreen view
00410                 if($this->content_obj->hasFullScreenItem())
00411                 {
00412                         $this->tpl->setCurrentBlock("fullscreen");
00413                         $full_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen");
00414                         $full_item =& $this->content_obj->getMediaItem("Fullscreen");
00415 
00416                         $this->tpl->setVariable("TXT_FULLSCREEN_VIEW", $this->lng->txt("cont_fullscreen"));
00417                         $this->tpl->setVariable("TXT_FULL_TYPE", $this->lng->txt("cont_".$full_item->getLocationType()));
00418                         $this->tpl->setVariable("TXT_FULL_LOCATION", $full_item->getLocation());
00419 
00420                         $this->tpl->setVariable("TXT_FULL_FORMAT", $this->lng->txt("cont_format"));
00421                         $this->tpl->setVariable("VAL_FULL_FORMAT", $full_item->getFormat());
00422 
00423                         // width text
00424                         $this->tpl->setVariable("TXT_FULL_WIDTH", $this->lng->txt("cont_width"));
00425                         $this->tpl->setVariable("INPUT_FULL_WIDTH", "full_width");
00426 
00427                         // height text
00428                         $this->tpl->setVariable("TXT_FULL_HEIGHT", $this->lng->txt("cont_height"));
00429                         $this->tpl->setVariable("INPUT_FULL_HEIGHT", "full_height");
00430 
00431                         // caption text
00432                         $this->tpl->setVariable("TXT_FULL_CAPTION", $this->lng->txt("cont_caption"));
00433                         $this->tpl->setVariable("INPUT_FULL_CAPTION", "full_caption");
00434 
00435                         // parameters text
00436                         $this->tpl->setVariable("TXT_FULL_PARAMETER", $this->lng->txt("cont_parameter"));
00437                         $this->tpl->setVariable("INPUT_FULL_PARAMETERS", "full_parameters");
00438 
00439                         // object default values
00440                         $this->tpl->setVariable("VAL_OBJ_FULL_SIZE", $full_item->getWidth()." / ".$full_item->getHeight());
00441                         $this->tpl->setVariable("VAL_OBJ_FULL_CAPTION", $full_item->getCaption());
00442                         $this->tpl->setVariable("VAL_OBJ_FULL_PARAMETERS", $full_item->getParameterString());
00443                         if ($full_alias_item->definesSize())
00444                         {
00445                                 $this->tpl->setVariable("DERIVE_FULL_SIZE_N", "checked=\"1\"");
00446                         }
00447                         else
00448                         {
00449                                 $this->tpl->setVariable("DERIVE_FULL_SIZE_Y", "checked=\"1\"");
00450                         }
00451                         if ($full_alias_item->definesCaption())
00452                         {
00453                                 $this->tpl->setVariable("DERIVE_FULL_CAPTION_N", "checked=\"1\"");
00454                         }
00455                         else
00456                         {
00457                                 $this->tpl->setVariable("DERIVE_FULL_CAPTION_Y", "checked=\"1\"");
00458                         }
00459                         if ($full_alias_item->definesParameters())
00460                         {
00461                                 $this->tpl->setVariable("DERIVE_FULL_PARAMETER_N", "checked=\"1\"");
00462                         }
00463                         else
00464                         {
00465                                 $this->tpl->setVariable("DERIVE_FULL_PARAMETER_Y", "checked=\"1\"");
00466                         }
00467 
00468                         if ($full_alias_item->exists())
00469                         {
00470                                 $this->tpl->setVariable("FULLSCREEN_CHECKED", "checked=\"1\"");
00471 
00472                                 // width
00473                                 $this->tpl->setVariable("VAL_FULL_WIDTH", $full_alias_item->getWidth());
00474 
00475                                 // height
00476                                 $this->tpl->setVariable("VAL_FULL_HEIGHT", $full_alias_item->getHeight());
00477 
00478                                 // caption
00479                                 $this->tpl->setVariable("VAL_FULL_CAPTION", $full_alias_item->getCaption());
00480 
00481                                 // parameters
00482                                 $this->tpl->setVariable("VAL_FULL_PARAMETERS", $full_alias_item->getParameterString());
00483                         }
00484 
00485                         $this->tpl->parseCurrentBlock();
00486                 }
00487 
00488                 // operations
00489                 $this->tpl->setCurrentBlock("commands");
00490                 $this->tpl->setVariable("BTN_NAME", "saveAliasProperties");
00491                 $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
00492                 $this->tpl->parseCurrentBlock();
00493 
00494         }
00495 
00496 
00500         function saveAliasProperties()
00501         {
00502                 $std_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard");
00503                 $full_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen");
00504 
00505                 // standard size
00506                 if($_POST["derive_st_size"] == "y")
00507                 {
00508                         $std_item->deriveSize();
00509                 }
00510                 else
00511                 {
00512                         $std_item->setWidth($_POST["mob_width"]);
00513                         $std_item->setHeight($_POST["mob_height"]);
00514                 }
00515 
00516                 // standard caption
00517                 if($_POST["derive_st_caption"] == "y")
00518                 {
00519                         $std_item->deriveCaption();
00520                 }
00521                 else
00522                 {
00523                         $std_item->setCaption($_POST["mob_caption"]);
00524                 }
00525 
00526                 // standard parameters
00527                 if($_POST["derive_st_parameter"] == "y")
00528                 {
00529                         $std_item->deriveParameters();
00530                 }
00531                 else
00532                 {
00533                         $std_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["mob_parameters"]))));
00534                 }
00535 
00536                 if($this->content_obj->hasFullscreenItem())
00537                 {
00538                         if ($_POST["fullscreen"] ==  "y")
00539                         {
00540                                 if (!$full_item->exists())
00541                                 {
00542                                         $full_item->insert();
00543                                 }
00544 
00545                                 // fullscreen size
00546                                 if($_POST["derive_full_size"] == "y")
00547                                 {
00548                                         $full_item->deriveSize();
00549                                 }
00550                                 else
00551                                 {
00552                                         $full_item->setWidth($_POST["full_width"]);
00553                                         $full_item->setHeight($_POST["full_height"]);
00554                                 }
00555 
00556                                 // fullscreen caption
00557                                 if($_POST["derive_full_caption"] == "y")
00558                                 {
00559                                         $full_item->deriveCaption();
00560                                 }
00561                                 else
00562                                 {
00563                                         $full_item->setCaption($_POST["full_caption"]);
00564                                 }
00565 
00566                                 // fullscreen parameters
00567                                 if($_POST["derive_full_parameter"] == "y")
00568                                 {
00569                                         $full_item->deriveParameters();
00570                                 }
00571                                 else
00572                                 {
00573                                         $full_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["full_parameters"]))));
00574                                 }
00575                         }
00576                         else
00577                         {
00578                                 if ($full_item->exists())
00579                                 {
00580                                         $full_item->delete();
00581                                 }
00582                         }
00583                 }
00584 
00585                 $this->updated = $this->pg_obj->update();
00586                 if ($this->updated === true)
00587                 {
00588                         $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00589                 }
00590                 else
00591                 {
00592                         $this->pg_obj->addHierIDs();
00593                         $this->edit();
00594                 }
00595         }
00596 
00600         function &executeCommand()
00601         {
00602                 // get next class that processes or forwards current command
00603                 $next_class = $this->ctrl->getNextClass($this);
00604 
00605                 // get current command
00606                 $cmd = $this->ctrl->getCmd();
00607 
00608                 switch($next_class)
00609                 {
00610                         default:
00611                                 $ret =& $this->$cmd();
00612                                 break;
00613                 }
00614 
00615                 return $ret;
00616         }
00617 
00618 
00622         function copyToClipboard()
00623         {
00624                 $this->ilias->account->addObjectToClipboard($this->content_obj->getId(), $this->content_obj->getType()
00625                         , $this->content_obj->getTitle());
00626                 sendInfo($this->lng->txt("copied_to_clipboard"), true);
00627                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00628         }
00629 
00633         function centerAlign()
00634         {
00635                 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard");
00636                 $std_alias_item->setHorizontalAlign("Center");
00637                 $_SESSION["il_pg_error"] = $this->pg_obj->update();
00638                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00639         }
00640 
00644         function leftAlign()
00645         {
00646                 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard");
00647                 $std_alias_item->setHorizontalAlign("Left");
00648                 $_SESSION["il_pg_error"] = $this->pg_obj->update();
00649                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00650         }
00651 
00655         function rightAlign()
00656         {
00657                 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard");
00658                 $std_alias_item->setHorizontalAlign("Right");
00659                 $_SESSION["il_pg_error"] = $this->pg_obj->update();
00660                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00661         }
00662 
00666         function leftFloatAlign()
00667         {
00668                 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard");
00669                 $std_alias_item->setHorizontalAlign("LeftFloat");
00670                 $_SESSION["il_pg_error"] = $this->pg_obj->update();
00671                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00672         }
00673 
00677         function rightFloatAlign()
00678         {
00679                 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard");
00680                 $std_alias_item->setHorizontalAlign("RightFloat");
00681                 $_SESSION["il_pg_error"] = $this->pg_obj->update();
00682                 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
00683         }
00684 
00691         function getTabs(&$tab_gui, $a_create = false)
00692         {
00693                 global $ilCtrl;
00694 
00695                 if ($a_create)
00696                 {
00697                         $tab_gui->addTarget("cont_back",
00698                                 $ilCtrl->getParentReturn($this), "",
00699                                 "");
00700                 }
00701                 else
00702                 {
00703                         $tab_gui->addTarget("cont_mob_inst_prop",
00704                                 $ilCtrl->getLinkTarget($this, "editAlias"), "editAlias",
00705                                 get_class($this));
00706                 }
00707         }
00708 
00709 }
00710 ?>

Generated on Fri Dec 13 2013 09:06:36 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1