-
<%
nBlocLevel := 0;
aKeywordList := HndKeywords.GetKeywordList(False);
for nCurKeyword := 0 to length(aKeywordList) - 1 do
begin
sCurrentKeyword := aKeywordList[nCurKeyword].id;
nCurKeywordLevel := HndKeywords.GetKeywordLevel(sCurrentKeyword);
nCurKeywordChildrenCnt := HndKeywords.GetKeywordDirectChildrenCount(sCurrentKeyword);
aAssociatedTopics := HndTopicsKeywordsEx.GetGeneratedTopicsAssociatedWithKeyword(sCurrentKeyword);
if Length(aAssociatedTopics) = 0 then
begin
sKeywordLink := '#';
sDataView := '';
sDataContext := '';
end
else if Length(aAssociatedTopics) = 1 then
begin
sKeywordLink := format('%s.html', [HndTopics.GetTopicHelpId(aAssociatedTopics[0])]);
sDataView := '.view-main';
sDataContext := '';
end
else begin
sKeywordLink := '_topiclist.html';
sDataView := '.view-left';
sDataContext := '{"title":"' + HndGeneratorInfo.GetCustomSettingValue('TocKeywordsTitle') + '",';
sDataContext := sDataContext + '"topics":[';
for nCurKeywordTopic := 0 to Length(aAssociatedTopics) - 1 do
begin
if nCurKeywordTopic > 0 then
sDataContext := sDataContext + ',';
sDataContext := sDataContext + Format('{"title":"%s","url":"%s.html"}', [StringReplace(HTMLEncode(HndTopics.GetTopicCaption(aAssociatedTopics[nCurKeywordTopic])), '"', '\"', [rfReplaceAll]), HndTopics.GetTopicHelpId(aAssociatedTopics[nCurKeywordTopic])]);
end;
sDataContext := sDataContext + ']}';
end;
// Close the previous keywords
if ((nCurKeyword > 0) and (nCurKeywordLevel < HndKeywords.GetKeywordLevel(aKeywordList[nCurKeyword - 1].id))) then
begin
nDif := HndKeywords.GetKeywordLevel(aKeywordList[nCurKeyword - 1].id) - nCurKeywordLevel;
for nClose := 0 to nDif - 1 do
begin
print('
<% print(aKeywordList[nCurKeyword].caption); %>
- ');
nBlocLevel := nBlocLevel + 1;
end
else begin
print('