{=var-set:cancache=yPTools=}
{=include-block:Y_Blocks.txt;management_check_top=}
{=include-block:Y_Blocks.txt;head=}
<script src="/Y_Baselib.js"></script>
<script>
function do_submit()
{
	if(document.f.cmd.value != "")
	{
		var app="false";
		if(document.f.appendx.checked == true)
			app="true";
		_url="/control/exec?Y_Tools&cmd&"+document.f.pwd.value +"&"+app+"&"+ encodeURIComponent(document.f.cmd.value);
		out.location.href = _url;
		document.f.cmd.value="";
	}
}
function set_pwd(_pwd)
{
	document.f.pwd.value = _pwd;
}
function do_clear()
{
	document.co.cmds.value = "";
}
/* Cursor to end . works only with IE */
function setCaretToEnd(control)
{
	if (control.createTextRange) {
		var range = control.createTextRange();
		range.collapse(false);
		range.select();
	}
	else if (control.setSelectionRange) {
		control.focus();
		var l = control.value.length;
		control.setSelectionRange(l, l);
	}
}
</script>
{=include-block:Y_Blocks.txt;head_close=}
<body>
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:menu={=L:tools.command_shell=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
	<form name="co" action="">
		<textarea name="cmds" cols="80" rows="18" title="shell output window"></textarea>
	</form>

	<form name="f" target="tmp" onsubmit="do_submit();return false;" action="">
		<table>
		<tr>
			<td><input type="button" name="clear" value="{=L:clear=}" onclick="do_clear()"/></td>
			<td><input type="checkbox" name="appendx" value="1" title="append output (only IE)"/>&nbsp;{=L:tools.cmd_shell.output_desc=}
			</td>
		</tr><tr>
			<td>{=L:tools.path=}:&nbsp;</td>
			<td><input name="pwd" type="text" size="60" maxlength="255" value="/"/></td>
		</tr><tr>
			<td>{=L:tools.command=}:</td>
			<td><input name="cmd" type="text" size="60" maxlength="255" title="{=L:tools.cmd.enter_command=}"/>
			<input type="submit" name="submit" value="{=L:submit=}" title="{=L:tools.cmd.execute_command=}"/></td>
		</tr>
		</table>
	</form>
	</div>
</div>

<iframe height="0" width="0" scrolling="no" align="left" frameborder="0" name="out" id="out">Your Browser does not support IFrames.</iframe>
<iframe height="0" width="0" scrolling="no" align="left" frameborder="0" name="tmp" id="tmp">Your Browser does not support IFrames.</iframe>

<script >
	if(isIE)
		document.f.appendx.checked = true;
	window.document.f.cmd.focus();
</script>
</body>
</html>
{=include-block:Y_Blocks.txt;management_check_bottom=}
