/** * 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 .= " " . $row2; } } } } return $html; }
/** * 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 .= " " . 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 .= " " . ilRSSButtonGUI::get($type2, $url); } break; } } } if ($html != "") { $html .= $row1; if ($row2 != "") { $html .= $row2; } } } } return $html; }