本文整理匯總了PHP中lms_steam::get_link_path方法的典型用法代碼示例。如果您正苦於以下問題:PHP lms_steam::get_link_path方法的具體用法?PHP lms_steam::get_link_path怎麽用?PHP lms_steam::get_link_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lms_steam
的用法示例。
在下文中一共展示了lms_steam::get_link_path方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_link_path_html
public static function get_link_path_html($obj, $offset = FALSE, $length = FALSE)
{
if (is_object($obj)) {
$link_path = lms_steam::get_link_path($obj, $offset);
} else {
if (is_array($obj)) {
if ($offset === FALSE) {
$link_path = $obj;
} else {
$index = array_search($offset, array_keys($obj));
if ($index === FALSE) {
return "";
}
if ($length === FALSE) {
$link_path = array_slice($obj, $index);
} else {
$link_path = array_slice($obj, $index, $length);
}
}
} else {
$link_path = array();
}
}
$container_path = "";
foreach ($link_path as $path_item) {
if (!empty($container_path)) {
$container_path .= " / ";
}
if (empty($path_item["link"])) {
$container_path .= $path_item["name"];
} else {
$container_path .= "<a href='" . $path_item["link"] . "'>" . h($path_item["name"]) . "</a>";
}
}
return $container_path;
}
示例2: str_replace
$content->setVariable("VALUE_VIEWED", str_replace("%x", count($readers), gettext("%x times")));
$content->setVariable("VALUE_SIZE", get_formatted_filesize($document->get_content_size()));
} else {
if ($document instanceof steam_container) {
// CONTAINER
$content->setCurrentBlock("BLOCK_CONTAINER");
$content->setVariable("LABEL_OBJECTCOUNT", gettext("Contents"));
$content->setVariable("VALUE_OBJECTCOUNT", str_replace("%COUNT", $document->count_inventory(), gettext("%COUNT Objects")));
$content->parse("BLOCK_CONTAINER");
} else {
// DOCEXTERN
$content->setCurrentBlock("BLOCK_DOCEXTERN");
$content->setVariable("LABEL_URL", gettext("URL"));
$content->setVariable("VALUE_URL", $document->get_attribute(DOC_EXTERN_URL));
$content->parse("BLOCK_DOCEXTERN");
}
}
$portal->set_rss_feed(PATH_URL . "services/feeds/document_public.php?id=" . $document->get_id(), gettext("Feed"), gettext("Subscribe to this document's newsfeed"));
$parent = $document->get_environment();
$link_path = -1;
if (is_object($parent)) {
$parent = koala_object::get_koala_object($parent);
if (is_object($parent) && $parent instanceof lms_wiki) {
$link_path = lms_steam::get_link_path($document);
}
}
if ($link_path === -1) {
$link_path = koala_object::get_koala_object($document)->get_link_path();
}
$portal->set_page_main($link_path, $content->get(), "");
$portal->show_html();