Backend --> Eigener Menüpunkt
Hi,
bei meiner 2.11.17 Installation hab ich mir im Backend selbst noch Links eingefügt (oberes Menü), die nur Admins zu Sehen bekommen.
Hier im neuen 4.7.x hätte ich die gerne in der seitlichen Navigation drin, nur wie?
HTML-Code:
<?php if ($this->User->isAdmin): ?> <span class="backup_db"><a href="backup/db_backup.php" title="Datenbank Backup">DB Backup</a> :: </span> <?php endif; ?>
<?php if ($this->User->isAdmin): ?> <span class="backup_ftp"><a href="backup/ftp_backup.php" title="Webspace Backup">FTP Backup</a> :: </span> <?php endif; ?>
ToM
Liste der Anhänge anzeigen (Anzahl: 1)
@ Harley Rider:
Schau mal, ich habs einfach hier in den Block integriert:
HTML-Code:
<?php $this->block('header'); ?>
<?php if (!$this->isPopup): ?>
<header id="header"<?php if ($this->pageOffset) echo ' class="down"'; ?>>
<div class="inner">
<h1><a href="<?= $this->route('contao_backend') ?>" accesskey="h" id="home" title="<?= $this->home ?>">Contao</a></h1>
<nav aria-label="<?= $this->headerNavigation ?>">
<ul id="tmenu">
<li><a href="<?= $this->route('contao_backend_alerts') ?>" class="icon-alert" title="<?= Contao\StringUtil::specialchars($this->systemMessages) ?>" onclick="Backend.openModalIframe({'title':'<?= str_replace("'", "\\'", Contao\StringUtil::specialchars($this->systemMessages)) ?>','url':this.href});return false"><?= $this->systemMessages ?><?php if ($this->systemErrorMessagesCount > 0) echo ' <sup>' . $this->systemErrorMessagesCount . '</sup>'; ?></a></li>
<?php $objUser = BackendUser::getInstance();
if ($objUser->authenticate() && $objUser->isAdmin) { ?>
<li><a href="_backup/db_backup.php" class="icon-db_bkp" title="Datenbank Backup">DB Backup</a></li>
<li><a href="_backup/ftp_backup.php" class="icon-ftp_bkp" title="Webspace Backup">FTP Backup</a></li>
<?php } ?>
<li><a href="<?= $this->route('contao_backend_preview') . $this->frontendFile ?>" class="icon-preview" title="<?= $this->previewTitle ?>" target="_blank" accesskey="f"><?= $this->preview ?></a></li>
<li class="submenu">
<h2><?= $this->username ?></h2>
<ul class="level_2">
<li class="info"><strong><?= $this->user->name ?></strong> <?= $this->user->email ?></li>
<li><a href="<?= $this->route('contao_backend', ['do'=>'login', 'ref'=>$this->ref]) ?>" class="icon-profile"><?= $this->profile ?></a></li>
<li><a href="<?= $this->route('contao_backend', ['do'=>'security', 'ref'=>$this->ref]) ?>" class="icon-security"><?= $this->security ?></a></li>
<li><a href="<?= $this->logoutLink ?>" class="icon-logout" accesskey="q"><?= $this->logout ?></a></li>
</ul>
</li>
<li class="burger"><button type="button" id="burger"><?= Contao\Image::getHtml('burger.svg') ?></button></li>
</ul>
</nav>
</div>
</header>
<?php endif; ?>
<?php $this->endblock(); ?>
Ergebnis: Anhang 22046
ToM
Tante Edith sagt: jetzt auch mit Abfrage, sodass nur Admins den Link sehen können.