{=include-block:Y_Blocks.txt;rc_variables=}
{=include-block:Y_Blocks.txt;management_check_top=}
{=include-block:Y_Blocks.txt;head=}
<script src="/Y_Baselib.js"></script>
<script>
function do_submit(){
	show_waitbox(true);
	do_reload = false;
	style_new = document.f.style.value;
	if (style_old != style_new)
	{
		do_reload = true;
		loadSyncURL("/control/exec?Y_Tools&style_set&" + style_new);
	}
	yhttpd_cache_clear("");
	document.f.submit();
	if (do_reload == true)
	{
		alert("Style changed. Maybe you'll have to reload this site.");
		/* ugly mess */
		top.top_main.prim_menu.location.reload();
		top.top_main.base.sec_menu.location.reload();
		//FIXME top.top_main.base.work.location.reload();
		top.top_left.location.reload();
		top.top_right.location.reload();
	}
}
function do_init(){
	var val = "{=ini-get:/var/tuxbox/config/yWeb.conf;fb;0~open=}";
	var cst = (loadSyncURL("/control/info?hwinfo").indexOf("CST") > -1);
	var fb_options = document.f.fb.getElementsByTagName("option");
	for (var i = 0; i < fb_options.length; i++)
	{
		if (fb_options[i].value == val)
			document.f.fb.selectedIndex = i;
		if (cst)
		{
			// rc_cst_trinity_duo is the last cst rc in selection
			if (val > {=var-get:_rc_cst_trinity_duo=})
				val = {=var-get:_rc_auto=};
			if (fb_options[i].value > {=var-get:_rc_cst_trinity_duo=})
				fb_options[i].disabled = true;
		}
	}
	obj_set_radio_value('screenshot_rc', "{=ini-get:/var/tuxbox/config/yWeb.conf;screenshot_rc;false~cache=}");
	val = "{=ini-get:/var/tuxbox/config/yWeb.conf;start_page;bouquets~cache=}";
	var sel=4;
	switch(val){
		case "bouquets": sel=0; break;
		case "control": sel=1; break;
		case "remote": sel=2; break;
		case "screenshot": sel=3; break;
	}
	document.f.start_page.selectedIndex = sel;
	style_old = "{=ini-get:/var/tuxbox/config/yWeb.conf;style~cache=}";
	if ("{=ini-get:/var/tuxbox/config/yWeb.conf;yweb_box_name=}" == "${HOSTNAME}") {
		document.f.hostname.checked = true;
		document.f.yweb_box_name.value = "${HOSTNAME}";
		document.f.yweb_box_name.readOnly = true;
		document.f.yweb_box_name.style.color='#aaaaaa'
	}
}
function do_switch_hostname()
{
	if(document.f.hostname.checked == true)
	{
		document.f.yweb_box_name.value = "${HOSTNAME}";
		document.f.yweb_box_name.readOnly = true;
		document.f.yweb_box_name.style.color='#aaaaaa'
	}
	else
	{
		document.f.yweb_box_name.value = "";
		document.f.yweb_box_name.readOnly = false;
		document.f.yweb_box_name.style.color='#555555'
		document.f.yweb_box_name.focus();
	}
}
</script>
<style>
input[type="text"],
select {
	width: 220px;
}
</style>
{=include-block:Y_Blocks.txt;head_close=}
<body onload="do_init()">
{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=}
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:menu=yWeb=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
	<form name="f" class="y_form" action="/y/cgi">
		<table border="0" class="y_form_table">
			<tr><td class="y_form_header" colspan="4">{=L:set.yweb.management_IPs=}</td></tr>
			<tr>
				<td>IP 1</td>
				<td colspan="3"><input type="text" name="managementIP" size="15" value="{=ini-get:/var/tuxbox/config/yWeb.conf;management_ip=}" title="{=L:set.yweb.enter_ip_desc=}"/></td>
			</tr>
			<tr>
				<td>IP 2</td>
				<td colspan="3"><input type="text" name="managementIP2" size="15" value="{=ini-get:/var/tuxbox/config/yWeb.conf;management_ip2=}" title="{=L:set.yweb.enter_ip_desc=}"/></td>
			</tr>
			<tr><td class="y_form_header" colspan="4">{=L:set.yweb.wake_on_lan=}</td></tr>
			<tr>
				<td>MAC 1</td>
				<td><input type="text" name="wol_mac_1" size="17" value="{=ini-get:/var/tuxbox/config/yWeb.conf;wol_mac_1=}" title="{=L:set.yweb.enter_mac_desc=}"/></td>
				<td>{=L:set.yweb.description=}</td>
				<td><input type="text" name="wol_desc_1" size="17" value="{=ini-get:/var/tuxbox/config/yWeb.conf;wol_desc_1=}" title="{=L:set.yweb.enter_description_desc=}"/></td>
			</tr>
			<tr>
				<td>MAC 2</td>
				<td><input type="text" name="wol_mac_2" size="17" value="{=ini-get:/var/tuxbox/config/yWeb.conf;wol_mac_2=}" title="{=L:set.yweb.enter_mac_desc=}"/></td>
				<td>{=L:set.yweb.description=}</td>
				<td><input type="text" name="wol_desc_2" size="17" value="{=ini-get:/var/tuxbox/config/yWeb.conf;wol_desc_2=}" title="{=L:set.yweb.enter_description_desc=}"/></td>
			</tr>
			<tr>
				<td>MAC 3</td>
				<td><input type="text" name="wol_mac_3" size="17" value="{=ini-get:/var/tuxbox/config/yWeb.conf;wol_mac_3=}" title="{=L:set.yweb.enter_mac_desc=}"/></td>
				<td>{=L:set.yweb.description=}</td>
				<td><input type="text" name="wol_desc_3" size="17" value="{=ini-get:/var/tuxbox/config/yWeb.conf;wol_desc_3=}" title="{=L:set.yweb.enter_description_desc=}"/></td>
			</tr>
			<tr><td class="y_form_header" colspan="4">{=L:set.yweb.box_tag=}</td></tr>
			<tr>
				<td>{=L:set.yweb.box_tag=}</td>
				<td colspan="3"><input type="text" name="yweb_box_name" size="17" value="{=ini-get:/var/tuxbox/config/yWeb.conf;yweb_box_name=}"
					title="{=L:set.yweb.box_tag_desc=}"/>
					<input type="checkbox" name="hostname" value="Hostname" onclick="do_switch_hostname()"/> Hostname
				</td>
			</tr>
			<tr>
				<td>{=L:set.yweb.box_color=}</td>
				<td colspan="3"><input type="text" name="yweb_box_color" size="8" value="{=ini-get:/var/tuxbox/config/yWeb.conf;yweb_box_color=}"
					title="{=L:set.yweb.box_color_desc=}"/></td>
			</tr>
			<tr><td class="y_form_header" colspan="4">{=L:bc.menue.screenshot=}</td></tr>
			<tr>
				<td>{=L:set.yweb.screenshot_rc=}</td>
				<td colspan="3">
					<input type="radio" name="screenshot_rc" value="false" />{=L:off=}&nbsp;
					<input type="radio" name="screenshot_rc" value="true" />{=L:on=}
				</td>
			</tr>
			<tr>
				<td>{=L:set.yweb.screenshot_timeout=}</td>
				<td colspan="3">
					<input type="number" name="screenshot_timeout" size="3" min="0" max="180" value="{=ini-get:/var/tuxbox/config/yWeb.conf;screenshot_timeout;15=}" title="{=L:set.yweb.screenshot_timeout=}"/>
				</td>
			</tr>
			<tr><td class="y_form_header" colspan="4">{=L:others=}</td></tr>
			<tr>
				<td>{=L:set.yweb.remote=}</td>
				<td colspan="3">
					<select name="fb" title="{=L:remote=}">
						<option value="{=var-get:_rc_dbox_philips=}">d-Box Philips</option>
						<option value="{=var-get:_rc_dbox_nokia_old=}">d-Box Nokia (alt)</option>
						<option value="{=var-get:_rc_auto=}" selected="selected">{=L:automatic=}</option>
						<option value="{=var-get:_rc_cst_neo=}">CST HD-1 BSE</option>
						<option value="{=var-get:_rc_cst_zee=}">CST HD-1plus Neo</option>
						<option value="{=var-get:_rc_cst_neo2=}">CST HD-1plus Zee/Neo2</option>
						<option value="{=var-get:_rc_cst_tank=}">CST HD-1plus Neo Twin</option>
						<option value="{=var-get:_rc_cst_trinity=}">CST HD-2 Tank</option>
						<option value="{=var-get:_rc_cst_zee2=}">CST HD-2 Trinity</option>
						<option value="{=var-get:_rc_cst_link=}">CST HD-2 Link</option>
						<option value="{=var-get:_rc_cst_trinity_duo=}">CST HD-2 Trinity Duo</option>
						<option value="{=var-get:_rc_ax_hd51=}">AX HD51</option>
						<option value="{=var-get:_rc_ax_hd60=}">AX HD60</option>
						<option value="{=var-get:_rc_ax_hd61=}">AX HD61</option>
						<option value="{=var-get:_rc_axas_e4hd=}">E4HD 4K Ultra</option>
						<option value="{=var-get:_rc_protek_4k_uhd=}">Protek 4K UHD</option>
						<option value="{=var-get:_rc_mutant_hd51=}">Mutant HD51</option>
						<option value="{=var-get:_rc_mutant_hd60=}">Mutant HD60</option>
						<option value="{=var-get:_rc_maxytec_multibox=}">Mayxtec Multibox 4K</option>
						<option value="{=var-get:_rc_maxytec_multiboxse=}">Mayxtec Multibox SE 4K</option>
						<option value="{=var-get:_rc_wwio_breeze4k=}">WWIO BRE2ZE 4K</option>
						<option value="{=var-get:_rc_airdigital_zgemma_h7=}">AirDigital Zgemma H7</option>
						<option value="{=var-get:_rc_vuplus_solo4k=}">VU+ Solo 4K</option>
						<option value="{=var-get:_rc_vuplus_duo4k=}">VU+ Duo 4K</option>
						<option value="{=var-get:_rc_vuplus_duo4kse=}">VU+ Duo 4K SE</option>
						<option value="{=var-get:_rc_vuplus_ultimo4k=}">VU+ Ultimo 4K</option>
						<option value="{=var-get:_rc_vuplus_uno4k=}">VU+ Uno 4K</option>
						<option value="{=var-get:_rc_vuplus_uno4kse=}">VU+ Uno 4K SE</option>
						<option value="{=var-get:_rc_vuplus_zero4k=}">VU+ Zero 4K</option>
						<option value="{=var-get:_rc_vuplus_duo=}">VU+ Duo</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>{=L:set.yweb.start_page=}</td>
				<td colspan="3">
					<select name="start_page" title="{=L:start_page=}">
						<option value="bouquets" selected="selected">{=L:bc.menue.bouquets=}</option>
						<option value="control">{=L:bc.menue.control=}</option>
						<option value="remote">{=L:bc.menue.remote=}</option>
						<option value="screenshot">{=L:bc.menue.screenshot=}</option>
						<option value="none">{=L:empty=}</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>Styles</td>
				<td colspan="3">
					<select name="style" title="Style">
						{=script:Y_Tools style_get=}
					</select>
				</td>
			</tr>
		</table>
		<br/>
		<input type="hidden" name="tmpl" value="Y_Settings_yWeb.yhtm"/>
		<input type="hidden" name="execute" value="include-block:Y_Blocks.txt;yWeb_save_settings;nix"/>
		<button type="button" ytype="save" title="{=L:save_values_desc=}" onclick="do_submit()">{=L:save=}</button>
	</form>
	</div>
</div>
</body>
</html>
{=include-block:Y_Blocks.txt;management_check_bottom=}

