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


PHP ilObjMediaObject::read方法代码示例

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


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

示例1: getFeedIconsHTML

 /**
  * Get feed icons HTML
  *
  * @param
  * @return
  */
 function getFeedIconsHTML()
 {
     global $lng;
     $html = "";
     include_once "./Services/Block/classes/class.ilBlockSetting.php";
     $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
     // rss icon/link
     if ($public_feed) {
         $news_set = new ilSetting("news");
         $enable_internal_rss = $news_set->get("enable_rss_for_internal");
         if ($enable_internal_rss) {
             // create dummy object in db (we need an id)
             $items = $this->object->getItemsArray();
             include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
             $html = "";
             foreach (ilObjMediaCast::$purposes as $purpose) {
                 foreach ($items as $id => $item) {
                     $mob = new ilObjMediaObject($item["mob_id"]);
                     $mob->read();
                     if ($mob->hasPurposeItem($purpose)) {
                         if ($html == "") {
                             $html = " ";
                         }
                         $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $_GET["ref_id"] . "&purpose={$purpose}";
                         $title = $lng->txt("news_feed_url");
                         $icon = ilUtil::getImagePath("rss_icon_" . strtolower($purpose) . ".png");
                         $target = "_blank";
                         $row1 .= "<A href='{$url}' target='{$target}'><img src='{$icon}' alt='{$title}'/></A>";
                         if ($this->object->getPublicFiles()) {
                             $url = preg_replace("/https?/i", "itpc", $url);
                             $title = $lng->txt("news_feed_url");
                             $icon = ilUtil::getImagePath("itunes_icon.png");
                             $row2 .= "<A href='{$url}' target='{$target}'><img src='{$icon}' alt='{$title}'/></A>";
                         }
                         break;
                     }
                 }
             }
             if ($html != "") {
                 $html .= $row1;
                 if ($row2 != "") {
                     $html .= "&nbsp;&nbsp;" . $row2;
                 }
             }
         }
     }
     return $html;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:54,代码来源:class.ilObjMediaCastGUI.php

示例2: getFeedIconsHTML

 /**
  * Get feed icons HTML
  *
  * @param
  * @return
  */
 function getFeedIconsHTML()
 {
     global $lng;
     $html = "";
     include_once "./Services/Block/classes/class.ilBlockSetting.php";
     $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
     // rss icon/link
     if ($public_feed) {
         $news_set = new ilSetting("news");
         $enable_internal_rss = $news_set->get("enable_rss_for_internal");
         if ($enable_internal_rss) {
             // create dummy object in db (we need an id)
             $items = $this->object->getItemsArray();
             include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
             $html = "";
             foreach (ilObjMediaCast::$purposes as $purpose) {
                 foreach ($items as $id => $item) {
                     $mob = new ilObjMediaObject($item["mob_id"]);
                     $mob->read();
                     if ($mob->hasPurposeItem($purpose)) {
                         if ($html == "") {
                             $html = " ";
                         }
                         $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $_GET["ref_id"] . "&purpose={$purpose}";
                         $title = $lng->txt("news_feed_url");
                         include_once "./Services/News/classes/class.ilRSSButtonGUI.php";
                         switch (strtolower($purpose)) {
                             case "audioportable":
                                 $type1 = ilRSSButtonGUI::ICON_RSS_AUDIO;
                                 $type2 = ilRSSButtonGUI::ICON_ITUNES_AUDIO;
                                 break;
                             case "videoportable":
                                 $type1 = ilRSSButtonGUI::ICON_RSS_VIDEO;
                                 $type2 = ilRSSButtonGUI::ICON_ITUNES_VIDEO;
                                 break;
                             default:
                                 $type1 = ilRSSButtonGUI::ICON_RSS;
                                 $type2 = ilRSSButtonGUI::ICON_ITUNES;
                                 break;
                         }
                         $row1 .= "&nbsp;" . ilRSSButtonGUI::get($type1, $url);
                         if ($this->object->getPublicFiles()) {
                             $url = preg_replace("/https?/i", "itpc", $url);
                             $title = $lng->txt("news_feed_url");
                             include_once "./Services/News/classes/class.ilRSSButtonGUI.php";
                             $row2 .= "&nbsp;" . ilRSSButtonGUI::get($type2, $url);
                         }
                         break;
                     }
                 }
             }
             if ($html != "") {
                 $html .= $row1;
                 if ($row2 != "") {
                     $html .= $row2;
                 }
             }
         }
     }
     return $html;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:67,代码来源:class.ilObjMediaCastGUI.php


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