<?php

// loginstatus.tpl
// -----------------------------------------------------------------------------
// LoginStatus template
//
// Revision   > $Rev: 137 $
// Date		  > $Date: 2009-11-05 14:00:20 +0000 (Thu, 05 Nov 2009) $
// Author     > RAK for DML
// Copyright  > (C) Digital Mail Limited (2005-2009)
// -------------------------------------------------------------------------------------------------

?>

<script language="javascript" type="text/javascript">

// CREATE 'PUBLIC' JS INTERFACE FOR COMPONENT
dmx.<?=$comp_name;?> = new Object();
dmx.<?=$comp_name;?>.name  = '<?=$comp_name;?>';
dmx.<?=$comp_name;?>.xclass = 'loginstatus';

</script>


<?php if (!$textonly) : ?>

	<!--------------------------->
	<!-- LOGINSTATUS COMPONENT -->
	<!--------------------------->
	
	<div class="dmb0" style="<?=$comp_width;?>">
		<div class="dmx">
			<div class="loginstatus">
				<div class="<?=$comp_name;?>">
				
					<?php if ($showheader && $showborder) : ?>
						<h1 class="bordered">Login status</h1>
					<?php elseif ($showheader) : ?>
						<h1>Login status</h1>
					<?php endif; ?>
					
					<div style="<?=$box_size;?>" <?php if ($showborder) : ?>class="border"<?php endif;?>>
					
						<?php if (!$err_msg) : ?>
						
						<?php if ($comp_err_msg) : ?>
							<span class="error"><?=$comp_err_msg;?><br></span>
						<?php elseif ($comp_msg) : ?>
							<?=$comp_msg;?><br>
						<?php endif; ?>
						
						<?php if ($logged_in) : ?>
							<?php if ($show_dmid) : ?>
								<?=$dmid;?>
								<?php if ($authenticated) : ?>(+)<?php else : ?>(-)<?php endif;?>
							<?php endif;?>
							<a href="<?=DMX_SELF;?>?dmx_action=logout&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=loginstatus" class="infotext">Logout<span class="tipcontents">Logout of your account</span></a>
						<?php else : ?>
							<a href="<?=DMX_SELF;?>?dmx_action=login&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=loginstatus" class="infotext">Login<span class="tipcontents">Login to your account</span></a>
						<?php endif; ?>
						
						<?php else : ?>
						<!-- ERROR HANDLING -->
							<div style="vertical-align: middle;">
							<img src="<?=$dmx_glib;?>interface/error_32.gif" alt="" width="36" height="32" border="0" style="float: left; padding: 0 10px 0 0;"><span class="error">ERROR<br><?=$err_msg;?>
							</div>
						<!-- END ERROR HANDLING -->
						<?php endif; ?>
				
					</div>
				
				</div>
			</div>
		</div>
	</div>

	<!------------------------------->
	<!-- END LOGINSTATUS COMPONENT -->
	<!------------------------------->

<?php else : // text only version ?>

	<?php if ($logged_in) : ?>
		<?php if ($show_dmid) : ?>
			<?=$dmid;?>
			<?php if ($authenticated) : ?>(+)<?php else : ?>(-)<?php endif;?>
		<?php endif;?>
		<a href="<?=DMX_SELF;?>?dmx_action=logout&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=loginstatus" class="infotext">Logout<span class="tipcontents">Logout of your account</span></a>
	<?php else : ?>
		<a href="<?=DMX_SELF;?>?dmx_action=login&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=loginstatus" class="infotext">Login<span class="tipcontents">Login to your account</span></a>
	<?php endif; ?>

<?php endif; ?>

