<!--// $Id$ //-->
<script type="text/javascript">
<!--
	function removeNodes() {
		document.nodeassignments.oper.value="0";
		document.nodeassignments.submit();
	}

	function changeMembersNetwork() {
		document.nodeassignments.oper.value="2";
		document.nodeassignments.submit();
	}

	function changeOthersNetwork() {
		document.nodeassignments.oper.value="3";
		document.nodeassignments.submit();
	}
//-->
</script>
<P>
<FORM NAME="nodeassignments" METHOD="POST" ACTION="?m=nodegroup&amp;id={$nodegroup.id}">
<INPUT type="submit" class="hiddenbtn">
<INPUT TYPE="hidden" NAME="oper" VALUE="1">
<TABLE WIDTH="100%" CELLPADDING="0">
    <TR><TD WIDTH="49%" style="valign-top">
	    <TABLE class="lmsbox">
                <THEAD>
		<TR>
		    <TD style="width: 100;" class="bold nobr">
			<IMG SRC="img/node.gif" ALT="">&nbsp;<B>{trans("Group members:")}</B>
		    </TD>
		</TR>
		<TR>
		    <TD style="width: 100%;" class="text-center">
			    {trans("Network:")}
			    <SELECT SIZE="1" NAME="nodeassignments[membersnetid]" ONCHANGE="javascript:changeMembersNetwork();">
			    	<OPTION value="0" {if !$membersnetid}SELECTED{/if}>{trans("— all networks —")}</OPTION>
				{section name=networks loop=$networks}
				<OPTION value="{$networks[networks].id}" {if $networks[networks].id == $membersnetid}SELECTED{/if}>{$networks[networks].name|truncate:30:"&hellip;":true}</OPTION>
				{/section}
			    </SELECT>&nbsp;
		    </TD>
		</TR>
                </THEAD>
                <TBODY>
		<TR>
		    <TD WIDTH="100%" ALIGN="CENTER">
		    {if $nodegroup.nodescount}
			<SELECT SIZE="20" NAME="nodeassignments[gmnodeid][]" multiple>
				{section name=node loop=$nodegroup.nodes}
					<OPTION VALUE="{$nodegroup.nodes[node].id}">
					{$nodegroup.nodes[node].nodename|truncate:40:"&hellip;":true} ({$nodegroup.nodes[node].id|string_format:"%04d"})
					</OPTION>
				{/section}
			</SELECT>
		    {else}
			<BR>
			<BR>
			<B>{trans("This group hasn't got any members.")}</B><BR>
			<BR>
			<BR>
		    {/if}
		    </TD>
		</TR>
		<TR>
		    <TD WIDTH="100%" ALIGN="RIGHT" NOWRAP>
			<A HREF="javascript:removeNodes();">{trans("Delete")} <IMG SRC="img/cancel.gif" ALT=""></A>
		    </TD>
		</TR>
                </TBODY>
	    </TABLE>
    </TD>
    <TD WIDTH="2%">
    </TD>
    <TD WIDTH="49%" STYLE="vertical-align: top;">
	    <TABLE class="lmsbox">
                <THEAD>
		<TR>
		    <TD style="width: 100;" class="bold nobr">
			<IMG SRC="img/node.gif" ALT="">&nbsp;<B>{trans("Add new member(s):")}</B>
		    </TD>
		</TR>
		<TR>
		    <TD style="width: 100%;" class="text-center">
			    {trans("Network:")}
			    <SELECT SIZE="1" NAME="nodeassignments[othersnetid]" ONCHANGE="javascript:changeOthersNetwork();">
			    	<OPTION value="0" {if !$othersnetid}SELECTED{/if}>{trans("— all networks —")}</OPTION>
				{section name=networks loop=$networks}
				<OPTION value="{$networks[networks].id}" {if $networks[networks].id == $othersnetid}SELECTED{/if}>{$networks[networks].name|truncate:30:"&hellip;":true}</OPTION>
				{/section}
			    </SELECT>&nbsp;
		    </TD>
		</TR>
                </THEAD>
                <TBODY>
		<TR>
		    <TD WIDTH="100%" ALIGN="CENTER">
			{if $nodescount}
			<SELECT SIZE="20" NAME="nodeassignments[mnodeid][]" multiple>
				{section name=node loop=$nodes}
					<OPTION VALUE="{$nodes[node].id}">
					{$nodes[node].nodename} ({$nodes[node].id|string_format:"%04d"})
					</OPTION>
				{/section}
			</SELECT>
			{else}
			<BR>
			<BR>
			<B>{trans("All nodes are members of this group.")}</B><BR>
			<BR>
			<BR>
			{/if}
		    </TD>
		</TR>
		<TR>
		    <TD WIDTH="100%" ALIGN="RIGHT" NOWRAP>
			<A HREF="javascript:document.nodeassignments.submit();">{trans("Submit")} <IMG SRC="img/save.gif" ALT=""></A>
		    </TD>
		</TR>
            </TBODY>
	</TABLE>
    </TD></TR>
</TABLE>
</FORM>
</P>
