Commit 66541c23 authored by Sylvain's avatar Sylvain

Bug menu Tag

parent 1a17eeed
...@@ -258,13 +258,14 @@ class Template3Bt4 ...@@ -258,13 +258,14 @@ class Template3Bt4
$render = ''; $render = '';
if (auth()->user()->hasRole('admin')) { if (auth()->user()->hasRole('admin')) {
$tags = data_get($this->_menu, 'tags', []);
if (count(data_get($this->_menu, 'tags')) > 0) { if (count($tags) > 0) {
$template = '<a class="dropdown-item clipboard-copy" href="#" title="Copier le Tag" data-clipboard-action="copy" data-clipboard-text="%s">' . PHP_EOL; $template = '<a class="dropdown-item clipboard-copy" href="#" title="Copier le Tag" data-clipboard-action="copy" data-clipboard-text="%s">' . PHP_EOL;
$template .= ' <i class="fa fa-clipboard mr-1"></i>%s' . PHP_EOL; $template .= ' <i class="fa fa-clipboard mr-1"></i>%s' . PHP_EOL;
$template .= '</a>' . PHP_EOL; $template .= '</a>' . PHP_EOL;
foreach (data_get($this->_menu, 'tags') as $tag) { foreach ($tags as $tag) {
$tag_value = $this->getValue($tag, $source); $tag_value = $this->getValue($tag, $source);
$render .= vsprintf($template, [$tag_value, $tag_value]); $render .= vsprintf($template, [$tag_value, $tag_value]);
} }
...@@ -285,9 +286,9 @@ class Template3Bt4 ...@@ -285,9 +286,9 @@ class Template3Bt4
if (auth()->user()->can($this->can_prefix . '-read')) { if (auth()->user()->can($this->can_prefix . '-read')) {
$menu_more = data_get($this->_menu, 'more'); $menu_more = data_get($this->_menu, 'more', []);
if (!empty($menu_more) && count($menu_more) > 0) { if (count($menu_more) > 0) {
$template = '<a class="dropdown-item%s"%s>' . PHP_EOL; $template = '<a class="dropdown-item%s"%s>' . PHP_EOL;
$template .= ' %s' . PHP_EOL; $template .= ' %s' . PHP_EOL;
$template .= '</a>' . PHP_EOL; $template .= '</a>' . PHP_EOL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment