[comment] There are 3 special help keys: home, faq, and 404. They have editable database entries like any other, but the keys get special handling here. One special token can be used in the helptext: ~~HELP_TOPICS~~. It's replaced with an HTML list of links to all help topics except the three listed above and whatever the current topic is. [/comment] [tmp fontface]Verdana, Arial, Helvetica, sans-serif[/tmp] [comment] This is a grievous hack made necessary by Apache mod_rewrite, which re-urlencodes query strings on a rewrite. [/comment] [tmp help_key][/tmp] [calc] my $topic = $CGI->{topic}; $topic =~ s/\%(\w\w)/chr( hex($1))/eg; $Scratch->{help_orig} = $Scratch->{help_key}=$topic; return; [/calc] [if scratch help_key =~ /^\s*$/] [tmp help_key]home[/tmp] [/if] [if type=data term="@_UI_HELP_TABLE_@::code::[scratch help_key]" op=eq compare=""] [tmp help_key]404[/tmp] [/if] [tmp help_title] [either] [data table=@_UI_HELP_TABLE_@ field=title key="[scratch help_key]"] [or] [scratch help_key] [/either] [/tmp] [tmp help_text] [either] [data table=@_UI_HELP_TABLE_@ field=helptext key="[scratch help_key]"] [or]

[L]No help text has been entered yet for the key[/L] '[scratch help_key]'.

[L]Perhaps one of these topics will be helpful:[/L]

~~HELP_TOPICS~~ [/either] [/tmp] [calc] if ($Scratch->{help_text} =~ /~~HELP_TOPICS~~/) { my $help_index = < [loop search=" fi=@_UI_HELP_TABLE_@ ra=yes rf=code,title tf=title "] [if type=explicit compare="q{[loop-code]} !~ m{^(?:faq|home|404|\Q[scratch help_key]\E)$}"]
  • [page href="@@MV_PAGE@@" form="topic=[loop-code]"][loop-pos 1] [/if] [/loop] EOF $Scratch->{help_text} =~ s/~~HELP_TOPICS~~/$help_index/g; } return; [/calc] [L]Interchange Help:[/L] [scratch help_title]
    [if scratch help_key ne 'home'] [page href="@@MV_PAGE@@" form="topic=home"]Home [/if] [if scratch help_key ne 'faq'] [page href="@@MV_PAGE@@" form="topic=faq"]FAQ [/if] Back

     
    [scratch help_title]


    [scratch help_text]

    Interchange - © 2001 Red Hat, Inc.