コード例 #1
0
ファイル: item.php プロジェクト: amjadtbssm/website
 // Assign data to the Return Value block
 if ($itemInfos["ReturnValue"] != "") {
     $tpl->setCurrentBlock("return_value");
     $tpl->setVariable("RETURN_VALUE", FormatEndLines($itemInfos["ReturnValue"]));
     $tpl->parseCurrentBlock("return_value");
 }
 // Assign data to the Description block
 if ($itemInfos["Description"] != "") {
     $tpl->setCurrentBlock("description");
     $tpl->setVariable("DESCRIPTION", EncodeString(FormatEndLines(trim($itemInfos["FormattedDescription"]))));
     $tpl->parseCurrentBlock("description");
 }
 // Assign data to the Extras block
 if ($itemInfos["Extras"] != "") {
     $tpl->setCurrentBlock("extras");
     $tpl->setVariable("EXTRAS", FormatEndLines(ProcessExtras($itemInfos["Extras"], $baseclass)));
     $tpl->parseCurrentBlock("extras");
 }
 // Assign data to the See Also block
 if ($itemInfos["SeeAlsoUndefined"] != "" or $itemInfos["SeeAlsoInternal"] != "" or $itemInfos["SeeAlsoExternal"] != "") {
     $tpl->setCurrentBlock("see_also");
     $seeAlsoInternalEmpty = true;
     // 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]) {
                 $tpl->setVariable("SEPARATOR", "");
コード例 #2
0
$tpl->setVariable("RETURN_VALUE", UnescapeCharsFromMySQL($itemInfos["ReturnValue"]));
$tpl->setVariable("DESCRIPTION", EncodeString(UnescapeCharsFromMySQL($itemInfos["Description"])));
$tpl->setVariable("EXTRAS", UnescapeCharsFromMySQL($itemInfos["Extras"]));
$tpl->setVariable("SEE_ALSO_LIST", UnescapeCharsFromMySQL($itemInfos["SeeAlsoList"]));
$tpl->setVariable("JVCL_INFO", UnescapeCharsFromMySQL($itemInfos["JVCLInfo"]));
// Set values from the original item (if any)
if ($originalItemId > 0) {
    $originalItemInfos = GetItemInfos($originalItemId);
    $baseclass = trim(substr($originalItemInfos["Name"], 0, strpos($originalItemInfos["Name"], ".")));
    $tpl->setVariable("ORIGINAL_ITEM_ID", $originalItemId);
    $tpl->setVariable("ORIGINAL_ITEM_NAME", $originalItemInfos["Name"]);
    $tpl->setVariable("ORIGINAL_SUMMARY", EncodeString(FormatEndLines($originalItemInfos["Summary"])));
    $tpl->setVariable("ORIGINAL_PARAMETERS", FormatEndLines($originalItemInfos["Parameters"]));
    $tpl->setVariable("ORIGINAL_RETURN_VALUE", FormatEndLines($originalItemInfos["ReturnValue"]));
    $tpl->setVariable("ORIGINAL_DESCRIPTION", EncodeString(FormatEndLines($originalItemInfos["Description"])));
    $tpl->setVariable("ORIGINAL_EXTRAS", FormatEndLines(ProcessExtras($originalItemInfos["Extras"], $baseclass)));
    // build the see also information
    $seeAlsoList = "";
    if ($originalItemInfos["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($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);
            }
        }
    }