-const char cgi_rcs[] = "$Id: cgi.c,v 1.12 2001/07/29 18:47:05 jongfoster Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.13 2001/07/30 22:08:36 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
*
* Revisions :
* $Log: cgi.c,v $
+ * Revision 1.13 2001/07/30 22:08:36 jongfoster
+ * Tidying up #defines:
+ * - All feature #defines are now of the form FEATURE_xxx
+ * - Permanently turned off WIN_GUI_EDIT
+ * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
+ *
* Revision 1.12 2001/07/29 18:47:05 jongfoster
* Adding missing #include "loadcfg.h"
*
exports = map(exports, "options", 1, csp->config->proxy_args, 1);
s = show_rcs();
exports = map(exports, "sourceversions", 1, s, 0);
- s = show_defines();
- exports = map(exports, "defines", 1, s, 0);
+ exports = show_defines(exports);
#ifdef FEATURE_STATISTICS
exports = add_stats(exports);
exports = map_block_killer(exports, "statistics");
#endif /* ndef FEATURE_STATISTICS */
- exports = map_block_killer(exports, "no-split-args");
-
if (csp->actions_list)
{
exports = map(exports, "actions-filename", 1, csp->actions_list->filename, 1);
}
+/*********************************************************************
+ *
+ * Function : map_conditional
+ *
+ * Description : Convenience function.
+ * Adds an "if-then-else" for the conditional HTML-template
+ * block <name>, i.e. a substitution of the form:
+ * @if-<name>-then@
+ * True text
+ * @else-not-<name>@
+ * False text
+ * @endif-<name>@
+ *
+ * The control structure and one of the alternatives
+ * will be hidden.
+ *
+ * Parameters :
+ * 1 : exports = map to extend
+ * 2 : name = name of conditional block
+ * 3 : choose_first = nonzero for first, zero for second.
+ *
+ * Returns : extended map
+ *
+ *********************************************************************/
+struct map *map_conditional(struct map *exports, char *name, int choose_first)
+{
+ char buf[1000]; /* Will do, since the names are hardwired */
+
+ snprintf(buf, 1000, (choose_first
+ ? "else-not-%s@.*@endif-%s"
+ : "if-%s-then@.*@else-not-%s"),
+ name, name);
+ exports = map(exports, buf, 1, "", 1);
+
+ snprintf(buf, 1000, (choose_first ? "if-%s-then" : "endif-%s"), name);
+ exports = map(exports, buf, 1, "", 1);
+
+ return(exports);
+
+}
+
+
/*********************************************************************
*
* Function : make_menu