]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mdhelp: do not show non-ui properties, mark read-only ones
authorJaroslav Kysela <perex@perex.cz>
Sun, 3 Apr 2016 14:27:42 +0000 (16:27 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 3 Apr 2016 14:27:42 +0000 (16:27 +0200)
src/webui/doc_md.c

index 2947839bf66dee59fcfa9db7348e5146b896362e..d2a58829956b5664f1000eb8cdb549423d8070c5 100644 (file)
@@ -131,7 +131,7 @@ http_markdown_class(http_connection_t *hc, const char *clazz)
   htsmsg_t *m, *l, *n, *e, *x;
   htsmsg_field_t *f, *f2;
   const char *s, **doc;
-  int nl = 0, first = 1;
+  int nl = 0, first = 1, b;
 
   pthread_mutex_lock(&global_lock);
   ic = idclass_find(clazz);
@@ -160,6 +160,7 @@ http_markdown_class(http_connection_t *hc, const char *clazz)
   HTSMSG_FOREACH(f, l) {
     n = htsmsg_field_get_map(f);
     if (!n) continue;
+    if (!htsmsg_get_bool(n, "noui", &b) && b) continue;
     s = htsmsg_get_str(n, "caption");
     if (!s) continue;
     if (first) {
@@ -174,6 +175,11 @@ http_markdown_class(http_connection_t *hc, const char *clazz)
     }
     nl = md_nl(hq, nl);
     md_style(hq, "**", s);
+    if (!htsmsg_get_bool(n, "rdonly", &b) && b) {
+      htsbuf_append(hq, " _", 2);
+      htsbuf_append_str(hq, tvh_gettext_lang(lang, N_("(Read-only)")));
+      htsbuf_append(hq, "_", 1);
+    }
     md_nl(hq, 1);
     s = htsmsg_get_str(n, "description");
     if (s) {