mirror of
https://github.com/danpros/htmly.git
synced 2026-04-21 21:16:23 +05:30
Update functions.php
This commit is contained in:
parent
92a13ece06
commit
7f713d32c7
1 changed files with 4 additions and 2 deletions
|
|
@ -2370,14 +2370,16 @@ function tab($p)
|
||||||
$role = user('role', $user);
|
$role = user('role', $user);
|
||||||
$tab = '';
|
$tab = '';
|
||||||
if (isset($p->author)) {
|
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>';
|
$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 {
|
} else {
|
||||||
if ($p->url) {
|
if ($p->url) {
|
||||||
|
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>';
|
$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;
|
return $tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue