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


PHP ilObjMediaObject::getRestrictedFileTypes方法代码示例

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


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

示例1: initForm

 /**
  * Init creation form
  */
 function initForm($a_mode = "create")
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     if ($a_mode == "edit") {
         $std_item = $this->object->getMediaItem("Standard");
     }
     $this->form_gui = new ilPropertyFormGUI();
     // standard view resource
     $title = new ilTextInputGUI($lng->txt("title"), "standard_title");
     $title->setSize(40);
     $title->setMaxLength(120);
     $this->form_gui->addItem($title);
     $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "standard_type");
     $op1 = new ilRadioOption($lng->txt("cont_file"), "File");
     $up = new ilFileInputGUI("", "standard_file");
     $up->setSuffixes(ilObjMediaObject::getRestrictedFileTypes());
     $up->setInfo("");
     $op1->addSubItem($up);
     $radio_prop->addOption($op1);
     $op2 = new ilRadioOption($lng->txt("url"), "Reference");
     $ref = new ilTextInputGUI("", "standard_reference");
     $ref->setInfo($lng->txt("cont_ref_helptext"));
     $op2->addSubItem($ref);
     $radio_prop->addOption($op2);
     $radio_prop->setValue("File");
     $this->form_gui->addItem($radio_prop);
     // standard format
     if ($a_mode == "edit") {
         $format = new ilNonEditableValueGUI($lng->txt("cont_format"), "standard_format");
         $format->setValue($std_item->getFormat());
         $this->form_gui->addItem($format);
     }
     // standard size
     $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "standard_size");
     if ($a_mode == "edit") {
         if ($orig_size = $std_item->getOriginalSize()) {
             $add_str = " (" . $orig_size["width"] . " x " . $orig_size["height"] . ")";
         }
         $op1 = new ilRadioOption($lng->txt("cont_resource_size") . $add_str, "original");
         $op2 = new ilRadioOption($lng->txt("cont_custom_size"), "selected");
     } else {
         $op1 = new ilRadioOption($lng->txt("cont_orig_size"), "original");
         $op2 = new ilRadioOption($lng->txt("cont_adjust_size"), "selected");
     }
     $radio_size->addOption($op1);
     // width height
     include_once "./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php";
     $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") . " / " . $lng->txt("cont_height"), "standard_width_height");
     $width_height->setConstrainProportions(true);
     $op2->addSubItem($width_height);
     // resize image
     if ($a_mode == "edit") {
         $std_item = $this->object->getMediaItem("Standard");
         if (is_int(strpos($std_item->getFormat(), "image")) && $std_item->getLocationType() == "LocalFile") {
             $resize = new ilCheckboxInputGUI($lng->txt("cont_resize_img"), "standard_resize");
             $op2->addSubItem($resize);
         }
     }
     $radio_size->setValue("original");
     if ($a_mode == "create" && ($this->getHeightPreset() > 0 || $this->getWidthPreset() > 0)) {
         $radio_size->setValue("selected");
         $width_height->setWidth($this->getWidthPreset());
         $width_height->setHeight($this->getHeightPreset());
     }
     $radio_size->addOption($op2);
     $this->form_gui->addItem($radio_size);
     // standard caption
     $caption = new ilTextAreaInputGUI($lng->txt("cont_caption"), "standard_caption");
     $caption->setCols(30);
     $caption->setRows(2);
     $this->form_gui->addItem($caption);
     /*$caption = new ilTextInputGUI($lng->txt("cont_caption"), "standard_caption");
     		$caption->setSize(40);
     		$caption->setMaxLength(200);
     		$this->form_gui->addItem($caption);*/
     // text representation (alt text)
     if ($a_mode == "edit" && is_int(strpos($std_item->getFormat(), "image"))) {
         $ta = new ilTextAreaInputGUI($lng->txt("text_repr"), "text_representation");
         $ta->setCols(30);
         $ta->setRows(2);
         $ta->setInfo($lng->txt("text_repr_info"));
         $this->form_gui->addItem($ta);
     }
     // standard parameters
     if ($a_mode == "edit" && !in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) {
         if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(), $std_item->getFormat())) {
             $auto = new ilCheckboxInputGUI($lng->txt("cont_autostart"), "standard_autostart");
             $this->form_gui->addItem($auto);
         } else {
             $par = new ilTextAreaInputGUI($lng->txt("cont_parameter"), "standard_parameters");
             $par->setRows(5);
             $par->setCols(50);
             $this->form_gui->addItem($par);
         }
     }
     if ($a_mode == "edit") {
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilObjMediaObjectGUI.php


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