<?php

defined('VSIGN') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser."); 
$username 	= Kit::GetParam('username', _SESSION, _USERNAME);
?>
<div id="form_container">
	<div id="form_header">
		<div id="form_header_left">
		</div>
		<div id="form_header_right">
		</div>
	</div>

	<div id="form_body">
			<div id="dashbuttons">
				<h2><span class="color"> Welcome to VSign Management Server, <?php echo $username; ?></span></h2>
				<?php
					// Put a menu here
					if (!$menu = new MenuManager($db, $user, 'Dashboard')) trigger_error($menu->message, E_USER_ERROR);
					
					while ($menuItem = $menu->GetNextMenuItem())
					{
						$uri 	= Kit::ValidateParam($menuItem['name'], _WORD);
						$args 	= Kit::ValidateParam($menuItem['Args'], _STRING);
						$class 	= Kit::ValidateParam($menuItem['Class'], _WORD);
						$title 	= Kit::ValidateParam($menuItem['Text'], _STRING);
						$title 	= __($title);
						$img 	= Kit::ValidateParam($menuItem['Img'], _STRING);
						
						$href = 'index.php?p=' . $uri . '&' . $args;
						
						// Override the HREF for the Manual Button
						if ($uri == 'manual')
							$href = $args;
						
						$out = <<<END
							<div class="dashicons">
								<a id="$class" alt="$title" href="$href">
								<img class="dash_button" src="$img"/>
								<span class="dash_text">$title</span></a>
							</div>
END;
						echo $out;
					}
				?>
			</div>	
	</div>
	
	<div id="form_footer">
		<div id="form_footer_left">
		</div>
		<div id="form_footer_right">
		</div>
	</div>
</div>