Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -12,7 +12,7 @@
namespace IPS\nexus;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -101,7 +101,7 @@ class _CommissionRule extends \IPS\Node\Model
$numberOfPurchasesField = array(
'getHtml' => function( $field )
{
return \IPS\Theme::i()->getTemplate('customers')->numberOfPurchasesField( $field );
return \IPS\Theme::i()->getTemplate('customers', 'nexus' )->numberOfPurchasesField( $field );
},
'formatValue'=> function( $field )
{
@@ -142,7 +142,7 @@ class _CommissionRule extends \IPS\Node\Model
$form->add( new \IPS\Helpers\Form\Custom( 'rrule_purchase_amount', array( $this->purchase_amount_op, $this->purchase_amount_unit ), FALSE, array(
'getHtml' => function( $field )
{
return \IPS\Theme::i()->getTemplate('customers')->purchaseValueField( $field );
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->purchaseValueField( $field );
},
'formatValue' => function( $field )
{
@@ -151,7 +151,7 @@ class _CommissionRule extends \IPS\Node\Model
{
return array( '', '' );
}
$value[1] = is_array( $value[1] ) ? json_encode( $value[1] ) : $value[1];
$value[1] = \is_array( $value[1] ) ? json_encode( $value[1] ) : $value[1];
return $value;
}
) ) );
@@ -319,8 +319,15 @@ class _CommissionRule extends \IPS\Node\Model
$prices
) ) );
}
return \IPS\Member::loggedIn()->language()->addToStack( 'ref_cond', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $conditions ) ) ) );
if( \count( $conditions ) )
{
return \IPS\Member::loggedIn()->language()->addToStack( 'ref_cond', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $conditions ) ) ) );
}
else
{
return \IPS\Member::loggedIn()->language()->addToStack( 'ref_no_cond', FALSE );
}
}
/**
@@ -331,13 +338,13 @@ class _CommissionRule extends \IPS\Node\Model
public function commissionLimit()
{
$prices = array();
if ( $this->commission_limit and $limits = json_decode( $this->commission_limit, TRUE ) and is_array( $limits ) )
if ( $this->commission_limit and $limits = json_decode( $this->commission_limit, TRUE ) and \is_array( $limits ) )
{
foreach ( $limits as $currency => $amount )
{
$prices[] = new \IPS\nexus\Money( $amount['amount'], $currency );
}
}
return count( $prices ) ? \IPS\Member::loggedIn()->language()->addToStack( 'ref_comm_limit', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $prices, \IPS\Member::loggedIn()->language()->get('or_list_format') ) ) ) ) : '';
return \count( $prices ) ? \IPS\Member::loggedIn()->language()->addToStack( 'ref_comm_limit', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $prices, \IPS\Member::loggedIn()->language()->get('or_list_format') ) ) ) ) : '';
}
}