当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObjMediaObject::_useAutoStartParameterOnly方法代码示例

本文整理汇总了PHP中ilObjMediaObject::_useAutoStartParameterOnly方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjMediaObject::_useAutoStartParameterOnly方法的具体用法?PHP ilObjMediaObject::_useAutoStartParameterOnly怎么用?PHP ilObjMediaObject::_useAutoStartParameterOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilObjMediaObject的用法示例。


在下文中一共展示了ilObjMediaObject::_useAutoStartParameterOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveAliasProperties

 /**
  * save table properties in db and return to page edit screen
  */
 function saveAliasProperties()
 {
     $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard", $this->content_obj->getPcId());
     $full_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen", $this->content_obj->getPcId());
     $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
     $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
     // standard size
     if ($_POST["st_derive_size"] == "y") {
         $std_alias_item->deriveSize();
     } else {
         $std_alias_item->setWidth(ilUtil::stripSlashes($_POST["st_width_height"]["width"]));
         $std_alias_item->setHeight(ilUtil::stripSlashes($_POST["st_width_height"]["height"]));
     }
     // standard caption
     if ($_POST["st_derive_caption"] == "y") {
         $std_alias_item->deriveCaption();
     } else {
         $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["st_caption"]));
     }
     // text representation
     if ($_POST["st_derive_text_representation"] == "y") {
         $std_alias_item->deriveTextRepresentation();
     } else {
         $std_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["st_text_representation"]));
     }
     // standard parameters
     if ($_POST["st_derive_parameters"] == "y") {
         $std_alias_item->deriveParameters();
     } else {
         if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(), $std_item->getFormat())) {
             if ($_POST["st_autostart"]) {
                 $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
             } else {
                 $std_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
             }
         } else {
             $std_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["st_parameters"]))));
         }
     }
     if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
         if ($_POST["fullscreen"] == "y") {
             if (!$full_alias_item->exists()) {
                 $full_alias_item->insert();
             }
             // fullscreen size
             if ($_POST["full_derive_size"] == "y") {
                 $full_alias_item->deriveSize();
             } else {
                 $full_alias_item->setWidth(ilUtil::stripSlashes($_POST["full_width_height"]["width"]));
                 $full_alias_item->setHeight(ilUtil::stripSlashes($_POST["full_width_height"]["height"]));
             }
             // fullscreen caption
             if ($_POST["full_derive_caption"] == "y") {
                 $full_alias_item->deriveCaption();
             } else {
                 $full_alias_item->setCaption(ilUtil::stripSlashes($_POST["full_caption"]));
             }
             // fullscreen text representation
             if ($_POST["full_derive_text_representation"] == "y") {
                 $full_alias_item->deriveTextRepresentation();
             } else {
                 $full_alias_item->setTextRepresentation(ilUtil::stripSlashes($_POST["full_text_representation"]));
             }
             // fullscreen parameters
             if ($_POST["full_derive_parameters"] == "y") {
                 $full_alias_item->deriveParameters();
             } else {
                 if (ilObjMediaObject::_useAutoStartParameterOnly($full_item->getLocation(), $full_item->getFormat())) {
                     if ($_POST["full_autostart"]) {
                         $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="true"'));
                     } else {
                         $full_alias_item->setParameters(ilUtil::extractParameterString('autostart="false"'));
                     }
                 } else {
                     $full_alias_item->setParameters(ilUtil::extractParameterString(ilUtil::stripSlashes(utf8_decode($_POST["full_parameters"]))));
                 }
             }
         } else {
             if ($full_alias_item->exists()) {
                 $full_alias_item->delete();
             }
         }
     }
     $this->updated = $this->pg_obj->update();
     if ($this->updated === true) {
         $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
     } else {
         $this->pg_obj->addHierIDs();
         $this->editAlias();
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:94,代码来源:class.ilPCMediaObjectGUI.php

示例2: savePropertiesObject

 /**
  * save properties in db and return to page edit screen
  */
 function savePropertiesObject()
 {
     global $lng, $tpl;
     $this->initForm("edit");
     if ($this->form_gui->checkInput()) {
         $title = trim($_POST["standard_title"]);
         $this->object->setTitle($title);
         $std_item = $this->object->getMediaItem("Standard");
         $location = $std_item->getLocation();
         $format = $std_item->getFormat();
         if ($_POST["standard_type"] == "Reference") {
             $format = ilObjMediaObject::getMimeType(ilUtil::stripSlashes($_POST["standard_reference"]));
             $std_item->setFormat($format);
             $std_item->setLocation(ilUtil::secureLink(ilUtil::stripSlashes($_POST["standard_reference"])));
             $std_item->setLocationType("Reference");
         }
         $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
         if ($_POST["standard_type"] == "File") {
             $resize = false;
             if ($_FILES['standard_file']['name'] != "") {
                 $file_name = ilObjMediaObject::fixFilename($_FILES['standard_file']['name']);
                 $file = $mob_dir . "/" . $file_name;
                 ilUtil::moveUploadedFile($_FILES['standard_file']['tmp_name'], $file_name, $file);
                 // get mime type
                 $format = ilObjMediaObject::getMimeType($file);
                 $location = $file_name;
                 $resize = true;
             } else {
                 if ($_POST["standard_resize"]) {
                     $file = $mob_dir . "/" . $location;
                     $resize = true;
                 }
             }
             // resize
             if ($resize) {
                 if ($_POST["standard_size"] != "original" && is_int(strpos($format, "image"))) {
                     $location = ilObjMediaObject::_resizeImage($file, (int) $_POST["standard_width_height"]["width"], (int) $_POST["standard_width_height"]["height"], (bool) $_POST["standard_width_height"]["contr_prop"]);
                 }
                 $std_item->setFormat($format);
                 $std_item->setLocation($location);
             }
             $std_item->setLocationType("LocalFile");
         }
         $this->object->setDescription($format);
         // determine width and height of known image types
         $wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format, $_POST["standard_type"], $mob_dir . "/" . $location, $std_item->getLocation(), $_POST["standard_width_height"]["constr_prop"], $_POST["standard_size"] == "original", $_POST["standard_width_height"]["width"], $_POST["standard_width_height"]["height"]);
         if ($wh["info"] != "") {
             ilUtil::sendInfo($wh["info"], true);
         }
         $std_item->setWidth($wh["width"]);
         $std_item->setHeight($wh["height"]);
         // set caption
         $std_item->setCaption(ilUtil::stripSlashes($_POST["standard_caption"]));
         // text representation
         $std_item->setTextRepresentation(ilUtil::stripSlashes($_POST["text_representation"]));
         // set parameters
         if (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) {
             if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(), $std_item->getFormat())) {
                 if ($_POST["standard_autostart"]) {
                     $std_item->setParameters('autostart="true"');
                 } else {
                     $std_item->setParameters("");
                 }
             } else {
                 $std_item->setParameters(ilUtil::stripSlashes(utf8_decode($_POST["standard_parameters"])));
             }
         }
         // "None" selected
         if ($_POST["full_type"] == "None") {
             if ($this->object->hasFullscreenItem()) {
                 $this->object->removeMediaItem("Fullscreen");
             }
         } else {
             if ($this->object->hasFullscreenItem()) {
                 $full_item = $this->object->getMediaItem("Fullscreen");
             } else {
                 $full_item = new ilMediaItem();
                 $this->object->addMediaItem($full_item);
                 $full_item->setPurpose("Fullscreen");
             }
             $location = $full_item->getLocation();
             $format = $full_item->getFormat();
             if ($_POST["full_type"] == "Reference") {
                 $format = ilObjMediaObject::getMimeType(ilUtil::stripSlashes($_POST["full_reference"]));
                 $full_item->setFormat($format);
                 $full_item->setLocationType("Reference");
                 $location = ilUtil::stripSlashes($_POST["full_reference"]);
                 $type = "Reference";
             }
             $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
             if ($_POST["full_type"] == "File") {
                 $resize = false;
                 if ($_FILES['full_file']['name'] != "") {
                     $full_file_name = ilObjMediaObject::fixFilename($_FILES['full_file']['name']);
                     $file = $mob_dir . "/" . $full_file_name;
                     ilUtil::moveUploadedFile($_FILES['full_file']['tmp_name'], $full_file_name, $file);
                     $format = ilObjMediaObject::getMimeType($file);
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilObjMediaObjectGUI.php


注:本文中的ilObjMediaObject::_useAutoStartParameterOnly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。