當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。