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


PHP ilObjMediaObject::_lookupItemPath方法代码示例

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


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

示例1: getValues

 /**
  * get Values
  * 
  */
 public function getValues()
 {
     //Get Record-Values
     $record_obj = ilDataCollectionCache::getRecordCache($this->record_id);
     //Get Table Field Definitions
     $allFields = $this->table->getFields();
     $values = array();
     foreach ($allFields as $field) {
         $value = $record_obj->getRecordFieldFormInput($field->getId());
         $values['field_' . $field->getId()] = $value;
         if ($field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_MOB) {
             $img = ilObjMediaObject::_lookupItemPath($value);
             if ($value) {
                 $this->form->getItemByPostVar('field_' . $field->getId())->setImage($img);
             }
         }
     }
     $this->form->setValuesByArray($values);
     return true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:24,代码来源:class.ilDataCollectionRecordEditGUI.php

示例2: ilObjectFeedWriter


//.........这里部分代码省略.........
             $feed_item->setLink(ILIAS_HTTP_PATH . "/goto.php?client_id=" . CLIENT_ID . "&target=" . $item["context_obj_type"]);
             $this->addItem($feed_item);
             return;
         }
     }
     include_once "./Services/Locator/classes/class.ilLocatorGUI.php";
     $cont_loc = new ilLocatorGUI();
     $cont_loc->addContextItems($a_ref_id, true);
     $cont_loc->setTextOnly(true);
     $loc = $cont_loc->getTextVersion();
     if (trim($loc) != "") {
         $loc = " [" . $loc . "] ";
     }
     $rss_period = ilNewsItem::_lookupRSSPeriod();
     ilNewsItem::setPrivateFeedId($a_userid);
     $news_item = new ilNewsItem();
     $news_item->setContextObjId($obj_id);
     $news_item->setContextObjType($obj_type);
     $items = $news_item->getNewsForRefId($a_ref_id, true, false, $rss_period, true);
     if ($a_purpose) {
         include_once "./Services/MediaObjects/classes/class.ilMediaItem.php";
     }
     $i = 0;
     foreach ($items as $item) {
         $i++;
         if ($a_purpose != false && $obj_type == "mcst") {
             $mob = ilMediaItem::_getMediaItemsOfMObId($item[mob_id], $a_purpose);
             if ($mob == false) {
                 continue;
             }
         }
         $obj_title = ilObject::_lookupTitle($item["context_obj_id"]);
         $feed_item = new ilFeedItem();
         $title = ilNewsItem::determineNewsTitle($item["context_obj_type"], $item["title"], $item["content_is_lang_var"], $item["agg_ref_id"], $item["aggregation"]);
         // path
         $cont_loc = new ilLocatorGUI();
         $cont_loc->addContextItems($item["ref_id"], true, $a_ref_id);
         $cont_loc->setTextOnly(true);
         $loc = $cont_loc->getHTML();
         if (trim($loc) != "") {
             $loc = "[" . $loc . "]";
         }
         if ($news_set->get("rss_title_format") == "news_obj") {
             $sep = trim($this->prepareStr($loc)) == "" ? "" : " ";
             $feed_item->setTitle($this->prepareStr($title) . " (" . $this->prepareStr($loc) . $sep . $this->prepareStr($obj_title) . ")");
         } else {
             $feed_item->setTitle($this->prepareStr($loc) . " " . $this->prepareStr($obj_title) . ": " . $this->prepareStr($title));
         }
         $feed_item->setDescription($this->prepareStr(nl2br(ilNewsItem::determineNewsContent($item["context_obj_type"], $item["content"], $item["content_text_is_lang_var"]))));
         // lm hack, not nice
         if (in_array($item["context_obj_type"], array("dbk", "lm")) && $item["context_sub_obj_type"] == "pg" && $item["context_sub_obj_id"] > 0) {
             $feed_item->setLink(ILIAS_HTTP_PATH . "/goto.php?client_id=" . CLIENT_ID . "&target=pg_" . $item["context_sub_obj_id"] . "_" . $item["ref_id"]);
         } else {
             if ($item["context_obj_type"] == "wiki" && $item["context_sub_obj_type"] == "wpg" && $item["context_sub_obj_id"] > 0) {
                 include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
                 $wptitle = ilWikiPage::lookupTitle($item["context_sub_obj_id"]);
                 $feed_item->setLink(ILIAS_HTTP_PATH . "/goto.php?client_id=" . CLIENT_ID . "&target=" . $item["context_obj_type"] . "_" . $item["ref_id"] . "_" . $wptitle);
             } else {
                 if (in_array($item["context_obj_type"], array("frm")) && $item["context_sub_obj_type"] == "pos" && $item["context_sub_obj_id"] > 0) {
                     // frm hack, not nice
                     include_once "./Modules/Forum/classes/class.ilObjForumAccess.php";
                     $thread_id = ilObjForumAccess::_getThreadForPosting($item["context_sub_obj_id"]);
                     if ($thread_id > 0) {
                         $feed_item->setLink(ILIAS_HTTP_PATH . "/goto.php?client_id=" . CLIENT_ID . "&target=" . $item["context_obj_type"] . "_" . $item["ref_id"] . "_" . $thread_id . "_" . $item["context_sub_obj_id"]);
                     } else {
                         $feed_item->setLink(ILIAS_HTTP_PATH . "/goto.php?client_id=" . CLIENT_ID . "&target=" . $item["context_obj_type"] . "_" . $item["ref_id"]);
                     }
                 } else {
                     $feed_item->setLink(ILIAS_HTTP_PATH . "/goto.php?client_id=" . CLIENT_ID . "&target=" . $item["context_obj_type"] . "_" . $item["ref_id"]);
                     //echo "<br>".ILIAS_HTTP_PATH."/goto.php?client_id=".CLIENT_ID.
                     //					"&amp;target=".$item["context_obj_type"]."_".$item["ref_id"];
                 }
             }
         }
         $feed_item->setAbout($feed_item->getLink() . "&amp;il_about_feed=" . $item["id"]);
         $feed_item->setDate($item["creation_date"]);
         // Enclosure
         if ($item["content_type"] == NEWS_AUDIO && $item["mob_id"] > 0 && ilObject::_exists($item["mob_id"])) {
             $go_on = true;
             if ($obj_type == "mcst") {
                 include_once "./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php";
                 if (!ilObjMediaCastAccess::_lookupPublicFiles($obj_id)) {
                     $go_on = false;
                 }
             }
             if ($go_on) {
                 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
                 $url = ilObjMediaObject::_lookupItemPath($item["mob_id"], true, true, $mob["purpose"]);
                 $file = ilObjMediaObject::_lookupItemPath($item["mob_id"], false, false, $mob["purpose"]);
                 if (is_file($file)) {
                     $size = filesize($file);
                 }
                 $feed_item->setEnclosureUrl($url);
                 $feed_item->setEnclosureType(isset($mob["format"]) ? $mob["format"] : "audio/mpeg");
                 $feed_item->setEnclosureLength($size);
             }
         }
         $this->addItem($feed_item);
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilObjectFeedWriter.php

示例3: _lookupStandardItemPath

 /**
  * Get path for standard item.
  *
  * @param	int		$a_mob_id		media object id
  */
 static function _lookupStandardItemPath($a_mob_id, $a_url_encode = false, $a_web = true)
 {
     return ilObjMediaObject::_lookupItemPath($a_mob_id, $a_url_encode, $a_web, "Standard");
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:9,代码来源:class.ilObjMediaObject.php

示例4: fillRow

 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     $news_set = new ilSetting("news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     // access
     if ($enable_internal_rss && !$this->presentation_mode) {
         $this->tpl->setCurrentBlock("access");
         $this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
         if ($a_set["visibility"] == NEWS_PUBLIC) {
             $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
         } else {
             $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
         }
         $this->tpl->parseCurrentBlock();
     }
     $ilCtrl->setParameterByClass("ilobjmediacastgui", "item_id", "");
     if (ilObject::_exists($a_set["mob_id"])) {
         if ($a_set["update_date"] != "") {
             $this->tpl->setCurrentBlock("last_update");
             $this->tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
             $this->tpl->setVariable("VAL_LAST_UPDATE", ilDatePresentation::formatDate(new ilDateTime($a_set["update_date"], IL_CAL_DATETIME)));
             $this->tpl->parseCurrentBlock();
         }
         $mob = new ilObjMediaObject($a_set["mob_id"]);
         $med = $mob->getMediaItem("Standard");
         $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
         $this->tpl->setVariable("VAL_DESCRIPTION", $a_set["content"]);
         $this->tpl->setVariable("TXT_CREATED", $lng->txt("created"));
         $this->tpl->setVariable("VAL_CREATED", ilDatePresentation::formatDate(new ilDateTime($a_set["creation_date"], IL_CAL_DATETIME)));
         $this->tpl->setVariable("TXT_DURATION", $lng->txt("mcst_play_time"));
         if ($a_set["playtime"] != "00:00:00") {
             $this->tpl->setVariable("VAL_DURATION", $a_set["playtime"]);
         } else {
             $this->tpl->setVariable("VAL_DURATION", "-");
         }
         if (!$this->edit_order) {
             if ($this->downloadable) {
                 $ilCtrl->setParameterByClass("ilobjmediacastgui", "item_id", $a_set["id"]);
                 // to keep always the order of the purposes
                 // iterate through purposes and display the according mediaitems
                 foreach (ilObjMediaCast::$purposes as $purpose) {
                     $a_mob = $mob->getMediaItem($purpose);
                     if (!is_object($a_mob)) {
                         continue;
                     }
                     $ilCtrl->setParameterByClass("ilobjmediacastgui", "purpose", $a_mob->getPurpose());
                     $file = ilObjMediaObject::_lookupItemPath($a_mob->getMobId(), false, false, $a_mob->getPurpose());
                     if (is_file($file)) {
                         $size = filesize($file);
                         $size = ", " . sprintf("%.1f MB", $size / 1024 / 1024);
                     }
                     $format = $a_mob->getFormat() != "" ? $a_mob->getFormat() : "audio/mpeg";
                     $this->tpl->setCurrentBlock("downloadable");
                     $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("mcst_download_" . strtolower($a_mob->getPurpose())));
                     $this->tpl->setVariable("CMD_DOWNLOAD", $ilCtrl->getLinkTargetByClass("ilobjmediacastgui", "downloadItem"));
                     $this->tpl->setVariable("TITLE_DOWNLOAD", "(" . $format . $size . ")");
                     $this->tpl->parseCurrentBlock();
                 }
             }
             include_once "./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php";
             $mpl = new ilMediaPlayerGUI();
             if (is_object($med)) {
                 if (strcasecmp("Reference", $med->getLocationType()) == 0) {
                     $mpl->setFile($med->getLocation());
                 } else {
                     $mpl->setFile(ilObjMediaObject::_getURL($mob->getId()) . "/" . $med->getLocation());
                 }
                 $mpl->setMimeType($med->getFormat());
                 //$mpl->setDisplayHeight($med->getHeight());
                 $mpl->setDisplayWidth("640");
                 $mpl->setDisplayHeight("480");
                 $mpl->setVideoPreviewPic($mob->getVideoPreviewPic());
                 $mpl->setTitle($a_set["title"]);
                 $mpl->setDescription($a_set["content"]);
                 $med_alt = $mob->getMediaItem("VideoAlternative");
                 if (is_object($med_alt)) {
                     $mpl->setAlternativeVideoFile(ilObjMediaObject::_getURL($mob->getId()) . "/" . $med_alt->getLocation());
                     $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
                 }
             }
             //$this->tpl->setVariable("PLAYER", $mpl->getMp3PlayerHtml());
             $this->tpl->setVariable("PLAYER", $mpl->getPreviewHtml());
             // edit link
             $ilCtrl->setParameterByClass("ilobjmediacastgui", "item_id", $a_set["id"]);
             if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && !$this->presentation_mode) {
                 $this->tpl->setCurrentBlock("edit");
                 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
                 $this->tpl->setVariable("CMD_EDIT", $ilCtrl->getLinkTargetByClass("ilobjmediacastgui", "editCastItem"));
                 if (!is_int(strpos($med->getFormat(), "image/"))) {
                     $this->tpl->setVariable("TXT_DET_PLAYTIME", $lng->txt("mcst_det_playtime"));
                     $this->tpl->setVariable("CMD_DET_PLAYTIME", $ilCtrl->getLinkTargetByClass("ilobjmediacastgui", "determinePlaytime"));
                 }
                 $this->tpl->parseCurrentBlock();
                 $this->tpl->setCurrentBlock("edit_checkbox");
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilMediaCastTableGUI.php


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