public static function ipAdminNavbarButtons($buttons, $info)
{
$breadcrumb = ipContent()->getBreadcrumb();
if (!empty($breadcrumb[0])) {
$rootPage = $breadcrumb[0];
$menu = ipContent()->getPage($rootPage->getParentId());
$alias = $menu->getAlias();
} else {
$alias = '';
}
if (ipContent()->getCurrentPage()) {
if (!ipAdminPermission('Content')) {
//Do nothing
} elseif (ipIsManagementState()) {
$buttons[] = array('text' => __('Preview', 'Ip-admin', false), 'hint' => __('Hides admin tools', 'Ip-admin', false), 'class' => 'ipsContentPreview', 'faIcon' => 'fa-eye', 'url' => '#');
} else {
$buttons[] = array('text' => __('Edit', 'Ip-admin', false), 'hint' => __('Show widgets', 'Ip-admin', false), 'class' => 'ipsContentEdit', 'faIcon' => 'fa-edit', 'url' => '#');
}
if (ipAdminPermission('Pages')) {
$buttons[] = array('text' => __('Settings', 'Ip-admin', false), 'hint' => __('Page settings', 'Ip-admin', false), 'class' => 'ipsAdminPageSettings', 'faIcon' => 'fa-gear', 'url' => ipActionUrl(array('aa' => 'Pages.index')) . '#hash&language=' . ipContent()->getCurrentLanguage()->getCode() . '&menu=' . $alias . '&page=' . ipContent()->getCurrentPage()->getId());
}
}
return $buttons;
}