<div id="primary_header">
	<h1><?php print $this->translate('Contact Settings')?></h1>
</div>

<div id="primary_content">
	<div id="primary_content_inner">
		<div id="Flash" class="flash_notice"><?php echo $this->translate('The settings have been updated') ?></div>
		
		<br />
		<div id="relay-table" class="contactSettings">
			<?php echo $this->render('settings/serverlist.phtml'); ?>
		</div>
		

		<div class="divider"/>
		
		<form id="settingsForm" method="post" action="<?php echo $this->moduleBaseUrl ?>/settings/serversave">
			<input type="hidden" name="save" value="1" />
			<table class='settings' id='carddav'>
			
				<tr>
					<td class="label"><?php echo $this->translate('Add Account') ?></td>
					<td>
						<strong><?php echo $this->translate('Specify a CardDAV (Open Protocol for Contact Data) server to add to your Webmail contact tab.') ?></strong>
						<small><?php echo $this->translate('This creates an connection to an external addressbook server for contact data.') ?></small>
					</td>
				</tr>
				
				<!--
				<tr>
					<td class="label"><?php print $this->translate('Server Type')?></td>
					<td>
						<select name="serverType" id='serverType'>
							<option value="CardDAV">CardDAV</option>
						</select>
						<small><?php print $this->translate('Specify the server type')?></small>
					</td>
				</tr>
				-->
				<tr>
					<td class="label"><?php print $this->translate('Server Address')?></td>
					<td>
						<input type="text" name='server' id='server' />
						<small><?php print $this->translate('Specify the hostname/IP for the CardDAV server')?></small>
					</td>
				</tr>
				<tr style="display:none">
					<td class="label"><?php print $this->translate('Server Port')?></td>
					<td>
						<input type="text" name='port' id='port' value='8800'/>
						<small><?php print $this->translate('Specify the port for the CardDAV server')?></small>
					</td>
				</tr>
				<tr>
					<td class="label"><?php print $this->translate('Username')?></td>
					<td>
						<input type="text" name='username' id='username' />
						<small><?php print $this->translate('Specify the username to authenticate with the server')?></small>
					</td>
				</tr>
			
				<tr>
					<td class="label"><?php print $this->translate('Password')?></td>
					<td>
						<input type="password" name="password" />
						<small><?php print $this->translate('Specify the password for the supplied account')?></small>
					</td>
				</tr>

				<tr style="display:none">
					<td class="label"><?php print $this->translate('URL')?></td>
					<td>
						<input type="url" name='url' id='url' />
						<small><?php print $this->translate('Specify the url for the addressbook')?></small>
					</td>
				</tr>
				
				</table>
				
				<div class="divider"/>
				
				<table class='settings' id='' style="margin-top: 5px;">
				
				<tr>
					<td class="label"></td>
					<td>
						<div id="add_contact_action" class="contacts-add">
							<a href="#">
								<span class="stronglastword"><?php echo $this->translate('Add Account') ?></span>
							</a>
						</div>
					</td>
				</tr>
				
				</table>
			
				
			
			
			</form>

		</div>

<script type="text/javascript">	
	$(function() 
	{
		
		$('#add_contact_action a', '#abook').bind("click", function() { 
			
			$("#Flash", "#abook").hide();
			$.php($("#settingsForm", '#abook').attr("action"),$("#settingsForm", "#abook").serializeArray());
			
		});
		$('.stronglastword').each( function() { $(this).stronglastword() });		
	});
	
</script>
