Ejemplo n.º 1
0
            }
            $seeAlsoOthers .= $itemInfos["SeeAlsoUndefined"];
        }
        if ($itemInfos["SeeAlsoExternal"] != "") {
            if ($seeAlsoOthers != "") {
                $seeAlsoOthers .= ", ";
            }
            $seeAlsoOthers .= $itemInfos["SeeAlsoExternal"];
        }
        $tpl->setVariable("SEE_ALSO_OTHERS", FormatEndLines($seeAlsoOthers));
        $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 {
        // 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($originalItemInfos["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 ($originalItemInfos["SeeAlsoUndefined"] != "") {
        if ($seeAlsoList != "") {
            $seeAlsoList .= ", ";
        }
        $seeAlsoList .= $originalItemInfos["SeeAlsoUndefined"];
    }
    if ($originalItemInfos["SeeAlsoExternal"] != "") {
        if ($seeAlsoList != "") {
            $seeAlsoList .= ", ";
        }
        $seeAlsoList .= $originalItemInfos["SeeAlsoExternal"];
    }
    // Finally, set the variable
    $tpl->setVariable("ORIGINAL_SEE_ALSO_LIST", FormatEndLines($seeAlsoList));
    $tpl->setVariable("ORIGINAL_JVCL_INFO", FormatEndLines($originalItemInfos["JVCLInfo"]));
}
$tpl->show();
EndAccessToDB();