Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -12,17 +12,29 @@
|
||||
namespace IPS\{app}\extensions\core\FrontNavigation;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\core\FrontNavigation\FrontNavigationAbstract;
|
||||
use IPS\Dispatcher;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Member as MemberClass;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Front Navigation Extension: {class}
|
||||
*/
|
||||
class _{class} extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
class {class} extends FrontNavigationAbstract
|
||||
{
|
||||
/**
|
||||
* @var string Default icon
|
||||
*/
|
||||
public string $defaultIcon = '\f15c';
|
||||
|
||||
/**
|
||||
* Get Type Title which will display in the AdminCP Menu Manager
|
||||
*
|
||||
@@ -30,9 +42,9 @@ class _{class} extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
*/
|
||||
public static function typeTitle(): string
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack('frontnavigation_{app}');
|
||||
return MemberClass::loggedIn()->language()->addToStack('frontnavigation_{app}');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Can this item be used at all?
|
||||
* For example, if this will link to a particular feature which has been diabled, it should
|
||||
@@ -44,7 +56,7 @@ class _{class} extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Can the currently logged in user access the content this item links to?
|
||||
*
|
||||
@@ -54,7 +66,7 @@ class _{class} extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Title
|
||||
*
|
||||
@@ -62,19 +74,19 @@ class _{class} extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack('frontnavigation_{app}');
|
||||
return MemberClass::loggedIn()->language()->addToStack('frontnavigation_{app}');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Link
|
||||
*
|
||||
* @return \IPS\Http\Url
|
||||
* @return Url
|
||||
*/
|
||||
public function link(): \IPS\Http\Url
|
||||
public function link(): Url
|
||||
{
|
||||
return \IPS\Http\Url::internal( "app={app}" );
|
||||
return Url::internal( "app={app}" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is Active?
|
||||
*
|
||||
@@ -82,16 +94,16 @@ class _{class} extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
*/
|
||||
public function active(): bool
|
||||
{
|
||||
return \IPS\Dispatcher::i()->application->directory === '{app}';
|
||||
return Dispatcher::i()->application->directory === '{app}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Children
|
||||
*
|
||||
* @param bool $noStore If true, will skip datastore and get from DB (used for ACP preview)
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public function children( $noStore=FALSE )
|
||||
public function children( bool $noStore=FALSE ): ?array
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user