Apply staged updates

This commit is contained in:
2026-03-01 00:42:10 +01:00
parent 4cf7039759
commit 412e235512
16 changed files with 574 additions and 539 deletions

View File

@@ -1,5 +1,5 @@
<?
if ( is_array( $this -> pages ) ) {
if ( is_array( $this -> pages ) and !empty( $this -> pages ) ) {
$settings = ( new \Domain\Settings\SettingsRepository( $GLOBALS['mdb'] ) )->allSettings();
echo '<ul class="level-' . $this -> level . ' clear" level="' . $this -> level . '">';
@@ -15,8 +15,9 @@ if ( is_array( $this -> pages ) ) {
$page['language']['seo_link'] ? $url = '/' . $page['language']['seo_link'] : $url = '/s-' . $page['id'] . '-' . \Shared\Helpers\Helpers::seo( $page['language']['title'] );
}
$children = [];
$has_children = !empty( $page['pages'] ) and is_array( $page['pages'] );
if ( is_array( $page['pages'] ) ): foreach ( $page['pages'] as $page_tmp ):
if ( $has_children ): foreach ( $page['pages'] as $page_tmp ):
$children[] = $page_tmp['id'];
endforeach;
endif;
@@ -26,10 +27,10 @@ if ( is_array( $this -> pages ) ) {
if ( $page['id'] == $this -> current_page )
echo ' active';
if ( is_array( $page['pages'] ) and in_array( $this -> current_page, $children ) )
if ( $has_children and in_array( $this -> current_page, $children ) )
echo ' open';
if ( is_array( $page['pages'] ) )
if ( $has_children )
echo ' parent';
echo '">';
@@ -40,14 +41,15 @@ if ( is_array( $this -> pages ) ) {
if ( $page['language']['noindex'] )
echo 'rel="nofollow"';
echo ' title="' . $page['language']['title'] . '"';
if ( is_array( $page['pages'] ) )
if ( $has_children )
echo "class='menu-trigger'";
echo '>';
echo $page['language']['title'];
echo '</a>';
if ( is_array( $page['pages'] ) )
if ( $has_children )
echo '<i class="fa fa-chevron-down menu-toggle" menu-id="link-' . $page['id'] . '"></i>';
echo \front\Views\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
if ( $has_children )
echo \front\Views\Menu::pages( $page['pages'], $this -> level + 1, $this -> current_page );
echo '</li>';
}
echo '</ul>';