");
return 0;
}
/**
* Rename of unmapped channel
*/
static int
ajax_transport_rename_channel(http_connection_t *hc, http_reply_t *hr,
const char *remain, void *opaque)
{
th_transport_t *t;
const char *newname;
htsbuf_queue_t *tq = &hr->hr_q;
if(remain == NULL || (t = transport_find_by_identifier(remain)) == NULL)
return HTTP_STATUS_NOT_FOUND;
if((newname = http_arg_get(&hc->hc_req_args, "newname")) == NULL)
return HTTP_STATUS_BAD_REQUEST;
free((void *)t->tht_chname);
t->tht_chname = strdup(newname);
ajax_a_jsfuncf(tq, newname,
"tentative_chname('chname_%s', "
"'/ajax/transport_rename_channel/%s', '%s')",
t->tht_identifier, t->tht_identifier, newname);
http_output_html(hc, hr);
t->tht_config_change(t);
return 0;
}
/**
*
*/
void
ajax_transport_build_mapper_state(char *buf, size_t siz, th_transport_t *t,
int mapped)
{
if(mapped) {
snprintf(buf, siz,
"$('chname_%s').innerHTML='%s';\n\r"
"$('map_%s').src='/gfx/mapped.png';\n\r",
t->tht_identifier, t->tht_ch->ch_name,
t->tht_identifier);
} else {
snprintf(buf, siz,
"$('chname_%s').innerHTML='"
"