directory[1024]; /* Directory */
cups_file_t *fp; /* Help file */
char line[1024]; /* Line from file */
+ int printable; /* Show printable version? */
/*
cgiInitialize();
+ printable = cgiGetVariable("PRINTABLE") != NULL;
+
/*
* Set the web interface section...
*/
{
perror(filename);
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
cgiSetVariable("ERROR", "Unable to load help index!");
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
{
perror(filename);
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
cgiSetVariable("ERROR", "Unable to access help file!");
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
if ((n = helpFindNode(hi, helpfile, NULL)) == NULL)
{
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
cgiSetVariable("ERROR", "Help file not in index!");
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
* Send a standard page header...
*/
- cgiStartHTML(n->text);
+ if (printable)
+ puts("Content-Type: text/html;charset=utf-8\n");
+ else
+ cgiStartHTML(n->text);
}
else
{
* Send a standard page header...
*/
- cgiStartHTML("Help");
+ cgiStartHTML(cgiText(_("Help")));
}
/*
* Show the search and bookmark content...
*/
- cgiCopyTemplateLang("help-header.tmpl");
+ if (!helpfile || !printable)
+ cgiCopyTemplateLang("help-header.tmpl");
+ else
+ cgiCopyTemplateLang("help-printable.tmpl");
/*
* If we are viewing a file, copy it in now...
* Send a standard trailer...
*/
- cgiEndHTML();
+ if (!printable)
+ cgiEndHTML();
+ else
+ puts("</BODY>\n</HTML>");
/*
* Delete the index...