<%
// --- Table of contents TAB --- //
if HndGeneratorInfo.GetCustomSettingValue('TocShow') then begin
%>
<%
nBlocLevel := 0;
aTopicList := HndTopicsEx.GetTopicListGenerated(True, False);
for nCurTopic := 0 to length(aTopicList) - 1 do
begin
HndGeneratorInfo.CurrentTopic := aTopicList[nCurTopic].id;
nTopicKind := aTopicList[nCurTopic].Kind;
nCurTopicLevel := HndTopics.GetTopicLevel(HndGeneratorInfo.CurrentTopic);
nCurTopicChildrenCnt := HndTopicsEx.GetTopicDirectChildrenCountGenerated(HndGeneratorInfo.CurrentTopic, True);
nCurTopicIcon := HndTopics.GetTopicIconIndex(HndGeneratorInfo.CurrentTopic);
// Topic URL
if nTopicKind = 2 then sTopicUrl := HndTopics.GetTopicUrlLink(HndGeneratorInfo.CurrentTopic) // Link to URL
else if nTopicKind = 1 then sTopicUrl := '#" onclick="return false;' // Empty
else sTopicUrl := format('%s.html', [aTopicList[nCurTopic].HelpId]); // Normal topic
// Close the previous topics
if ((nCurTopic > 0) and (nCurTopicLevel < HndTopics.GetTopicLevel(aTopicList[nCurTopic - 1].id))) then
begin
nDif := HndTopics.GetTopicLevel(aTopicList[nCurTopic - 1].id) - nCurTopicLevel;
for nClose := 0 to nDif - 1 do
begin
print('
');
nBlocLevel := nBlocLevel - 1;
end;
end;
// Topic class
if nCurTopicChildrenCnt > 0 then sTopicClass := 'folder'
else sTopicClass := '';
// Topic icon
if nCurTopicIcon > -1 then sTopicIconData := 'icon: ''' + IntToStr(nCurTopicIcon) + '.png'''
else sTopicIconData := '';
%>
');
nBlocLevel := nBlocLevel + 1;
end
else begin
print('
');
end;
// Close the last topic
if (HndTopicsEx.GetTopicNextGenerated(HndGeneratorInfo.CurrentTopic, True) = '') then
begin
while nBlocLevel > 0 do
begin
print('');
nBlocLevel := nBlocLevel - 1;
end;
end;
end;
%>
<%
end;
// --- Keywords TAB --- //
if HndGeneratorInfo.GetCustomSettingValue('TocKeywordsShow') then begin
%>
<%
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 := HndTopicsKeywords.GetTopicsAssociatedWithKeyword(sCurrentKeyword);
if Length(aAssociatedTopics) > 0 then
begin
sKeywordLink := format('%s.html', [HndTopics.GetTopicHelpId(aAssociatedTopics[0])]);
sKeywordOnCData := '[';
sKeywordOnClick := '[';
for nCurKeywordTopic := 0 to Length(aAssociatedTopics) - 1 do
begin
if nCurKeywordTopic > 0 then
begin
sKeywordOnCData := sKeywordOnCData + ',';
sKeywordOnClick := sKeywordOnClick + ',';
end;
sKeywordOnCData := sKeywordOnCData + format('[\''%s\'',\''%s.html\'']', [StringReplace(HTMLEncode(HndTopics.GetTopicCaption(aAssociatedTopics[nCurKeywordTopic])), '''', '\\\''', [rfReplaceAll]), HndTopics.GetTopicHelpId(aAssociatedTopics[nCurKeywordTopic])]);
sKeywordOnClick := sKeywordOnClick + format('[''%s'',''%s.html'']', [StringReplace(HTMLEncode(HndTopics.GetTopicCaption(aAssociatedTopics[nCurKeywordTopic])), '''', '\''', [rfReplaceAll]), HndTopics.GetTopicHelpId(aAssociatedTopics[nCurKeywordTopic])]);
end;
sKeywordOnCData := sKeywordOnCData + ']';
sKeywordOnClick := sKeywordOnClick + ']';
end
else begin
sKeywordLink := '#';
sKeywordOnCData := '[]';
sKeywordOnClick := '[]';
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('
');
nBlocLevel := nBlocLevel - 1;
end;
end;
// Keyword class
if nCurKeywordChildrenCnt > 0 then sKeywordClass := 'folder'
else sKeywordClass := 'file';
%>
');
nBlocLevel := nBlocLevel + 1;
end
else begin
print('
');
end;
// Close the last keyword
if (HndKeywords.GetKeywordNext(sCurrentKeyword) = '') then
begin
while nBlocLevel > 0 do
begin
print('');
nBlocLevel := nBlocLevel - 1;
end;
end;
end;
%>
<%
end;
// --- Search TAB --- //
if HndGeneratorInfo.GetCustomSettingValue('TocSearchShow') then begin
%>