File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/admin/templates/view.form.tpl
{template="header"}
<script type="text/javascript" src="../javascript/jquery.form.js"></script>
<script type="text/javascript" src="../javascript/jquery.field.js"></script>
<script type="text/javascript" src="{$config.siteURL}/js.php?f=admin.validator&section={$section}&a=1"></script>
<script type="text/javascript">
<!--
var currLogic = 'AND';
function updateLogic(AndOr) {
currLogic = AndOr;
$('.RowTypeFilter').html(AndOr);
}
$(document).ready(function() {
$('#match_UseAND').bind('change', function() { updateLogic('AND'); });
$('#match_UseOR').bind('change', function() { updateLogic('OR'); });
if($('#match_UseOR:checked').length > 0) {
$('#match_UseOR').click();
updateLogic('OR');
} else {
$('#match_UseAND').click();
updateLogic('AND');
}
{$onLoadEditFilters}
var options = {
success: showResponse
};
$('#frmView').ajaxForm(options);
$('.CancelButton').click(function(){
if (confirm('{$lang.ConfirmCancelJS}')) {
location.href = "index.php?section={$section}&action=view";
}
});
});
function showResponse(xml, statusText) {
var redirect = $('redirect', xml).text();
if(redirect) {
window.top.location = redirect;
} else {
$('#MainMessage').successMessage($('message', xml).text());
$('#viewid').val($('viewid', xml).text());
}
}
function validateForm(redirect) {
var result = false;
var errormsgs = [];
if(redirect) {
$('#saveexit').val('true');
}
// House-keeping
$('.validation_error').remove();
// Validation entries
{$formvalidate}
// If we have no errors
if(errormsgs.length == 0) {
// Complete the submission
$('#MessageTable').hide();
$('#frmView').submit();
return;
}
// Otherwise we're displaying errors and waiting for next input
$('html').scrollTo( 'body', 500 );
ErrorMessage('{$lang.ContentSaveErrors|sprintf,"view"}', errormsgs);
}
function FieldName(field) {
var lang = { {$fieldLangs} };
return eval('lang.' + field);
}
function ErrorMessage(error,arrMsgs){
var val = '';
if(arrMsgs.length > 0){
val = error+"<ul>";
for(i=0;i<arrMsgs.length;i++){
val += '<li>' + arrMsgs[i] + '</li>';
}
val += "</ul>";
}else{
val = error;
}
$('#MainMessage').errorMessage(val);
}
//--></script>
{template="common.form.top"}
</div>
</td></tr></table>
</div>
<form action="remote.php?section={$section}&action=saveview" enctype="multipart/form-data" name="frmView" id="frmView" method="post">
<input type="hidden" name="viewid" id="viewid" value="{$ViewID}" />
<input type="hidden" name="saveexit" id="saveexit" value="false" />
<div style="padding-left:20px;">
<input type="button" name="saveonly" value="{$lang.Save}" class="FormButton" onClick="validateForm(false);">
<input type="button" name="saveandexit" value="{$lang.SaveAndExit}" class="FormButton" onClick="validateForm(true);">
<input type="button" value="{$lang.Cancel}" class="FormButton CancelButton" />
</div>
<div class="BodyContainer Intro" id="random">
{$formfields}
{if sizeof($tpl.JSfiles) > 0}
{foreach from=$tpl.JSfiles key=key item=file id=jsFileLoop}
{if $tpl.JSfilesIF.$key !== false}
<!--[if {$tpl.JSfilesIF.$key}]><script type="text/javascript" src="{$file}"></script><![endif]-->
{else}
<script type="text/javascript" src="{$file}"></script>
{/if}
{/foreach}
{/if}
<div style="padding-left:185px;">
<input type="button" name="saveonly" value="{$lang.Save}" class="FormButton" onClick="validateForm(false);">
<input type="button" name="saveandexit" value="{$lang.SaveAndExit}" class="FormButton" onClick="validateForm(true);">
<input type="button" value="{$lang.Cancel}" class="FormButton CancelButton" />
</div>
</div>
</form>
{template="footer"}