<?php
	$addon['name'] = 'Grafana';
	$addon['icon'] = 'file-o';
	
	global $sitefolder;
	
	$path = $sitefolder.'/addons';
	if (!file_exists($path))
	{
		mkdir($path);
	}
	$path .= '/grafana.txt';
	
	if (file_exists($path))
		$url = file_get_contents($path);
		
	global $addins;
			
	if (in_array('grafana',$addins->enabledaddons))
	{		
		if (!isset($url))
		{
			$path = "http://".$_SERVER['HTTP_HOST'].":3000";
		}
		else
		{
			$path = $url;
		}
		$addon['menu'] = array();
		$addon['menuicon'] = 'line-chart';
		$addon['menuname'] = 'Grafana';
		$itm['href'] = $path;
		$addon['menu'][] = $itm;
	}

?>