{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
{if $emptydb}
    <TABLE WIDTH="100%"><TR><TD WIDTH="100%" ALIGN="Center">
	<BR><BR><span class="lms-ui-alert">{trans("No such devices in database.")}</span>
    </TD></TR></TABLE>
{elseif !$ming && $type == 'flash'}
    <TABLE WIDTH="100%"><TR><TD WIDTH="100%" ALIGN="Center">
	<BR><BR><span class="lms-ui-alert">{trans("Your PHP does not support Ming library required for map generation!")}</span>
    </TD></TR></TABLE>
{elseif $ming && (!$type || $type=='flash')}
<P ALIGN="CENTER">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100%" HEIGHT="400" id="intro">
<PARAM NAME="movie" VALUE="?m=netdevmap&amp;graph=flash&amp;start={$start}{if $mini}&mini=1{/if}">
<PARAM NAME="loop" VALUE="false">
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#EBE4D6">
<EMBED src="?m=netdevmap&amp;graph=flash&amp;start={$start}{if $mini}&mini=1{/if}" loop="false" quality="high" bgcolor="#EBE4D6" WIDTH="100%" HEIGHT="400" NAME="map"
  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</P>
{elseif $type=='openlayers'}
{include file="openlayers.html"}
<div id="map" class="map"></div>
<script>

	{include file="map.js"}

	$('#lms-ui-contents').show();

	{if $lon && $lat}
	map = createMap(devices, devlinks, nodes, nodelinks, ranges, true, '{$lon}', '{$lat}');
	{else}
	map = createMap(devices, devlinks, nodes, nodelinks, ranges, true);
	{/if}

	$(function() {
		map.updateSize();
	});

	set_lastonline_limit({ConfigHelper::getConfig('phpui.lastonline_limit')});
	setTimeout("netdevmap_refresh()", lastonline_limit * 1000);

</script>
{elseif $gd} {* default if $type is not set or not 'flash' *}
<P ALIGN="CENTER">
<IMG SRC="?m=netdevmap&amp;graph=true&amp;start={$start}{if $mini}&mini=1{/if}" ALT="" USEMAP="#devices">
<MAP NAME="devices">
{section name=devicemap loop=$devicemap}
    <AREA SHAPE="CIRCLE" COORDS="{$devicemap[devicemap].x},{$devicemap[devicemap].y},10"  HREF="?m=netdevinfo&amp;id={$devicemap[devicemap].id}">
{/section}
{section name=nodemap loop=$nodemap}
    <AREA SHAPE="CIRCLE" COORDS="{$nodemap[nodemap].x},{$nodemap[nodemap].y},10"  HREF="?m=nodeinfo&amp;id={$nodemap[nodemap].id}">
{/section}
</MAP>
</P>
{else}
    <TABLE WIDTH="100%"><TR><TD WIDTH="100%" ALIGN="Center">
	<BR><BR><span class="lms-ui-alert">{trans("Your PHP does not support GD library required for map generation!")}</span>
    </TD></TR></TABLE>
{/if}
{if !$emptydb && $type != 'openlayers'}
<P ALIGN="CENTER">
<FORM METHOD="GET" ACTION="?m=netdevmap" NAME="x">
	<INPUT type="submit" class="hiddenbtn">
	{trans("Start map from:")}
	<INPUT TYPE="hidden" NAME="m" VALUE="netdevmap">
	<SELECT SIZE="1" NAME="start" onChange="document.x.submit();">
		{section name=a loop=$deviceslist}
		<OPTION VALUE="{$deviceslist[a].id}"{if $deviceslist[a].id == $start} SELECTED{/if}>{$deviceslist[a].name}</OPTION>
		{/section}
	</SELECT>
	<INPUT TYPE="SUBMIT" VALUE="{trans("Generate")}">
	<INPUT TYPE="CHECKBOX" NAME="mini" VALUE="1"{if $mini} CHECKED{/if}> {trans("only devices")}
</FORM>
</P>
{/if}
{/block}
