File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/admin/templates/lists.form.js.tpl
<script type="text/javascript">
<!--
// ----- Javascript that relies on PHP set variables ----- //
// The counter to make the ID's for each filer unique
var filterCounter = 0;
var currentContentDataType = '';
var linkRow = '';
var defaultStaticLinkText = "{$lang.DefaultLinkText}";
var defaultStaticLinkUrl = "{$lang.DefaultLinkUrl}";
var globalTmpIdNum = 0;
var linkRowCounter = 0;
var objContentTypeList = {$jsonContentTypeList};
// These are the fields that a category has:
var typeName = Array();
var optionInfo = Array();
var TypeList = Array();
var ValueField = Array();
// Categories
var CategoryFields = { '0': '{$lang.ListPleaseSelectField}', {$categoryFields} };
var DefaultSelectedCategoryField = 'sortcache';
var DefaultCategoryOrder = 'asc';
// Users
var UserFields = { '0': '{$lang.ListPleaseSelectField}', {$usersFields} };
var DefaultSelectedUserField = 'firstname';
var DefaultUserOrder = 'asc';
// Content
var ContentFields = { '0': '{$lang.ListPleaseSelectField}', {$contentFields} };
var DefaultSelectedContentField = 'sortorder';
var DefaultContentOrder = 'asc';
// ----- List Type Variables ----- //
// Content
{$contentListOptions}
{$contentValueFields}
// Users
{$usersListOptions}
{$usersValueFields}
// Comments
{$commentsListOptions}
{$commentsValueFields}
// Categories
{$categoryListOptions}
{$categoryValueFields}
// Actions
var ActionLangList = {$ActionLangList};
/**
* Document Load
* This section loads or runs any script that needs to take place on the page load
*/
$(document).ready(function() {
$('#ValidateFeedButton').bind('click', function() {
$('#rssValidateResponse').html('<img src=\'images/load.gif\' />');
$('#rssValidateResponse').load('remote.php?section=lists&action=validatefeed&url='+escape($('#rssurl').val()));
});
$('.CancelButton').click(function(){
if (confirm(iwp.lang.get('ConfirmCancelJS'))) {
location.href = "index.php?section=lists&action=view";
}
});
// bind form using 'ajaxForm'
$('#frmLists').ajaxForm(ajaxFormOptions);
linkRow = {$linkRowContainer|iwp_FilterJavascriptString};
// hide our fields first
$('.dynamic_fields').hide();
$('.static_fields').hide();
$('.rss_fields').hide();
// load the main tabs
$("#mainTabMenu").tabs();
$('.HideTabsDuringLoad').removeClass('HideTabsDuringLoad');
// Run our on click events to check what fields are selected
CheckFieldsToShow();
CheckTemplateOptions();
CheckListConsists(true);
if($('#contentTypeList').children().size() < 4){
$('#contentTypeList').css('height', '90px');
}else if($('#contentTypeList').children().size() > 3 && $('#contentTypeList').children().size() < 11){
$('#contentTypeList').css('height', ($('#contentTypeList').children().size() *30 )+'px');
}else{
$('#contentTypeList').css('height', '300px');
}
// check the sub categories depth thing
{if $ShowSubCats_checked}
$('#ShowSubCats').click();
{/if}
$('#contentTypeListDiv').css('height', (parseInt($('#contentTypeList').css('height')) + 10) + 'px');
{* if we're editing we're loading the fields *}
{if $listid > 0}
// need to load order by field
// load the order by direction
// load the number of items
// load the filter options
{$onLoadJavascript}
{if $edit_type == 'rss'}
AddstaticListLink();
AddFilter();
{elseif $edit_type == 'static'}
AddFilter();
{else}
AddstaticListLink();
window.setTimeout('UpdateContentTypeFiltersFromList();', 500);
{/if}
{else}
// Add a first filter
AddstaticListLink();
AddFilter();
{/if}
if('{$selectedPosition}' != '' && in_array('{$selectedPosition}', ['top', 'bottom', 'left', 'right', 'center'])){
$('#list_position').selectOptions('{$selectedPosition}', true);
}
{$CurrentstaticListLinks}
});
/**
* validateForm
* This is the callback function used when a 'submit' event is called for the ajax form.
* This function is activated before the request is sent and can cancel the submission if an error or problem is found.
*/
function validateForm() {
$('#frmContent').submit();
var result = false;
var errormsgs = [];
$('.validation_error').remove();
{$formvalidate}
if(errormsgs.length == 0){
$('#MessageTable').hide()
return;
}
$('html').scrollTo( 'body', 500 );
$('#MainMessage').errorMessage('{$lang.ContentSaveErrors|sprintf,$ContentType.name_singular}', errormsgs);
}
//-->
</script>