Version 4.7.13

This commit is contained in:
Neo committed 2025-12-19 16:14:56 -08:00
1 parent fd22d99e69
commit 7124a02564
954 files changed
+29277 -59308

No files matched your search

@@ -89,6 +89,10 @@ class _ConfigurationError extends \IPS\core\AdminNotification
{
return \IPS\Member::loggedIn()->language()->addToStack('acp_notification_nexus_config_error_paymethod');
}
elseif( mb_substr( $this->extra, 0, 2 ) === 'po' )
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acp_notification_nexus_config_error_payoutmethod' );
}
else
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusBACancelErrors', FALSE, array( 'pluralize' => array( \count( json_decode( $this->extra, TRUE ) ) ) ) );
@@ -111,6 +115,11 @@ class _ConfigurationError extends \IPS\core\AdminNotification
}
catch ( \OutOfRangeException $e ) { }
}
elseif( mb_substr( $this->extra, 0, 2 ) === 'po' )
{
$gateway = mb_substr( $this->extra, 2 );
return \IPS\Member::loggedIn()->language()->addToStack( 'acp_notification_nexus_config_error_payoutmethod_desc', FALSE, array( 'sprintf' => array( $gateway ) ) );
}
else
{
return '';
@@ -136,6 +145,11 @@ class _ConfigurationError extends \IPS\core\AdminNotification
return '';
}
}
elseif( mb_substr( $this->extra, 0, 2 ) === 'po' )
{
$gateway = mb_substr( $this->extra, 2 );
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus', 'admin' )->payoutSettingsError( $gateway );
}
else
{
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus', 'admin' )->baCancellationError( json_decode( $this->extra, TRUE ) );
@@ -149,7 +163,7 @@ class _ConfigurationError extends \IPS\core\AdminNotification
*/
public function severity()
{
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' ) ? static::SEVERITY_CRITICAL : static::SEVERITY_OPTIONAL;
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' OR mb_substr( $this->extra, 0, 2 ) === 'po' ) ? static::SEVERITY_CRITICAL : static::SEVERITY_OPTIONAL;
}
/**
@@ -159,7 +173,7 @@ class _ConfigurationError extends \IPS\core\AdminNotification
*/
public function dismissible()
{
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' ) ? static::DISMISSIBLE_NO : static::DISMISSIBLE_PERMANENT;
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' OR mb_substr( $this->extra, 0, 2 ) === 'po' ) ? static::DISMISSIBLE_NO : static::DISMISSIBLE_PERMANENT;
}
/**
@@ -195,7 +209,7 @@ class _ConfigurationError extends \IPS\core\AdminNotification
*/
public function style()
{
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' ) ? static::STYLE_ERROR : static::STYLE_WARNING;
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' OR mb_substr( $this->extra, 0, 2 ) === 'po' ) ? static::STYLE_ERROR : static::STYLE_WARNING;
}
/**
@@ -205,6 +219,15 @@ class _ConfigurationError extends \IPS\core\AdminNotification
*/
public function link()
{
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' ) ? \IPS\Http\Url::internal( 'app=nexus&module=payments&controller=paymentsettings&tab=gateways&do=form&id=' . \substr( $this->extra, 2 ) ) : parent::link();
if( mb_substr( $this->extra, 0, 2 ) === 'pm' )
{
return \IPS\Http\Url::internal( 'app=nexus&module=payments&controller=paymentsettings&tab=gateways&do=form&id=' . \substr( $this->extra, 2 ) );
}
elseif( mb_substr( $this->extra, 0, 2 ) === 'po' )
{
return \IPS\Http\Url::internal( 'app=nexus&module=payments&controller=payouts&do=settings' );
}
parent::link();
}
}
@@ -1,11 +1,11 @@
<?php
/**
* @brief ACP Notification: Hosting Errors
* @brief ACP Notification Extension
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 27 Jul 2018
* @subpackage Commerce
* @since 18 Jan 2023
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
@@ -18,9 +18,9 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
}
/**
* ACP Notification: Pending Shipping Orders
* ACP Notification Extension
*/
class _HostingError extends \IPS\core\AdminNotification
class _Maxmind extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
@@ -30,12 +30,12 @@ class _HostingError extends \IPS\core\AdminNotification
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
public static $groupPriority = 3;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 5;
public static $itemPriority = 1;
/**
* Title for settings
@@ -44,46 +44,7 @@ class _HostingError extends \IPS\core\AdminNotification
*/
public static function settingsTitle()
{
return 'acp_notification_HostingError';
}
/**
* Is this type of notification ever optional (controls if it will be selectable as "viewable" in settings)
*
* @return string
*/
public static function mayBeOptional()
{
return TRUE;
}
/**
* Is this type of notification might recur (controls what options will be available for the email setting)
*
* @return bool
*/
public static function mayRecur()
{
return TRUE;
}
/**
* @brief Current count
*/
protected $count = NULL;
/**
* Get count
*
* @return bool
*/
public function count()
{
if ( $this->count === NULL )
{
$this->count = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_hosting_errors' )->first();
}
return $this->count;
return 'acp_notification_Maxmind';
}
/**
@@ -94,19 +55,39 @@ class _HostingError extends \IPS\core\AdminNotification
*/
public static function permissionCheck( \IPS\Member $member )
{
return $member->hasAcpRestriction( 'nexus', 'hosting', 'errors_manage' ) and \IPS\Db::i()->select( 'COUNT(*)', 'nexus_hosting_servers' )->first();
return true;// $member->hasAcpRestriction( ... );
}
/**
* Is this type of notification ever optional (controls if it will be selectable as "viewable" in settings)
*
* @return string
*/
public static function mayBeOptional()
{
return FALSE;
}
/**
* Is this type of notification might recur (controls what options will be available for the email setting)
*
* @return bool
*/
public static function mayRecur()
{
return FALSE;
}
/**
* Notification Title (full HTML, must be escaped where necessary)
*
* @return string
*/
public function title()
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusHostingErrors', FALSE, array( 'pluralize' => array( $this->count() ) ) );
{
return \IPS\Member::loggedIn()->language()->addToStack('acp_notification_nexus_maxmind');
}
/**
* Notification Subtitle (no HTML)
*
@@ -114,14 +95,7 @@ class _HostingError extends \IPS\core\AdminNotification
*/
public function subtitle()
{
try
{
return \IPS\DateTime::ts( \IPS\Db::i()->select( 'e_time', 'nexus_hosting_errors', NULL, 'e_time asc', 1 )->first() )->relative();
}
catch ( \UnderflowException $e )
{
return NULL;
}
return \IPS\Member::loggedIn()->language()->addToStack( 'acp_notification_nexus_maxmind_sub', FALSE );
}
/**
@@ -131,10 +105,7 @@ class _HostingError extends \IPS\core\AdminNotification
*/
public function body()
{
$table = \IPS\nexus\modules\admin\hosting\errors::table( \IPS\Http\Url::internal('app=core&module=overview&controller=notifications&_table=nexus_HostingError') );
$table->limit = 10;
return $table;
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus', 'admin' )->maxmind();
}
/**
@@ -144,7 +115,7 @@ class _HostingError extends \IPS\core\AdminNotification
*/
public function severity()
{
return static::SEVERITY_OPTIONAL;
return static::SEVERITY_HIGH;
}
/**
@@ -153,8 +124,8 @@ class _HostingError extends \IPS\core\AdminNotification
* @return string
*/
public function dismissible()
{
return static::DISMISSIBLE_NO;
{
return static::DISMISSIBLE_TEMPORARY;
}
/**
@@ -170,21 +141,10 @@ class _HostingError extends \IPS\core\AdminNotification
/**
* Quick link from popup menu
*
* @return bool
* @return \IPS\Http\Url
*/
public function link()
{
return \IPS\Http\Url::internal('app=nexus&module=hosting&controller=errors');
}
/**
* Should this notification dismiss itself?
*
* @note This is checked every time the notification shows. Should be lightweight.
* @return bool
*/
public function selfDismiss()
{
return !$this->count();
return parent::link(); // \IPS\Http\Url::internal( '...' );
}
}