Beispiel #1
0
function GetSeeAlsoString($itemInfos)
{
    $seeAlsoList = "";
    // build the see also information
    if ($itemInfos["SeeAlsoInternal"] != "") {
        $baseclass = trim(substr($itemInfos["Name"], 0, strpos($itemInfos["Name"], ".")));
        // start with the internal: the value in the DB is a comma separated list
        // of IDs, so we get the required infos from the database
        $sa_items = GetListOfItems(trim($itemInfos["SeeAlsoInternal"]));
        if (!is_array($sa_items)) {
            die($sa_items);
        }
        foreach ($sa_items as $sa_item) {
            if ($sa_item == $sa_items[0]) {
                $seeAlsoList .= RemoveBaseClass(trim($sa_item["Name"]), $baseclass);
            } else {
                $seeAlsoList .= ", " . RemoveBaseClass(trim($sa_item["Name"]), $baseclass);
            }
        }
    }
    // add the undefined and external
    if ($itemInfos["SeeAlsoUndefined"] != "") {
        if ($seeAlsoList != "") {
            $seeAlsoList .= ", ";
        }
        $seeAlsoList .= trim($itemInfos["SeeAlsoUndefined"]);
    }
    if ($itemInfos["SeeAlsoExternal"] != "") {
        if ($seeAlsoList != "") {
            $seeAlsoList .= ", ";
        }
        $seeAlsoList .= trim($itemInfos["SeeAlsoExternal"]);
    }
    return $seeAlsoList;
}
Beispiel #2
0
        $tpl->parseCurrentBlock("see_also");
    }
    // Assign data to the JVCL Info block
    if ($itemInfos["JVCLInfo"] != "") {
        $tpl->setCurrentBlock("jvcl_info");
        $tpl->setVariable("JVCL_INFO", FormatEndLines($itemInfos["JVCLInfo"]));
        $tpl->parseCurrentBlock("jvcl_info");
    }
} else {
    $seeAlsoList = "";
    if (is_numeric($itemId)) {
        // build the see also information
        if ($itemInfos["SeeAlsoInternal"] != "") {
            // start with the internal: the value in the DB is a comma separated list
            // of IDs, so we get the required infos from the database
            $sa_items = GetListOfItems($itemInfos["SeeAlsoInternal"]);
            foreach ($sa_items as $sa_item) {
                $tpl->setCurrentBlock("see_also_internal");
                if ($sa_item == $sa_items[0]) {
                    $seeAlsoList .= RemoveBaseClass(trim($sa_item["Name"]), $baseclass);
                } else {
                    $seeAlsoList .= ", " . RemoveBaseClass(trim($sa_item["Name"]), $baseclass);
                }
            }
        }
        // add the undefined and external
        if ($itemInfos["SeeAlsoUndefined"] != "") {
            if ($seeAlsoList != "") {
                $seeAlsoList .= ", ";
            }
            $seeAlsoList .= $itemInfos["SeeAlsoUndefined"];