Update functions.php

This commit is contained in:
danpros 2024-03-31 15:58:16 +07:00
commit 7f713d32c7

View file

@ -2370,12 +2370,14 @@ function tab($p)
$role = user('role', $user);
$tab = '';
if (isset($p->author)) {
if ($user === $p->author || $role === 'admin') {
if ($user === $p->author || $role === 'editor' || $role === 'admin') {
$tab = '<div class="tab"><ul class="nav nav-tabs"><li role="presentation" class="active"><a href="' . $p->url . '">' . i18n('View') .'</a></li><li><a href="' . $p->url . '/edit?destination=post">'. i18n('Edit') .'</a></li></ul></div>';
}
} else {
if ($p->url) {
$tab = '<div class="tab"><ul class="nav nav-tabs"><li role="presentation" class="active"><a href="' . $p->url . '">' . i18n('View') .'</a></li><li><a href="' . $p->url . '/edit?destination=post">'. i18n('Edit') .'</a></li></ul></div>';
if ($role === 'editor' || $role === 'admin') {
$tab = '<div class="tab"><ul class="nav nav-tabs"><li role="presentation" class="active"><a href="' . $p->url . '">' . i18n('View') .'</a></li><li><a href="' . $p->url . '/edit?destination=post">'. i18n('Edit') .'</a></li></ul></div>';
}
}
}
return $tab;