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


PHP ilObjMediaObject::removeMediaItem方法代码示例

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


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

示例1: updateCastItemObject

 /**
  * Update cast item
  */
 function updateCastItemObject()
 {
     global $tpl, $lng, $ilCtrl, $ilUser, $log;
     $this->checkPermission("write");
     $this->initAddCastItemForm("edit");
     if ($this->form_gui->checkInput()) {
         // create new media cast item
         include_once "./Services/News/classes/class.ilNewsItem.php";
         $mc_item = new ilNewsItem($_GET["item_id"]);
         $mob_id = $mc_item->getMobId();
         // create dummy object in db (we need an id)
         include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
         $mob = new ilObjMediaObject($mob_id);
         foreach (ilObjMediaCast::$purposes as $purpose) {
             if ($this->form_gui->getInput("delete_" . $purpose)) {
                 $mob->removeMediaItem($purpose);
                 $log->write("Mcst: deleting purpose {$purpose}");
                 continue;
             }
             $media_item = $mob->getMediaItem($purpose);
             $url_gui = $this->form_gui->getInput("url_" . $purpose);
             $file_gui = $this->form_gui->getInput("file_" . $purpose);
             if ($media_item == null) {
                 if ($purpose != "Standard" && ($url_gui || $file_gui["size"] > 0)) {
                     // check if we added an additional purpose when updating
                     // either by url or by file
                     $file = $this->createMediaItemForPurpose($mob, $purpose);
                 }
             } else {
                 $file = $this->updateMediaItem($mob, $media_item);
             }
             if ($purpose == "Standard") {
                 $duration = $this->getDuration($file);
                 $title = $this->form_gui->getInput("title") != "" ? $this->form_gui->getInput("title") : basename($file);
                 $description = $this->form_gui->getInput("description");
                 $mob->setTitle($title);
                 $mob->setDescription($description);
                 $prevpic = $this->form_gui->getInput("preview_pic");
                 if ($prevpic["size"] > 0) {
                     $mob->uploadVideoPreviewPic($prevpic);
                 } else {
                     $prevpici = $this->form_gui->getItemByPostVar("preview_pic");
                     if ($prevpici->getDeletionFlag()) {
                         $mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
                     }
                 }
             }
         }
         // set real meta and object data
         $mob->update();
         //
         // @todo: save usage
         //
         $news_set = new ilSetting("news");
         $enable_internal_rss = $news_set->get("enable_rss_for_internal");
         $mc_item->setUserId($ilUser->getId());
         if (isset($duration)) {
             $mc_item->setPlaytime($duration);
         }
         $mc_item->setTitle($title);
         $mc_item->setContent($description);
         if ($enable_internal_rss) {
             $mc_item->setVisibility($this->form_gui->getInput("visibility"));
         }
         $mc_item->update();
         $ilCtrl->redirect($this, "listItems");
     } else {
         $this->populateFormFromPost();
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:73,代码来源:class.ilObjMediaCastGUI.php


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