<?php

namespace EasyEditor;

class Navigation {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function renderEmailclient() { 
    
    
    // --- BLOCK: main ---
    
		$items = \FOP\Database::query('SELECT * FROM (
		SELECT
			'.qi('ID').' AS mailbox,
			0 AS indent,
			from_address AS name,
			\'mailbox\' AS kind,
			(SELECT '.qi('ID').' FROM fop_mail_host_box_dir WHERE mailbox = fop_mail_host_box.'.qi('ID').' AND imap_name LIKE \'%INBOX%\' LIMIT 1) AS '.qi('ID').',
			(SELECT COUNT(*) FROM fop_mail_host_box_dir_email WHERE NOT seen AND boxid = fop_mail_host_box.'.qi('ID').') AS seen
			FROM fop_mail_host_box WHERE (CASE WHEN FALSE THEN TRUE ELSE NOT (('.qi('fop_mail_host_box').'.'.qi('fopuser').') <> ('.\FOP\Database::sessionVarSQL('user').')) END)
		UNION ALL
		SELECT
			mailbox AS mailbox,
			1 AS indent,
			name AS name,
			\'folder\' AS kind,
			'.qi('ID').' AS '.qi('ID').',
			(SELECT COUNT(*) FROM fop_mail_host_box_dir_email WHERE directory = fop_mail_host_box_dir.'.qi('ID').' AND NOT seen AND boxid = mailbox) AS seen
			FROM fop_mail_host_box_dir WHERE (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))
	) t ORDER BY mailbox ASC, indent ASC, name ASC');
		$lastIndent = -1;
		$indents = [];
		while ($row = $items->fetch(\PDO::FETCH_ASSOC)) {
			while (count($indents) && $indents[count($indents)-1] > $row['indent']) {
				array_pop($indents);
				echo '</span>';
			}
			if ($row['indent'] > $lastIndent) {
				$lastIndent = $row['indent'];
				array_push($indents, $lastIndent);
				echo '<span class="mdlext-collapsible-region" role="region">';
			} else {
				$lastIndent = $row['indent'];
			}
			?><div
				class="mdl-navigation__link  indented fop-menu-<?php echo intval($row['indent']); /* begin collapse mode */ if ($row['indent'] < 1) { ?> remember-collapse2 mdlext-js-collapsible mdlext-collapsible" aria-expanded="false<?php } /* end collapse mode */ ?>"
				style="margin-left: <?php echo 35 + 12 * ($row['indent'] ?: 0); ?>px!important;">
				<?php /* begin collapse mode */ if ($row['indent'] < 1) { ?><i style='margin-left: -24px;' class="mdlext-aria-expanded-more-less"></i><?php } /* end collapse mode */ ?>
				<a href="<?php
				if ($row['kind'] == 'mailbox') {
					echo htmlentities(\TablesRouter\Fop_mail_host_box_dir::viewURL2(['id' => $row['ID']]));
				} else if ($row['kind'] == 'folder') {
					echo htmlentities(\TablesRouter\Fop_mail_host_box_dir::viewURL2(['id' => $row['ID']]));
				} else {
					echo '#';
				}
				 ?>" style="color: unset; width: 100%;">
					<?php echo htmlentities($row['name']); ?>
				</a>
				<?php if ($row['seen'] > 0) { ?><div class="mdl-badge" style='position:absolute;left:12px' data-badge="<?php echo htmlentities($row['seen']); ?>"></div><?php } ?>
			</div>
		<?php }
		while (count($indents)) {
			array_pop($indents);
			echo '</span>';
		}
	
    
  }

  public static function render() { 
    
    
    // --- BLOCK: main ---
    ?><div class="fop-drawer-arrow-up" style="display: none;" onclick="var x = $('.fop-drawer'); x.animate({scrollTop: x.scrollTop() - 230}); if (x.scrollTop() <= 230) { $(this).hide(); }"><i class="material-icons">keyboard_arrow_up</i></div>
				<div class="fop-drawer-arrow-down" onclick="var x = $('.fop-drawer'); x.animate({scrollTop: x.scrollTop() + 230}); $('.fop-drawer-arrow-up').show();"><i class="material-icons">keyboard_arrow_down</i></div>
				<div class="fop-drawer mdl-layout__drawer" id="fop-drawer" <?php \EasyEditor\Navigation::printScroll('navigation', 'if (this.scrollTop == 0) { $(".fop-drawer-arrow-up").hide(); } else {$(".fop-drawer-arrow-up").show();}'); ?>>
					<header class="fop-drawer-header">
						<a href="<?php echo htmlentities(\FOPRouter\Index::indexURL()); ?>"><div class="logo"></div></a>
						<span style='text-align: right;'>Version: 1.2</span>
						
							<div class="fop-avatar-dropdown">
								<span style="max-width: calc(100% - 30px); overflow: hidden;"><?php echo htmlentities(\FOP\User::getUsername() ?: _('guest')); ?></span>
								
								<div class="mdl-layout-spacer"></div>
								<button id="accbtn" class="mdl-button mdl-js-button mdl-button--icon">
									<i class="material-icons" role="presentation">arrow_drop_down</i>
								</button>
								<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu" for="accbtn">
									
										<?php if((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
										<a class="mdl-menu__item" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box::createURL2([])); ?>"><?php echo(sprintf(_('create %s'), _('emailmailbox_singular'))); ?></a>
										<?php } ?>
										
										<?php if(((\FOP\User::getIsLoggedIn()))) { ?>
										<a class="mdl-menu__item" href="<?php echo htmlentities(\FOPRouter\Login::logoutURL2([])); ?>"><?php echo(_('logout')); ?></a>
										<?php } ?>
										
										<?php if(!\FOP\User::getIsGuest()) { ?>
										<a class="mdl-menu__item" href="<?php echo htmlentities(\TablesRouter\Mitglied::viewURL2(['id' => \FOP\User::getID()])); ?>"><?php echo(_('user profile')); ?></a>
										<?php } ?>
										
										<?php if(((\FOP\User::getIsLoggedIn()))) { ?>
										<a class="mdl-menu__item" href="<?php echo htmlentities(\TablesRouter\Mitglied::editNotificationSettingsURL2(['id' => \FOP\User::getID()])); ?>"><?php echo(_('Benachrichtigungen...')); ?></a>
										<?php } ?>
										
										<?php if(((\FOP\User::getIsLoggedIn()))) { ?>
										<a class="mdl-menu__item" href="<?php echo htmlentities(\TablesRouter\Mitglied::changepwURL2([])); ?>"><?php echo(_('changepw')); ?></a>
										<?php } ?>
										
										<?php if(((\FOP\User::getIsGuest()))) { ?>
										<a class="mdl-menu__item" href="<?php echo htmlentities(\FOPRouter\Login::loginFormURL2([])); ?>"><?php echo(_('login')); ?></a>
										<?php } ?>
										
								</ul>
								
							</div>
						
					</header>
					<nav class="fop-navigation mdl-navigation"><?php if (!\FOP\User::getIsGuest()) { ?>
		<span id="favorites">
			<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" id="easymenu_favorites" aria-expanded="false"><i class="mdlext-aria-expanded-more-less"></i><div class="material-icons pdr">stars</div><?php echo(_('favorites')); ?></a>
			<script>
				function addFav(item) {
					if (!item) {
						// wenn item = null: fav-Eintrag anlegen
						item = {
							title: $('title').text(),
							href: window.location.href
						}
						let favs = <?php echo \FOP\User::getFavorites() ?: '[]' ?>;
						for (let i = 0; i < favs.length; i++) {
							if (favs[i].href == item.href) {
								// Favorit schon vorhanden: löschen!
								favs.splice(i, 1);
								$.get('FOP/Index/favorites?newValue=' + encodeURIComponent(JSON.stringify(favs))).then(function () {
									window.location.reload();
								});
								return;
							}
						}
						// Namen auswählen
						item.title = prompt('<?php echo _('title'); ?>', item.title);
						if (!item.title) return;
						// sonst: hinzufügen
						favs.push(item);
						$.get('FOP/Index/favorites?newValue=' + encodeURIComponent(JSON.stringify(favs))).then(function () {
							window.location.reload();
						});
					}
					// Item dem DOM hinzufügen
					var fav = $('<a class="favoritesitem mdl-navigation__link mdlext-collapsible-group indented"></a>');
					fav.attr('href', item.href);
					fav.text(item.title);
					$('#favorites').append(fav);
					componentHandler.upgradeElements(fav);
					if ($('#easymenu_favorites')[0].MaterialExtCollapsible) {
						$('#easymenu_favorites')[0].MaterialExtCollapsible.addRegionElements(fav[0]);
					}

					// Stern-Markierung umschalten
					if (item.href == window.location.href) {
						$('#favorites_button').text('star');
					}
				}
				$(function() {
					let favs = <?php echo \FOP\User::getFavorites() ?: '[]' ?>;
					for (var i = 0; i < favs.length; i++) {
						addFav(favs[i]);
					}
					menucollapse();
				});
			</script> 
		</span>
		<div class="easy-seperator"></div>
		<?php } ?>
						<?php if (true && ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()))) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="#" onclick='return false;' id='easymenu_Aufgaben' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" ></i>
								<div class="material-icons pdr">add_alert</div><?php echo(_('Aufgaben')); ?>
								</a>
								
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\AufgabePropertyType::indexURL2([])); ?>"><?php echo(sprintf(_('%s-Eigenschaften'), _('Aufgabe'))); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Aufgabe::indexURL2([])); ?>"><?php echo(_('Aufgaben')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\DataViewRouter\ReminderAufgabeAssigned::viewURL2([])); ?>"><?php echo(_('Mir zugewiesen')); ?>
								<?php if ((\FOP\User::getReminderAufgabeAssigned()) != 0) { ?><div class="mdl-badge fop-badge-Aufgaben:Mir_zugewiesen" style='position:absolute;right:12px;'data-badge="<?php echo htmlentities((\FOP\User::getReminderAufgabeAssigned())); ?>"></div><?php } ?>
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\DataViewRouter\ReminderAufgabeNot_assigned::viewURL2([])); ?>"><?php echo(_('Nicht zugewiesen')); ?>
								<?php if ((\FOP\User::getReminderAufgabeNotAssigned()) != 0) { ?><div class="mdl-badge fop-badge-Aufgaben:Nicht_zugewiesen" style='position:absolute;right:12px;'data-badge="<?php echo htmlentities((\FOP\User::getReminderAufgabeNotAssigned())); ?>"></div><?php } ?>
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\AufgabeType::indexURL2([])); ?>"><?php echo(sprintf(_('%s-Typen'), _('Aufgabe'))); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\AufgabeState::indexURL2([])); ?>"><?php echo(sprintf(_('%s-Zustände'), _('Aufgabe'))); ?>
								
								</a><?php } ?>
								
							</span>
						<?php } ?>
					
						<?php if (true && ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="#" onclick='return false;' id='easymenu_Mitglieder' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" ></i>
								<div class="material-icons pdr">person</div><?php echo(_('Mitglieder')); ?>
								</a>
								
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Gruppe::indexURL2([])); ?>"><?php echo(_('Gruppen')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Ansprechpartner::indexURL2([])); ?>"><?php echo(_('Kontaktpersonen')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Mitglied::indexURL2([])); ?>"><?php echo(_('Mitglieder')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\MitgliedPassnummer::indexURL2([])); ?>"><?php echo(_('Passnummern')); ?>
								
								</a><?php } ?>
								
							</span>
						<?php } ?>
					
						<?php if (true && (((\FOP\User::getBuchhaltung()) && (\FOP\User::getGruppe())) || ((\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || ((\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || ((\FOP\User::getBuchhaltung()) && (\FOP\User::getBuchhaltung())))) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="#" onclick='return false;' id='easymenu_Buchhaltung' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" ></i>
								<div class="material-icons pdr">euro_symbol</div><?php echo(_('Buchhaltung')); ?>
								</a>
								
									<?php if (((\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Tarif::indexURL2([])); ?>"><?php echo(_('Beitrags-Tarife')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Sammlung::indexURL2([])); ?>"><?php echo(_('Geld-Sammlungen')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\DataViewRouter\ReminderMitgliedForderungen::viewURL2([])); ?>"><?php echo(_('Offene Beiträge')); ?>
								<?php if ((\FOP\User::getReminderMitgliedForderungen()) != 0) { ?><div class="mdl-badge fop-badge-Buchhaltung:Offene_Beitr_ge" style='position:absolute;right:12px;'data-badge="<?php echo htmlentities((\FOP\User::getReminderMitgliedForderungen())); ?>"></div><?php } ?>
								</a><?php } ?>
									<?php if (((\FOP\User::getBuchhaltung()) && (\FOP\User::getGruppe()))) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Mitglied::payoutURL2([])); ?>"><?php echo(_('SEPA-Lastschrift')); ?>
								<?php if (((\FOP\Util::FalseToNull(\FOP\Database::query('SELECT COUNT(1) FROM '.qi('mitglied').' '.qi('mKiHp1c9').' WHERE TRUE AND (((SELECT SUM('.qi('rhU469mT').'.'.qi('betrag').') FROM '.qi('mitgliedBuchung').' '.qi('rhU469mT').' WHERE '.qi('rhU469mT').'.'.qi('mitglied').' = '.qi('mKiHp1c9').'.'.qi('ID').' LIMIT 1)) < (0)) AND ('.qi('mKiHp1c9').'.'.qi('sepa').')')->fetchColumn()))) != 0) { ?><div class="mdl-badge fop-badge-Buchhaltung:SEPA_Lastschrift" style='position:absolute;right:12px;'data-badge="<?php echo htmlentities(((\FOP\Util::FalseToNull(\FOP\Database::query('SELECT COUNT(1) FROM '.qi('mitglied').' '.qi('mKiHp1c9').' WHERE TRUE AND (((SELECT SUM('.qi('rhU469mT').'.'.qi('betrag').') FROM '.qi('mitgliedBuchung').' '.qi('rhU469mT').' WHERE '.qi('rhU469mT').'.'.qi('mitglied').' = '.qi('mKiHp1c9').'.'.qi('ID').' LIMIT 1)) < (0)) AND ('.qi('mKiHp1c9').'.'.qi('sepa').')')->fetchColumn())))); ?>"></div><?php } ?>
								</a><?php } ?>
									<?php if (((\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Fop_fints_konto::indexURL2([])); ?>"><?php echo(_('Bankkonten')); ?>
								
								</a><?php } ?>
									<?php if (((\FOP\User::getBuchhaltung()) && (\FOP\User::getBuchhaltung()))) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\DataViewRouter\ReminderFop_fints_buchungForderungen::viewURL2([])); ?>"><?php echo(_('unbehandelte Zahlungseingänge')); ?>
								<?php if ((\FOP\User::getReminderFopFintsBuchungForderungen()) != 0) { ?><div class="mdl-badge fop-badge-Buchhaltung:Unbehandelte_Zahlungseing_nge" style='position:absolute;right:12px;'data-badge="<?php echo htmlentities((\FOP\User::getReminderFopFintsBuchungForderungen())); ?>"></div><?php } ?>
								</a><?php } ?>
								
							</span>
						<?php } ?>
					
						<?php if (true && (((\FOP\User::getCampaign())) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || ((\FOP\User::getDokument())) && (!\FOP\User::getIsGuest()) || ((\FOP\User::getProtokoll())) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="#" onclick='return false;' id='easymenu_Verwaltung' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" ></i>
								<div class="material-icons pdr">share</div><?php echo(_('Verwaltung')); ?>
								</a>
								
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\ProtokollVorlage::indexURL2([])); ?>"><?php echo(_('Protokoll-Vorlagen')); ?>
								
								</a><?php } ?>
									<?php if (((\FOP\User::getProtokoll())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Protokoll::indexURL2([])); ?>"><?php echo(_('Protokolle')); ?>
								
								</a><?php } ?>
									<?php if (((\FOP\User::getDokument())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Doc::indexURL2([])); ?>"><?php echo(_('Dokumente')); ?>
								<?php if ((\FOP\User::getBadgeDoc()) != 0) { ?><div class="mdl-badge fop-badge-Verwaltung:Dokumente" style='position:absolute;right:12px;'data-badge="<?php echo htmlentities((\FOP\User::getBadgeDoc())); ?>"></div><?php } ?>
								</a><?php } ?>
									<?php if (((\FOP\User::getCampaign())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Campaign::indexURL2([])); ?>"><?php echo(_('Rundmails / Aktionen')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Brief::indexURL2([])); ?>"><?php echo(_('Einzelbriefe')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\BriefVorlage::indexURL2([])); ?>"><?php echo(_('texttemplates')); ?>
								
								</a><?php } ?>
								
							</span>
						<?php } ?>
					
						<?php if ((((\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())))) && ((\FOP\User::getIsLoggedIn())) && ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()))) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="#" onclick='return false;' id='easymenu_emailclient' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" ></i>
								<div class="material-icons pdr">email</div><?php echo(_('emailclient')); ?>
								</a>
								
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_draft::indexURL2([])); ?>"><?php echo(_('drafts')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_draft::createURL2([])); ?>"><?php echo(_('sendmail')); ?>
								
								</a><?php } ?>
								<?php \EasyEditor\Navigation::renderEmailclient(); ?>
							</span>
						<?php } ?>
					
						<?php if (true && (((\FOP\User::getCampaign())) && (!\FOP\User::getIsGuest()) || ((\FOP\User::getMitglied())) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) || ((\FOP\User::getDokument())) && (!\FOP\User::getIsGuest()) || ((\FOP\User::getAdmin())) || ((\FOP\User::getMitglied())))) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="#" onclick='return false;' id='easymenu_admin' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" ></i>
								<div class="material-icons pdr">settings</div><?php echo(_('admin')); ?>
								</a>
								
									<?php if (((\FOP\User::getMitglied())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Fop_chat::indexURL2([])); ?>"><?php echo(_('Chat-Nachrichten')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host_box_share::indexURL2([])); ?>"><?php echo(_('Freigaben')); ?>
								
								</a><?php } ?>
									<?php if (((\FOP\User::getCampaign())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\CampaignState::indexURL2([])); ?>"><?php echo(sprintf(_('%s-Status'), _('Rundmails / Aktionen'))); ?>
								
								</a><?php } ?>
									<?php if (((\FOP\User::getAdmin()))) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Userconfig::view1URL2([])); ?>"><?php echo(_('config')); ?>
								
								</a><?php } ?>
									<?php if (((\FOP\User::getDokument())) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\DocType::indexURL2([])); ?>"><?php echo(_('DMS-Kategorien')); ?>
								
								</a><?php } ?>
									<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\TablesRouter\Fop_mail_host::indexURL2([])); ?>"><?php echo(_('emailhosts')); ?>
								
								</a><?php } ?>
									<?php if (((\FOP\User::getMitglied()))) { ?>
								<a class="mdl-navigation__link mdlext-collapsible-group indented" href="<?php echo htmlentities(\DataViewRouter\Fop_chat__chatflow::viewURL2([])); ?>"><?php echo(_('gemeldete Chat-Nachrichten')); ?>
								<?php if ((\FOP\User::getWfcFopChatChatflow()) != 0) { ?><div class="mdl-badge fop-badge-admin:Gemeldete_Chat_Nachrichten" style='position:absolute;right:12px;'data-badge="<?php echo htmlentities((\FOP\User::getWfcFopChatChatflow())); ?>"></div><?php } ?>
								</a><?php } ?>
								
							</span>
						<?php } ?>
					
						<?php if (((\FOP\User::getIsLoggedIn())) && (true)) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="<?php echo htmlentities(\FOPRouter\Index::aiURL2([])); ?>" id='easymenu_KI' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" style="visibility: hidden;" ></i>
								<div class="material-icons pdr">accessibility</div><?php echo(_('KI')); ?>
								</a>
								
								
							</span>
						<?php } ?>
					
						<?php if ((!\FOP\User::getIsGuest()) && (true)) { ?>

							<span>
								<a class="mdlext-js-collapsible mdl-navigation__link remember-collapse" href="<?php echo htmlentities(\DataViewRouter\ReminderMitgliedMitglied_gebtag::viewURL2([])); ?>" id='easymenu_Geburtstage' aria-expanded='false'>
								<i class="mdlext-aria-expanded-more-less" style="visibility: hidden;" ></i>
								<div class="material-icons pdr">alarm on</div><?php echo(_('Geburtstage')); ?><?php if ((\FOP\User::getReminderMitgliedMitgliedGebtag()) != 0) { ?><div class="mdl-badge fop-badge-Geburtstage"  style='position:absolute;right:12px;' data-badge="<?php echo htmlentities((\FOP\User::getReminderMitgliedMitgliedGebtag())); ?>"></div><?php } ?>
								</a>
								
								
							</span>
						<?php } ?>
					
				<div class="navfooter">
		  &#149;&nbsp;<a href="<?php echo htmlentities(\FOPRouter\Index::ImpressumURL()); ?>"><?php echo(_('Impressum')); ?></a>&nbsp;
		  &#149;
	</div>
			</nav>
		</div>
	<?php
    
  }

  public static function printScroll($context, $additionalJS = '' ) { 
    
    
    // --- BLOCK: main ---
    
		// Achtung HACK!
		// diese Funktion wird als LETZTES ATTRIBUT in einem DOM-Element hineingerendert
		// diese Funktion schließt den DOM-Tag und schreibt ein <script> mit fehlender Klammer am Ende
		// das ist besser lesbar im Code
		// hinter dem Funktionsaufruf muss zwingend dann das '>' kommen
		echo ' data-scroll-context="' . htmlentities($context) . '"'; // identify
		echo ' onscroll="
			sessionStorage[\'scroll_\' + '.htmlentities(json_encode($context)).'] = this.scrollTop;
			sessionStorage[\'lscroll_\' + '.htmlentities(json_encode($context)).'] = this.scrollLeft;
			'.htmlentities($additionalJS).'"'; // update scroll position
		echo '><script type="text/javascript">$(function () {
			$(\'[data-scroll-context="\' + ' . json_encode($context) . ' + \'"]\')
			.scrollTop(sessionStorage[\'scroll_\' + '.json_encode($context).'] || 0)
			.scrollLeft(sessionStorage[\'lscroll_\' + '.json_encode($context).'] || 0);
		});</script'; // restore scroll position -> '><' mismatch is intended! do not change unless you understood why
	
    
  }


  
  

  
  
}



