示例#1
0
 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
0
    $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();