diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-04 13:30:58 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-04 13:31:20 (EDT) |
commit | 5eb7fd6635d47317ecce261940bb6e951abdc5c8 (patch) | |
tree | 77e95655100644368277a00992b822f5bfe41a82 | |
parent | fe24da629d0e96795e5e2c368964fc2e60118f04 (diff) | |
download | marquee-5eb7fd6635d47317ecce261940bb6e951abdc5c8.zip marquee-5eb7fd6635d47317ecce261940bb6e951abdc5c8.tar.gz marquee-5eb7fd6635d47317ecce261940bb6e951abdc5c8.tar.bz2 |
mq_html_input_radio(): Allow label to be disabled
-rw-r--r-- | src/utils/html.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/utils/html.c b/src/utils/html.c index 744e74d..ac4ae9f 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -685,9 +685,20 @@ gchar * mq_html_input_radio(const gchar *name, const gchar *id, const gchar *label, gboolean checked) { - return g_strdup_printf("<label for=\"%s\">\n<span>%s:</span>\n" - "<input type=\"radio\" name=\"%s\" id=\"%s\"%s>\n</label>\n", - name, label, name, id, checked ? " checked=\"checked\"" : ""); + if (label && label[0]) { + return g_strdup_printf( + "<label for=\"%s\">\n<span>%s:</span>\n" + "<input type=\"radio\" name=\"%s\" " + "id=\"%s\"%s>\n" + "</label>\n", + name, label, name, id, + checked ? " checked=\"checked\"" : ""); + } else { + return g_strdup_printf( + "<input type=\"radio\" name=\"%s\" id=\"%s\"%s>\n", + name, id, + checked ? " checked=\"checked\"" : ""); + } } gchar * |