d1c82531fdb1f0833584404c75e3c977508e454f
tdreszer
Tue Mar 8 16:23:55 2011 -0800
Added lib routine for creating a single/multiple drop down, where the multiple will be expected to be converted into a ui-dropdownchecklist.js type multi-select
diff --git src/lib/cheapcgi.c src/lib/cheapcgi.c
index d338e3c..9574d27 100644
--- src/lib/cheapcgi.c
+++ src/lib/cheapcgi.c
@@ -1646,30 +1646,104 @@
{
printf("\n");
}
+char *cgiMakeSelectDropList(boolean multiple, char *name, struct slPair *valsAndLabels,char *selected, char *anyAll,char *extraClasses, char *extraHtml)
+// Returns allocated string of HTML defining a drop-down select (if multiple, REQUIRES ui-dropdownchecklist.js)
+// In valsAndLabels, val (pair->name) must be filled in but label (pair->val) may be NULL.
+// selected, if not NULL is a val found in the valsAndLabels (multiple then comma delimited list). If null and anyAll not NULL, that will be selected
+// anyAll, if not NULL is the string for an initial option. It can contain val and label, delimited by a comma
+// extraHtml, if not NULL contains id, javascript calls and style. It does NOT contain class definitions
+{
+struct dyString *output = dyStringNew(1024);
+boolean checked = FALSE;
+
+dyStringPrintf(output,"\n");
+
+return dyStringCannibalize(&output);
+}
+
void cgiMakeDropListWithVals(char *name, char *menu[], char *values[],
int menuSize, char *checked)
/* Make a drop-down list with names and values. In this case checked
* corresponds to a value, not a menu. */
{
int i;
char *selString;
if (checked == NULL) checked = values[0];
printf("