Version 5.0.0 beta 3

This commit is contained in:
Neo committed 2025-12-19 16:47:22 -08:00
1 parent f61b0da85d
commit e86153356a
108 files changed
+2927 -1573

No files matched your search

@@ -203,7 +203,14 @@ class FrontNavigation
'config' => '[]',
'position' => $position++,
'parent' => NULL,
'permissions' => NULL,
'permissions' => '*',
'icon' => json_encode( [ [
'key' => 'bars-staggered:fas',
'type' => 'fa',
'raw' => '<i class="fa-solid fa-bars-staggered"></i>',
'title' => 'bars-staggered',
'html' => '\r\n<!-- theme_core_global_global_icon --><span class="ipsIcon ipsIcon--fa" data-label="bars-staggered" aria-hidden="true"><i class="fa-solid fa-bars-staggered"></i></span>'
] ] )
) );
Lang::saveCustom( 'core', "menu_item_1", Member::loggedIn()->language()->get('default_menu_item_1') );
@@ -215,7 +222,14 @@ class FrontNavigation
'config' => '[]',
'position' => $position++,
'parent' => NULL,
'permissions' => NULL,
'permissions' => '*',
'icon' => json_encode( [ [
'key' => 'newspaper:far',
'type' => 'fa',
'raw' => '<i class="fa-regular fa-newspaper"></i>',
'title' => 'newspaper',
'html' => '\r\n<!-- theme_core_global_global_icon --><span class="ipsIcon ipsIcon--fa" data-label="newspaper (regular)" aria-hidden="true"><i class="fa-regular fa-newspaper"></i></span>'
] ] )
) );
Lang::saveCustom( 'core', "menu_item_2", Member::loggedIn()->language()->get('default_menu_item_2') );
@@ -292,6 +306,7 @@ class FrontNavigation
'parent' => (int) $parent,
'permissions' => NULL,
'is_menu_child' => $isMenuChild,
'icon' => $config['icon'] ?? null
) );
if ( isset( $config['title'] ) )
@@ -17,6 +17,7 @@ use IPS\core\FrontNavigation;
use IPS\Http\Url;
use IPS\Member;
use IPS\Request;
use IPS\Theme;
use function defined;
use function in_array;
use function is_array;
@@ -290,20 +291,27 @@ abstract class FrontNavigationAbstract
}
/**
* Is this item, or any of it's child items, active?
* Is this item, or any of its child items, active?
*
* @param string|null $menuType header|sidebar|smallscreen
* @return bool
*/
public function activeOrChildActive() : bool
public function activeOrChildActive( ?string $menuType=null ) : bool
{
if ( $this->active() )
if( $menuType === null )
{
$menuType = ( Theme::i()->getLayoutValue( 'global_view_mode' ) == 'side' ) ? 'sidebar' : 'header';
}
if ( $this->isAvailableFor( $menuType ) and $this->active() )
{
return TRUE;
}
foreach ( $this->subItems() as $item )
{
if ( $item->active() )
/* @var FrontNavigationAbstract $item */
if ( $item->isAvailableFor( $menuType ) and $item->active() )
{
return TRUE;
}