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

</div>

<div id="primary_content">
	<div id="primary_content_inner">
		<div id="Flash" class="flash_notice"><?php print $this->translate('The settings have been updated') ?></div>
		
	    <div id="licence-error" class="default_notice">
			<?php echo $this->translate("Extend your Atmail installation by downloading API Mashups at <a href='http://atmail.com/plugins/#API' target='_blank'>http://atmail.com/plugins/</a>") ?>
	    </div>

		<form id="settingsForm" method="post" action="<?php echo $this->moduleBaseUrl ?>/services/apisave">
			<input type="hidden" name="save" value="1" />
			<table class="settings">
				<tr>
					<td class="label"><?php print $this->translate('JSON API')?></td>
					<td>
						<strong>Available by default</strong>
						<small><?php print $this->translate('JSON access to the Atmail API (Mail, Contacts, Calendaring) for 3rd party mashups and script usage.')?></small>
					</td>
				</tr>
			</table>

			<div class="divider"/>

			<table class="settings">
				<tr>
					<td class="label"><?php print $this->translate('Enable JSON-P API')?></td>
					<td>
						<input name="fields[jsonpAPI]" type='hidden' value="0"/>
						<input name="fields[jsonpAPI]" type="checkbox" class="iphoneStyle" value="1" <?php echo ($this->global['jsonpAPI']) ? 'checked' : '' ?>>
						<small><?php print $this->translate('JSON-P is a complement to the base JSON data format, allowing a page to request data from a server in a different domain. This is required when using a Javascript mashup which is outside of the domain used for Atmail to bypass browser restrictions. JSON-P is off by default for security.')?></small>
					</td>
				</tr>
			</table>

			<div class="divider"/>

			<table class="settings">
				<tr>
					<td class="label"><?php print $this->translate('Atmail Geo-location API')?></td>
					<td>
						<input name="fields[resolveLogIPsToGeoLocationViaAtmailGeoLocationServer]" type='hidden' value="0"/>
						<input name="fields[resolveLogIPsToGeoLocationViaAtmailGeoLocationServer]" type="checkbox" class="iphoneStyle" value="1" <?php echo ($this->global['resolveLogIPsToGeoLocationViaAtmailGeoLocationServer']) ? 'checked' : '' ?>>
						<small><?php print $this->translate('This feature enables looking up the geo-location of logged IP addresses using the Atmail Geo-location Server API.')?></small>
					</td>
				</tr>
			</table>
		</form>
		<div class="divider"></div>
		
		<table class="settings">

	  <tr>
	    <td class="label"></td>
	    <td>
			<div id="back_button" style="margin-left:0px; margin-top: 0px;">
				<a href="#">
					<span class="stronglastword"><?php echo $this->translate('Save Settings') ?></span>
				</a>
			</div>
			</td>
	  </tr>

		</table>
		
		
	</div>
</div>

<script type="text/javascript">
$( function(){
	var tabId = '#API_Access';
	perform_service_common_binds(tabId);
});

</script>
