Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Advertisement Package
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
@@ -449,8 +448,6 @@ class _Ad extends \IPS\nexus\Package
|
||||
$purchase->extra = $extra;
|
||||
$purchase->save();
|
||||
|
||||
unset( \IPS\Data\Cache::i()->advertisements );
|
||||
|
||||
parent::onPurchaseGenerated( $purchase, $invoice );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Custom Package Field Node
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 1 May 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
@@ -131,6 +130,7 @@ class _CustomField extends \IPS\CustomField
|
||||
return !( $node instanceof \IPS\nexus\Package\Group );
|
||||
} ) ), 'pf_desc' );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'cf_sticky', $this->sticky, FALSE ), 'pf_type' );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'cf_allow_attachments', $this->id ? $this->allow_attachments : 1, FALSE, array( ), NULL, NULL, NULL, 'pf_allow_attachments' ) );
|
||||
|
||||
$form->addHeader( 'display_settings' );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'cf_purchase', $this->purchase, FALSE ) );
|
||||
@@ -146,6 +146,7 @@ class _CustomField extends \IPS\CustomField
|
||||
unset( $form->elements['']['pf_search_type'] );
|
||||
unset( $form->elements['']['pf_search_type_on_off'] );
|
||||
unset( $form->elements['']['pf_format'] );
|
||||
unset( $form->elements['']['pf_allow_attachments'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,23 +196,27 @@ class _CustomField extends \IPS\CustomField
|
||||
/**
|
||||
* Display Value
|
||||
*
|
||||
* @param mixed $value The value
|
||||
* @param mixed $value The value
|
||||
* @param bool $showSensitiveInformation If TRUE, potentially sensitive data (like passwords) will be displayed - otherwise will be blanked out
|
||||
* @return string
|
||||
*/
|
||||
public function displayValue( $value=NULL )
|
||||
public function displayValue( $value=NULL, $showSensitiveInformation=FALSE )
|
||||
{
|
||||
if ( $this->type === 'UserPass' )
|
||||
{
|
||||
if ( is_array( $value ) )
|
||||
if ( !is_array( $value ) )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'nexus', 'global' )->usernamePasswordDisplay( $value );
|
||||
$value = json_decode( \IPS\Text\Encrypt::fromTag( $value )->decrypt(), TRUE );
|
||||
}
|
||||
else
|
||||
|
||||
if ( !$showSensitiveInformation )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'nexus', 'global' )->usernamePasswordDisplay( json_decode( \IPS\Text\Encrypt::fromTag( $value )->decrypt(), TRUE ) );
|
||||
$value['pw'] = '********';
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'nexus', 'global' )->usernamePasswordDisplay( $value );
|
||||
}
|
||||
|
||||
return parent::displayValue( $value );
|
||||
return parent::displayValue( $value, $showSensitiveInformation );
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Dedicated Server Package
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Package Group Node
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Hosting Package
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
@@ -399,6 +398,10 @@ class _Hosting extends \IPS\nexus\Package
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( \DomainException $e )
|
||||
{
|
||||
throw $e;
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
throw new \DomainException('domain_not_valid');
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Nexus Package Content Item Model
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
@@ -22,7 +21,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* File Model
|
||||
*/
|
||||
class _Item extends \IPS\Content\Item implements \IPS\Content\Featurable, \IPS\Content\Shareable, \IPS\Content\Embeddable
|
||||
class _Item extends \IPS\Content\Item implements \IPS\Content\Featurable, \IPS\Content\Shareable, \IPS\Content\Embeddable, \IPS\Content\MetaData
|
||||
{
|
||||
/**
|
||||
* @brief Application
|
||||
@@ -69,7 +68,8 @@ class _Item extends \IPS\Content\Item implements \IPS\Content\Featurable, \IPS\C
|
||||
'num_reviews' => 'reviews',
|
||||
'unapproved_reviews' => 'unapproved_reviews',
|
||||
'hidden_reviews' => 'hidden_reviews',
|
||||
'rating' => 'rating'
|
||||
'rating' => 'rating',
|
||||
'meta_data' => 'meta_data'
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -245,7 +245,24 @@ class _Item extends \IPS\Content\Item implements \IPS\Content\Featurable, \IPS\C
|
||||
*/
|
||||
public function embedContent( $params )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'nexus' )->embedProduct( $this, $this->url()->setQueryString( $params ), $this->embedImage() );
|
||||
$memberCurrency = ( ( isset( $_SESSION['currency'] ) and in_array( $_SESSION['currency'], \IPS\nexus\Money::currencies() ) ) ? $_SESSION['currency'] : \IPS\nexus\Customer::loggedIn()->defaultCurrency() );
|
||||
$package = \IPS\nexus\Package::load( $this->id );
|
||||
|
||||
/* Do we have renewal terms? */
|
||||
$renewalTerm = NULL;
|
||||
$renewOptions = $package->renew_options ? json_decode( $package->renew_options, TRUE ) : array();
|
||||
if ( count( $renewOptions ) )
|
||||
{
|
||||
$renewalTerm = TRUE;
|
||||
if ( count( $renewOptions ) === 1 )
|
||||
{
|
||||
$renewalTerm = array_pop( $renewOptions );
|
||||
$renewalTerm = new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( $renewalTerm['cost'][ $memberCurrency ]['amount'], $memberCurrency ), new \DateInterval( 'P' . $renewalTerm['term'] . mb_strtoupper( $renewalTerm['unit'] ) ), $package->tax ? \IPS\nexus\Tax::load( $package->tax ) : NULL, $renewalTerm['add'] );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'embed.css', 'nexus', 'front' ) );
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'nexus' )->embedProduct( $this, $renewalTerm, $this->url()->setQueryString( $params ), $this->embedImage() );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,4 +290,14 @@ class _Item extends \IPS\Content\Item implements \IPS\Content\Featurable, \IPS\C
|
||||
}
|
||||
return parent::mapped($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported Meta Data Types
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function supportedMetaDataTypes()
|
||||
{
|
||||
return array( 'core_FeaturedComments' );
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Package Node
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus;
|
||||
@@ -376,7 +375,8 @@ class _Package extends \IPS\Node\Model
|
||||
{
|
||||
foreach ( $discounts['loyalty'] as $discount )
|
||||
{
|
||||
$count = ( ( $discount['package'] ?: $this->id ) == $this->id ) ? $initialCount : 0;
|
||||
$comparingPackageId = ( $discount['package'] ?: $this->id );
|
||||
$count = ( $comparingPackageId == $this->id ) ? $initialCount : 0;
|
||||
if ( $discount['price'][ $currency ] < $price )
|
||||
{
|
||||
$count += $customer->member_id ? $customer->previousPurchasesCount( $discount['package'] ?: $this->id, $discount['active'] ) : 0;
|
||||
@@ -385,7 +385,7 @@ class _Package extends \IPS\Node\Model
|
||||
{
|
||||
foreach ( $_SESSION['cart'] as $item )
|
||||
{
|
||||
if ( $item->id == $this->id )
|
||||
if ( $item->id == $comparingPackageId )
|
||||
{
|
||||
$count += $item->quantity;
|
||||
}
|
||||
@@ -954,7 +954,7 @@ class _Package extends \IPS\Node\Model
|
||||
'autoSaveKey' => ( $this->id ? "nexus-pkg-{$this->id}-pg" : "nexus-new-pkg-pg" ),
|
||||
'attachIds' => $this->id ? array( $this->id, NULL, 'pkg-pg' ) : NULL, 'minimize' => 'p_page_placeholder'
|
||||
)
|
||||
), NULL, NULL, NULL, 'p_desc_editor' ) );
|
||||
), NULL, NULL, NULL, 'p_page' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'p_support', $this->support, FALSE, array( 'togglesOn' => array( 'p_support_department' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'p_support_department', $this->support ? $this->support_department : 0, FALSE, array( 'class' => 'IPS\nexus\Support\Department', 'zeroVal' => 'none' ), NULL, NULL, NULL, 'p_support_department' ) );
|
||||
$form->addHeader('package_client_area_renewals');
|
||||
@@ -2238,6 +2238,11 @@ class _Package extends \IPS\Node\Model
|
||||
*/
|
||||
public function canRenewUntil( \IPS\nexus\Purchase $purchase, $admin )
|
||||
{
|
||||
if ( !$purchase->expire )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( $admin )
|
||||
{
|
||||
return TRUE;
|
||||
@@ -2418,7 +2423,14 @@ class _Package extends \IPS\Node\Model
|
||||
|
||||
/* Loop through our siblings */
|
||||
$return = array();
|
||||
$currency = $purchase->original_invoice->currency;
|
||||
try
|
||||
{
|
||||
$currency = $purchase->original_invoice->currency;
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$currency = $purchase->member->defaultCurrency();
|
||||
}
|
||||
$prices = json_decode( $this->base_price, TRUE );
|
||||
$thisPrice = $prices[ $currency ]['amount'];
|
||||
foreach ( $this->parent()->children() as $package )
|
||||
@@ -2614,12 +2626,15 @@ class _Package extends \IPS\Node\Model
|
||||
$renewalOptionsOnNewPackage = json_decode( $this->renew_options, TRUE );
|
||||
if ( $purchase->renewals )
|
||||
{
|
||||
foreach ( $renewalOptionsOnNewPackage as $renewalOption )
|
||||
if ( $renewalOptionsOnNewPackage )
|
||||
{
|
||||
$term = $purchase->renewals->getTerm();
|
||||
if ( $renewalOption['add'] and $term['term'] == $renewalOption['term'] and $term['unit'] == $renewalOption['unit'] )
|
||||
foreach ( $renewalOptionsOnNewPackage as $renewalOption )
|
||||
{
|
||||
$priceOfThisPackage += $renewalOption['cost'][ $currency ]['amount'];
|
||||
$term = $purchase->renewals->getTerm();
|
||||
if ( $renewalOption['add'] and $term['term'] == $renewalOption['term'] and $term['unit'] == $renewalOption['unit'] )
|
||||
{
|
||||
$priceOfThisPackage += $renewalOption['cost'][ $currency ]['amount'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2651,11 +2666,8 @@ class _Package extends \IPS\Node\Model
|
||||
{
|
||||
throw new \InvalidArgumentException;
|
||||
}
|
||||
|
||||
$oldCostPerDay = $purchase->renewals->costPerDay()->amount;
|
||||
$numberOfDaysInCurrentRenewalTerm = $purchase->renewals->days();
|
||||
$daysLeftUntilExpiry = new \IPS\Math\Number( (string) \IPS\DateTime::create()->diff( $purchase->expire )->days );
|
||||
|
||||
/* What is the closest renewal option on the new package? We'll use that one */
|
||||
$renewalOptionsInDays = array();
|
||||
foreach ( $renewalOptionsOnNewPackage as $optionId => $renewalTerm )
|
||||
{
|
||||
@@ -2672,9 +2684,20 @@ class _Package extends \IPS\Node\Model
|
||||
}
|
||||
$renewalTermToUse = $renewalOptionsInDays[ $closestRenewalOption ];
|
||||
|
||||
$newCostPerDay = $renewalTermToUse->costPerDay()->amount;
|
||||
return new \IPS\nexus\Money( $newCostPerDay->multiply( $daysLeftUntilExpiry )->subtract( $oldCostPerDay->multiply( $daysLeftUntilExpiry ) ), $currency );
|
||||
|
||||
/* What is the difference between our current renewal term and the renewal term we're moving to? */
|
||||
$diff = $purchase->renewals->diff( $renewalTermToUse );
|
||||
|
||||
/* Multiply that by how many days are left */
|
||||
$numberOfDaysInCurrentRenewalTerm = new \IPS\Math\Number( $purchase->renewals->days() );
|
||||
$daysLeftUntilExpiry = new \IPS\Math\Number( (string) ceil( ( $purchase->expire->getTimestamp() - time() ) / 86400 ) );
|
||||
if ( $numberOfDaysInCurrentRenewalTerm->compare( $daysLeftUntilExpiry ) === 0 )
|
||||
{
|
||||
return $diff;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new \IPS\nexus\Money( $diff->amount->divide( $numberOfDaysInCurrentRenewalTerm )->multiply( $daysLeftUntilExpiry ), $currency );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2947,7 +2970,7 @@ class _Package extends \IPS\Node\Model
|
||||
if ( $this->primary_group and $this->primary_group != $purchase->member->member_group_id and !in_array( $purchase->member->member_group_id, explode( ',', \IPS\Settings::i()->cm_protected ) ) )
|
||||
{
|
||||
/* Hang on, are we about to boot someone out the ACP? */
|
||||
if ( ! ( \IPS\Member\Group::load( $purchase->member->member_group_id )->g_access_cp and !\IPS\Member\Group::load( $this->primary_group )->g_access_cp ) )
|
||||
if ( ! ( $purchase->member->isAdmin() and !in_array( $this->primary_group, array_keys( \IPS\Member::administrators()['g'] ) ) ) )
|
||||
{
|
||||
/* Save the current group */
|
||||
$extra['old_primary_group'] = $purchase->member->member_group_id;
|
||||
@@ -2960,6 +2983,7 @@ class _Package extends \IPS\Node\Model
|
||||
|
||||
/* And update to the new group */
|
||||
$purchase->member->member_group_id = $this->primary_group;
|
||||
$purchase->member->members_bitoptions['ignore_promotions'] = true;
|
||||
$purchase->member->save();
|
||||
}
|
||||
}
|
||||
@@ -3032,6 +3056,7 @@ class _Package extends \IPS\Node\Model
|
||||
|
||||
/* Save */
|
||||
$purchase->member->cm_return_group = 0;
|
||||
$purchase->member->members_bitoptions['ignore_promotions'] = false;
|
||||
$purchase->member->save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Product Package
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 29 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Product Review
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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
|
||||
* @subpackage Nexus
|
||||
* @since 5 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Package;
|
||||
@@ -110,4 +109,32 @@ class _Review extends \IPS\Content\Review implements \IPS\Content\ReportCenter,
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'global', static::$application )->commentTableHeader( $this, \IPS\nexus\Package::load( $this->item()->id ), $this->item() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get content for embed
|
||||
*
|
||||
* @param array $params Additional parameters to add to URL
|
||||
* @return string
|
||||
*/
|
||||
public function embedContent( $params )
|
||||
{
|
||||
$memberCurrency = ( ( isset( $_SESSION['currency'] ) and in_array( $_SESSION['currency'], \IPS\nexus\Money::currencies() ) ) ? $_SESSION['currency'] : \IPS\nexus\Customer::loggedIn()->defaultCurrency() );
|
||||
$package = \IPS\nexus\Package::load( $this->id );
|
||||
|
||||
/* Do we have renewal terms? */
|
||||
$renewalTerm = NULL;
|
||||
$renewOptions = $package->renew_options ? json_decode( $package->renew_options, TRUE ) : array();
|
||||
if ( count( $renewOptions ) )
|
||||
{
|
||||
$renewalTerm = TRUE;
|
||||
if ( count( $renewOptions ) === 1 )
|
||||
{
|
||||
$renewalTerm = array_pop( $renewOptions );
|
||||
$renewalTerm = new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( $renewalTerm['cost'][ $memberCurrency ]['amount'], $memberCurrency ), new \DateInterval( 'P' . $renewalTerm['term'] . mb_strtoupper( $renewalTerm['unit'] ) ), $package->tax ? \IPS\nexus\Tax::load( $package->tax ) : NULL, $renewalTerm['add'] );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'embed.css', 'nexus', 'front' ) );
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'nexus' )->embedProductReview( $this, $this->item(), $renewalTerm, $this->url()->setQueryString( $params ) );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user