return strtab2htsmsg_str(tab, 1, lang);
}
+static const char *access_entry_doc[] = {
+ N_("Setting up access control is an important initial step as "
+ "**the system is initially wide open**."),
+ N_("Tvheadend verifies access by scanning through all enabled access control "
+ "entries in sequence, from the top of the list to the bottom. "
+ "The permission flags, streaming profiles, DVR config profiles, "
+ "channel tags and so on are combined for all matching access entries. "
+ "An access entry is said to match if the username matches and the IP "
+ "source address of the requesting peer is within the prefix. There is "
+ "also anonymous access, if the user is set to asterisk. Only network "
+ "prefix is matched then."),
+ NULL
+};
+
const idclass_t access_entry_class = {
.ic_class = "access",
.ic_caption = N_("Access"),
.ic_event = "access",
.ic_perm_def = ACCESS_ADMIN,
+ .ic_doc = access_entry_doc,
.ic_save = access_entry_class_save,
.ic_get_title = access_entry_class_get_title,
.ic_delete = access_entry_class_delete,
const char *ic_class; ///< Class name
const char *ic_caption; ///< Class description
const char *ic_order; ///< Property order (comma-separated)
+ const char **ic_doc; ///< NULL terminated array of strings
const property_group_t *ic_groups; ///< Groups for visual representation
const property_t *ic_properties; ///< Property list
const char *ic_event; ///< Events to fire on add/delete/title
htsbuf_queue_t *hq = &hc->hc_reply;
htsmsg_t *m, *l, *n, *e, *x;
htsmsg_field_t *f, *f2;
- const char *s;
- int nl = 0;
+ const char *s, **doc;
+ int nl = 0, first = 1;
pthread_mutex_lock(&global_lock);
ic = idclass_find(clazz);
pthread_mutex_unlock(&global_lock);
return HTTP_STATUS_NOT_FOUND;
}
+ doc = ic->ic_doc;
m = idclass_serialize(ic, lang);
pthread_mutex_unlock(&global_lock);
s = htsmsg_get_str(m, "caption");
if (s) {
- md_header(hq, "####", s);
+ md_header(hq, "##", s);
nl = 1;
}
+ for (; *doc; doc++) {
+ md_nl(hq, 1);
+ md_text(hq, NULL, NULL, tvh_gettext_lang(lang, *doc));
+ md_nl(hq, 1);
+ }
l = htsmsg_get_list(m, "props");
HTSMSG_FOREACH(f, l) {
n = htsmsg_field_get_map(f);
if (!n) continue;
s = htsmsg_get_str(n, "caption");
if (!s) continue;
+ if (first) {
+ md_nl(hq, 1);
+ md_nl(hq, 1);
+ htsbuf_append_str(hq, "####");
+ htsbuf_append_str(hq, tvh_gettext_lang(lang, N_("Items")));
+ md_nl(hq, 1);
+ md_nl(hq, 1);
+ htsbuf_append_str(hq, tvh_gettext_lang(lang, N_("The items have the following functions:")));
+ md_nl(hq, 1);
+ first = 0;
+ }
nl = md_nl(hq, nl);
md_style(hq, "**", s);
md_nl(hq, 1);
}
md_nl(hq, 1);
}
- htsmsg_print(n);
}
htsmsg_destroy(m);
return 0;