Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+9 -6
View File
@@ -140,14 +140,17 @@ class _Ad extends \IPS\nexus\Package
unset( $values['p_max_dims'] );
}
$locations = $values['p_locations'];
$customKey = array_search( '_ad_custom_', $locations );
if ( $customKey !== FALSE )
if ( isset( $values['p_locations'] ) )
{
unset( $locations[ $customKey ] );
$locations = array_merge( $locations, $values['p_locations_custom'] );
$locations = $values['p_locations'];
$customKey = array_search( '_ad_custom_', $locations );
if ( $customKey !== FALSE )
{
unset( $locations[ $customKey ] );
$locations = array_merge( $locations, $values['p_locations_custom'] );
}
$values['p_locations'] = implode( ',', $locations );
}
$values['p_locations'] = implode( ',', $locations );
unset( $values['p_locations_custom'] );
return parent::formatFormValues( $values );
@@ -257,4 +257,19 @@ class _Item extends \IPS\Content\Item implements \IPS\Content\Featurable, \IPS\C
$product = \IPS\nexus\Package::load( $this->id );
return $product->_data['image'] ? \IPS\File::get( 'nexus_Products', $product->_data['image'] ) : NULL;
}
/**
* Get mapped value
*
* @param string $key date,content,ip_address,first
* @return mixed
*/
public function mapped( $key )
{
if ( $key === 'title' )
{
return $this->title;
}
return parent::mapped($key);
}
}
+19 -16
View File
@@ -791,7 +791,13 @@ class _Package extends \IPS\Node\Model
$form->add( $field );
}
$form->addHeader('package_registration');
$form->add( new \IPS\Helpers\Form\YesNo( 'p_reg', $this->reg ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'p_reg', $this->reg, FALSE, array(), function( $val )
{
if ( $val and ( !\IPS\Request::i()->p_store_checkbox or ( \IPS\Request::i()->p_member_groups and !in_array( \IPS\Settings::i()->guest_group, \IPS\Request::i()->p_member_groups ) ) ) )
{
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack( 'p_reg_err', FALSE, array( 'sprintf' => array( \IPS\Member\Group::load( \IPS\Settings::i()->guest_group )->name ) ) ) );
}
} ) );
$form->addHeader('package_associations');
$form->addMessage('package_associations_desc');
$form->add( new \IPS\Helpers\Form\Radio( 'p_associate', ( $this->force_assoc and count( $this->associablePackages() ) ) ? 2 : ( count( $this->associablePackages() ) ? 1 : 0 ), FALSE, array(
@@ -1300,19 +1306,22 @@ class _Package extends \IPS\Node\Model
{
$newRenewTerms = array();
}
$key = 'x';
foreach ( $changes['renew_options'] as $k => $data )
if ( $purchase->renewals )
{
if ( $data['old'] != 'x' )
foreach ( $changes['renew_options'] as $k => $data )
{
if ( $data['old']['cost'][ $purchase->renewals->cost->currency ]['amount'] == $purchase->renewals->cost->amount )
if ( $data['old'] != 'x' )
{
$term = $purchase->renewals->getTerm();
if ( $data['old']['term'] == $term['term'] and $data['old']['unit'] == $term['unit'] )
if ( $data['old']['cost'][ $purchase->renewals->cost->currency ]['amount'] == $purchase->renewals->cost->amount )
{
$key = $k;
break;
$term = $purchase->renewals->getTerm();
if ( $data['old']['term'] == $term['term'] and $data['old']['unit'] == $term['unit'] )
{
$key = $k;
break;
}
}
}
}
@@ -2802,13 +2811,7 @@ class _Package extends \IPS\Node\Model
catch ( \UnderflowException $e )
{
$purchase->member->member_group_id = $purchase->member->cm_return_group;
/* Don't move them back into validating */
if ( $purchase->member->member_group_id == \IPS\Settings::i()->auth_group )
{
$purchase->member->member_group_id = \IPS\Settings::i()->member_group;
}
/* Does this group exist? */
try
{