Version 5.0.0 beta 3
This commit is contained in:
1 parent
f61b0da85d
commit
e86153356a
108 files changed
+2927
-1573
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user