Skip to content

Commit

Permalink
fix: alfred icons only shown on pagebuilder blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jan 12, 2023
1 parent 9360b10 commit 811a296
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static function getModuleInfo()
{
return [
'title' => 'RockFrontend',
'version' => '2.13.0',
'version' => '2.13.1',
'summary' => 'Module for easy frontend development',
'autoload' => true,
'singular' => true,
Expand Down Expand Up @@ -718,6 +718,7 @@ public function ___getIcons($page, $opt)
}
}

// icon to edit page
if ($page and $page->editable() and $opt->edit) {
$icons[] = (object)[
'icon' => 'edit',
Expand All @@ -738,7 +739,7 @@ public function ___getIcons($page, $opt)
}
}

if ($this->wire->user->isSuperuser() and $page instanceof Block) {
if ($this->wire->user->isSuperuser()) {
$tracy = $this->wire->config->tracy;
if (is_array($tracy) and array_key_exists('localRootPath', $tracy))
$root = $tracy['localRootPath'];
Expand All @@ -755,7 +756,7 @@ public function ___getIcons($page, $opt)

$ext = pathinfo($link, PATHINFO_EXTENSION);

// controller edit link
// php file edit link
$php = substr($opt->path, 0, strlen($ext) * -1 - 1) . ".php";
if (is_file($php)) {
$php = str_replace($this->wire->config->paths->root, $root, $php);
Expand Down
7 changes: 5 additions & 2 deletions profiles/rock/files/site/templates/sections/header.latte
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
{define mainmenu, $items, $first}
{foreach $items as $item}{* loop all items*}
{* define variables for inside the loop *}
{var $selector = ""} {* exclude child items here *}
{var $show = ($rockfrontend->isActive($item) or $item->parents->count()===1)}
{var $inDropdown = $item->parents->count()>1}
{var $active = $inDropdown ? $item==$page : $rockfrontend->isActive($item)}
{var $subid = "menu-".$item->id}
{var $numc = ($item->children()->count() && $item!==$first) }
{var $numc = ($item->children($selector)->count() && $item!==$first) }
{* list item markup *}
<li n:class="$active ? 'uk-active'">
<a
Expand All @@ -50,7 +51,9 @@
>
{include
mainmenu,
$inDropdown ? $item->children()->prepend($item) : $item->children(),
$inDropdown
? $item->children($selector)->prepend($item)
: $item->children($selector),
$item
}
</ul>
Expand Down

0 comments on commit 811a296

Please sign in to comment.