<?php

namespace DataView;

class Fop_mail_host_box_share_mailbox {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function renderTabTableAction($id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
     ?><div class='fop-dv-buttonbar'><?php if((!\FOP\User::getIsGuest())) { ?><a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" onclick="var self = this; $.get(reloadfop_mail_host_box_share_mailbox({action: 'open', fop_table: 'fop_mail_host_box_share', fop_id: '_', fop_from: location.href}, true)).then(function () { open_url(self.href, false);}); return false;" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_share::createURL2(['from' => \FOP\Util::getBackUrl(), 'column_mailbox' => $id])); ?>"><i class="material-icons">add</i> <?php echo(sprintf(_('create %s'), _('Freigabe'))); ?></a><?php } ?></div><?php 
								\FOP\User::getIsGuest();
								$itemheight = 32;
								$itemsperpage = ceil(1080 / $itemheight * 0.8);
								$page = (isset($_GET['page_fop_mail_host_box_share_mailbox']) ? intval($_GET['page_fop_mail_host_box_share_mailbox']) : 0);
								$addlines = (isset($_GET['addlines_fop_mail_host_box_share_mailbox']) ? intval($_GET['addlines_fop_mail_host_box_share_mailbox']) : 0);
								$firstitem = $page * $itemsperpage;
								$sqladdon = ' LIMIT ' . ($itemsperpage * 2) . ' OFFSET ' . ($firstitem);
								$data = self::getData($sqladdon, $_GET, $id);
								$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;
								$additionalLines = 0;

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

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

											];
											$columns['type'] = $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_share_mailbox'))->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_share_mailbox(); 
		}});
		
		win.append(getfilter_fop_mail_host_box_share_mailbox_fopuserListMultiFilter()); 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_share_mailbox'] == 'fopuser ASC') {
			query['sort_fop_mail_host_box_share_mailbox'] = 'fopuser DESC';
		 } else if (query['sort_fop_mail_host_box_share_mailbox'] == 'fopuser DESC') {
		 	delete query['sort_fop_mail_host_box_share_mailbox'];
		 } else {
			query['sort_fop_mail_host_box_share_mailbox'] = 'fopuser ASC';
		 }
		 reloadfop_mail_host_box_share_mailbox();
		 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(_('Benutzer')); ?>'><?php echo(_('Benutzer')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box_share_mailbox']) && $_GET['sort_fop_mail_host_box_share_mailbox'] == 'fopuser ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box_share_mailbox']) && $_GET['sort_fop_mail_host_box_share_mailbox'] == 'fopuser DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_share_mailbox_fopuser']) || isset($_GET['range_max_fop_mail_host_box_share_mailbox_fopuser']) || isset($_GET['deps_fop_mail_host_box_share_mailbox_fopuser']) || isset($_GET['fullsearch_fop_mail_host_box_share_mailbox_fopuser']) || isset($_GET['dynamic_fop_mail_host_box_share_mailbox_fopuser']) || isset($_GET['search_fop_mail_host_box_share_mailbox_fopuser']) || isset($_GET['searchnot_fop_mail_host_box_share_mailbox_fopuser']) || isset($_GET['filter_fop_mail_host_box_share_mailbox_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='type'
												data-order='<?php echo intval($columns['type']['order']); ?>'
												data-width='<?php echo intval($columns['type']['width']); ?>'
												data-collapsed='<?php echo intval($columns['type']['collapsed']); ?>'
												style='width: <?php echo intval($columns['type']['width']); ?>px; <?php if ($columns['type']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_mail_host_box_share_mailbox(); 
		}});
		win.append($('<input type=\'checkbox\'' + (querySet('filter_fop_mail_host_box_share_mailbox_type', '1') ? ' checked>': '>')).change(function (){querySet('filter_fop_mail_host_box_share_mailbox_type', '1', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('nur lesen')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_mail_host_box_share_mailbox_type', '2') ? ' checked>': '>')).change(function (){querySet('filter_fop_mail_host_box_share_mailbox_type', '2', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('lesen und schreiben')); ?><br/>');
		return false;
	">
													<span class='title-title' title='<?php echo(_('Berechtigung')); ?>'><?php echo(_('Berechtigung')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_mail_host_box_share_mailbox']) && $_GET['sort_fop_mail_host_box_share_mailbox'] == 'type ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_mail_host_box_share_mailbox']) && $_GET['sort_fop_mail_host_box_share_mailbox'] == 'type DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_mail_host_box_share_mailbox_type']) || isset($_GET['range_max_fop_mail_host_box_share_mailbox_type']) || isset($_GET['deps_fop_mail_host_box_share_mailbox_type']) || isset($_GET['fullsearch_fop_mail_host_box_share_mailbox_type']) || isset($_GET['dynamic_fop_mail_host_box_share_mailbox_type']) || isset($_GET['search_fop_mail_host_box_share_mailbox_type']) || isset($_GET['searchnot_fop_mail_host_box_share_mailbox_type']) || isset($_GET['filter_fop_mail_host_box_share_mailbox_type'])) {
															// 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['type']['header'] = ob_get_contents(); ob_end_clean();
											$columns['type']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['type']['width']); ?>px; <?php if ($columns['type']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='type'><?php echo htmlentities(\Types\Fop_mail_host_box_sharetype::toStringShort($item['type'])); ?></div><?php
											};
											$columns['type']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='type'
													data-order='<?php echo intval($columns['type']['order']); ?>'
													data-width='<?php echo intval($columns['type']['width']); ?>'
													data-collapsed='<?php echo intval($columns['type']['collapsed']); ?>'
													style='width: <?php echo intval($columns['type']['width']); ?>px; <?php if ($columns['type']['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_share_mailbox-table .fop-table-header {
											height: <?php echo 32; ?>px;
										}
										#fop_mail_host_box_share_mailbox-table .fop-table-header .fop-table-column .title,
										#fop_mail_host_box_share_mailbox-table .fop-column-handle,
										#fop_mail_host_box_share_mailbox-table .fop-table-row,
										#fop_mail_host_box_share_mailbox-table .fop-table-row .fop-table-column,
										#fop_mail_host_box_share_mailbox-table .fop-table-column-multicontrol,
										#fop_mail_host_box_share_mailbox-table .fop-filter-button {
											height: 32px;
											line-height: 32px;
										}
										</style>
											<div class="fop-table" data-table-id="fop_mail_host_box_share_mailbox">
											<div class="fop-legend"></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_share_mailbox__all-checkbox">
														<input class="mdl-checkbox__input" id="fop_mail_host_box_share_mailbox__all-checkbox" type="checkbox" onchange="checkfop_mail_host_box_share_mailbox('all', 'ID', this.checked);">
														</label>
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon fop_mail_host_box_share_mailbox__mass-action" style='visibility: hidden;' onclick="$.get('DataView/Fop_mail_host_box_share_mailbox/permissions?id=' + checkfop_mail_host_box_share_mailbox(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_share_mailbox_') == 0 || key.indexOf('range_max_fop_mail_host_box_share_mailbox_') == 0 || key.indexOf('deps_fop_mail_host_box_share_mailbox_') == 0 || key.indexOf('fullsearch_fop_mail_host_box_share_mailbox_') == 0 || key.indexOf('dynamic_fop_mail_host_box_share_mailbox_') == 0 || key.indexOf('search_fop_mail_host_box_share_mailbox_') == 0 || key.indexOf('searchnot_fop_mail_host_box_share_mailbox_') == 0 || key.indexOf('filter_fop_mail_host_box_share_mailbox_') == 0) delete query[key]; reloadfop_mail_host_box_share_mailbox(); $(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_share_mailbox_ID'] = checkfop_mail_host_box_share_mailbox(null, 'ID'); delete query['page_fop_mail_host_box_share_mailbox']; reloadfop_mail_host_box_share_mailbox(); $(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_share_mailbox(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_share_mailbox(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_share/delete?ajax&from=<?php echo urlencode(\FOP\Util::getBackUrl()); ?>&id=' + escape(checkfop_mail_host_box_share_mailbox(null, 'ID'))).then(function () { reloadfop_mail_host_box_share_mailbox(); }, 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_share_mailbox', <?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_share_mailbox', 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_share_mailbox" <?php \EasyEditor\Navigation::printScroll('dv.Fop_mail_host_box_share_mailbox', '/* 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_share_mailbox\'] || 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_share_mailbox\'] = wantedPage;
														reloadfop_mail_host_box_share_mailbox(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="" data-fop_mail_host_box_share-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_share_mailbox({action: \'open\', fop_table: \'fop_mail_host_box_share\', 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_share_mailbox__checkbox fop_mail_host_box_share_mailbox__checkbox fop_mail_host_box_share_mailbox__checkbox-ID-<?php echo htmlentities($item['ID']); ?>" style="width: auto;" for="fop_mail_host_box_share_mailbox__<?php echo htmlentities($itempos); ?>-checkbox">
													<input class="mdl-checkbox__input" id="fop_mail_host_box_share_mailbox__<?php echo htmlentities($itempos); ?>-checkbox" type="checkbox" onchange="<?php if (isset($item['ID'])) echo 'checkfop_mail_host_box_share_mailbox(' . 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_share_mailbox__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_share_mailbox-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_share::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick=" if (!event.ctrlKey) { open_url(reloadfop_mail_host_box_share_mailbox({action: 'open', fop_table: 'fop_mail_host_box_share', 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_share::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']) && $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_share/delete?ajax&id=<?php echo htmlentities($item['ID']);?>&from=<?php echo htmlentities(\FOP\Util::getBackUrl());?>').then(function () { reloadfop_mail_host_box_share_mailbox(); }, 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'] && $item['operation::edit']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_mail_host_box_share" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="edit" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_share::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();    reloadfop_mail_host_box_share_mailbox();
					$(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_share" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="view" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_share::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();  if (!event.ctrlKey) { open_url(reloadfop_mail_host_box_share_mailbox({action: 'open', fop_table: 'fop_mail_host_box_share', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), false); return false; }  reloadfop_mail_host_box_share_mailbox();
					$(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 renderScript($id) { 
    
    
    // --- BLOCK: main ---
    
								\FOP\I18n::ensureIsLoaded();
								?>
								<script type="text/javascript">
									
    function changefilter_fop_mail_host_box_share_mailbox_mailboxListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_share_mailbox_mailbox', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_share_mailbox_mailbox'];
		  }reloadfop_mail_host_box_share_mailbox();
        
    }

		var ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout = null;
		function changefilter_fop_mail_host_box_share_mailbox_mailboxSearchFilter(val, callback) {
			if(ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout) clearTimeout(ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout);

			ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box_share_mailbox({action: 'getfilter_fop_mail_host_box_share_mailbox_mailboxItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_share_mailbox_mailbox_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_share_mailbox_mailboxListMultiFilter() {
		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_share_mailbox_mailbox_orig']) ? json_encode($_GET['filter_fop_mail_host_box_share_mailbox_mailbox_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="b3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2" type="text">' +
			'<label class="mdl-textfield__label" for="b3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2">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_share_mailbox_mailbox', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_share_mailbox_mailbox_orig'] = '';
					delete query['filter_fop_mail_host_box_share_mailbox_mailbox'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box_share_mailbox();
					
				} else {
					$('#table_fop_mail_host_box_share_mailbox').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_share_mailbox_mailboxSearchFilter(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_share_mailbox::getfilter_fop_mail_host_box_share_mailbox_mailboxItemsByStringAction('', $id));
		?>;

		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_share_mailbox_mailbox_orig'] = '';
				delete query['filter_fop_mail_host_box_share_mailbox_mailbox'];
				reload('', items);reloadfop_mail_host_box_share_mailbox();
				
			})).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_share_mailbox_mailbox', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_share_mailbox_mailboxListMultiFilter("' + 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_share_mailbox_fopuserListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_share_mailbox_fopuser', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_share_mailbox_fopuser'];
		  }reloadfop_mail_host_box_share_mailbox();
        
    }

		var i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout = null;
		function changefilter_fop_mail_host_box_share_mailbox_fopuserSearchFilter(val, callback) {
			if(i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout) clearTimeout(i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout);

			i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box_share_mailbox({action: 'getfilter_fop_mail_host_box_share_mailbox_fopuserItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_share_mailbox_fopuser_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_share_mailbox_fopuserListMultiFilter() {
		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_share_mailbox_fopuser_orig']) ? json_encode($_GET['filter_fop_mail_host_box_share_mailbox_fopuser_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42" type="text">' +
			'<label class="mdl-textfield__label" for="30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42">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_share_mailbox_fopuser', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_share_mailbox_fopuser_orig'] = '';
					delete query['filter_fop_mail_host_box_share_mailbox_fopuser'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box_share_mailbox();
					
				} else {
					$('#table_fop_mail_host_box_share_mailbox').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_share_mailbox_fopuserSearchFilter(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_share_mailbox::getfilter_fop_mail_host_box_share_mailbox_fopuserItemsByStringAction('', $id));
		?>;

		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_share_mailbox_fopuser_orig'] = '';
				delete query['filter_fop_mail_host_box_share_mailbox_fopuser'];
				reload('', items);reloadfop_mail_host_box_share_mailbox();
				
			})).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_share_mailbox_fopuser', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_share_mailbox_fopuserListMultiFilter("' + 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_share_mailbox_mailboxListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_share_mailbox_mailbox', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_share_mailbox_mailbox'];
		  }reloadfop_mail_host_box_share_mailbox();
        
    }

		var ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout = null;
		function changefilter_fop_mail_host_box_share_mailbox_mailboxSearchFilter(val, callback) {
			if(ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout) clearTimeout(ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout);

			ib3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box_share_mailbox({action: 'getfilter_fop_mail_host_box_share_mailbox_mailboxItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_share_mailbox_mailbox_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_share_mailbox_mailboxListMultiFilter() {
		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_share_mailbox_mailbox_orig']) ? json_encode($_GET['filter_fop_mail_host_box_share_mailbox_mailbox_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="b3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2" type="text">' +
			'<label class="mdl-textfield__label" for="b3033bfa8a95a3e7c7e1af1e68d6cea2f6041350c204273166d08db0df46f0a2">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_share_mailbox_mailbox', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_share_mailbox_mailbox_orig'] = '';
					delete query['filter_fop_mail_host_box_share_mailbox_mailbox'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box_share_mailbox();
					
				} else {
					$('#table_fop_mail_host_box_share_mailbox').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_share_mailbox_mailboxSearchFilter(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_share_mailbox::getfilter_fop_mail_host_box_share_mailbox_mailboxItemsByStringAction('', $id));
		?>;

		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_share_mailbox_mailbox_orig'] = '';
				delete query['filter_fop_mail_host_box_share_mailbox_mailbox'];
				reload('', items);reloadfop_mail_host_box_share_mailbox();
				
			})).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_share_mailbox_mailbox', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_share_mailbox_mailboxListMultiFilter("' + 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_share_mailbox_fopuserListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_mail_host_box_share_mailbox_fopuser', val, cb.checked);
		  } else {
			  delete query['filter_fop_mail_host_box_share_mailbox_fopuser'];
		  }reloadfop_mail_host_box_share_mailbox();
        
    }

		var i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout = null;
		function changefilter_fop_mail_host_box_share_mailbox_fopuserSearchFilter(val, callback) {
			if(i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout) clearTimeout(i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout);

			i30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42timeout = setTimeout(function() {
				$.getJSON(reloadfop_mail_host_box_share_mailbox({action: 'getfilter_fop_mail_host_box_share_mailbox_fopuserItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_mail_host_box_share_mailbox_fopuser_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_mail_host_box_share_mailbox_fopuserListMultiFilter() {
		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_share_mailbox_fopuser_orig']) ? json_encode($_GET['filter_fop_mail_host_box_share_mailbox_fopuser_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42" type="text">' +
			'<label class="mdl-textfield__label" for="30a872a0e9215e9d89a76f1d98eac81ac066888b632fec92bedcaf5fecee0d42">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_share_mailbox_fopuser', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_mail_host_box_share_mailbox_fopuser_orig'] = '';
					delete query['filter_fop_mail_host_box_share_mailbox_fopuser'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_mail_host_box_share_mailbox();
					
				} else {
					$('#table_fop_mail_host_box_share_mailbox').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_mail_host_box_share_mailbox_fopuserSearchFilter(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_share_mailbox::getfilter_fop_mail_host_box_share_mailbox_fopuserItemsByStringAction('', $id));
		?>;

		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_share_mailbox_fopuser_orig'] = '';
				delete query['filter_fop_mail_host_box_share_mailbox_fopuser'];
				reload('', items);reloadfop_mail_host_box_share_mailbox();
				
			})).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_share_mailbox_fopuser', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_mail_host_box_share_mailbox_fopuserListMultiFilter("' + 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_share_mailbox(col) {
										//var checklist = window.DataViewChecked['fop_mail_host_box_share_mailbox'][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_share_mailbox'] && window.DataViewChecked['fop_mail_host_box_share_mailbox'][col].ranges.length > 0) {
											$('.fop_mail_host_box_share_mailbox__mass-action').css('visibility', 'visible');
											$('.fop_mail_host_box_share_mailbox__action').css('visibility', 'hidden');
										} else {
											$('.fop_mail_host_box_share_mailbox__mass-action').css('visibility', 'hidden');
											$('.fop_mail_host_box_share_mailbox__action').css('visibility', 'visible');
										}
										$('.fop_mail_host_box_share_mailbox__checkbox').each(function (idx, x) {
											for (var cssclass of x.classList) {
												if (cssclass.startsWith('fop_mail_host_box_share_mailbox__checkbox-'+col+'-')) {
													var my_id = cssclass.substr(('fop_mail_host_box_share_mailbox__checkbox-'+col+'-').length);
													if (window.DataViewChecked) {
														x.MaterialCheckbox[checklist.has(my_id) ? 'check' : 'uncheck']();
													}
												}
											}
										});
									}
									function reloadfop_mail_host_box_share_mailbox (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 } ?>
										nq["id"] = <?php echo json_encode($id); ?>; 
										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_share_mailbox/" + 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_share_mailbox/renderTabTable?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// per Ajax laden
											if(!$("#fop_mail_host_box_share_mailbox-table")?.parent()?.parent()?.hasClass('fop-form-feature-collapsed') || $("#fop_mail_host_box_share_mailbox-table")?.parent()?.parent()?.hasClass('fop-form-feature-mode-area')) {
											$.get(querystr, function(data){
												var tab = $("#fop_mail_host_box_share_mailbox-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_share_mailbox('ID');
											});
											} else {
												// gesamten Tab ersetzen
												var tab = $("#fop_mail_host_box_share_mailbox-table");
												tab.children().remove();
												el = tab.html('<div class="fop-lazy-reload" onclick="reloadfop_mail_host_box_share_mailbox()"></div>');
											}
											<?php } ?>
											
										}
									}
									function checkfop_mail_host_box_share_mailbox (id, col, checked) {
										// ID-Liste aufbauen
										if (!window.DataViewChecked) window.DataViewChecked = {};
										if (!window.DataViewChecked['fop_mail_host_box_share_mailbox']) window.DataViewChecked['fop_mail_host_box_share_mailbox'] = {};
										if (!window.DataViewChecked['fop_mail_host_box_share_mailbox'][col]) window.DataViewChecked['fop_mail_host_box_share_mailbox'][col] = new IDList();

										// Abfrage aller gecheckten IDs für eine Tabelle
										if (!id) {
											return window.DataViewChecked['fop_mail_host_box_share_mailbox'][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_share_mailbox({action: 'getids', col: col}, true), function (ids) {
													window.DataViewChecked['fop_mail_host_box_share_mailbox'][col] = new IDList(ids);
													updateNumberfop_mail_host_box_share_mailbox(col);
												});
											} else {
												window.DataViewChecked['fop_mail_host_box_share_mailbox'][col] = new IDList();
												updateNumberfop_mail_host_box_share_mailbox(col);
											}
										} else {
											var ids = new IDList(id);
											var allcb = $('#fop_mail_host_box_share_mailbox__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_share_mailbox'][col] = ids;
											} else for (id of ids.all()) {
												if (checked) {
													window.DataViewChecked['fop_mail_host_box_share_mailbox'][col].push(id);
												} else {
													window.DataViewChecked['fop_mail_host_box_share_mailbox'][col].remove(id);
												}
											}
											updateNumberfop_mail_host_box_share_mailbox(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_share_mailbox();
			
		}

	</script>
	<?php
	
    
  }

  public static function getSQL($params, $id) { 
    
    
    // --- 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 /* ID */ '.qi('ID').' AS '.qi('ID').',
									/* fopuser */ '.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').',
									/* mailbox */ '.qi('mailbox').' AS '.qi('mailbox').',
									/* mailbox::canView */ '.qi('ref:mailbox').'.'.qi('mailbox:canView').' AS '.qi('mailbox::canView').',
									/* mailbox::description */ '.qi('ref:mailbox').'.'.qi('mailbox:description').' AS '.qi('mailbox::description').',
									/* 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::view */ (COALESCE((SELECT (CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('OKfm4xjz').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('fop_mail_host_box').' '.qi('OKfm4xjz').' WHERE '.qi('OKfm4xjz').'.'.qi('ID').' = '.qi('fop_mail_host_box_share').'.'.qi('mailbox').' LIMIT 1), FALSE)) AS '.qi('operation::view').',
									/* type */ '.qi('type').' AS '.qi('type').',
									1
								FROM '.qi('fop_mail_host_box_share').' '.qi('fop_mail_host_box_share').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('mailbox:ID').', '.qi('fop_mail_host_box').'.'.qi('from_address').' AS '.qi('mailbox:description').', ((CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('fop_mail_host_box').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END)) AS '.qi('mailbox:canView').' FROM '.qi('fop_mail_host_box').') '.qi('ref:mailbox').' ON '.qi('ref:mailbox').'.'.qi('mailbox:ID').' = '.qi('mailbox').'
								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('fopuser').'
								WHERE ('.qi('mailbox').' = ' . \FOP\Database::quote($id) . ')
									AND ((COALESCE((SELECT (CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('OKfm4xjz').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END) FROM '.qi('fop_mail_host_box').' '.qi('OKfm4xjz').' WHERE '.qi('OKfm4xjz').'.'.qi('ID').' = '.qi('fop_mail_host_box_share').'.'.qi('mailbox').' LIMIT 1), FALSE)))) AS t
								LEFT JOIN '.qi('mitglied').' AS '.qi('sorter-fopuser').' ON t.'.qi('fopuser').' = '.qi('sorter-fopuser').'.'.qi('ID').'
								WHERE ' . (isset($params['filter_fop_mail_host_box_share_mailbox_mailbox']) ? ($params['filter_fop_mail_host_box_share_mailbox_mailbox'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_share_mailbox_mailbox']))->toSQL('t.'.qi('mailbox').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_share_mailbox_fopuser']) ? ($params['filter_fop_mail_host_box_share_mailbox_fopuser'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_share_mailbox_fopuser']))->toSQL('t.'.qi('fopuser').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_share_mailbox_type']) ? ($params['filter_fop_mail_host_box_share_mailbox_type'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_share_mailbox_type']))->toSQL('t.'.qi('type').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_mail_host_box_share_mailbox_ID']) ? ($params['filter_fop_mail_host_box_share_mailbox_ID'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_mail_host_box_share_mailbox_ID']))->toSQL('t.'.qi('ID').'') . ') AND ') : '') : '') . 
								'
								 TRUE ';
								return $sql;
	
    
  }

  public static function getidsAction($col, $id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
			$q = \FOP\Database::query('SELECT t.'.qi($col).' '.self::getSQL($_GET, $id));
			$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_share').' WHERE ' . $ids->toSQL(qi('ID')))->fetch(\PDO::FETCH_ASSOC);
		
		return $perms;
	
    
  }

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

    
  }

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

    
  }

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

								$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',
									'' => ''), isset($params['sort_fop_mail_host_box_share_mailbox']) ? $params['sort_fop_mail_host_box_share_mailbox'] : '') ?: '');
								// 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['mailbox'] = \FOP\Sanitizers::null_converter($item['mailbox']);
											$item['fopuser'] = \FOP\Sanitizers::null_converter($item['fopuser']);
											$item['type'] = \FOP\Util::IntStringNull($item['type']);
											
											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['mailbox'] = \FOP\Sanitizers::null_converter($item['mailbox']);
										$item['fopuser'] = \FOP\Sanitizers::null_converter($item['fopuser']);
										$item['type'] = \FOP\Util::IntStringNull($item['type']);
										
									}
									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 (isset($params['filter_fop_mail_host_box_share_mailbox_type'])) {
		if ($params['filter_fop_mail_host_box_share_mailbox_type'] == '_null') {
			array_push($filters, _('Berechtigung') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_share_mailbox_type']))->all() AS $val) {
				$value = \Types\Fop_mail_host_box_sharetype::toString($val);
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Berechtigung') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_share_mailbox_mailbox'])) {
		if ($params['filter_fop_mail_host_box_share_mailbox_mailbox'] == '_null') {
			array_push($filters, _('Mailbox') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_share_mailbox_mailbox']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('fop_mail_host_box').'.'.qi('from_address').' AS description FROM '.qi('fop_mail_host_box').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Mailbox') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_mail_host_box_share_mailbox_fopuser'])) {
		if ($params['filter_fop_mail_host_box_share_mailbox_fopuser'] == '_null') {
			array_push($filters, _('Benutzer') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_mail_host_box_share_mailbox_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, _('Benutzer') . ': ' . implode(', ', $values));
		}
	}
		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_share_mailbox_\')) delete query[q];} reloadfop_mail_host_box_share_mailbox(); ">clear</i>' : '');
		} else {
			$result = _('no_filter');
		}
		return $result;
	
    
  }

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

if ($fop_table == 'fop_mail_host_box_share') {
	\FOP\Session::setPayload('dv-fop_mail_host_box_share', [
		'id' => 'fop_mail_host_box_share_mailbox',
		'tbl' => 'fop_mail_host_box_share',
		'idcol' => 'ID',
		'prev' => \DataViewRouter\Fop_mail_host_box_share_mailbox::stepURL('fop_mail_host_box_share', 'XXX', -1),
		'next' => \DataViewRouter\Fop_mail_host_box_share_mailbox::stepURL('fop_mail_host_box_share', 'XXX',  1),
		'from' => $fop_from,
		'param_id' => $id
	]);
	
	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_share::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, $dv['param_id']);
	$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();

    
  }


  
  

  
  
}



