<?php

namespace DataView;

class Fop_mail_host_box {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function renderScript() { 
    
    
    // --- BLOCK: main ---
    
								\FOP\I18n::ensureIsLoaded();
								?>
								<script type="text/javascript">
									
    function changefilter_fop_mail_host_box_email_serverListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_email_server', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_email_server'];
		  }reloadfop_mail_host_box();
        
    }

		var ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout = null;
		function changefilter_fop_mail_host_box_email_serverSearchFilter(val, callback) {
			if(ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout) clearTimeout(ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout);

			ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_email_serverItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_email_server_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_email_serverListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_email_server_orig']) ? json_encode($_GET['filter_fop_mail_host_box_email_server_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="fa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839" type="text">' +
			'<label class="mdl-textfield__label" for="fa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_email_server', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_email_server_orig'] = '';
					delete query['filter_fop_mail_host_box_email_server'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_email_serverSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_email_serverItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_email_server_orig'] = '';
				delete query['filter_fop_mail_host_box_email_server'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_email_server', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_email_serverListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_trash_dirListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_trash_dir', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_trash_dir'];
		  }reloadfop_mail_host_box();
        
    }

		var i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout = null;
		function changefilter_fop_mail_host_box_trash_dirSearchFilter(val, callback) {
			if(i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout) clearTimeout(i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout);

			i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_trash_dirItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_trash_dir_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_trash_dirListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_trash_dir_orig']) ? json_encode($_GET['filter_fop_mail_host_box_trash_dir_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="147af282771f872165338695769d02e6f17ad014e77287739727587c28c486ef" type="text">' +
			'<label class="mdl-textfield__label" for="147af282771f872165338695769d02e6f17ad014e77287739727587c28c486ef">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_trash_dir', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_trash_dir_orig'] = '';
					delete query['filter_fop_mail_host_box_trash_dir'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_trash_dirSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_trash_dirItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_trash_dir_orig'] = '';
				delete query['filter_fop_mail_host_box_trash_dir'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_trash_dir', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_trash_dirListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_spam_dirListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_spam_dir', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_spam_dir'];
		  }reloadfop_mail_host_box();
        
    }

		var i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout = null;
		function changefilter_fop_mail_host_box_spam_dirSearchFilter(val, callback) {
			if(i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout) clearTimeout(i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout);

			i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_spam_dirItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_spam_dir_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_spam_dirListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_spam_dir_orig']) ? json_encode($_GET['filter_fop_mail_host_box_spam_dir_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9" type="text">' +
			'<label class="mdl-textfield__label" for="486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_spam_dir', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_spam_dir_orig'] = '';
					delete query['filter_fop_mail_host_box_spam_dir'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_spam_dirSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_spam_dirItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_spam_dir_orig'] = '';
				delete query['filter_fop_mail_host_box_spam_dir'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_spam_dir', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_spam_dirListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_sent_dirListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_sent_dir', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_sent_dir'];
		  }reloadfop_mail_host_box();
        
    }

		var i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout = null;
		function changefilter_fop_mail_host_box_sent_dirSearchFilter(val, callback) {
			if(i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout) clearTimeout(i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout);

			i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_sent_dirItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_sent_dir_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_sent_dirListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_sent_dir_orig']) ? json_encode($_GET['filter_fop_mail_host_box_sent_dir_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552" type="text">' +
			'<label class="mdl-textfield__label" for="8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_sent_dir', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_sent_dir_orig'] = '';
					delete query['filter_fop_mail_host_box_sent_dir'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_sent_dirSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_sent_dirItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_sent_dir_orig'] = '';
				delete query['filter_fop_mail_host_box_sent_dir'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_sent_dir', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_sent_dirListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_fopuser_ListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_fopuser_', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_fopuser_'];
		  }reloadfop_mail_host_box();
        
    }

		var i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout = null;
		function changefilter_fop_mail_host_box_fopuser_SearchFilter(val, callback) {
			if(i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout) clearTimeout(i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout);

			i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_fopuser_ItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_fopuser__orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_fopuser_ListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_fopuser__orig']) ? json_encode($_GET['filter_fop_mail_host_box_fopuser__orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412" type="text">' +
			'<label class="mdl-textfield__label" for="4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_fopuser_', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_fopuser__orig'] = '';
					delete query['filter_fop_mail_host_box_fopuser_'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_fopuser_SearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_fopuser_ItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_fopuser__orig'] = '';
				delete query['filter_fop_mail_host_box_fopuser_'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_fopuser_', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_fopuser_ListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									
    function changefilter_fop_mail_host_box_email_serverListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_email_server', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_email_server'];
		  }reloadfop_mail_host_box();
        
    }

		var ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout = null;
		function changefilter_fop_mail_host_box_email_serverSearchFilter(val, callback) {
			if(ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout) clearTimeout(ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout);

			ifa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_email_serverItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_email_server_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_email_serverListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_email_server_orig']) ? json_encode($_GET['filter_fop_mail_host_box_email_server_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="fa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839" type="text">' +
			'<label class="mdl-textfield__label" for="fa57c8f01d171699d457434f55e6a47fdac15bdb2f85dd87ce9c2278a0378839">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_email_server', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_email_server_orig'] = '';
					delete query['filter_fop_mail_host_box_email_server'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_email_serverSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_email_serverItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_email_server_orig'] = '';
				delete query['filter_fop_mail_host_box_email_server'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_email_server', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_email_serverListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_trash_dirListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_trash_dir', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_trash_dir'];
		  }reloadfop_mail_host_box();
        
    }

		var i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout = null;
		function changefilter_fop_mail_host_box_trash_dirSearchFilter(val, callback) {
			if(i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout) clearTimeout(i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout);

			i147af282771f872165338695769d02e6f17ad014e77287739727587c28c486eftimeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_trash_dirItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_trash_dir_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_trash_dirListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_trash_dir_orig']) ? json_encode($_GET['filter_fop_mail_host_box_trash_dir_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="147af282771f872165338695769d02e6f17ad014e77287739727587c28c486ef" type="text">' +
			'<label class="mdl-textfield__label" for="147af282771f872165338695769d02e6f17ad014e77287739727587c28c486ef">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_trash_dir', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_trash_dir_orig'] = '';
					delete query['filter_fop_mail_host_box_trash_dir'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_trash_dirSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_trash_dirItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_trash_dir_orig'] = '';
				delete query['filter_fop_mail_host_box_trash_dir'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_trash_dir', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_trash_dirListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_spam_dirListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_spam_dir', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_spam_dir'];
		  }reloadfop_mail_host_box();
        
    }

		var i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout = null;
		function changefilter_fop_mail_host_box_spam_dirSearchFilter(val, callback) {
			if(i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout) clearTimeout(i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout);

			i486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_spam_dirItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_spam_dir_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_spam_dirListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_spam_dir_orig']) ? json_encode($_GET['filter_fop_mail_host_box_spam_dir_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9" type="text">' +
			'<label class="mdl-textfield__label" for="486eb2d1c39759c0187a8a8f23c2e4bbecaa79e7948720bcb06affe8d01be7a9">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_spam_dir', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_spam_dir_orig'] = '';
					delete query['filter_fop_mail_host_box_spam_dir'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_spam_dirSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_spam_dirItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_spam_dir_orig'] = '';
				delete query['filter_fop_mail_host_box_spam_dir'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_spam_dir', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_spam_dirListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_sent_dirListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_sent_dir', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_sent_dir'];
		  }reloadfop_mail_host_box();
        
    }

		var i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout = null;
		function changefilter_fop_mail_host_box_sent_dirSearchFilter(val, callback) {
			if(i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout) clearTimeout(i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout);

			i8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_sent_dirItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_sent_dir_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_sent_dirListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_sent_dir_orig']) ? json_encode($_GET['filter_fop_mail_host_box_sent_dir_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552" type="text">' +
			'<label class="mdl-textfield__label" for="8ab8b0bd5677b4688273e423c9ead0f378c054aebd731b982e3f215f0cb91552">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_sent_dir', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_sent_dir_orig'] = '';
					delete query['filter_fop_mail_host_box_sent_dir'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_sent_dirSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_sent_dirItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_sent_dir_orig'] = '';
				delete query['filter_fop_mail_host_box_sent_dir'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_sent_dir', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_sent_dirListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_mail_host_box_fopuser_ListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_fopuser_', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_fopuser_'];
		  }reloadfop_mail_host_box();
        
    }

		var i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout = null;
		function changefilter_fop_mail_host_box_fopuser_SearchFilter(val, callback) {
			if(i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout) clearTimeout(i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout);

			i4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box({action: 'getfilter_fop_mail_host_box_fopuser_ItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_fopuser__orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_fopuser_ListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_mail_host_box_fopuser__orig']) ? json_encode($_GET['filter_fop_mail_host_box_fopuser__orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412" type="text">' +
			'<label class="mdl-textfield__label" for="4d1d3addcc06d9571790d7879483f2cfa79d9f75578697bb5ae3e9b1ad3a3412">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_mail_host_box_fopuser_', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_fopuser__orig'] = '';
					delete query['filter_fop_mail_host_box_fopuser_'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box();
					
				} else {
					$('#table_fop_mail_host_box').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_fopuser_SearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_mail_host_box::getfilter_fop_mail_host_box_fopuser_ItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_mail_host_box_fopuser__orig'] = '';
				delete query['filter_fop_mail_host_box_fopuser_'];
				reload('', items);reloadfop_mail_host_box();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_mail_host_box_fopuser_', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_fopuser_ListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									function updateNumberfop_mail_host_box(col) {
										//var checklist = window.DataViewChecked['fop_mail_host_box'][col];
										//if (checklist.id) {
											// checklist is online
											// TODO: check if cache is alive, otherwise reload from ajax, delay execution and return now
											//checklist.ranges = [[1,10000000]]; // mostly we use indirect idlists to tick all marks; so this is an approximation
										//}
										// checkboxes aktualisieren
										if (window.DataViewChecked && window.DataViewChecked['fop_mail_host_box'] && window.DataViewChecked['fop_mail_host_box'][col].ranges.length > 0) {
											$('.fop_mail_host_box__mass-action').css('visibility', 'visible');
											$('.fop_mail_host_box__action').css('visibility', 'hidden');
										} else {
											$('.fop_mail_host_box__mass-action').css('visibility', 'hidden');
											$('.fop_mail_host_box__action').css('visibility', 'visible');
										}
										$('.fop_mail_host_box__checkbox').each(function (idx, x) {
											for (var cssclass of x.classList) {
												if (cssclass.startsWith('fop_mail_host_box__checkbox-'+col+'-')) {
													var my_id = cssclass.substr(('fop_mail_host_box__checkbox-'+col+'-').length);
													if (window.DataViewChecked) {
														x.MaterialCheckbox[checklist.has(my_id) ? 'check' : 'uncheck']();
													}
												}
											}
										});
									}
									function reloadfop_mail_host_box (params, returnUrl, onlyScroll, addPadding = 0) {
										// copy query
										let nq = JSON.parse(JSON.stringify(query));
										nq['parent_request'] = <?php echo json_encode(strtok(\FOP\Util::getBackUrl(), '?')); ?>;
										<?php if (isset($_GET['select'])) { ?>nq['select'] = 'select';<?php } ?>
										
										if (params) {
											for (var i in params) nq[i] = params[i];
											var action = nq['action'];
											delete nq['action'];
											let querystr = "DataView/Fop_mail_host_box/" + action + "?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// direkt aufrufen (ist wohl ein Download oder so)
											if (returnUrl) return querystr;
											window.location.href = querystr;
										} else {
											let querystr;
											
											
											<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
											delete nq['action'];
											querystr = "DataView/Fop_mail_host_box/renderTabTable?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// per Ajax laden
											if(!$("#fop_mail_host_box-table")?.parent()?.parent()?.hasClass('fop-form-feature-collapsed') || $("#fop_mail_host_box-table")?.parent()?.parent()?.hasClass('fop-form-feature-mode-area')) {
											$.get(querystr, function(data){
												var tab = $("#fop_mail_host_box-table");
												var top = tab.find('.fop-table-body-inner');
												var el;
												if (onlyScroll && (el = $('<div class="tabcontent">' + data + '</div>').find('.fop-table-body-inner'))) {
													// nur Scroll-Bereich ersetzen
													var paddingTop = parseInt(el.css('paddingTop') || '0px', 10);
													var minHeight = parseInt(el.css('minHeight'), 10)
													paddingTop += addPadding;
													minHeight += addPadding;
													top.css({paddingTop: paddingTop.toString()+'px', minHeight: minHeight.toString()+'px'}); // Offset
													el = el.children();
													top.empty();
													top.append(el);
													el = top; // top-upgrade doppelt machen, dadurch vermeiden wir das Array-upgrade => Performance
												} else {
													// gesamten Tab ersetzen
													tab.children().remove();
													el = tab.html('<div class="tabcontent">' + data + '</div>');
												}
												try {
													for (var i = 0; i < el.length; i++) upgradeDOM(el[i]);
												} catch (e) {
													console.log(e);
												}
												upgradeTable(el.find('.fop-table .fop-table-header')); // Falls es Tabellen-Layout ist: Spalten-Order anpassen
												flushURL(); // Neue URL in Titelleiste eintragen

												// Checkbox-Auswahl ankreuzen
												updateNumberfop_mail_host_box('ID');
											});
											} else {
												// gesamten Tab ersetzen
												var tab = $("#fop_mail_host_box-table");
												tab.children().remove();
												el = tab.html('<div class="fop-lazy-reload" onclick="reloadfop_mail_host_box()"></div>');
											}
											<?php } ?>
											
										}
									}
									function checkfop_mail_host_box (id, col, checked) {
										// ID-Liste aufbauen
										if (!window.DataViewChecked) window.DataViewChecked = {};
										if (!window.DataViewChecked['fop_mail_host_box']) window.DataViewChecked['fop_mail_host_box'] = {};
										if (!window.DataViewChecked['fop_mail_host_box'][col]) window.DataViewChecked['fop_mail_host_box'][col] = new IDList();

										// Abfrage aller gecheckten IDs für eine Tabelle
										if (!id) {
											return window.DataViewChecked['fop_mail_host_box'][col].toString();
										}

										// check all, check id
										if (id == 'all') {
											// TODO: umbauen #1289: 'all' auch nur auf ne idlist reduzieren
											if (checked) {
												$.get(reloadfop_mail_host_box({action: 'getids', col: col}, true), function (ids) {
													window.DataViewChecked['fop_mail_host_box'][col] = new IDList(ids);
													updateNumberfop_mail_host_box(col);
												});
											} else {
												window.DataViewChecked['fop_mail_host_box'][col] = new IDList();
												updateNumberfop_mail_host_box(col);
											}
										} else {
											var ids = new IDList(id);
											var allcb = $('#fop_mail_host_box__all-checkbox');
											if (allcb[0]) {
												allcb[0].parentElement.MaterialCheckbox.uncheck(); // TODO: prüfen, ob Gruppen-CBs voll werden
											}
											if (checked == 'set') {
												window.DataViewChecked['fop_mail_host_box'][col] = ids;
											} else for (id of ids.all()) {
												if (checked) {
													window.DataViewChecked['fop_mail_host_box'][col].push(id);
												} else {
													window.DataViewChecked['fop_mail_host_box'][col].remove(id);
												}
											}
											updateNumberfop_mail_host_box(col);
										}
									}
								</script><?php

    
  }

  public static function renderSpecialFilters() { 
    
    
    // --- BLOCK: main ---
    ?>
	
	<script type"text/javascript">
		function updateSpecialFilter(param, val) {
			query[param] = val.toString();reloadfop_mail_host_box();
			
		}

	</script>
	<?php
	
    
  }

  public static function renderTabTableAction() { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
     ?><div class='fop-dv-buttonbar'><?php if((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?><a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" onclick="
		var self = this;
		event.preventDefault();
		$.get(reloadfop_mail_host_box({action: 'open', fop_table: 'fop_mail_host_box', fop_id: '_', fop_from: location.href}, true))
		.then(function () {
			window.open_url(self.href, false);
		});" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::createURL2(['from' => $_GET['from'] ?? null, 'popup' => $_GET['popup'] ?? null])); ?>"><i class="material-icons">add</i> <?php echo(sprintf(_('create %s'), _('emailmailbox_singular'))); ?></a><?php } ?></div><?php 
								\FOP\User::getIsGuest();
								$itemheight = 32;
								$itemsperpage = ceil(1080 / $itemheight * 0.8);
								$page = (isset($_GET['page_fop_mail_host_box']) ? intval($_GET['page_fop_mail_host_box']) : 0);
								$addlines = (isset($_GET['addlines_fop_mail_host_box']) ? intval($_GET['addlines_fop_mail_host_box']) : 0);
								$firstitem = $page * $itemsperpage;
								$sqladdon = ' LIMIT ' . ($itemsperpage * 2) . ' OFFSET ' . ($firstitem);
								$data = self::getData($sqladdon, $_GET);
								$arr = $data["items"];
								$itemcount = $data["itemcount"];
								$lastPage = ceil($itemcount/$itemsperpage-1);
								// calculate width of first column: 67px + 32px for each shortcut
								$firstColumnWidth = 66 + 34 + 34 + 34;
								$additionalLines = 0;

									// Spaltenliste zuerst aufbauen, damit sie noch umsortiert werden kann
									$order = 1000;
									$columns = [];
									
										if(true){
											$col = [
												'id' => 'fopuser_',
												'desc' => _('owner'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['fopuser_'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'user',
												'desc' => _('user'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['user'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'password',
												'desc' => _('password'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['password'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'from_name',
												'desc' => _('displayname'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['from_name'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'from_address',
												'desc' => _('E-Mail'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['from_address'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'email_server',
												'desc' => _('emailhost'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['email_server'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'syncdate',
												'desc' => _('earliest synchronization date'),
												'order' => ++$order,
												'width' => 100, // default value
												'collapsed' => 0

											];
											$columns['syncdate'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'trash_dir',
												'desc' => _('trash folder'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['trash_dir'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'spam_dir',
												'desc' => _('Spam'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['spam_dir'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'sent_dir',
												'desc' => _('sent folder'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['sent_dir'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'status',
												'desc' => _('Status'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['status'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'signature',
												'desc' => _('signature'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['signature'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'zustand',
												'desc' => _('Zustand'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['zustand'] = $col;
										}
									

									// gespeicherte Spaltenanordnung
									foreach (\FOP\Database::query('SELECT * FROM fop_dataview WHERE '.qi('user').' = ' . \FOP\Database::quote(\FOP\User::getID()) . ' AND dataview = ' . \FOP\Database::quote('fop_mail_host_box'))->fetchAll(\PDO::FETCH_ASSOC) AS $column => $c) {
										if (isset($columns[$c['column']])) {
											$columns[$c['column']]['order'] = $c['order']; // order, width, collapsed
											$columns[$c['column']]['width'] = $c['width']; // order, width, collapsed
											$columns[$c['column']]['collapsed'] = $c['collapsed']; // order, width, collapsed
										}
									}

									// DOM vor-rendern
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='fopuser_'
												data-order='<?php echo intval($columns['fopuser_']['order']); ?>'
												data-width='<?php echo intval($columns['fopuser_']['width']); ?>'
												data-collapsed='<?php echo intval($columns['fopuser_']['collapsed']); ?>'
												style='width: <?php echo intval($columns['fopuser_']['width']); ?>px; <?php if ($columns['fopuser_']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		win.append(getfilter_fop_mail_host_box_fopuser_ListMultiFilter()); win.find('input').first().focus();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_mail_host_box'] == 'fopuser_ ASC') {
			query['sort_fop_mail_host_box'] = 'fopuser_ DESC';
		 } else if (query['sort_fop_mail_host_box'] == 'fopuser_ DESC') {
		 	delete query['sort_fop_mail_host_box'];
		 } else {
			query['sort_fop_mail_host_box'] = 'fopuser_ ASC';
		 }
		 reloadfop_mail_host_box();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('owner')); ?>'><?php echo(_('owner')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'fopuser_ ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'fopuser_ DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_fopuser_']) || isset($_GET['range_max_fop_mail_host_box_fopuser_']) || isset($_GET['deps_fop_mail_host_box_fopuser_']) || isset($_GET['fullsearch_fop_mail_host_box_fopuser_']) || isset($_GET['dynamic_fop_mail_host_box_fopuser_']) || isset($_GET['search_fop_mail_host_box_fopuser_']) || isset($_GET['searchnot_fop_mail_host_box_fopuser_']) || isset($_GET['filter_fop_mail_host_box_fopuser_'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['fopuser_']['header'] = ob_get_contents(); ob_end_clean();
											$columns['fopuser_']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['fopuser_']['width']); ?>px; <?php if ($columns['fopuser_']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='fopuser_'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['fopuser_'];
	$val = $item['fopuser_::description'];
	$canView = $item['fopuser_::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"mitglied\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, true);\" href=\"" . \TablesRouter\Mitglied::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['fopuser_']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='fopuser_'
													data-order='<?php echo intval($columns['fopuser_']['order']); ?>'
													data-width='<?php echo intval($columns['fopuser_']['width']); ?>'
													data-collapsed='<?php echo intval($columns['fopuser_']['collapsed']); ?>'
													style='width: <?php echo intval($columns['fopuser_']['width']); ?>px; <?php if ($columns['fopuser_']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='user'
												data-order='<?php echo intval($columns['user']['order']); ?>'
												data-width='<?php echo intval($columns['user']['width']); ?>'
												data-collapsed='<?php echo intval($columns['user']['collapsed']); ?>'
												style='width: <?php echo intval($columns['user']['width']); ?>px; <?php if ($columns['user']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_mail_host_box_user'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_mail_host_box_user'] = text.val(); } else { delete query['search_fop_mail_host_box_user']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_mail_host_box_user'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_mail_host_box_user'] = text2.val(); } else { delete query['searchnot_fop_mail_host_box_user']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_mail_host_box'] == 'user ASC') {
			query['sort_fop_mail_host_box'] = 'user DESC';
		 } else if (query['sort_fop_mail_host_box'] == 'user DESC') {
		 	delete query['sort_fop_mail_host_box'];
		 } else {
			query['sort_fop_mail_host_box'] = 'user ASC';
		 }
		 reloadfop_mail_host_box();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('user')); ?>'><?php echo(_('user')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'user ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'user DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_user']) || isset($_GET['range_max_fop_mail_host_box_user']) || isset($_GET['deps_fop_mail_host_box_user']) || isset($_GET['fullsearch_fop_mail_host_box_user']) || isset($_GET['dynamic_fop_mail_host_box_user']) || isset($_GET['search_fop_mail_host_box_user']) || isset($_GET['searchnot_fop_mail_host_box_user']) || isset($_GET['filter_fop_mail_host_box_user'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['user']['header'] = ob_get_contents(); ob_end_clean();
											$columns['user']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['user']['width']); ?>px; <?php if ($columns['user']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='user'><span class='overflow-text' title="<?php echo htmlentities($item['user']); ?>"><?php echo htmlentities($item['user']); ?></span></div><?php
											};
											$columns['user']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='user'
													data-order='<?php echo intval($columns['user']['order']); ?>'
													data-width='<?php echo intval($columns['user']['width']); ?>'
													data-collapsed='<?php echo intval($columns['user']['collapsed']); ?>'
													style='width: <?php echo intval($columns['user']['width']); ?>px; <?php if ($columns['user']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='password'
												data-order='<?php echo intval($columns['password']['order']); ?>'
												data-width='<?php echo intval($columns['password']['width']); ?>'
												data-collapsed='<?php echo intval($columns['password']['collapsed']); ?>'
												style='width: <?php echo intval($columns['password']['width']); ?>px; <?php if ($columns['password']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		win.text('Keine Filter vorhanden');
		return false;
	">
													<span class='title-title' title='<?php echo(_('password')); ?>'><?php echo(_('password')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'password ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'password DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_password']) || isset($_GET['range_max_fop_mail_host_box_password']) || isset($_GET['deps_fop_mail_host_box_password']) || isset($_GET['fullsearch_fop_mail_host_box_password']) || isset($_GET['dynamic_fop_mail_host_box_password']) || isset($_GET['search_fop_mail_host_box_password']) || isset($_GET['searchnot_fop_mail_host_box_password']) || isset($_GET['filter_fop_mail_host_box_password'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['password']['header'] = ob_get_contents(); ob_end_clean();
											$columns['password']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['password']['width']); ?>px; <?php if ($columns['password']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='password'><span class='overflow-text' title="<?php echo htmlentities('*****'); ?>"><?php echo htmlentities('*****'); ?></span></div><?php
											};
											$columns['password']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='password'
													data-order='<?php echo intval($columns['password']['order']); ?>'
													data-width='<?php echo intval($columns['password']['width']); ?>'
													data-collapsed='<?php echo intval($columns['password']['collapsed']); ?>'
													style='width: <?php echo intval($columns['password']['width']); ?>px; <?php if ($columns['password']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='from_name'
												data-order='<?php echo intval($columns['from_name']['order']); ?>'
												data-width='<?php echo intval($columns['from_name']['width']); ?>'
												data-collapsed='<?php echo intval($columns['from_name']['collapsed']); ?>'
												style='width: <?php echo intval($columns['from_name']['width']); ?>px; <?php if ($columns['from_name']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_mail_host_box_from_name'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_mail_host_box_from_name'] = text.val(); } else { delete query['search_fop_mail_host_box_from_name']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_mail_host_box_from_name'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_mail_host_box_from_name'] = text2.val(); } else { delete query['searchnot_fop_mail_host_box_from_name']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_mail_host_box'] == 'from_name ASC') {
			query['sort_fop_mail_host_box'] = 'from_name DESC';
		 } else if (query['sort_fop_mail_host_box'] == 'from_name DESC') {
		 	delete query['sort_fop_mail_host_box'];
		 } else {
			query['sort_fop_mail_host_box'] = 'from_name ASC';
		 }
		 reloadfop_mail_host_box();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('displayname')); ?>'><?php echo(_('displayname')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'from_name ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'from_name DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_from_name']) || isset($_GET['range_max_fop_mail_host_box_from_name']) || isset($_GET['deps_fop_mail_host_box_from_name']) || isset($_GET['fullsearch_fop_mail_host_box_from_name']) || isset($_GET['dynamic_fop_mail_host_box_from_name']) || isset($_GET['search_fop_mail_host_box_from_name']) || isset($_GET['searchnot_fop_mail_host_box_from_name']) || isset($_GET['filter_fop_mail_host_box_from_name'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['from_name']['header'] = ob_get_contents(); ob_end_clean();
											$columns['from_name']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['from_name']['width']); ?>px; <?php if ($columns['from_name']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='from_name'><span class='overflow-text' title="<?php echo htmlentities($item['from_name']); ?>"><?php echo htmlentities($item['from_name']); ?></span></div><?php
											};
											$columns['from_name']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='from_name'
													data-order='<?php echo intval($columns['from_name']['order']); ?>'
													data-width='<?php echo intval($columns['from_name']['width']); ?>'
													data-collapsed='<?php echo intval($columns['from_name']['collapsed']); ?>'
													style='width: <?php echo intval($columns['from_name']['width']); ?>px; <?php if ($columns['from_name']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='from_address'
												data-order='<?php echo intval($columns['from_address']['order']); ?>'
												data-width='<?php echo intval($columns['from_address']['width']); ?>'
												data-collapsed='<?php echo intval($columns['from_address']['collapsed']); ?>'
												style='width: <?php echo intval($columns['from_address']['width']); ?>px; <?php if ($columns['from_address']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_mail_host_box_from_address'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_mail_host_box_from_address'] = text.val(); } else { delete query['search_fop_mail_host_box_from_address']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_mail_host_box_from_address'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_mail_host_box_from_address'] = text2.val(); } else { delete query['searchnot_fop_mail_host_box_from_address']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_mail_host_box'] == 'from_address ASC') {
			query['sort_fop_mail_host_box'] = 'from_address DESC';
		 } else if (query['sort_fop_mail_host_box'] == 'from_address DESC') {
		 	delete query['sort_fop_mail_host_box'];
		 } else {
			query['sort_fop_mail_host_box'] = 'from_address ASC';
		 }
		 reloadfop_mail_host_box();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('E-Mail')); ?>'><?php echo(_('E-Mail')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'from_address ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'from_address DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_from_address']) || isset($_GET['range_max_fop_mail_host_box_from_address']) || isset($_GET['deps_fop_mail_host_box_from_address']) || isset($_GET['fullsearch_fop_mail_host_box_from_address']) || isset($_GET['dynamic_fop_mail_host_box_from_address']) || isset($_GET['search_fop_mail_host_box_from_address']) || isset($_GET['searchnot_fop_mail_host_box_from_address']) || isset($_GET['filter_fop_mail_host_box_from_address'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['from_address']['header'] = ob_get_contents(); ob_end_clean();
											$columns['from_address']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['from_address']['width']); ?>px; <?php if ($columns['from_address']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='from_address'><span class='overflow-text'><a onclick="event.stopPropagation();<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>event.preventDefault(); window.open_over(document.baseURI + 'Tables/Fop_mail_host_box_draft/create?to=' + encodeURIComponent(this.href.substr(7)) + '&popup&from=' + encodeURIComponent(document.baseURI + 'jscloser.php?action=popup&close')); <?php } ?>
" href="<?php echo ('mailto:' . htmlentities(($item['from_address']))); ?>"><?php echo htmlentities($item['from_address']); ?></a></span></div><?php
											};
											$columns['from_address']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='from_address'
													data-order='<?php echo intval($columns['from_address']['order']); ?>'
													data-width='<?php echo intval($columns['from_address']['width']); ?>'
													data-collapsed='<?php echo intval($columns['from_address']['collapsed']); ?>'
													style='width: <?php echo intval($columns['from_address']['width']); ?>px; <?php if ($columns['from_address']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='email_server'
												data-order='<?php echo intval($columns['email_server']['order']); ?>'
												data-width='<?php echo intval($columns['email_server']['width']); ?>'
												data-collapsed='<?php echo intval($columns['email_server']['collapsed']); ?>'
												style='width: <?php echo intval($columns['email_server']['width']); ?>px; <?php if ($columns['email_server']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		win.append(getfilter_fop_mail_host_box_email_serverListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('emailhost')); ?>'><?php echo(_('emailhost')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'email_server ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'email_server DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_email_server']) || isset($_GET['range_max_fop_mail_host_box_email_server']) || isset($_GET['deps_fop_mail_host_box_email_server']) || isset($_GET['fullsearch_fop_mail_host_box_email_server']) || isset($_GET['dynamic_fop_mail_host_box_email_server']) || isset($_GET['search_fop_mail_host_box_email_server']) || isset($_GET['searchnot_fop_mail_host_box_email_server']) || isset($_GET['filter_fop_mail_host_box_email_server'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['email_server']['header'] = ob_get_contents(); ob_end_clean();
											$columns['email_server']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['email_server']['width']); ?>px; <?php if ($columns['email_server']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='email_server'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['email_server'];
	$val = $item['email_server::description'];
	$canView = $item['email_server::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"fop_mail_host\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Fop_mail_host::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['email_server']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='email_server'
													data-order='<?php echo intval($columns['email_server']['order']); ?>'
													data-width='<?php echo intval($columns['email_server']['width']); ?>'
													data-collapsed='<?php echo intval($columns['email_server']['collapsed']); ?>'
													style='width: <?php echo intval($columns['email_server']['width']); ?>px; <?php if ($columns['email_server']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='syncdate'
												data-order='<?php echo intval($columns['syncdate']['order']); ?>'
												data-width='<?php echo intval($columns['syncdate']['width']); ?>'
												data-collapsed='<?php echo intval($columns['syncdate']['collapsed']); ?>'
												style='width: <?php echo intval($columns['syncdate']['width']); ?>px; <?php if ($columns['syncdate']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}}, 600);
		date_filter(win, 'fop_mail_host_box', 'syncdate', <?php echo htmlentities(json_encode(_('period'))); ?>, <?php echo htmlentities(json_encode(\FOP\I18n::getShortLocale())); ?>, <?php echo htmlentities(json_encode(_('dateformat_moment'))); ?>, function() { reloadfop_mail_host_box();  reloadfop_mail_host_box(); });
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_mail_host_box'] == 'syncdate ASC') {
			query['sort_fop_mail_host_box'] = 'syncdate DESC';
		 } else if (query['sort_fop_mail_host_box'] == 'syncdate DESC') {
		 	delete query['sort_fop_mail_host_box'];
		 } else {
			query['sort_fop_mail_host_box'] = 'syncdate ASC';
		 }
		 reloadfop_mail_host_box();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('earliest synchronization date')); ?>'><?php echo(_('earliest synchronization date')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'syncdate ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'syncdate DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_syncdate']) || isset($_GET['range_max_fop_mail_host_box_syncdate']) || isset($_GET['deps_fop_mail_host_box_syncdate']) || isset($_GET['fullsearch_fop_mail_host_box_syncdate']) || isset($_GET['dynamic_fop_mail_host_box_syncdate']) || isset($_GET['search_fop_mail_host_box_syncdate']) || isset($_GET['searchnot_fop_mail_host_box_syncdate']) || isset($_GET['filter_fop_mail_host_box_syncdate'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['syncdate']['header'] = ob_get_contents(); ob_end_clean();
											$columns['syncdate']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['syncdate']['width']); ?>px; <?php if ($columns['syncdate']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='syncdate'><span class='overflow-text' title="<?php echo htmlentities(($item['syncdate']) ? strftime(_('dateformat_php2'), intval($item['syncdate'])) : ''); ?>"><?php echo htmlentities(($item['syncdate']) ? strftime(_('dateformat_php2'), intval($item['syncdate'])) : ''); ?></span></div><?php
											};
											$columns['syncdate']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='syncdate'
													data-order='<?php echo intval($columns['syncdate']['order']); ?>'
													data-width='<?php echo intval($columns['syncdate']['width']); ?>'
													data-collapsed='<?php echo intval($columns['syncdate']['collapsed']); ?>'
													style='width: <?php echo intval($columns['syncdate']['width']); ?>px; <?php if ($columns['syncdate']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='trash_dir'
												data-order='<?php echo intval($columns['trash_dir']['order']); ?>'
												data-width='<?php echo intval($columns['trash_dir']['width']); ?>'
												data-collapsed='<?php echo intval($columns['trash_dir']['collapsed']); ?>'
												style='width: <?php echo intval($columns['trash_dir']['width']); ?>px; <?php if ($columns['trash_dir']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		win.append(getfilter_fop_mail_host_box_trash_dirListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('trash folder')); ?>'><?php echo(_('trash folder')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'trash_dir ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'trash_dir DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_trash_dir']) || isset($_GET['range_max_fop_mail_host_box_trash_dir']) || isset($_GET['deps_fop_mail_host_box_trash_dir']) || isset($_GET['fullsearch_fop_mail_host_box_trash_dir']) || isset($_GET['dynamic_fop_mail_host_box_trash_dir']) || isset($_GET['search_fop_mail_host_box_trash_dir']) || isset($_GET['searchnot_fop_mail_host_box_trash_dir']) || isset($_GET['filter_fop_mail_host_box_trash_dir'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['trash_dir']['header'] = ob_get_contents(); ob_end_clean();
											$columns['trash_dir']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['trash_dir']['width']); ?>px; <?php if ($columns['trash_dir']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='trash_dir'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['trash_dir'];
	$val = $item['trash_dir::description'];
	$canView = $item['trash_dir::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"fop_mail_host_box_dir\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Fop_mail_host_box_dir::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['trash_dir']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='trash_dir'
													data-order='<?php echo intval($columns['trash_dir']['order']); ?>'
													data-width='<?php echo intval($columns['trash_dir']['width']); ?>'
													data-collapsed='<?php echo intval($columns['trash_dir']['collapsed']); ?>'
													style='width: <?php echo intval($columns['trash_dir']['width']); ?>px; <?php if ($columns['trash_dir']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='spam_dir'
												data-order='<?php echo intval($columns['spam_dir']['order']); ?>'
												data-width='<?php echo intval($columns['spam_dir']['width']); ?>'
												data-collapsed='<?php echo intval($columns['spam_dir']['collapsed']); ?>'
												style='width: <?php echo intval($columns['spam_dir']['width']); ?>px; <?php if ($columns['spam_dir']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		win.append(getfilter_fop_mail_host_box_spam_dirListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('Spam')); ?>'><?php echo(_('Spam')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'spam_dir ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'spam_dir DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_spam_dir']) || isset($_GET['range_max_fop_mail_host_box_spam_dir']) || isset($_GET['deps_fop_mail_host_box_spam_dir']) || isset($_GET['fullsearch_fop_mail_host_box_spam_dir']) || isset($_GET['dynamic_fop_mail_host_box_spam_dir']) || isset($_GET['search_fop_mail_host_box_spam_dir']) || isset($_GET['searchnot_fop_mail_host_box_spam_dir']) || isset($_GET['filter_fop_mail_host_box_spam_dir'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['spam_dir']['header'] = ob_get_contents(); ob_end_clean();
											$columns['spam_dir']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['spam_dir']['width']); ?>px; <?php if ($columns['spam_dir']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='spam_dir'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['spam_dir'];
	$val = $item['spam_dir::description'];
	$canView = $item['spam_dir::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"fop_mail_host_box_dir\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Fop_mail_host_box_dir::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['spam_dir']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='spam_dir'
													data-order='<?php echo intval($columns['spam_dir']['order']); ?>'
													data-width='<?php echo intval($columns['spam_dir']['width']); ?>'
													data-collapsed='<?php echo intval($columns['spam_dir']['collapsed']); ?>'
													style='width: <?php echo intval($columns['spam_dir']['width']); ?>px; <?php if ($columns['spam_dir']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='sent_dir'
												data-order='<?php echo intval($columns['sent_dir']['order']); ?>'
												data-width='<?php echo intval($columns['sent_dir']['width']); ?>'
												data-collapsed='<?php echo intval($columns['sent_dir']['collapsed']); ?>'
												style='width: <?php echo intval($columns['sent_dir']['width']); ?>px; <?php if ($columns['sent_dir']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		win.append(getfilter_fop_mail_host_box_sent_dirListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('sent folder')); ?>'><?php echo(_('sent folder')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'sent_dir ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'sent_dir DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_sent_dir']) || isset($_GET['range_max_fop_mail_host_box_sent_dir']) || isset($_GET['deps_fop_mail_host_box_sent_dir']) || isset($_GET['fullsearch_fop_mail_host_box_sent_dir']) || isset($_GET['dynamic_fop_mail_host_box_sent_dir']) || isset($_GET['search_fop_mail_host_box_sent_dir']) || isset($_GET['searchnot_fop_mail_host_box_sent_dir']) || isset($_GET['filter_fop_mail_host_box_sent_dir'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['sent_dir']['header'] = ob_get_contents(); ob_end_clean();
											$columns['sent_dir']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['sent_dir']['width']); ?>px; <?php if ($columns['sent_dir']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='sent_dir'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['sent_dir'];
	$val = $item['sent_dir::description'];
	$canView = $item['sent_dir::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"fop_mail_host_box_dir\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Fop_mail_host_box_dir::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['sent_dir']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='sent_dir'
													data-order='<?php echo intval($columns['sent_dir']['order']); ?>'
													data-width='<?php echo intval($columns['sent_dir']['width']); ?>'
													data-collapsed='<?php echo intval($columns['sent_dir']['collapsed']); ?>'
													style='width: <?php echo intval($columns['sent_dir']['width']); ?>px; <?php if ($columns['sent_dir']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='status'
												data-order='<?php echo intval($columns['status']['order']); ?>'
												data-width='<?php echo intval($columns['status']['width']); ?>'
												data-collapsed='<?php echo intval($columns['status']['collapsed']); ?>'
												style='width: <?php echo intval($columns['status']['width']); ?>px; <?php if ($columns['status']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_mail_host_box_status'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_mail_host_box_status'] = text.val(); } else { delete query['search_fop_mail_host_box_status']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_mail_host_box_status'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_mail_host_box_status'] = text2.val(); } else { delete query['searchnot_fop_mail_host_box_status']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_mail_host_box'] == 'status ASC') {
			query['sort_fop_mail_host_box'] = 'status DESC';
		 } else if (query['sort_fop_mail_host_box'] == 'status DESC') {
		 	delete query['sort_fop_mail_host_box'];
		 } else {
			query['sort_fop_mail_host_box'] = 'status ASC';
		 }
		 reloadfop_mail_host_box();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Status')); ?>'><?php echo(_('Status')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'status ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'status DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_status']) || isset($_GET['range_max_fop_mail_host_box_status']) || isset($_GET['deps_fop_mail_host_box_status']) || isset($_GET['fullsearch_fop_mail_host_box_status']) || isset($_GET['dynamic_fop_mail_host_box_status']) || isset($_GET['search_fop_mail_host_box_status']) || isset($_GET['searchnot_fop_mail_host_box_status']) || isset($_GET['filter_fop_mail_host_box_status'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['status']['header'] = ob_get_contents(); ob_end_clean();
											$columns['status']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['status']['width']); ?>px; <?php if ($columns['status']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='status'><span class='overflow-text' title="<?php echo htmlentities($item['status']); ?>"><?php echo htmlentities($item['status']); ?></span></div><?php
											};
											$columns['status']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='status'
													data-order='<?php echo intval($columns['status']['order']); ?>'
													data-width='<?php echo intval($columns['status']['width']); ?>'
													data-collapsed='<?php echo intval($columns['status']['collapsed']); ?>'
													style='width: <?php echo intval($columns['status']['width']); ?>px; <?php if ($columns['status']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='signature'
												data-order='<?php echo intval($columns['signature']['order']); ?>'
												data-width='<?php echo intval($columns['signature']['width']); ?>'
												data-collapsed='<?php echo intval($columns['signature']['collapsed']); ?>'
												style='width: <?php echo intval($columns['signature']['width']); ?>px; <?php if ($columns['signature']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_mail_host_box_signature'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_mail_host_box_signature'] = text.val(); } else { delete query['search_fop_mail_host_box_signature']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_mail_host_box_signature'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_mail_host_box_signature'] = text2.val(); } else { delete query['searchnot_fop_mail_host_box_signature']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_mail_host_box').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_mail_host_box'] == 'signature ASC') {
			query['sort_fop_mail_host_box'] = 'signature DESC';
		 } else if (query['sort_fop_mail_host_box'] == 'signature DESC') {
		 	delete query['sort_fop_mail_host_box'];
		 } else {
			query['sort_fop_mail_host_box'] = 'signature ASC';
		 }
		 reloadfop_mail_host_box();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('signature')); ?>'><?php echo(_('signature')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'signature ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'signature DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_signature']) || isset($_GET['range_max_fop_mail_host_box_signature']) || isset($_GET['deps_fop_mail_host_box_signature']) || isset($_GET['fullsearch_fop_mail_host_box_signature']) || isset($_GET['dynamic_fop_mail_host_box_signature']) || isset($_GET['search_fop_mail_host_box_signature']) || isset($_GET['searchnot_fop_mail_host_box_signature']) || isset($_GET['filter_fop_mail_host_box_signature'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['signature']['header'] = ob_get_contents(); ob_end_clean();
											$columns['signature']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['signature']['width']); ?>px; <?php if ($columns['signature']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='signature'><?php 
	$html = preg_replace('/^<!DOCTYPE.+?>/m', '', \FOP\Sanitizers::htmlentities_decode($item['signature'])); ?>
	<span style="display: block;" onmouseenter='handleHTMLOverlay(event, &apos;#overlayFormsignature<?php echo htmlentities($item['ID'] ?? 'fail'); ?>&apos;);' onmouseleave='handleHTMLOverlayFade(event, &apos;#overlayFormsignature<?php echo htmlentities($item['ID'] ?? 'fail'); ?>&apos;);' ng-non-bindable><?php echo htmlentities(mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($item['signature'])))), 0, 50) . (strlen(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($item['signature']))))) >= 50 ? '...' : ''));  ?></span>
	<div class="overlay-iframe" id="overlayFormsignature<?php echo $item['ID'] ?? 'fail'; ?>">
		<div class="iframe-container" id="iframecontainer">
			<?php echo \FOP\Util::SanitizeUserHtml($html); ?>
		</div>
	</div>
</div><?php
											};
											$columns['signature']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='signature'
													data-order='<?php echo intval($columns['signature']['order']); ?>'
													data-width='<?php echo intval($columns['signature']['width']); ?>'
													data-collapsed='<?php echo intval($columns['signature']['collapsed']); ?>'
													style='width: <?php echo intval($columns['signature']['width']); ?>px; <?php if ($columns['signature']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='zustand'
												data-order='<?php echo intval($columns['zustand']['order']); ?>'
												data-width='<?php echo intval($columns['zustand']['width']); ?>'
												data-collapsed='<?php echo intval($columns['zustand']['collapsed']); ?>'
												style='width: <?php echo intval($columns['zustand']['width']); ?>px; <?php if ($columns['zustand']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box(); 
		}});
		win.append($('<input type=\'checkbox\'' + (querySet('filter_fop_mail_host_box_zustand', '0') ? ' checked>': '>')).change(function (){querySet('filter_fop_mail_host_box_zustand', '0', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('Verbindung nicht möglich')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_mail_host_box_zustand', '1') ? ' checked>': '>')).change(function (){querySet('filter_fop_mail_host_box_zustand', '1', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('Aktiviert')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_mail_host_box_zustand', '2') ? ' checked>': '>')).change(function (){querySet('filter_fop_mail_host_box_zustand', '2', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('Deaktiviert')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_mail_host_box_zustand', '3') ? ' checked>': '>')).change(function (){querySet('filter_fop_mail_host_box_zustand', '3', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('Wartet auf erste Synchronisation')); ?><br/>');
		return false;
	">
													<span class='title-title' title='<?php echo(_('Zustand')); ?>'><?php echo(_('Zustand')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'zustand ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box']) && $_GET['sort_fop_mail_host_box'] == 'zustand DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_zustand']) || isset($_GET['range_max_fop_mail_host_box_zustand']) || isset($_GET['deps_fop_mail_host_box_zustand']) || isset($_GET['fullsearch_fop_mail_host_box_zustand']) || isset($_GET['dynamic_fop_mail_host_box_zustand']) || isset($_GET['search_fop_mail_host_box_zustand']) || isset($_GET['searchnot_fop_mail_host_box_zustand']) || isset($_GET['filter_fop_mail_host_box_zustand'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['zustand']['header'] = ob_get_contents(); ob_end_clean();
											$columns['zustand']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['zustand']['width']); ?>px; <?php if ($columns['zustand']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='zustand'><?php echo htmlentities(\Types\Zustand_box::toStringShort($item['zustand'])); ?></div><?php
											};
											$columns['zustand']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='zustand'
													data-order='<?php echo intval($columns['zustand']['order']); ?>'
													data-width='<?php echo intval($columns['zustand']['width']); ?>'
													data-collapsed='<?php echo intval($columns['zustand']['collapsed']); ?>'
													style='width: <?php echo intval($columns['zustand']['width']); ?>px; <?php if ($columns['zustand']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									

									// sort by order
									uasort($columns, function ($a, $b) {
										return $a['order'] - $b['order'];
									});
									?>
									<style type='text/css'>
										#fop_mail_host_box-table .fop-table-header {
											height: <?php echo 32; ?>px;
										}
										#fop_mail_host_box-table .fop-table-header .fop-table-column .title,
										#fop_mail_host_box-table .fop-column-handle,
										#fop_mail_host_box-table .fop-table-row,
										#fop_mail_host_box-table .fop-table-row .fop-table-column,
										#fop_mail_host_box-table .fop-table-column-multicontrol,
										#fop_mail_host_box-table .fop-filter-button {
											height: 32px;
											line-height: 32px;
										}
										</style>
											<div class="fop-table" data-table-id="fop_mail_host_box">
											<div class="fop-legend">
													<div class="fop-legend-item">
														<div class="fop-legend-item-color" style="background: #F5A9A922;"></div>
														<?php echo(_('Verbindung nicht möglich')); ?>
													</div>
												
													<div class="fop-legend-item">
														<div class="fop-legend-item-color" style="background: #9FF78122;"></div>
														<?php echo(_('Aktiviert')); ?>
													</div>
												
													<div class="fop-legend-item">
														<div class="fop-legend-item-color" style="background: #F4FA5822;"></div>
														<?php echo(_('Deaktiviert')); ?>
													</div>
												
													<div class="fop-legend-item">
														<div class="fop-legend-item-color" style="background: #A9D0F522;"></div>
														<?php echo(_('Wartet auf erste Synchronisation')); ?>
													</div>
												</div>
											<div class="fop-filter-string-wrapper"><div class="fop-filter-string"><label>Filter:</label> <span><?php echo self::getFilterHTML($_GET); ?></span></div></div>
											
											<?php if (isset($_GET['select'])) { echo '<br>'; } ?>
											<div class="fop-table-header">
											<?php if (!isset($_GET['select'])) { ?>
												<div class="fop-table-column noprint" style="width: <?php echo json_encode($firstColumnWidth); ?>px;">
													
													<div class="fop-table-column-multicontrol">
													<label class="mdl-checkbox mdl-js-checkbox"  style='width: auto;' for="fop_mail_host_box__all-checkbox">
														<input class="mdl-checkbox__input" id="fop_mail_host_box__all-checkbox" type="checkbox" onchange="checkfop_mail_host_box('all', 'ID', this.checked);">
														</label>
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon fop_mail_host_box__mass-action" style='visibility: hidden;' onclick="$.get('DataView/Fop_mail_host_box/permissions?id=' + checkfop_mail_host_box(null, 'ID'), function (data) { for (var method in data) if (method != '__cnt') { var btn = $('[data-interaction-name=&quot;' + method + '&quot;]'); if (data[method] >= 1) btn.show(); else btn.hide(); btn.find('.cnt').text(data[method]); }; }); dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">more_vert</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterall" style="margin-right:auto; text-align:left;"
					onclick="for (key in query) if (key.indexOf('range_min_fop_mail_host_box_') == 0 || key.indexOf('range_max_fop_mail_host_box_') == 0 || key.indexOf('deps_fop_mail_host_box_') == 0 || key.indexOf('fullsearch_fop_mail_host_box_') == 0 || key.indexOf('dynamic_fop_mail_host_box_') == 0 || key.indexOf('search_fop_mail_host_box_') == 0 || key.indexOf('searchnot_fop_mail_host_box_') == 0 || key.indexOf('filter_fop_mail_host_box_') == 0) delete query[key]; reloadfop_mail_host_box(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">list</i></span><span class="fop-menu-caption" title="<?php echo(_('view all elements')); ?>"><?php echo(_('view all elements')); ?> 
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filteronly" style="margin-right:auto; text-align:left;"
					onclick="query['filter_fop_mail_host_box_ID'] = checkfop_mail_host_box(null, 'ID'); delete query['page_fop_mail_host_box']; reloadfop_mail_host_box(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">arrow_forward</i></span><span class="fop-menu-caption" title="<?php echo(_('view only these elements')); ?>"><?php echo(_('view only these elements')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterrange" style="margin-right:auto; text-align:left;"
					onclick="
		var ticks = new IDList(checkfop_mail_host_box(null, 'ID'));
		var range = prompt('Bitte geben Sie den Bereich ein', '1-' + ticks.count());
		var newticks = new IDList();
		if (range) {
			range = range.split('-');
			if (range.length == 1) {
				range.push(range[0]);
			}
			var skip = (range[0] || 1) - 1;
			var take = (range[1] || Infinity) - skip;
			for (var item of ticks.all()) {
				if (skip > 0) {
					skip--;
				} else if (take > 0) {
					newticks.push(item);
					take--;
				} else break;
			}
			checkfop_mail_host_box(newticks, 'ID', 'set');
		} $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">colorize</i></span><span class="fop-menu-caption" title="<?php echo(_('limit range')); ?>"><?php echo(_('limit range')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true && (!\FOP\User::getIsGuest())) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;"
					onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return;$.get('Tables/Fop_mail_host_box/delete?ajax&from=<?php echo urlencode(\FOP\Util::getBackUrl()); ?>&id=' + escape(checkfop_mail_host_box(null, 'ID'))).then(function () { reloadfop_mail_host_box(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?>
														</ul>
														<!-- column hide -->
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon" onclick="dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">visibility</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php foreach ($columns AS $col) { ?>
																<li class="mdl-list__item mdl-button" onclick="
																	var isVisible = this.firstElementChild.innerText !== 'clear';
																	this.firstElementChild.innerText = isVisible ? 'clear' : 'visibility'; // switch icon
																	tableColumnVisibility('fop_mail_host_box', <?php echo htmlentities(json_encode($col['id'])); ?>, !isVisible); // the rest is up to a helper function in layout/tables.fop
																	">
																	<i class="material-icons"><?php if ($col['collapsed']) { echo 'clear'; } else { echo 'visibility'; }?></i>
																	<?php echo htmlentities($col['desc']); ?>
																</li>
															<?php } ?>
															<li class="mdl-list__item mdl-button" onclick="
																$.get('FOP/Index/dataview?data='+encodeURIComponent(JSON.stringify({dataview: 'fop_mail_host_box', reset: true}))).then(function () { location.reload(); });
																">
																<i class="material-icons">refresh</i>
																<?php echo _('reset all'); ?>
															</li>
														</ul>
													</div>
												</div><?php }
												
												foreach ($columns AS $col) {
													// Spalten-Überschrift rendern
													echo $col['header'];
												} ?>
											 </div>
											
											<div class="fop-table-body" id="table_fop_mail_host_box" <?php \EasyEditor\Navigation::printScroll('dv.Fop_mail_host_box', '/* scroll horiz */ this.previousElementSibling.firstElementChild.style.marginLeft = \'-\' + this.scrollLeft + \'px\';
												/* scroll verti */
												var self = this;
												if (window.DataViewScrollReloadTimeout) clearTimeout(window.DataViewScrollReloadTimeout);
												window.DataViewScrollReloadTimeout = setTimeout(function () {
													var currentPage = parseInt(query[\'page_fop_mail_host_box\'] || 0);
													var paddingTop = parseInt( self.lastElementChild.style.paddingTop, 10);
													var wantedPage = Math.max(0, currentPage + Math.floor((self.scrollTop - paddingTop) / ' . ($itemheight * $itemsperpage) . '));
													if (wantedPage != currentPage) {
														query[\'page_fop_mail_host_box\'] = wantedPage;
														reloadfop_mail_host_box(undefined, undefined, true);
													}
												}, 50);
											'); ?>>
												<div class="fop-table-body-inner" style="min-height: <?php echo 12 + $itemheight * ($itemcount + $additionalLines); ?>px; padding-top: <?php echo $itemheight * $itemsperpage * $page; ?>px;">
												<?php foreach($arr as $itempos => $item) {
													?>
													<div class="fop-table-row" style="<?php echo 'background: ' .htmlentities((function ($item) {return $item['::color'];})($item)).'!important;'; ?> " data-fop_mail_host_box-id="<?php echo htmlentities($item['ID']); ?>"<?php if (isset($item['ID'])){
														if (isset($_GET['select']) && isset($_GET['from'])) {
															echo 'onclick="event.preventDefault(); if (!window.getSelection().toString()) window.location.href=' . htmlentities(json_encode($_GET['from'] . '&colvalue=' . urlencode($item['ID']))) . ';" ';
														} else {
															echo 'onclick="event.preventDefault(); if (!window.getSelection().toString()) open_url(reloadfop_mail_host_box({action: \'open\', fop_table: \'fop_mail_host_box\', fop_id: ' .  htmlentities(json_encode($item['ID'])) . ', fop_from: location.href}, true), false);"';
														}
													}?> >

													<?php if (!isset($_GET['select'])) { ?>
													<div class='fop-table-column noprint' style="width: <?php echo json_encode($firstColumnWidth); ?>px;" onclick="$(this).find('input[type=checkbox]').first().click(); event.stopPropagation();">
													<label onclick="event.stopPropagation();" class="mdl-checkbox mdl-js-checkbox fop_mail_host_box__checkbox fop_mail_host_box__checkbox fop_mail_host_box__checkbox-ID-<?php echo htmlentities($item['ID']); ?>" style="width: auto;" for="fop_mail_host_box__<?php echo htmlentities($itempos); ?>-checkbox">
													<input class="mdl-checkbox__input" id="fop_mail_host_box__<?php echo htmlentities($itempos); ?>-checkbox" type="checkbox" onchange="<?php if (isset($item['ID'])) echo 'checkfop_mail_host_box(' . htmlentities(json_encode($item['ID'])) . ', \'ID\', this.checked); ' ?>">
													</label><button type="button" class="mdl-button mdl-js-button mdl-button--icon fop_mail_host_box__action" onclick="
														event.stopPropagation();
														dropDownFixPosition($(this), $(this).next());
														">
														<i class="material-icons">more_vert</i>
													</button><ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu" id="fop-scroll-menu-fop_mail_host_box-action-<?php echo $item['ID'] ?? 0; ?>">
														<?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="view" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick=" if (!event.ctrlKey) { open_url(reloadfop_mail_host_box({action: 'open', fop_table: 'fop_mail_host_box', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), false); return false; } $(this).closest('.overlay').click(); return false;  
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">find_in_page</i></span><span class="fop-menu-caption" title="<?php echo(_('open')); ?>"><?php echo(_('open')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="edit" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">edit</i></span><span class="fop-menu-caption" title="<?php echo(_('edit')); ?>"><?php echo(_('edit')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && (!\FOP\User::getIsGuest())) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="create_fop_mail_host_box_dir_mailbox" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_dir::createURL2(['column_mailbox' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">create</i></span><span class="fop-menu-caption" title="<?php echo(sprintf(_('create %s'), _('emaildirectory_singular'))); ?>"><?php echo(sprintf(_('create %s'), _('emaildirectory_singular'))); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && (!\FOP\User::getIsGuest())) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="create_fop_mail_host_box_share_mailbox" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_share::createURL2(['column_mailbox' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">create</i></span><span class="fop-menu-caption" title="<?php echo(sprintf(_('create %s'), _('Freigabe'))); ?>"><?php echo(sprintf(_('create %s'), _('Freigabe'))); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::send'] && $item['operation::view'] && (!\FOP\User::getIsGuest())) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="sendmail" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_draft::createURL2(['column_mailbox' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">send</i></span><span class="fop-menu-caption" title="<?php echo(_('sendmail')); ?>"><?php echo(_('sendmail')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="startmailboxsync" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::mailboxSyncURL2(['id' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">power_settings_new</i></span><span class="fop-menu-caption" title="<?php echo(_('activate/deactivate mailbox')); ?>"><?php echo(_('activate/deactivate mailbox')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::delete']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;" href="#"
				onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return false;   $.get('Tables/Fop_mail_host_box/delete?ajax&id=<?php echo htmlentities($item['ID']);?>&from=<?php echo htmlentities(\FOP\Util::getBackUrl());?>').then(function () { reloadfop_mail_host_box(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?></span>
			</a>
		<?php } ?>
													</ul><?php
		if(isset($item['ID']) && $item['operation::view']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_mail_host_box" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="startmailboxsync" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::mailboxSyncURL2(['id' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();    reloadfop_mail_host_box();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('activate/deactivate mailbox')); ?>">
				<i class="material-icons">power_settings_new</i>
			</a><?php } ?><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_mail_host_box" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="edit" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();    reloadfop_mail_host_box();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('edit')); ?>">
				<i class="material-icons">edit</i>
			</a><?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_mail_host_box" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="view" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();  if (!event.ctrlKey) { open_url(reloadfop_mail_host_box({action: 'open', fop_table: 'fop_mail_host_box', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), false); return false; }  reloadfop_mail_host_box();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('open')); ?>">
				<i class="material-icons">find_in_page</i>
			</a><?php } ?>
													</div><?php } ?><?php
													
													foreach ($columns AS $col) {
														$col['render']($item);
													}
													?></div>
												 <?php }?>

													</div>
												</div>

												
												
												</div><?php
												
	
    
  }

  public static function getidsAction($col) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
			$q = \FOP\Database::query('SELECT t.'.qi($col).' '.self::getSQL($_GET));
			$result = new \FOP\IDList();
			while ($item = $q->fetchColumn()) {
				$result->push($item);
			}
			die($result->toString());

    
  }

  public static function permissionsAction($id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		$ids = new \FOP\IDList($id);
		header('Content-Type: application/json');
		
		$perms = \FOP\Database::query('SELECT COUNT(*) AS __cnt, SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filteronly').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterrange').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterall').', SUM(CASE ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('delete').' FROM '.qi('fop_mail_host_box').' WHERE ' . $ids->toSQL(qi('ID')))->fetch(\PDO::FETCH_ASSOC);
		
		return $perms;
	
    
  }

  public static function getSQL($params) { 
    
    
    // --- BLOCK: dependency-fop_mail_host_box ---
    
		if (isset($params['select']) && $params['select'] == 'fop_mail_host_box') {
			$deps = [];
		}
	
    // --- BLOCK: dependency-fop_mail_host_boxNull ---
    
		if (isset($params['select']) && $params['select'] == 'fop_mail_host_boxNull') {
			$deps = [];
		}
	
    // --- BLOCK: dependency-fop_mail_host_box_send ---
    
		if (isset($params['select']) && $params['select'] == 'fop_mail_host_box_send') {
			$deps = [];
		}
	
    // --- BLOCK: main ---
    
								// returns a sql snippet 'FROM (...) AS t WHERE' where you can prepend your select clauses and append your ORDER LIMIT
								$sql = 'FROM (SELECT /* ::color */ CASE  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (0) THEN (\'#F5A9A922\')  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (0) THEN (\'#F5A9A922\')  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (1) THEN (\'#9FF78122\')  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (1) THEN (\'#9FF78122\')  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (2) THEN (\'#F4FA5822\')  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (2) THEN (\'#F4FA5822\')  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (3) THEN (\'#A9D0F522\')  WHEN ('.qi('fop_mail_host_box').'.'.qi('zustand').') = (3) THEN (\'#A9D0F522\')  ELSE NULL END AS '.qi('::color').',
									/* ID */ '.qi('ID').' AS '.qi('ID').',
									/* delimiter */ '.qi('delimiter').' AS '.qi('delimiter').',
									/* email_server */ '.qi('email_server').' AS '.qi('email_server').',
									/* email_server::canView */ '.qi('ref:email_server').'.'.qi('email_server:canView').' AS '.qi('email_server::canView').',
									/* email_server::description */ '.qi('ref:email_server').'.'.qi('email_server:description').' AS '.qi('email_server::description').',
									/* fopuser */ '.qi('fopuser').' AS '.qi('fopuser').',
									/* fopuser_ */ '.qi('fop_mail_host_box').'.'.qi('fopuser').' AS '.qi('fopuser_').',
									/* fopuser_::canView */ '.qi('ref:fopuser_').'.'.qi('fopuser_:canView').' AS '.qi('fopuser_::canView').',
									/* fopuser_::description */ '.qi('ref:fopuser_').'.'.qi('fopuser_:description').' AS '.qi('fopuser_::description').',
									/* from_address */ '.qi('from_address').' AS '.qi('from_address').',
									/* from_name */ '.qi('from_name').' AS '.qi('from_name').',
									/* gssapi */ '.qi('gssapi').' AS '.qi('gssapi').',
									/* hoststr */ '.qi('hoststr').' AS '.qi('hoststr').',
									/* operation::create */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::create').',
									/* operation::delete */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::delete').',
									/* operation::edit */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::edit').',
									/* operation::index */ ' . (!\FOP\User::getIsGuest() ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::menu */ ' . (((\FOP\Util::FalseToNull(\FOP\Database::query('SELECT EXISTS (SELECT (TRUE) FROM '.qi('fop_mail_host_box').' '.qi('k8RY5cHX').' WHERE TRUE AND ((SELECT ((CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('JRBjvdI2').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END)) FROM '.qi('fop_mail_host_box').' '.qi('JRBjvdI2').' WHERE '.qi('JRBjvdI2').'.'.qi('ID').' = '.qi('k8RY5cHX').'.'.qi('ID').' LIMIT 1)))')->fetchColumn()))) ? 1 : 0) . ' AS '.qi('operation::menu').',
									/* operation::send */ '.(\FOP\User::getIsGuest() ? 'false' : 'true').' AS '.qi('operation::send').',
									/* operation::view */ (CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('fop_mail_host_box').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) AS '.qi('operation::view').',
									/* password */ '.qi('password').' AS '.qi('password').',
									/* root_dir */ '.qi('root_dir').' AS '.qi('root_dir').',
									/* sent_dir */ '.qi('sent_dir').' AS '.qi('sent_dir').',
									/* sent_dir::canView */ '.qi('ref:sent_dir').'.'.qi('sent_dir:canView').' AS '.qi('sent_dir::canView').',
									/* sent_dir::description */ '.qi('ref:sent_dir').'.'.qi('sent_dir:description').' AS '.qi('sent_dir::description').',
									/* sent_dir::mbox */ '.qi('fop_mail_host_box').'.'.qi('ID').' AS '.qi('sent_dir::mbox').',
									/* signature */ '.qi('signature').' AS '.qi('signature').',
									/* spam_dir */ '.qi('spam_dir').' AS '.qi('spam_dir').',
									/* spam_dir::canView */ '.qi('ref:spam_dir').'.'.qi('spam_dir:canView').' AS '.qi('spam_dir::canView').',
									/* spam_dir::description */ '.qi('ref:spam_dir').'.'.qi('spam_dir:description').' AS '.qi('spam_dir::description').',
									/* spam_dir::mbox */ '.qi('fop_mail_host_box').'.'.qi('ID').' AS '.qi('spam_dir::mbox').',
									/* status */ '.qi('status').' AS '.qi('status').',
									/* syncdate */ '.qi('syncdate').' AS '.qi('syncdate').',
									/* trash_dir */ '.qi('trash_dir').' AS '.qi('trash_dir').',
									/* trash_dir::canView */ '.qi('ref:trash_dir').'.'.qi('trash_dir:canView').' AS '.qi('trash_dir::canView').',
									/* trash_dir::description */ '.qi('ref:trash_dir').'.'.qi('trash_dir:description').' AS '.qi('trash_dir::description').',
									/* trash_dir::mbox */ '.qi('fop_mail_host_box').'.'.qi('ID').' AS '.qi('trash_dir::mbox').',
									/* user */ '.qi('user').' AS '.qi('user').',
									/* zustand */ '.qi('zustand').' AS '.qi('zustand').',
									1
								FROM '.qi('fop_mail_host_box').' '.qi('fop_mail_host_box').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('email_server:ID').', '.qi('fop_mail_host').'.'.qi('name').' AS '.qi('email_server:description').', ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('email_server:canView').' FROM '.qi('fop_mail_host').') '.qi('ref:email_server').' ON '.qi('ref:email_server').'.'.qi('email_server:ID').' = '.qi('email_server').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('trash_dir:ID').', '.qi('fop_mail_host_box_dir').'.'.qi('name').' AS '.qi('trash_dir:description').', ((COALESCE((SELECT (CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('1IDxgk3w').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('fop_mail_host_box').' '.qi('1IDxgk3w').' WHERE '.qi('1IDxgk3w').'.'.qi('ID').' = '.qi('fop_mail_host_box_dir').'.'.qi('mailbox').' LIMIT 1), FALSE))) AS '.qi('trash_dir:canView').' FROM '.qi('fop_mail_host_box_dir').') '.qi('ref:trash_dir').' ON '.qi('ref:trash_dir').'.'.qi('trash_dir:ID').' = '.qi('trash_dir').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('spam_dir:ID').', '.qi('fop_mail_host_box_dir').'.'.qi('name').' AS '.qi('spam_dir:description').', ((COALESCE((SELECT (CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('1IDxgk3w').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('fop_mail_host_box').' '.qi('1IDxgk3w').' WHERE '.qi('1IDxgk3w').'.'.qi('ID').' = '.qi('fop_mail_host_box_dir').'.'.qi('mailbox').' LIMIT 1), FALSE))) AS '.qi('spam_dir:canView').' FROM '.qi('fop_mail_host_box_dir').') '.qi('ref:spam_dir').' ON '.qi('ref:spam_dir').'.'.qi('spam_dir:ID').' = '.qi('spam_dir').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('sent_dir:ID').', '.qi('fop_mail_host_box_dir').'.'.qi('name').' AS '.qi('sent_dir:description').', ((COALESCE((SELECT (CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('1IDxgk3w').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('fop_mail_host_box').' '.qi('1IDxgk3w').' WHERE '.qi('1IDxgk3w').'.'.qi('ID').' = '.qi('fop_mail_host_box_dir').'.'.qi('mailbox').' LIMIT 1), FALSE))) AS '.qi('sent_dir:canView').' FROM '.qi('fop_mail_host_box_dir').') '.qi('ref:sent_dir').' ON '.qi('ref:sent_dir').'.'.qi('sent_dir:ID').' = '.qi('sent_dir').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('fopuser_:ID').', CONCAT('.qi('mitglied').'.'.qi('vorname').', \' \', '.qi('mitglied').'.'.qi('name').') AS '.qi('fopuser_:description').', ((CASE WHEN '.\FOP\Database::quote(\FOP\User::getGruppe()).' THEN TRUE ELSE NOT (('.qi('mitglied').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) AND (CASE WHEN '.\FOP\Database::quote(\FOP\User::getMitglied()).' THEN TRUE ELSE NOT ((('.qi('mitglied').'.'.qi('ID').') <> ('.\FOP\Database::sessionVarSQL('user').')) AND (NOT (EXISTS (SELECT (TRUE) FROM '.qi('gruppeItem').' '.qi('7sncgH3z').' WHERE '.qi('7sncgH3z').'.'.qi('item').' = '.qi('mitglied').'.'.qi('ID').' AND (EXISTS (SELECT (TRUE) FROM '.qi('gruppeVerantwortlich').' '.qi('eHueOsQC').' WHERE '.qi('eHueOsQC').'.'.qi('gruppe').' = '.qi('7sncgH3z').'.'.qi('list').' AND (('.qi('eHueOsQC').'.'.qi('mitglied').') = ('.\FOP\Database::sessionVarSQL('user').')) LIMIT 1)) LIMIT 1)))) END) AND (CASE WHEN '.\FOP\Database::quote(\FOP\User::getSuperadmin()).' THEN TRUE ELSE NOT ('.qi('mitglied').'.'.qi('superadmin').') END)) AS '.qi('fopuser_:canView').' FROM '.qi('mitglied').') '.qi('ref:fopuser_').' ON '.qi('ref:fopuser_').'.'.qi('fopuser_:ID').' = '.qi('fop_mail_host_box').'.'.qi('fopuser').'
								WHERE (((CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('fop_mail_host_box').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END)))
									AND (' . (isset($_GET['select']) && $_GET['select'] == 'fop_mail_host_box' ? 'TRUE' : 'TRUE') . ')
									AND (' . (isset($_GET['select']) && $_GET['select'] == 'fop_mail_host_box_send' ? 'TRUE' : 'TRUE') . ')
									AND (' . (isset($_GET['select']) && $_GET['select'] == 'fop_mail_host_boxNull' ? 'TRUE' : 'TRUE') . ')) AS t
								LEFT JOIN '.qi('mitglied').' AS '.qi('sorter-fopuser_').' ON t.'.qi('fopuser_').' = '.qi('sorter-fopuser_').'.'.qi('ID').'
								WHERE ' . (isset($params['range_min_fop_mail_host_box_syncdate']) ? ($params['range_min_fop_mail_host_box_syncdate'] !== '' && is_numeric($params['range_min_fop_mail_host_box_syncdate']) ? 't.'.qi('syncdate').' >= ' . \FOP\Database::quote($params['range_min_fop_mail_host_box_syncdate']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_mail_host_box_syncdate']) ? ($params['range_max_fop_mail_host_box_syncdate'] !== '' && is_numeric($params['range_max_fop_mail_host_box_syncdate']) ? 't.'.qi('syncdate').' <= ' . \FOP\Database::quote($params['range_max_fop_mail_host_box_syncdate']) . ' AND ' : '') : '') . 
								(isset($params['filter_fop_mail_host_box_fopuser_']) ? ($params['filter_fop_mail_host_box_fopuser_'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_fopuser_']))->toSQL('t.'.qi('fopuser_').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_user']) ? ($params['filter_fop_mail_host_box_user'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_user']))->toSQL('t.'.qi('user').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_password']) ? ($params['filter_fop_mail_host_box_password'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_password']))->toSQL('t.'.qi('password').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_from_name']) ? ($params['filter_fop_mail_host_box_from_name'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_from_name']))->toSQL('t.'.qi('from_name').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_from_address']) ? ($params['filter_fop_mail_host_box_from_address'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_from_address']))->toSQL('t.'.qi('from_address').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_email_server']) ? ($params['filter_fop_mail_host_box_email_server'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_email_server']))->toSQL('t.'.qi('email_server').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_syncdate']) ? ($params['filter_fop_mail_host_box_syncdate'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_syncdate']))->toSQL('t.'.qi('syncdate').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_trash_dir']) ? ($params['filter_fop_mail_host_box_trash_dir'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_trash_dir']))->toSQL('t.'.qi('trash_dir').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_spam_dir']) ? ($params['filter_fop_mail_host_box_spam_dir'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_spam_dir']))->toSQL('t.'.qi('spam_dir').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_sent_dir']) ? ($params['filter_fop_mail_host_box_sent_dir'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_sent_dir']))->toSQL('t.'.qi('sent_dir').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_status']) ? ($params['filter_fop_mail_host_box_status'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_status']))->toSQL('t.'.qi('status').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_signature']) ? ($params['filter_fop_mail_host_box_signature'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_signature']))->toSQL('t.'.qi('signature').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_zustand']) ? ($params['filter_fop_mail_host_box_zustand'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_zustand']))->toSQL('t.'.qi('zustand').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_ID']) ? ($params['filter_fop_mail_host_box_ID'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_ID']))->toSQL('t.'.qi('ID').'') . ') AND ') : '') : '') . 
								(isset($params['search_fop_mail_host_box_user']) ? 't.'.qi('user').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box_user'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_mail_host_box_from_name']) ? 't.'.qi('from_name').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box_from_name'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_mail_host_box_from_address']) ? 't.'.qi('from_address').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box_from_address'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_mail_host_box_status']) ? 't.'.qi('status').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box_status'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_mail_host_box_signature']) ? 't.'.qi('signature').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box_signature'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_mail_host_box_user']) ? 'NOT t.'.qi('user').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_mail_host_box_user'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_mail_host_box_from_name']) ? 'NOT t.'.qi('from_name').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_mail_host_box_from_name'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_mail_host_box_from_address']) ? 'NOT t.'.qi('from_address').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_mail_host_box_from_address'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_mail_host_box_status']) ? 'NOT t.'.qi('status').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_mail_host_box_status'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_mail_host_box_signature']) ? 'NOT t.'.qi('signature').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_mail_host_box_signature'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_mail_host_box']) ? '(' . 't.'.qi('user').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box'] . '%') . ' OR ' . 't.'.qi('from_name').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box'] . '%') . ' OR ' . 't.'.qi('from_address').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box'] . '%') . ' OR ' . 't.'.qi('status').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box'] . '%') . ' OR ' . 't.'.qi('signature').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_mail_host_box'] . '%') . ') AND ' : '') . 
								'
								 TRUE ';
								return $sql;
	
    
  }

  public static function getfilter_fop_mail_host_box_email_serverItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_mail_host_box_email_server']);
		return \Types\Fop_mail_host::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('email_server').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_fop_mail_host_box_trash_dirItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_mail_host_box_trash_dir']);
		return \Types\Fop_mail_host_box_dirMailbox::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('trash_dir').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_fop_mail_host_box_spam_dirItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_mail_host_box_spam_dir']);
		return \Types\Fop_mail_host_box_dirMailbox::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('spam_dir').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_fop_mail_host_box_sent_dirItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_mail_host_box_sent_dir']);
		return \Types\Fop_mail_host_box_dirMailbox::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('sent_dir').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_fop_mail_host_box_fopuser_ItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_mail_host_box_fopuser_']);
		return \Types\Mitglied::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('fopuser_').''.self::getSQL($params).')');
	

    
  }

  public static function getData($sqladdon, $params, $stream = false ) { 
    
    
    // --- BLOCK: main ---
    
								$sql = self::getSQL($params);

								$order = (\FOP\Util::array_value(array(
									'fopuser_ ASC' => 'ORDER BY '.qi('sorter-fopuser_').'.'.qi('name').' , '.qi('sorter-fopuser_').'.'.qi('name').' , '.qi('sorter-fopuser_').'.'.qi('vorname').' , '.qi('sorter-fopuser_').'.'.qi('vorname').' ',
									'fopuser_ DESC' => 'ORDER BY '.qi('sorter-fopuser_').'.'.qi('name').' DESC, '.qi('sorter-fopuser_').'.'.qi('name').' DESC, '.qi('sorter-fopuser_').'.'.qi('vorname').' DESC, '.qi('sorter-fopuser_').'.'.qi('vorname').' DESC',
									'from_address ASC' => 'ORDER BY t.'.qi('from_address').' ASC',
									'signature ASC' => 'ORDER BY t.'.qi('signature').' ASC',
									'user ASC' => 'ORDER BY t.'.qi('user').' ASC',
									'from_name ASC' => 'ORDER BY t.'.qi('from_name').' ASC',
									'status ASC' => 'ORDER BY t.'.qi('status').' ASC',
									'syncdate ASC' => 'ORDER BY t.'.qi('syncdate').' ASC',
									'from_address DESC' => 'ORDER BY t.'.qi('from_address').' DESC',
									'signature DESC' => 'ORDER BY t.'.qi('signature').' DESC',
									'user DESC' => 'ORDER BY t.'.qi('user').' DESC',
									'from_name DESC' => 'ORDER BY t.'.qi('from_name').' DESC',
									'status DESC' => 'ORDER BY t.'.qi('status').' DESC',
									'syncdate DESC' => 'ORDER BY t.'.qi('syncdate').' DESC',
									'' => ''), isset($params['sort_fop_mail_host_box']) ? $params['sort_fop_mail_host_box'] : '') ?: '');
								// wenn sqladdon bereits ein ORDER enthält, kein order aufbauen
								if (strpos($sqladdon, 'ORDER') !== false) {
									$order = '';
								}
								if ($stream) {
									// als Stream (währenddessen darf keine weitere SQL-Query laufen) für große Datenmengen und Statistiken
									$result = (function () use ($sql, $order, $sqladdon) {
										$stream = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
										while ($item = $stream->fetch(\PDO::FETCH_ASSOC)) {
											$item['fopuser_'] = \FOP\Sanitizers::null_converter($item['fopuser_']);
											$item['password'] = \Types\Password::decryptSymmetric($item['password']);
											$item['from_address'] = \FOP\Sanitizers::a_text($item['from_address']);
											$item['email_server'] = \FOP\Sanitizers::null_converter($item['email_server']);
											$item['syncdate'] = intval($item['syncdate']);
											$item['trash_dir'] = \FOP\Sanitizers::null_converter($item['trash_dir']);
											$item['spam_dir'] = \FOP\Sanitizers::null_converter($item['spam_dir']);
											$item['sent_dir'] = \FOP\Sanitizers::null_converter($item['sent_dir']);
											$item['zustand'] = \FOP\Util::IntStringNull($item['zustand']);
											
											yield $item;
										}
									})();
								} else {
									// als RAM-Array
									$result = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
									$arr = $result->fetchAll(\PDO::FETCH_ASSOC);
									$itemcount = count($arr);

									foreach($arr as $i => &$item){
										$item['fopuser_'] = \FOP\Sanitizers::null_converter($item['fopuser_']);
										$item['password'] = \Types\Password::decryptSymmetric($item['password']);
										$item['from_address'] = \FOP\Sanitizers::a_text($item['from_address']);
										$item['email_server'] = \FOP\Sanitizers::null_converter($item['email_server']);
										$item['syncdate'] = intval($item['syncdate']);
										$item['trash_dir'] = \FOP\Sanitizers::null_converter($item['trash_dir']);
										$item['spam_dir'] = \FOP\Sanitizers::null_converter($item['spam_dir']);
										$item['sent_dir'] = \FOP\Sanitizers::null_converter($item['sent_dir']);
										$item['zustand'] = \FOP\Util::IntStringNull($item['zustand']);
										
									}
									unset($item);

									$result = ["items" => $arr, "itemcount" => $itemcount];

									
								}

								return $result;
	
    
  }

  public static function getFilterHTML($params, $delimiter = ', ' , $showButton = true ) { 
    
    
    // --- BLOCK: main ---
    
		// Contract: ist showButton == false, sollten keine HTML-Tags im Output enthalten sein (Verwendung in Dateinamen!!)
		$filters = [];
		
	
	if ( // Corner Case: Monat
		isset($params['range_min_fop_mail_host_box_syncdate'])
		&& isset($params['range_max_fop_mail_host_box_syncdate'])
		&& (date('d', $params['range_min_fop_mail_host_box_syncdate']) == '01') //check first day of month
		&& (date('d', $params['range_max_fop_mail_host_box_syncdate']) == date('t', $params['range_max_fop_mail_host_box_syncdate'])) //check last day of month
		&& (date('Y-m', $params['range_min_fop_mail_host_box_syncdate']) == date('Y-m', $params['range_max_fop_mail_host_box_syncdate'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				reloadfop_mail_host_box(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				reloadfop_mail_host_box(); ">add_circle_outline</i>' : ''),
			htmlentities(_('earliest synchronization date') . ': ' . strftime('%B', $params['range_min_fop_mail_host_box_syncdate']) . ' ' . date('Y', $params['range_min_fop_mail_host_box_syncdate']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_fop_mail_host_box_syncdate'])
		&& isset($params['range_max_fop_mail_host_box_syncdate'])
		&& (date('Y-m-d', $params['range_min_fop_mail_host_box_syncdate']) == (date('Y-m-d', $params['range_max_fop_mail_host_box_syncdate'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				reloadfop_mail_host_box(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				reloadfop_mail_host_box(); ">add_circle_outline</i>' : ''),
			htmlentities(_('earliest synchronization date') . ': ' . date('d.m.Y', $params['range_min_fop_mail_host_box_syncdate']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_fop_mail_host_box_syncdate'])
		&& isset($params['range_max_fop_mail_host_box_syncdate'])
		&& (date('Y', $params['range_min_fop_mail_host_box_syncdate']) == (date('Y', $params['range_max_fop_mail_host_box_syncdate'])))
		&& ((date('m-d', $params['range_min_fop_mail_host_box_syncdate']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_mail_host_box_syncdate']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				reloadfop_mail_host_box(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				reloadfop_mail_host_box(); ">add_circle_outline</i>' : ''),
			htmlentities(_('earliest synchronization date') . ': ' . date('Y', $params['range_min_fop_mail_host_box_syncdate']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_fop_mail_host_box_syncdate'])
		&& isset($params['range_max_fop_mail_host_box_syncdate'])
		&& ( (
		 ((date('m-d', $params['range_min_fop_mail_host_box_syncdate']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_mail_host_box_syncdate']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_fop_mail_host_box_syncdate']) == '04-01'))
		&& ((date('m-d', $params['range_max_fop_mail_host_box_syncdate']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_mail_host_box_syncdate']) == '07-01'))
		&& ((date('m-d', $params['range_max_fop_mail_host_box_syncdate']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_mail_host_box_syncdate']) == '10-01'))
		&& ((date('m-d', $params['range_max_fop_mail_host_box_syncdate']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
					query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_fop_mail_host_box_syncdate']).'&apos;;
					reloadfop_mail_host_box(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_fop_mail_host_box_syncdate']).'&apos;;
				query[&apos;range_max_fop_mail_host_box_syncdate&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_fop_mail_host_box_syncdate']).'&apos;;
				reloadfop_mail_host_box(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('earliest synchronization date') . ': Q' . (ceil((date('m', $params['range_min_fop_mail_host_box_syncdate']))/3)) . ' (' . date('d.m.', $params['range_min_fop_mail_host_box_syncdate']) . ' - ' . date('d.m.Y', $params['range_max_fop_mail_host_box_syncdate']) . ')')
		]);
	}
	else if (isset($params['range_min_fop_mail_host_box_syncdate']) && isset($params['range_max_fop_mail_host_box_syncdate'])) {
		array_push($filters, _('earliest synchronization date') . ': ' . (($params['range_min_fop_mail_host_box_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_mail_host_box_syncdate'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_fop_mail_host_box_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_mail_host_box_syncdate'])) : ''));
	} else if (isset($params['range_min_fop_mail_host_box_syncdate'])) {
		array_push($filters, _('earliest synchronization date') . ': ' . _('filters_from') . ' ' . (($params['range_min_fop_mail_host_box_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_mail_host_box_syncdate'])) : ''));
	} else if (isset($params['range_max_fop_mail_host_box_syncdate'])) {
		array_push($filters, _('earliest synchronization date') . ': ' . _('filters_to') . ' ' . (($params['range_max_fop_mail_host_box_syncdate']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_mail_host_box_syncdate'])) : ''));
	}if (isset($params['filter_fop_mail_host_box_user'])) {
		if ($params['filter_fop_mail_host_box_user'] == '_null') {
			array_push($filters, _('user') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_user']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('user') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_password'])) {
		if ($params['filter_fop_mail_host_box_password'] == '_null') {
			array_push($filters, _('password') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_password']))->all() AS $val) {
				$value = '*****';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('password') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_from_name'])) {
		if ($params['filter_fop_mail_host_box_from_name'] == '_null') {
			array_push($filters, _('displayname') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_from_name']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('displayname') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_from_address'])) {
		if ($params['filter_fop_mail_host_box_from_address'] == '_null') {
			array_push($filters, _('E-Mail') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_from_address']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('E-Mail') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_syncdate'])) {
		if ($params['filter_fop_mail_host_box_syncdate'] == '_null') {
			array_push($filters, _('earliest synchronization date') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_syncdate']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('earliest synchronization date') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_status'])) {
		if ($params['filter_fop_mail_host_box_status'] == '_null') {
			array_push($filters, _('Status') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_status']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Status') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_signature'])) {
		if ($params['filter_fop_mail_host_box_signature'] == '_null') {
			array_push($filters, _('signature') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_signature']))->all() AS $val) {
				$value = mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($val)))), 0, 20) . (strlen($val) >= 20 ? '...' : '');
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('signature') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_zustand'])) {
		if ($params['filter_fop_mail_host_box_zustand'] == '_null') {
			array_push($filters, _('Zustand') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_zustand']))->all() AS $val) {
				$value = \Types\Zustand_box::toString($val);
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Zustand') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_email_server'])) {
		if ($params['filter_fop_mail_host_box_email_server'] == '_null') {
			array_push($filters, _('emailhost') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_email_server']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('fop_mail_host').'.'.qi('name').' AS description FROM '.qi('fop_mail_host').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('emailhost') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_trash_dir'])) {
		if ($params['filter_fop_mail_host_box_trash_dir'] == '_null') {
			array_push($filters, _('trash folder') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_trash_dir']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('fop_mail_host_box_dir').'.'.qi('name').' AS description FROM '.qi('fop_mail_host_box_dir').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('-')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('trash folder') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_spam_dir'])) {
		if ($params['filter_fop_mail_host_box_spam_dir'] == '_null') {
			array_push($filters, _('Spam') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_spam_dir']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('fop_mail_host_box_dir').'.'.qi('name').' AS description FROM '.qi('fop_mail_host_box_dir').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('-')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Spam') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_sent_dir'])) {
		if ($params['filter_fop_mail_host_box_sent_dir'] == '_null') {
			array_push($filters, _('sent folder') . ': ' . _('-'));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_sent_dir']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('fop_mail_host_box_dir').'.'.qi('name').' AS description FROM '.qi('fop_mail_host_box_dir').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('-')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('sent folder') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_fopuser_'])) {
		if ($params['filter_fop_mail_host_box_fopuser_'] == '_null') {
			array_push($filters, _('owner') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_fopuser_']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT CONCAT('.qi('mitglied').'.'.qi('vorname').', \' \', '.qi('mitglied').'.'.qi('name').') AS description FROM '.qi('mitglied').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('owner') . ': ' . implode(', ', $values));
		}
	}if (isset($params['search_fop_mail_host_box_user'])) {
		array_push($filters, _('user') . ' ' . _('filter_contains') . ' ' . $params['search_fop_mail_host_box_user']);
	}if (isset($params['search_fop_mail_host_box_from_name'])) {
		array_push($filters, _('from_name') . ' ' . _('filter_contains') . ' ' . $params['search_fop_mail_host_box_from_name']);
	}if (isset($params['search_fop_mail_host_box_from_address'])) {
		array_push($filters, _('from_address') . ' ' . _('filter_contains') . ' ' . $params['search_fop_mail_host_box_from_address']);
	}if (isset($params['search_fop_mail_host_box_status'])) {
		array_push($filters, _('status') . ' ' . _('filter_contains') . ' ' . $params['search_fop_mail_host_box_status']);
	}if (isset($params['search_fop_mail_host_box_signature'])) {
		array_push($filters, _('signature') . ' ' . _('filter_contains') . ' ' . $params['search_fop_mail_host_box_signature']);
	}if (isset($params['searchnot_fop_mail_host_box_user'])) {
		array_push($filters, _('user') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_mail_host_box_user']);
	}if (isset($params['searchnot_fop_mail_host_box_from_name'])) {
		array_push($filters, _('from_name') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_mail_host_box_from_name']);
	}if (isset($params['searchnot_fop_mail_host_box_from_address'])) {
		array_push($filters, _('from_address') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_mail_host_box_from_address']);
	}if (isset($params['searchnot_fop_mail_host_box_status'])) {
		array_push($filters, _('status') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_mail_host_box_status']);
	}if (isset($params['searchnot_fop_mail_host_box_signature'])) {
		array_push($filters, _('signature') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_mail_host_box_signature']);
	}
		if (count($filters)) {
			$result = implode($delimiter, array_map(function ($filter) {
				if (is_array($filter)) {
					return implode('', $filter);
				}
				return htmlentities($filter);
			}, $filters))
			// Button, um Filter zu entfernen
			. ($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="for (var q in query) {if (q.includes(\'_fop_mail_host_box_\')) delete query[q];} reloadfop_mail_host_box(); ">clear</i>' : '');
		} else {
			$result = _('no_filter');
		}
		return $result;
	
    
  }

  public static function openAction($fop_table, $fop_id, $fop_from) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    

if ($fop_table == 'fop_mail_host_box') {
	\FOP\Session::setPayload('dv-fop_mail_host_box', [
		'id' => 'fop_mail_host_box',
		'tbl' => 'fop_mail_host_box',
		'idcol' => 'ID',
		'prev' => \DataViewRouter\Fop_mail_host_box::stepURL('fop_mail_host_box', 'XXX', -1),
		'next' => \DataViewRouter\Fop_mail_host_box::stepURL('fop_mail_host_box', 'XXX',  1),
		'from' => $fop_from
	]);
	
	if ($fop_id == '_') return; // nur Rückreferenz setzen, nicht öffnen
	$params = [];
	if (isset($_GET['popup'])) $params['popup'] = true;
	if (isset($_GET['from'])) $params['from'] = $_GET['from'];
	$params['id'] = $fop_id;
	
	$url = \TablesRouter\Fop_mail_host_box::viewURL2($params);
	header('Location: ' . $url);
}

die();
    
  }

  public static function stepAction($tbl, $id, $step) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
	$dv = \FOP\Session::getPayload('dv-'.$tbl);
	$url = $dv['from'];
	$parts = parse_url($url);
	parse_str($parts['query'], $query);
	$data = self::getData('', $query);
	$col = $dv['idcol'];
	$ids = array_map(function ($x) use ($col) {return $x[$col];}, $data['items']);
	if (!count($ids)) {
		header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])));
		die();
	}
	$idx = array_search($id, $ids);
	$idx += count($ids) + $step;
	$idx = $idx % count($ids);
	header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])) . '/view?id=' . urlencode($ids[$idx]));
	die();

    
  }


  
  

  
  
}



