File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/admin/templates/user.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="../javascript/jquery/plugins/ajax.file.upload.js"></script>
<script type="text/javascript" src="{$config.siteURL}/js.php?f=admin.validator&section={$section}&a=1"></script>
<script type="text/javascript"><!--
$(document).ready(function() {
var options = {
success: showResponse,
dataType: 'xml'
};
$('#frmUser').submit(function(){ RunCallbacks('beforePost'); }).ajaxForm(options);
$('#interactive').click(function() {
changeUpFields();
});
$('.CancelButton').click(function(){
if (confirm('{$lang.ConfirmCancelJS}')) {
location.href = "index.php?section=user&action=view";
}
});
changeUpFields();
});
var setGroup = false;
function changeUpFields() {
var count = $('#interactive:checked').length;
if(count < 1) {
$('#username_row').fadeOut('fast');
if($('#username').val().length < 1) {
$('#username').val('.');
}
if($('#groupidcsv_old').selectedValues().length == 0) {
$('#ISelectorgroupidcsv_1').click();
setGroup = true;
} else {
setGroup = false;
}
$('#passA_row').fadeOut('fast');
$('#passB_row').fadeOut('fast');
$('#adsenseid_row').fadeOut('fast');
$('#channelid_row').fadeOut('fast');
$('#groupidcsv_row').fadeOut('fast');
$('#status_row').fadeOut('fast');
} else {
$('#username_row').fadeIn('fast');
if($('#username').val() == ".") {
$('#username').val('');
}
$('#passA_row').fadeIn('fast');
$('#passB_row').fadeIn('fast');
$('#adsenseid_row').fadeIn('fast');
$('#channelid_row').fadeIn('fast');
$('#groupidcsv_row').fadeIn('fast');
if(setGroup) {
$('#ISelectorgroupidcsv_1').click();
}
$('#status_row').fadeIn('fast');
}
}
function FieldName(field) {
var lang = { {$fieldLangs} };
return eval('lang.' + field);
}
function validateForm(isExit) {
var result = false;
var errormsgs = [];
// Clean out any previous errors
$('.validation_error').remove();
// The validation entries coming through from the validation object
{$formvalidate}
// If we have no errors
if(errormsgs.length == 0) {
// Complete the submission
$('#MainMessage').hide();
$('#frmUser').submit();
return;
}
// Otherwise we're displaying errors and waiting for next input
$('html').scrollTo( 'body', 500 );
ErrorMessage('{$lang.ContentSaveErrors|sprintf,"user"}', errormsgs);
}
function showResponse (xml, statusText) {
if($('redirect', xml).text() == "true") {
window.top.location = "index.php?section=user&action=view";
} else if($('status', xml).text() == "0") {
$('#MainMessage').errorMessage($('message', xml).text());
} else {
$('#MainMessage').successMessage($('message', xml).text());
$('#userid').val($('userid', xml).text());
currentUploadFileId = $('userid', xml).text();
if($('picture', xml).exists()){
var picture = $('picture', xml).text();
if (picture) {
$('#file_Message').infoMessage("Current Picture: [<a class='fileMsg' href='index.php?section={$section}&action=deletefile&id=" + $('userid', xml).text() + "'>{$lang.Delete}</a>]<br /><br /><img src='" + $('picture', xml).text() + "' />");
delClick();
}
}
}
}
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"}
<form action="remote.php?section=user&action=saveuser" enctype="multipart/form-data" name="frmUser" id="frmUser" method="post">
<input type="hidden" name="savemethod" value="" id="savemethod" />
<input type="button" name="saveonly" id="saveonly" value="{$lang.Save}" class="FormButton" onclick="validateForm(false);">
<input type="button" name="saveandexit" id="saveandexit" value="{$lang.SaveAndExit}" class="FormButton" onclick="$('#savemethod').val('andexit'); validateForm(true);">
<input type="button" value="{$lang.Cancel}" class="FormButton CancelButton" />
<div class="BodyContainer Intro">
{$formfields}
<table class="Panel" style="margin-top:0;"><tbody><tr>
<td class="FieldLabel"> </td>
<td>
<input type="button" name="saveonly" id="saveonly" value="{$lang.Save}" class="FormButton" onclick="validateForm(false);">
<input type="button" name="saveandexit" id="saveandexit" value="{$lang.SaveAndExit}" class="FormButton" onclick="$('#savemethod').val('andexit'); validateForm(true);">
<input type="button" value="{$lang.Cancel}" class="FormButton CancelButton" />
</td>
</tr><tbody></table>
{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>
</form>
{template="footer"}