Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

@@ -11,38 +11,45 @@
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\core\AdminNotification;
use IPS\Http\Url;
use IPS\Member;
use IPS\Theme;
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;
}
/**
* ACP Notification Extension
*/
class _Maxmind extends \IPS\core\AdminNotification
class Maxmind extends AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
public static string $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 3;
public static int $groupPriority = 3;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 1;
public static int $itemPriority = 1;
/**
* Title for settings
*
* @return string
*/
public static function settingsTitle()
public static function settingsTitle(): string
{
return 'acp_notification_Maxmind';
}
@@ -50,10 +57,10 @@ class _Maxmind extends \IPS\core\AdminNotification
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @param Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
public static function permissionCheck( Member $member ): bool
{
return true;// $member->hasAcpRestriction( ... );
}
@@ -61,9 +68,9 @@ class _Maxmind extends \IPS\core\AdminNotification
/**
* Is this type of notification ever optional (controls if it will be selectable as "viewable" in settings)
*
* @return string
* @return bool
*/
public static function mayBeOptional()
public static function mayBeOptional(): bool
{
return FALSE;
}
@@ -73,7 +80,7 @@ class _Maxmind extends \IPS\core\AdminNotification
*
* @return bool
*/
public static function mayRecur()
public static function mayRecur(): bool
{
return FALSE;
}
@@ -83,29 +90,29 @@ class _Maxmind extends \IPS\core\AdminNotification
*
* @return string
*/
public function title()
public function title(): string
{
return \IPS\Member::loggedIn()->language()->addToStack('acp_notification_nexus_maxmind');
return Member::loggedIn()->language()->addToStack('acp_notification_nexus_maxmind');
}
/**
* Notification Subtitle (no HTML)
*
* @return string
* @return string|null
*/
public function subtitle()
public function subtitle(): ?string
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acp_notification_nexus_maxmind_sub', FALSE );
return Member::loggedIn()->language()->addToStack( 'acp_notification_nexus_maxmind_sub', FALSE );
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
* @return string|null
*/
public function body()
public function body(): ?string
{
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus', 'admin' )->maxmind();
return Theme::i()->getTemplate( 'notifications', 'nexus', 'admin' )->maxmind();
}
/**
@@ -113,7 +120,7 @@ class _Maxmind extends \IPS\core\AdminNotification
*
* @return string
*/
public function severity()
public function severity(): string
{
return static::SEVERITY_HIGH;
}
@@ -123,7 +130,7 @@ class _Maxmind extends \IPS\core\AdminNotification
*
* @return string
*/
public function dismissible()
public function dismissible(): string
{
return static::DISMISSIBLE_TEMPORARY;
}
@@ -131,9 +138,9 @@ class _Maxmind extends \IPS\core\AdminNotification
/**
* Style
*
* @return bool
* @return string
*/
public function style()
public function style(): string
{
return static::STYLE_ERROR;
}
@@ -141,9 +148,9 @@ class _Maxmind extends \IPS\core\AdminNotification
/**
* Quick link from popup menu
*
* @return \IPS\Http\Url
* @return Url|null
*/
public function link()
public function link(): Url|null
{
return parent::link(); // \IPS\Http\Url::internal( '...' );
}