mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 11:36:20 +05:30
Update functions.php
This commit is contained in:
parent
92a13ece06
commit
7f713d32c7
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue