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

+126 -13
View File
@@ -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;
@@ -50,7 +50,7 @@ class _Application extends \IPS\Application
$subscription = \IPS\Db::i()->select( '*', 'nexus_subscriptions', array( 's_gateway_key=? AND s_id=?', 'paypalpro', \IPS\Request::i()->recurring_payment_id ) )->first();
}
$items = \unserialize( $subscription['s_items'] );
if ( !is_array( $items ) or empty( $items ) )
if ( !\is_array( $items ) or empty( $items ) )
{
/* Don't exit here, throw an underflow exception so we can see if this is a legacy subscription */
throw new \UnderflowException( 'NO_ITEMS' );
@@ -64,14 +64,14 @@ class _Application extends \IPS\Application
if ( mb_strstr( \IPS\Request::i()->custom, '-' ) !== FALSE )
{
$exploded = explode( '-', \IPS\Request::i()->custom );
$memberId = intval( $exploded[0] );
$purchaseId = intval( $exploded[1] );
$memberId = \intval( $exploded[0] );
$purchaseId = \intval( $exploded[1] );
$item = \IPS\Db::i()->select( '*', 'nexus_purchases', array( "ps_id=?", $purchaseId ), 'ps_id' )->first();
}
else
{
$memberId = intval( \IPS\Request::i()->custom );
$memberId = \intval( \IPS\Request::i()->custom );
$item = \IPS\Db::i()->select( '*', 'nexus_purchases', array( "ps_member=? AND ps_name=?", $memberId, \IPS\Request::i()->item_name ), 'ps_start DESC' )->first();
}
@@ -136,7 +136,7 @@ class _Application extends \IPS\Application
$invoice = \IPS\nexus\Invoice::constructFromData( \IPS\Db::i()->select( '*', 'nexus_invoices', array( 'i_member=? AND i_status=?', $subscription['s_member'], 'pend' ), 'i_date DESC', 1 )->first() );
foreach ( $invoice->items as $item )
{
if ( $item instanceof \IPS\nexus\Invoice\Item\Renewal and in_array( $item->id, $_items ) )
if ( $item instanceof \IPS\nexus\Invoice\Item\Renewal and \in_array( $item->id, $_items ) )
{
unset( $_items[ array_search( $item->id, $_items ) ] );
}
@@ -145,7 +145,7 @@ class _Application extends \IPS\Application
catch ( \UnderflowException $e ) { }
/* No, create one */
if ( count( $_items ) )
if ( \count( $_items ) )
{
$invoice = new \IPS\nexus\Invoice;
$invoice->member = \IPS\nexus\Customer::load( $subscription['s_member'] );
@@ -161,7 +161,7 @@ class _Application extends \IPS\Application
}
catch ( \OutOfRangeException $e ) { }
}
if ( !count( $invoice->items ) )
if ( !\count( $invoice->items ) )
{
exit;
}
@@ -194,6 +194,66 @@ class _Application extends \IPS\Application
exit;
}
}
/**
* Install Other
*
* @return void
*/
public function installOther()
{
/* Disable hosting support for new installations */
\IPS\Db::i()->update( 'core_modules', array( 'sys_module_visible' => 0 ), array( 'sys_module_application=? AND sys_module_key=? AND sys_module_area=?', 'nexus', 'hosting', 'admin' ) );
}
/**
* Returns the ACP Menu JSON for this application.
*
* @return array
*/
public function acpMenu()
{
$menu = parent::acpMenu();
if( $m = \IPS\Application\Module::get( 'nexus', 'hosting', 'admin' ) AND $m->visible )
{
$menu['hosting'] = array(
'queues' => array(
'tab' => 'nexus',
'controller' => 'queues',
'do' => '',
'restriction' => 'queues_manage'
),
'servers' => array(
'tab' => 'nexus',
'controller' => 'servers',
'do' => '',
'restriction' => 'servers_manage'
),
'monitoring' => array(
'tab' => 'nexus',
'controller' => 'monitoring',
'do' => '',
'restriction' => null
),
'errors' => array(
'tab' => 'nexus',
'controller' => 'errors',
'do' => '',
'restriction' => 'errors_manage'
),
'settings' => array(
'tab' => 'nexus',
'controller' => 'settings',
'do' => '',
'restriction' => 'settings_manage'
)
);
}
return $menu;
}
/**
* @brief Cached menu counts
@@ -214,7 +274,7 @@ class _Application extends \IPS\Application
case 'transactions':
if( !isset( $this->menuCounts['transactions'] ) )
{
$this->menuCounts['transactions'] = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions', array( '( t_status=? OR t_status=? OR t_status=? )', \IPS\nexus\Transaction::STATUS_HELD, \IPS\nexus\Transaction::STATUS_REVIEW, \IPS\nexus\Transaction::STATUS_DISPUTED ) )->first();
$this->menuCounts['transactions'] = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions', array( \IPS\Db::i()->in( 't_status', array( \IPS\nexus\Transaction::STATUS_HELD, \IPS\nexus\Transaction::STATUS_WAITING, \IPS\nexus\Transaction::STATUS_REVIEW, \IPS\nexus\Transaction::STATUS_DISPUTED ) ) ) )->first();
}
return $this->menuCounts['transactions'];
break;
@@ -294,12 +354,17 @@ class _Application extends \IPS\Application
*/
public function allowGuestAccess( \IPS\Application\Module $module, $controller, $do )
{
if( ( \IPS\Settings::i()->nexus_reg_force OR \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages', 'p_reg=1' )->first() ) AND ( $module->key == 'store' OR $module->key == 'checkout' ) )
if( ( \IPS\Settings::i()->nexus_reg_force OR \IPS\nexus\Package::haveRegistrationProducts() ) AND ( $module->key == 'store' OR $module->key == 'checkout' ) )
{
return TRUE;
}
if ( \IPS\Settings::i()->nexus_subs_register AND ( $module->key == 'store' OR $module->key == 'checkout' ) )
if ( \IPS\Settings::i()->nexus_subs_register AND ( \in_array( $module->key, [ 'store', 'checkout', 'subscriptions' ] ) ) )
{
return TRUE;
}
if ( \IPS\Settings::i()->cm_ref_on AND $module->key == 'promotion' AND $controller == 'referral' )
{
return TRUE;
}
@@ -335,13 +400,15 @@ class _Application extends \IPS\Application
array(
'key' => 'Store',
'children' => array(
array( 'key' => 'Store' ),
array( 'key' => 'Gifts' ),
array( 'key' => 'Subscriptions' ),
array( 'key' => 'Donations' ),
array( 'key' => 'Orders' ),
array( 'key' => 'Purchases' ),
array(
'app' => 'core',
'key' => 'Menu',
'app' => 'core',
'key' => 'Menu',
'title' => 'default_menu_item_my_details',
'children' => array(
array( 'key' => 'Info' ),
@@ -373,6 +440,35 @@ class _Application extends \IPS\Application
}
/**
* Get Extensions - Deprecate Hosting Utilities
*
* @param \IPS\Application|string $app The app key of the application which owns the extension
* @param string $extension Extension Type
* @param bool $construct Should an object be returned? (If false, just the classname will be returned)
* @param \IPS\Member|\IPS\Member\Group|bool $checkAccess Check access permission for extension against supplied member/group (or logged in member, if TRUE)
* @return array
*/
public function extensions( $app, $extension, $construct=TRUE, $checkAccess=FALSE )
{
$extensions = parent::extensions( $app, $extension, $construct, $checkAccess );
/* If Item extension and hosting support is hidden, we'll need to remove the hosting specific items that are deprecated */
if( $extension == 'Item' AND $m = \IPS\Application\Module::get( 'nexus', 'hosting', 'admin' ) AND !$m->visible )
{
$deprecated = array( 'Bandwidth', 'DedicatedServer', 'Domain' );
foreach( $extensions as $key => $class )
{
if( \in_array( $key, $deprecated ) )
{
unset( $extensions[ $key ] );
}
}
}
return $extensions;
}
/**
* Perform some legacy URL parameter conversions
*
* @return void
@@ -391,4 +487,21 @@ class _Application extends \IPS\Application
\IPS\Request::i()->validate = 'paypal';
}
}
/**
* Return an array of specific links to add to the sitemap
*
* @return array
*/
public function sitemapLinks()
{
$return = array( \IPS\Http\Url::internal( 'app=nexus&module=store&controller=store', 'front', 'store' ) );
if( \IPS\Settings::i()->nexus_subs_enabled )
{
$return[] = \IPS\Http\Url::internal( 'app=nexus&module=subscriptions&controller=subscriptions', 'front', 'nexus_subscriptions' );
}
return $return;
}
}
+3 -3
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -58,7 +58,7 @@ class _invoices extends \IPS\Api\Controller
}
/* Sort */
if ( isset( \IPS\Request::i()->sortBy ) and in_array( \IPS\Request::i()->sortBy, array( 'date', 'title', 'total' ) ) )
if ( isset( \IPS\Request::i()->sortBy ) and \in_array( \IPS\Request::i()->sortBy, array( 'date', 'title', 'total' ) ) )
{
$sortBy = 'i_' . \IPS\Request::i()->sortBy;
}
@@ -66,7 +66,7 @@ class _invoices extends \IPS\Api\Controller
{
$sortBy = 'i_id';
}
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and \in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
/* Return */
return new \IPS\Api\PaginatedResponse(
+2 -1
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -56,6 +56,7 @@ class _lkey extends \IPS\Api\Controller
*
* @apiclientonly
* @apiparam object customFields Values for custom fields
* @param string $lkey License key
* @throws 2X310/2 INVALID_KEY The license key does not exist
* @return \IPS\nexus\Purchase
*/
+14 -9
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -46,7 +46,10 @@ class _purchases extends \IPS\Api\Controller
{
/* Where clause */
$where = array();
/* Get only the purchases from active applications */
$where[] = array( "ps_app IN('" . implode( "','", array_keys( \IPS\Application::enabledApplications() ) ) . "')" );
/* Customers */
if ( $this->member )
{
@@ -56,15 +59,15 @@ class _purchases extends \IPS\Api\Controller
{
$where[] = array( \IPS\Db::i()->in( 'ps_member', array_map( 'intval', array_filter( explode( ',', \IPS\Request::i()->customers ) ) ) ) );
}
/* Status */
if ( isset( \IPS\Request::i()->active ) )
{
$where[] = array( 'ps_active=?', intval( \IPS\Request::i()->active ) );
$where[] = array( 'ps_active=?', \intval( \IPS\Request::i()->active ) );
}
if ( isset( \IPS\Request::i()->canceled ) )
{
$where[] = array( 'ps_cancelled=?', intval( \IPS\Request::i()->canceled ) );
$where[] = array( 'ps_cancelled=?', \intval( \IPS\Request::i()->canceled ) );
}
/* Item */
@@ -84,17 +87,17 @@ class _purchases extends \IPS\Api\Controller
/* Parent */
if ( isset( \IPS\Request::i()->parent ) )
{
$where[] = array( 'ps_parent=?', intval( \IPS\Request::i()->parent ) );
$where[] = array( 'ps_parent=?', \intval( \IPS\Request::i()->parent ) );
}
/* Show */
if ( isset( \IPS\Request::i()->show ) )
{
$where[] = array( 'ps_show=?', intval( \IPS\Request::i()->show ) );
$where[] = array( 'ps_show=?', \intval( \IPS\Request::i()->show ) );
}
/* Sort */
if ( isset( \IPS\Request::i()->sortBy ) and in_array( \IPS\Request::i()->sortBy, array( 'start', 'expire' ) ) )
if ( isset( \IPS\Request::i()->sortBy ) and \in_array( \IPS\Request::i()->sortBy, array( 'start', 'expire' ) ) )
{
$sortBy = 'ps_' . \IPS\Request::i()->sortBy;
}
@@ -102,7 +105,7 @@ class _purchases extends \IPS\Api\Controller
{
$sortBy = 'ps_id';
}
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and \in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
/* Return */
return new \IPS\Api\PaginatedResponse(
@@ -148,6 +151,8 @@ class _purchases extends \IPS\Api\Controller
*
* @apiclientonly
* @apiparam object customFields Values for custom fields
* @param int $id ID Number
* @throws 2X309/1 INVALID_ID The purchase ID does not exist
* @return \IPS\nexus\Purchase
*/
public function POSTitem( $id )
+3 -3
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -60,7 +60,7 @@ class _shipments extends \IPS\Api\Controller
}
/* Sort */
if ( isset( \IPS\Request::i()->sortBy ) and in_array( \IPS\Request::i()->sortBy, array( 'date', 'shipped_date' ) ) )
if ( isset( \IPS\Request::i()->sortBy ) and \in_array( \IPS\Request::i()->sortBy, array( 'date', 'shipped_date' ) ) )
{
$sortBy = 'o_' . \IPS\Request::i()->sortBy;
}
@@ -68,7 +68,7 @@ class _shipments extends \IPS\Api\Controller
{
$sortBy = 'o_id';
}
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and \in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
/* Return */
return new \IPS\Api\PaginatedResponse(
+3 -3
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -79,7 +79,7 @@ class _supportreplies extends \IPS\Content\Api\CommentController
/* Are we a staff member? */
$bypassPerms = FALSE;
if ( $this->member and $this->member->isAdmin() and count( \IPS\nexus\Support\Department::departmentsWithPermission( $this->member ) ) )
if ( $this->member and $this->member->isAdmin() and \count( \IPS\nexus\Support\Department::departmentsWithPermission( $this->member ) ) )
{
$where[] = array( \IPS\Db::i()->in( 'r_department', array_keys( iterator_to_array( \IPS\nexus\Support\Department::departmentsWithPermission( $this->member ) ) ) ) );
$bypassPerms = TRUE;
@@ -146,7 +146,7 @@ class _supportreplies extends \IPS\Content\Api\CommentController
{
// Okay
}
elseif ( $this->member->isAdmin() and ( $request->department->staff === '*' or count( array_intersect( explode( ',', $request->department->staff ), Department::staffDepartmentPerms( $this->member ) ) ) ) )
elseif ( $this->member->isAdmin() and ( $request->department->staff === '*' or \count( array_intersect( explode( ',', $request->department->staff ), Department::staffDepartmentPerms( $this->member ) ) ) ) )
{
// Okay
}
+5 -3
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -102,7 +102,7 @@ class _supportrequests extends \IPS\Content\Api\ItemController
/* Are we a staff member? */
$bypassPerms = FALSE;
if ( $this->member and $this->member->isAdmin() and count( \IPS\nexus\Support\Department::departmentsWithPermission( $this->member ) ) )
if ( $this->member and $this->member->isAdmin() and \count( \IPS\nexus\Support\Department::departmentsWithPermission( $this->member ) ) )
{
$where[] = array( \IPS\Db::i()->in( 'r_department', array_keys( iterator_to_array( \IPS\nexus\Support\Department::departmentsWithPermission( $this->member ) ) ) ) );
$bypassPerms = TRUE;
@@ -195,7 +195,7 @@ class _supportrequests extends \IPS\Content\Api\ItemController
{
continue;
}
if ( $key === 'severity' and ( !$this->member->cm_no_sev or !in_array( $object, \IPS\nexus\Support\Department::load( \IPS\Request::i()->department )->availableSeverities() ) ) )
if ( $key === 'severity' and ( !$this->member->cm_no_sev or !\in_array( $object, \IPS\nexus\Support\Department::load( \IPS\Request::i()->department )->availableSeverities() ) ) )
{
continue;
}
@@ -331,6 +331,7 @@ class _supportrequests extends \IPS\Content\Api\ItemController
if ( !$this->member and isset( \IPS\Request::i()->email ) )
{
$item->email = \IPS\Request::i()->email;
$item->save();
}
/* Do it */
@@ -349,6 +350,7 @@ class _supportrequests extends \IPS\Content\Api\ItemController
* @apiparam int purchase Associated purchase ID number. Ignored for requests using an OAuth Access Token for a particular member (users cannot change associated purchase of request after its created)
* @apiparam string lkey License key of associated purchase ID number. (Will be ignored if "purchase" is provided). Ignored for requests using an OAuth Access Token for a particular member (users cannot change associated purchase of request after its created)
* @apiparam int staff Assigned staff ID number. Ignored for requests using an OAuth Access Token for a particular member
* @param int $id ID Number
* @throws 2X313/7 INVALID_ID The topic ID does not exist or the authorized user does not have permission to view it
* @return \IPS\nexus\Support\Request
*/
+3 -3
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -65,7 +65,7 @@ class _transactions extends \IPS\Api\Controller
}
/* Sort */
if ( isset( \IPS\Request::i()->sortBy ) and in_array( \IPS\Request::i()->sortBy, array( 'date', 'amount' ) ) )
if ( isset( \IPS\Request::i()->sortBy ) and \in_array( \IPS\Request::i()->sortBy, array( 'date', 'amount' ) ) )
{
$sortBy = 't_' . \IPS\Request::i()->sortBy;
}
@@ -73,7 +73,7 @@ class _transactions extends \IPS\Api\Controller
{
$sortBy = 't_id';
}
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and \in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
/* Return */
return new \IPS\Api\PaginatedResponse(
+3 -3
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\api;
/* 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;
@@ -58,7 +58,7 @@ class _withdrawals extends \IPS\Api\Controller
}
/* Sort */
if ( isset( \IPS\Request::i()->sortBy ) and in_array( \IPS\Request::i()->sortBy, array( 'date', 'amount' ) ) )
if ( isset( \IPS\Request::i()->sortBy ) and \in_array( \IPS\Request::i()->sortBy, array( 'date', 'amount' ) ) )
{
$sortBy = 'po_' . \IPS\Request::i()->sortBy;
}
@@ -66,7 +66,7 @@ class _withdrawals extends \IPS\Api\Controller
{
$sortBy = 'po_id';
}
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and \in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
/* Return */
return new \IPS\Api\PaginatedResponse(
+8 -39
View File
@@ -49,12 +49,6 @@
"controller": "fields",
"do": "",
"restriction": "fields_manage"
},
"referrals": {
"tab": "nexus",
"controller": "referrals",
"do": "",
"restriction": "referrals_manage"
}
},
"support": {
@@ -62,7 +56,8 @@
"tab": "nexus",
"controller": "requests",
"do": "",
"restriction": "requests_manage"
"restriction": "requests_manage",
"subcontrollers": "request"
},
"reports": {
"tab": "nexus",
@@ -104,6 +99,12 @@
"do": "",
"restriction": "packages_manage"
},
"filters": {
"tab": "nexus",
"controller": "filters",
"do": "",
"restriction": "packages_manage"
},
"fields": {
"tab": "nexus",
"controller": "fields",
@@ -123,38 +124,6 @@
"restriction": "settings_manage"
}
},
"hosting": {
"queues": {
"tab": "nexus",
"controller": "queues",
"do": "",
"restriction": "queues_manage"
},
"servers": {
"tab": "nexus",
"controller": "servers",
"do": "",
"restriction": "servers_manage"
},
"monitoring": {
"tab": "nexus",
"controller": "monitoring",
"do": "",
"restriction": null
},
"errors": {
"tab": "nexus",
"controller": "errors",
"do": "",
"restriction": "errors_manage"
},
"settings": {
"tab": "nexus",
"controller": "settings",
"do": "",
"restriction": "settings_manage"
}
},
"reports": {
"purchases": {
"tab": "stats",
@@ -72,11 +72,6 @@
"customers_edit_cards": "customers_edit_cards",
"customers_void": "customers_void"
},
"referrals": {
"referrals_manage": "referrals_manage",
"referrals_commission_rules": "referrals_commission_rules",
"referrals_banners": "referrals_banners"
},
"notes": {
"customer_notes_view": "customer_notes_view",
"customer_notes_add": "customer_notes_add",
-30
View File
@@ -34,36 +34,6 @@
"nexus fields"
]
},
"app=nexus&module=customers&controller=referrals": {
"lang_key": "menu__nexus_customers_referrals",
"restriction": "referrals_manage",
"keywords": [
"comision",
"comission",
"commision",
"commission",
"refer",
"referals",
"referrals",
"reffer"
]
},
"app=nexus&module=customers&controller=referrals&searchResult=form_cm_ref_on": {
"lang_key": "cm_ref_on",
"restriction": "referrals_manage",
"keywords": [
"referral",
"referrals"
]
},
"app=nexus&module=customers&controller=referrals&tab=refersettings": {
"lang_key": "settings",
"restriction": "referrals_manage",
"keywords": [
"referral settings",
"referrals"
]
},
"app=nexus&module=customers&controller=search": {
"lang_key": "menu__nexus_customers_search",
"restriction": "customers_view",
+233
View File
@@ -0,0 +1,233 @@
<?xml version="1.0" encoding="UTF-8"?>
<build>
<module key="front/store"><![CDATA[{"default_controller":"store","protected":0,"default":1}]]></module>
<module key="front/checkout"><![CDATA[{"default_controller":null,"protected":1,"default":0}]]></module>
<module key="front/support"><![CDATA[{"default_controller":"home","protected":0,"default":0}]]></module>
<module key="front/clients"><![CDATA[{"default_controller":"purchases","protected":0,"default":0}]]></module>
<module key="front/promotion"><![CDATA[{"default_controller":"","protected":0,"default":0}]]></module>
<module key="front/subscriptions"><![CDATA[{"default_controller":"","protected":0,"default":0}]]></module>
<module key="admin/payments"><![CDATA[{"default_controller":"transactions","protected":0,"default":1}]]></module>
<module key="admin/customers"><![CDATA[{"default_controller":null,"protected":0,"default":0}]]></module>
<module key="admin/support"><![CDATA[{"default_controller":"","protected":0,"default":0}]]></module>
<module key="admin/store"><![CDATA[{"default_controller":"","protected":0,"default":0}]]></module>
<module key="admin/hosting"><![CDATA[{"default_controller":"","protected":0,"default":0}]]></module>
<module key="admin/reports"><![CDATA[{"default_controller":"","protected":0,"default":0}]]></module>
<module key="admin/subscriptions"><![CDATA[{"default_controller":"subscriptions","protected":0,"default":0}]]></module>
<task frequency="P0Y0M0DT1H0M0S">capture</task>
<task frequency="P0Y0M0DT1H0M0S">sendInvoiceWarnings</task>
<task frequency="P0Y0M0DT0H30M0S">generateRenewalInvoices</task>
<task frequency="P0Y0M0DT1H0M0S">expirePurchases</task>
<task frequency="P0Y0M0DT1H0M0S">expireInvoices</task>
<task frequency="P0Y0M0DT1H0M0S">supportAutoresolve</task>
<task frequency="P0Y0M1DT0H0M0S">supportAssignedReminder</task>
<task frequency="P0Y0M0DT0H5M0S">monitor</task>
<task frequency="P0Y0M1DT0H0M0S">terminateHosting</task>
<task frequency="P0Y0M0DT0H30M0S">expectedOutputMonitoring</task>
<task frequency="P0Y0M1DT0H0M0S">cartCleanup</task>
<setting key="billing_agreement_gateways"><![CDATA[{"key":"billing_agreement_gateways","default":"0","report":"bool"}]]></setting>
<setting key="card_storage_gateways"><![CDATA[{"key":"card_storage_gateways","default":"0","report":"bool"}]]></setting>
<setting key="cm_invoice_expireafter"><![CDATA[{"key":"cm_invoice_expireafter","default":"30","report":"full"}]]></setting>
<setting key="cm_invoice_generate"><![CDATA[{"key":"cm_invoice_generate","default":"12","report":"full"}]]></setting>
<setting key="cm_invoice_warning"><![CDATA[{"key":"cm_invoice_warning","default":"72","report":"full"}]]></setting>
<setting key="cm_protected"><![CDATA[{"key":"cm_protected","default":"","report":"bool"}]]></setting>
<setting key="customer_fields"><![CDATA[{"key":"customer_fields","default":"0","report":"bool"}]]></setting>
<setting key="donation_goals"><![CDATA[{"key":"donation_goals","default":"0","report":"bool"}]]></setting>
<setting key="easypost_address"><![CDATA[{"key":"easypost_address","default":"","report":"bool"}]]></setting>
<setting key="easypost_api_key"><![CDATA[{"key":"easypost_api_key","default":"","report":"bool"}]]></setting>
<setting key="easypost_delivery_adjustment"><![CDATA[{"key":"easypost_delivery_adjustment","default":"0","report":"full"}]]></setting>
<setting key="easypost_phone"><![CDATA[{"key":"easypost_phone","default":"","report":"bool"}]]></setting>
<setting key="easypost_price_adjustment"><![CDATA[{"key":"easypost_price_adjustment","default":"","report":"bool"}]]></setting>
<setting key="easypost_show_rates"><![CDATA[{"key":"easypost_show_rates","default":"0","report":"full"}]]></setting>
<setting key="easypost_tax"><![CDATA[{"key":"easypost_tax","default":"0","report":"bool"}]]></setting>
<setting key="gateways_counts"><![CDATA[{"key":"gateways_counts","default":"{}","report":"none"}]]></setting>
<setting key="idm_nexus_display"><![CDATA[{"key":"idm_nexus_display","default":"purchases","report":"full"}]]></setting>
<setting key="idm_nexus_gateways"><![CDATA[{"key":"idm_nexus_gateways","default":"","report":"bool"}]]></setting>
<setting key="idm_nexus_mincost"><![CDATA[{"key":"idm_nexus_mincost","default":"{}","report":"bool"}]]></setting>
<setting key="idm_nexus_on"><![CDATA[{"key":"idm_nexus_on","default":"0","report":"full"}]]></setting>
<setting key="idm_nexus_percent"><![CDATA[{"key":"idm_nexus_percent","default":"100","report":"full"}]]></setting>
<setting key="idm_nexus_tax"><![CDATA[{"key":"idm_nexus_tax","default":"0","report":"bool"}]]></setting>
<setting key="idm_nexus_transfee"><![CDATA[{"key":"idm_nexus_transfee","default":"{}","report":"bool"}]]></setting>
<setting key="maxmind_error"><![CDATA[{"key":"maxmind_error","default":"okay","report":"full"}]]></setting>
<setting key="maxmind_gateways"><![CDATA[{"key":"maxmind_gateways","default":"*","report":"bool"}]]></setting>
<setting key="maxmind_key"><![CDATA[{"key":"maxmind_key","default":"","report":"bool"}]]></setting>
<setting key="monitoring_alert"><![CDATA[{"key":"monitoring_alert","default":"","report":"bool"}]]></setting>
<setting key="monitoring_allowed_fails"><![CDATA[{"key":"monitoring_allowed_fails","default":"1","report":"full"}]]></setting>
<setting key="monitoring_backup"><![CDATA[{"key":"monitoring_backup","default":"","report":"bool"}]]></setting>
<setting key="monitoring_from"><![CDATA[{"key":"monitoring_from","default":"","report":"bool"}]]></setting>
<setting key="monitoring_panic"><![CDATA[{"key":"monitoring_panic","default":"6","report":"full"}]]></setting>
<setting key="monitoring_script"><![CDATA[{"key":"monitoring_script","default":"","report":"bool"}]]></setting>
<setting key="network_status"><![CDATA[{"key":"network_status","default":"0","report":"full"}]]></setting>
<setting key="nexus_autoresolve_applicable"><![CDATA[{"key":"nexus_autoresolve_applicable","default":"3","report":"full"}]]></setting>
<setting key="nexus_autoresolve_days"><![CDATA[{"key":"nexus_autoresolve_days","default":"0","report":"full"}]]></setting>
<setting key="nexus_autoresolve_departments"><![CDATA[{"key":"nexus_autoresolve_departments","default":"*","report":"bool"}]]></setting>
<setting key="nexus_autoresolve_notify"><![CDATA[{"key":"nexus_autoresolve_notify","default":"24","report":"full"}]]></setting>
<setting key="nexus_autoresolve_status"><![CDATA[{"key":"nexus_autoresolve_status","default":"4","report":"full"}]]></setting>
<setting key="nexus_checkreg_captcha"><![CDATA[{"key":"nexus_checkreg_captcha","default":"0","report":"full"}]]></setting>
<setting key="nexus_checkreg_usernames"><![CDATA[{"key":"nexus_checkreg_usernames","default":"0","report":"full"}]]></setting>
<setting key="nexus_checkreg_validate"><![CDATA[{"key":"nexus_checkreg_validate","default":"0","report":"full"}]]></setting>
<setting key="nexus_com_rules"><![CDATA[{"key":"nexus_com_rules","default":"1","report":"full"}]]></setting>
<setting key="nexus_currency"><![CDATA[{"key":"nexus_currency","default":"USD","report":"none"}]]></setting>
<setting key="nexus_domain_prices"><![CDATA[{"key":"nexus_domain_prices","default":"{}","report":"bool"}]]></setting>
<setting key="nexus_domain_tax"><![CDATA[{"key":"nexus_domain_tax","default":"0","report":"bool"}]]></setting>
<setting key="nexus_donate_loggedin"><![CDATA[{"key":"nexus_donate_loggedin","default":"0","report":"full"}]]></setting>
<setting key="nexus_enom_pw"><![CDATA[{"key":"nexus_enom_pw","default":"","report":"none"}]]></setting>
<setting key="nexus_enom_un"><![CDATA[{"key":"nexus_enom_un","default":"","report":"bool"}]]></setting>
<setting key="nexus_gift_vouchers"><![CDATA[{"key":"nexus_gift_vouchers","default":"","report":"bool"}]]></setting>
<setting key="nexus_gift_vouchers_free"><![CDATA[{"key":"nexus_gift_vouchers_free","default":"0","report":"full"}]]></setting>
<setting key="nexus_hosting_allow_change_domain"><![CDATA[{"key":"nexus_hosting_allow_change_domain","default":"1","report":"full"}]]></setting>
<setting key="nexus_hosting_allow_own_domain"><![CDATA[{"key":"nexus_hosting_allow_own_domain","default":"1","report":"full"}]]></setting>
<setting key="nexus_hosting_bandwidth"><![CDATA[{"key":"nexus_hosting_bandwidth","default":"[]","report":"bool"}]]></setting>
<setting key="nexus_hosting_error_emails"><![CDATA[{"key":"nexus_hosting_error_emails","default":"","report":"bool"}]]></setting>
<setting key="nexus_hosting_nameservers"><![CDATA[{"key":"nexus_hosting_nameservers","default":"","report":"bool"}]]></setting>
<setting key="nexus_hosting_own_domain_sub"><![CDATA[{"key":"nexus_hosting_own_domain_sub","default":"","report":"bool"}]]></setting>
<setting key="nexus_hosting_own_domains"><![CDATA[{"key":"nexus_hosting_own_domains","default":"","report":"bool"}]]></setting>
<setting key="nexus_hosting_subdomains"><![CDATA[{"key":"nexus_hosting_subdomains","default":"","report":"bool"}]]></setting>
<setting key="nexus_hosting_terminate"><![CDATA[{"key":"nexus_hosting_terminate","default":"60","report":"full"}]]></setting>
<setting key="nexus_invoice_footer"><![CDATA[{"key":"nexus_invoice_footer","default":"","report":"bool"}]]></setting>
<setting key="nexus_invoice_header"><![CDATA[{"key":"nexus_invoice_header","default":"","report":"bool"}]]></setting>
<setting key="nexus_max_credit"><![CDATA[{"key":"nexus_max_credit","default":"","report":"bool"}]]></setting>
<setting key="nexus_min_topup"><![CDATA[{"key":"nexus_min_topup","default":"","report":"bool"}]]></setting>
<setting key="nexus_minimum_order"><![CDATA[{"key":"nexus_minimum_order","default":"","report":"bool"}]]></setting>
<setting key="nexus_no_commission"><![CDATA[{"key":"nexus_no_commission","default":"","report":"bool"}]]></setting>
<setting key="nexus_notify_copy_email"><![CDATA[{"key":"nexus_notify_copy_email","default":"","report":"bool"}]]></setting>
<setting key="nexus_notify_copy_types"><![CDATA[{"key":"nexus_notify_copy_types","default":"","report":"bool"}]]></setting>
<setting key="nexus_payout"><![CDATA[{"key":"nexus_payout","default":"","report":"bool"}]]></setting>
<setting key="nexus_payout_approve"><![CDATA[{"key":"nexus_payout_approve","default":"1","report":"full"}]]></setting>
<setting key="nexus_payout_max"><![CDATA[{"key":"nexus_payout_max","default":"","report":"bool"}]]></setting>
<setting key="nexus_payout_max_period"><![CDATA[{"key":"nexus_payout_max_period","default":"[\"1\",\"day\"]","report":"bool"}]]></setting>
<setting key="nexus_payout_min"><![CDATA[{"key":"nexus_payout_min","default":"","report":"bool"}]]></setting>
<setting key="nexus_reg_force"><![CDATA[{"key":"nexus_reg_force","default":"0","report":"full"}]]></setting>
<setting key="nexus_reg_group"><![CDATA[{"key":"nexus_reg_group","default":"0","report":"bool"}]]></setting>
<setting key="nexus_require_billing"><![CDATA[{"key":"nexus_require_billing","default":"product,giftvoucher,donation,domain,other","report":"bool"}]]></setting>
<setting key="nexus_revw_sa"><![CDATA[{"key":"nexus_revw_sa","default":"0","report":"full"}]]></setting>
<setting key="nexus_severities"><![CDATA[{"key":"nexus_severities","default":"1","report":"full"}]]></setting>
<setting key="nexus_show_renew_option_savings"><![CDATA[{"key":"nexus_show_renew_option_savings","default":"amount","report":"full"}]]></setting>
<setting key="nexus_show_stock"><![CDATA[{"key":"nexus_show_stock","default":"0","report":"full"}]]></setting>
<setting key="nexus_show_tax"><![CDATA[{"key":"nexus_show_tax","default":"0","report":"full"}]]></setting>
<setting key="nexus_sout_autoreply"><![CDATA[{"key":"nexus_sout_autoreply","default":"0","report":"full"}]]></setting>
<setting key="nexus_sout_chrome"><![CDATA[{"key":"nexus_sout_chrome","default":"0","report":"full"}]]></setting>
<setting key="nexus_sout_from"><![CDATA[{"key":"nexus_sout_from","default":"staff","report":"full"}]]></setting>
<setting key="nexus_split_payments"><![CDATA[{"key":"nexus_split_payments","default":"0","report":"full"}]]></setting>
<setting key="nexus_store_new"><![CDATA[{"key":"nexus_store_new","default":"10,30","report":"bool"}]]></setting>
<setting key="nexus_store_popular"><![CDATA[{"key":"nexus_store_popular","default":"10,365","report":"bool"}]]></setting>
<setting key="nexus_subs_downgrade"><![CDATA[{"key":"nexus_subs_downgrade","default":"0","report":"none"}]]></setting>
<setting key="nexus_subs_enabled"><![CDATA[{"key":"nexus_subs_enabled","default":"0","report":"full"}]]></setting>
<setting key="nexus_subs_exclude_groups"><![CDATA[{"key":"nexus_subs_exclude_groups","default":"4","report":"bool"}]]></setting>
<setting key="nexus_subs_invoice_grace"><![CDATA[{"key":"nexus_subs_invoice_grace","default":"3","report":"none"}]]></setting>
<setting key="nexus_subs_register"><![CDATA[{"key":"nexus_subs_register","default":"0","report":"full"}]]></setting>
<setting key="nexus_subs_show_public"><![CDATA[{"key":"nexus_subs_show_public","default":"1","report":"full"}]]></setting>
<setting key="nexus_subs_upgrade"><![CDATA[{"key":"nexus_subs_upgrade","default":"0","report":"full"}]]></setting>
<setting key="nexus_support_satisfaction"><![CDATA[{"key":"nexus_support_satisfaction","default":"1","report":"full"}]]></setting>
<setting key="nexus_tac"><![CDATA[{"key":"nexus_tac","default":"none","report":"full"}]]></setting>
<setting key="nexus_tac_link"><![CDATA[{"key":"nexus_tac_link","default":"","report":"bool"}]]></setting>
<setting key="reply_request_resolved"><![CDATA[{"key":"reply_request_resolved","default":"reopen","report":"full"}]]></setting>
<widget key="pendingActions"><![CDATA[{"class":"\\IPS\\Widget","restrict":["sidebar","cms"],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true}]]></widget>
<widget key="donations"><![CDATA[{"class":"\\IPS\\Widget\\StaticCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true}]]></widget>
<widget key="subscriptions"><![CDATA[{"class":"\\IPS\\Widget","restrict":["sidebar","cms"],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true}]]></widget>
<widget key="bestSellers"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":true,"menu_style":"menu","embeddable":true}]]></widget>
<widget key="latestProducts"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":true,"menu_style":"menu","embeddable":true}]]></widget>
<widget key="recentCommerceReviews"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":true,"menu_style":"menu","embeddable":true}]]></widget>
<widget key="featuredProduct"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":true,"menu_style":"menu","embeddable":true}]]></widget>
<acpsearch key="app=core&amp;module=applications&amp;controller=enhancements&amp;do=edit&amp;id=nexus_EasyPost&amp;searchResult=form_easypost_enable"><![CDATA[{"lang_key":"easypost_enable","restriction":"enhancements_manage","keywords":["easy post","easypost"]}]]></acpsearch>
<acpsearch key="app=core&amp;module=applications&amp;controller=enhancements&amp;do=edit&amp;id=nexus_Enom&amp;searchResult=form_nexus_enom_un"><![CDATA[{"lang_key":"nexus_enom_un","restriction":"enhancements_manage","keywords":["enom","hosting"]}]]></acpsearch>
<acpsearch key="app=core&amp;module=applications&amp;controller=enhancements&amp;do=edit&amp;id=nexus_MaxMind&amp;searchResult=form_maxmind_enable"><![CDATA[{"lang_key":"maxmind_enable","restriction":"enhancements_manage","keywords":["fraud","maxmind"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=customers&amp;controller=fields"><![CDATA[{"lang_key":"menu__nexus_customers_fields","restriction":null,"keywords":["custom customer fields","custom fields","custom nexus fields","customer fields","nexus fields"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=customers&amp;controller=search"><![CDATA[{"lang_key":"menu__nexus_customers_search","restriction":"customers_view","keywords":["clients","customers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=errors"><![CDATA[{"lang_key":"menu__nexus_hosting_errors","restriction":"errors_manage","keywords":["error log hosting","hosting errors","server api","server errors"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=monitoring"><![CDATA[{"lang_key":"menu__nexus_hosting_monitoring","restriction":null,"keywords":["expected output monitoring","monitoring","offline","online","output monitoring","server monitoring","server reporting","server reports"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=monitoring&amp;searchResult=form_monitoring_on"><![CDATA[{"lang_key":"monitoring_on","restriction":null,"keywords":["enable monitoring"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=monitoring&amp;searchResult=network_status"><![CDATA[{"lang_key":"network_status","restriction":null,"keywords":["network status","offline","online","server status"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=monitoring&amp;tab=eom"><![CDATA[{"lang_key":"expected_output_monitoring","restriction":null,"keywords":["Expected output monitoring"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=monitoring&amp;tab=settings"><![CDATA[{"lang_key":"settings","restriction":null,"keywords":["monitor","monitoring settings","monnitoring"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=queues"><![CDATA[{"lang_key":"menu__nexus_hosting_queues","restriction":"queues_manage","keywords":["queues","server","server groups","server queues","servers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=servers"><![CDATA[{"lang_key":"menu__nexus_hosting_servers","restriction":"servers_manage","keywords":["audit","cpanel","server","servers","whm"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=settings"><![CDATA[{"lang_key":"menu__nexus_hosting_settings","restriction":"settings_manage","keywords":["bandwidth","hosting settings","servers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=settings&amp;searchResult=form_domain_options"><![CDATA[{"lang_key":"domain_options","restriction":"settings_manage","keywords":["domain options","domains","enom","subdomains"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=settings&amp;searchResult=form_nexus_hosting_terminate"><![CDATA[{"lang_key":"nexus_hosting_terminate","restriction":"settings_manage","keywords":["retain expired","terminate","time to retain accounts"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=settings&amp;searchResult=nexus_hosting_nameservers"><![CDATA[{"lang_key":"nexus_hosting_nameservers","restriction":"settings_manage","keywords":["dns","name servers","nameservers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=hosting&amp;controller=settings&amp;searchResult=nexus_hosting_subdomains"><![CDATA[{"lang_key":"nexus_hosting_subdomains","restriction":"settings_manage","keywords":["subdomains"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=donations"><![CDATA[{"lang_key":"menu__nexus_payments_donations","restriction":"donations_manage","keywords":["donate","donations","goals"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=invoices"><![CDATA[{"lang_key":"menu__nexus_payments_invoices","restriction":"invoices_manage","keywords":["invoices","orders"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=invoices&amp;do=settings&amp;searchResult=form_cm_invoice_expireafter"><![CDATA[{"lang_key":"cm_invoice_expireafter","restriction":"invoices_settings","keywords":["invoices"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=invoices&amp;do=settings&amp;searchResult=form_cm_invoice_generate"><![CDATA[{"lang_key":"cm_invoice_generate","restriction":"invoices_settings","keywords":["invoices","renewal"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=invoices&amp;do=settings&amp;searchResult=form_cm_invoice_warning"><![CDATA[{"lang_key":"cm_invoice_warning","restriction":"invoices_settings","keywords":["cards","invoices","renewal"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=invoices&amp;do=settings&amp;searchResult=form_nexus_invoice_footer"><![CDATA[{"lang_key":"nexus_invoice_footer","restriction":"invoices_manage","keywords":["invoice footer"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=invoices&amp;do=settings&amp;searchResult=form_nexus_invoice_header"><![CDATA[{"lang_key":"nexus_invoice_header","restriction":"invoices_manage","keywords":["invoice header"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings"><![CDATA[{"lang_key":"checkout_settings","restriction":"checkout_settings","keywords":["checkout"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings&amp;searchResult=form_nexus_checkreg_captcha"><![CDATA[{"lang_key":"nexus_checkreg_captcha","restriction":"paymentsettings_overview","keywords":["question and answer guest checkout"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings&amp;searchResult=form_nexus_checkreg_usernames"><![CDATA[{"lang_key":"nexus_checkreg_usernames","restriction":null,"keywords":["full name","guest check out","guest checkout","guest display name","guest full name","guest purchases","guest username"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings&amp;searchResult=form_nexus_checkreg_validate"><![CDATA[{"lang_key":"nexus_checkreg_validate","restriction":"paymentsettings_overview","keywords":["Validate email on checkout"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings&amp;searchResult=form_nexus_require_billing"><![CDATA[{"lang_key":"nexus_require_billing","restriction":"paymentsettings_overview","keywords":["Name Required","require name and address on checkout"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings&amp;searchResult=form_nexus_split_payments_on"><![CDATA[{"lang_key":"nexus_split_payments_on","restriction":"checkout_settings","keywords":["cards","split","split payments"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings&amp;searchResult=form_nexus_tac"><![CDATA[{"lang_key":"nexus_tac","restriction":"checkout_settings","keywords":["checkout","terms and conditions"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=checkoutsettings&amp;searchResult=nexus_split_payments"><![CDATA[{"lang_key":"nexus_split_payments","restriction":"paymentsettings_overview","keywords":["Minimum amount split"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=currencies"><![CDATA[{"lang_key":"currencies","restriction":"currencies_manage","keywords":["currencies","currency","dollar","euro","money","pound"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=emails"><![CDATA[{"lang_key":"notification_copies","restriction":null,"keywords":["customer emails","emails","invoice emails","nexus emails","payment emails","store emails","transaction emails"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=emails&amp;searchResult=form_nexus_notify_copy_email"><![CDATA[{"lang_key":"nexus_notify_copy_email","restriction":"paymentsettings_overview","keywords":["email notification","email notifications list commerce"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=emails&amp;searchResult=form_nexus_notify_copy_types"><![CDATA[{"lang_key":"nexus_notify_copy_types","restriction":"paymentsettings_overview","keywords":["commission notification","email notifications commerce","payment notification","transaction notification"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=fraud"><![CDATA[{"lang_key":"anti_fraud_rules","restriction":"fraud_manage","keywords":["anti fraud rules","anti-fraud rules","antifraud rules","fraud","fraud rules"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=gateways"><![CDATA[{"lang_key":"payment_methods","restriction":"gateways_manage","keywords":["2checkout","auth.net","authorize.net","bank","cards","checks","cheques","credit","credit cards","debit","gateways","methods","paypal","stripe"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=review"><![CDATA[{"lang_key":"transaction_review","restriction":null,"keywords":["flag for review","hold for review","transaction flag","transaction review"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=review&amp;searchResult=form_nexus_revw_sa_on"><![CDATA[{"lang_key":"nexus_revw_sa_on","restriction":"paymentsettings_overview","keywords":["transaction review support ticket"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=paymentsettings&amp;tab=tax"><![CDATA[{"lang_key":"tax_rates","restriction":"tax_manage","keywords":["sales tax","tax","tax rate","vat"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts"><![CDATA[{"lang_key":"menu__nexus_payments_payouts","restriction":"payouts_manage","keywords":["account credit","credit","pay outs","payouts","withdrawals"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts&amp;do=settings"><![CDATA[{"lang_key":"menu__nexus_payments_payouts","restriction":"payouts_manage","keywords":["account credit","account credit settings","credit","credit settings","pay out","pay out settings","pay outs settings","payout settings","payouts","payouts settings","withdrawal settings","withdrawals","withdrawals settings"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts&amp;do=settings&amp;searchResult=form_allow_topups"><![CDATA[{"lang_key":"allow_topups","restriction":"payouts_manage","keywords":["account credit","add credit","buy credit","credit","top ups","topups"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts&amp;do=settings&amp;searchResult=form_nexus_no_commission"><![CDATA[{"lang_key":"nexus_no_commission","restriction":"payouts_settings","keywords":["comision","comission","commission","no commission"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts&amp;do=settings&amp;searchResult=form_nexus_payout"><![CDATA[{"lang_key":"nexus_payout","restriction":"payouts_settings","keywords":["bank","check","cheque","credit card","pay outs","payouts","paypal","stripe","withdrawals"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts&amp;do=settings&amp;searchResult=nexus_max_credit"><![CDATA[{"lang_key":"nexus_max_credit","restriction":"payouts_manage","keywords":["maximum account credit","maximum credit"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts&amp;do=settings&amp;searchResult=nexus_payout_approve"><![CDATA[{"lang_key":"nexus_payout_approve","restriction":"payouts_manage","keywords":["approve pay outs","approve payouts","approve withdrawals","pay out approve","payout approve","withdrawal approve"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=payouts&amp;do=settings&amp;searchResult=nexus_payout_min"><![CDATA[{"lang_key":"nexus_payout_min","restriction":"payouts_manage","keywords":["minimum pay out","minimum payout","minimum withdrawal"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=shipping"><![CDATA[{"lang_key":"menu__nexus_payments_shipping","restriction":"shiporders_manage","keywords":["handling","orders","postage","ship","shipments","shipping"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=shippingrates"><![CDATA[{"lang_key":"shipping_rates","restriction":"shipmethods_manage","keywords":["air mail","airmail","fedex","mail","orders","post","royal mail","shipments","shipping","tracking","ups","usps"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=payments&amp;controller=transactions"><![CDATA[{"lang_key":"menu__nexus_payments_transactions","restriction":"transactions_manage","keywords":["approve","payments","sales","transactions"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=reports&amp;controller=income"><![CDATA[{"lang_key":"menu__nexus_reports_income","restriction":"income_manage","keywords":["income","income stats","revenue"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=reports&amp;controller=income&amp;tab=totals"><![CDATA[{"lang_key":"nexus_report_income_totals","restriction":"income_manage","keywords":["income","total income"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=reports&amp;controller=income&amp;tab=USD"><![CDATA[{"lang_key":"USD Income by Method","restriction":"income_manage","keywords":["income method stats"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=reports&amp;controller=markets"><![CDATA[{"lang_key":"menu__nexus_reports_markets","restriction":"markets_manage","keywords":["markets","regional sales"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=reports&amp;controller=markets&amp;tab=count"><![CDATA[{"lang_key":"nexus_report_count","restriction":"markets_manage","keywords":["sales numbers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=reports&amp;controller=markets&amp;tab=USD"><![CDATA[{"lang_key":"USD Income","restriction":"markets_manage","keywords":["income reports"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=reports&amp;controller=purchases"><![CDATA[{"lang_key":"menu__nexus_reports_purchases","restriction":"purchases_manage","keywords":["order stats","sale stats","sales stats"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=coupons"><![CDATA[{"lang_key":"menu__nexus_store_coupons","restriction":"coupons_manage","keywords":["coupons","discounts","gift","promotions","vouchers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=fields"><![CDATA[{"lang_key":"menu__nexus_store_fields","restriction":"package_fields_manage","keywords":["custom package fields","custom product fields","package fields","product fields"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=packages"><![CDATA[{"lang_key":"menu__nexus_store_packages","restriction":"packages_manage","keywords":["hosting","hosting plans","items","packages","plans","products","stock","store"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_cm_protected"><![CDATA[{"lang_key":"cm_protected","restriction":"settings_manage","keywords":["protected groups"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_gift_vouchers"><![CDATA[{"lang_key":"nexus_gift_vouchers","restriction":"settings_manage","keywords":["gift cards","gift vouchers","vouchers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_gift_vouchers_free"><![CDATA[{"lang_key":"nexus_gift_vouchers_free","restriction":"settings_manage","keywords":["gift card amount"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_minimum_order"><![CDATA[{"lang_key":"nexus_minimum_order","restriction":"settings_manage","keywords":["minimum order","minimum order amount","minimum purchase"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_reg_force"><![CDATA[{"lang_key":"nexus_reg_force","restriction":"settings_manage","keywords":["force purchase","force purchase on registration","register","registration"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_show_stock"><![CDATA[{"lang_key":"nexus_show_stock","restriction":"settings_manage","keywords":["show stock","show stock levels","stock","stock levels"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_show_tax"><![CDATA[{"lang_key":"nexus_show_tax","restriction":"settings_manage","keywords":["sales tax","tax","vat"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_store_new"><![CDATA[{"lang_key":"nexus_store_new","restriction":"settings_manage","keywords":["new products","store index options"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_store_popular"><![CDATA[{"lang_key":"nexus_store_popular","restriction":"settings_manage","keywords":["best sellers","popular products"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=store&amp;controller=settings&amp;searchResult=form_nexus_tax_explain"><![CDATA[{"lang_key":"nexus_tax_explain","restriction":"settings_manage","keywords":["price description"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=subscriptions&amp;controller=subscribers"><![CDATA[{"lang_key":"menu__nexus_subscriptions_subscribers","restriction":"subscribers_manage","keywords":["subscribers"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=subscriptions&amp;controller=subscriptions"><![CDATA[{"lang_key":"menu__nexus_subscriptions_subscriptions","restriction":"subscriptions_manage","keywords":["monetize","package","subscription"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=subscriptions&amp;controller=subscriptions&amp;do=settings&amp;searchResult=nexus_subs_enabled"><![CDATA[{"lang_key":"nexus_subs_enabled","restriction":"subscriptions_manage","keywords":["member subscription","package","subscription"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=reports"><![CDATA[{"lang_key":"menu__nexus_support_reports","restriction":"reports_manage","keywords":["customer feedback","customer satisfaction","staff performance","support performance","support ratings","support replies","support reports","support reviews","support staff"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=reports&amp;tab=feedback_ratings"><![CDATA[{"lang_key":"feedback_ratings","restriction":"reports_manage","keywords":["support feedback"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=reports&amp;tab=latest_feedback"><![CDATA[{"lang_key":"latest_feedback","restriction":"reports_manage","keywords":["latest support feedback"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=reports&amp;tab=overview"><![CDATA[{"lang_key":"overview","restriction":"reports_manage","keywords":["support overview"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=reports&amp;tab=replies"><![CDATA[{"lang_key":"replies","restriction":"reports_manage","keywords":["support replies"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=requests"><![CDATA[{"lang_key":"menu__nexus_support_requests","restriction":"requests_manage","keywords":["support","support requests","support tickets","tickets"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=autoresolve"><![CDATA[{"lang_key":"autoresolve","restriction":"autoresolve_manage","keywords":["auto resolve","auto-resolve","automatic resolve","automatically resolve","autoresolve","resolve"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=customerfeedback"><![CDATA[{"lang_key":"customer_feedback","restriction":"customerfeedback_manage","keywords":["feedback","performance","ratings","satisfaction"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=departments"><![CDATA[{"lang_key":"departments","restriction":"departments_manage","keywords":["categories","departments","email"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=fields"><![CDATA[{"lang_key":"custom_support_fields","restriction":"scfields_manage","keywords":["custom support fields","custom ticket fields","support custom fields","support fields","support form","support information","ticket custom fields","ticket fields","ticket information"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=incomingemail"><![CDATA[{"lang_key":"incoming_emails","restriction":"incomingemail_manage","keywords":["email filters","email piping","incoming emails","pop3","spam filters","support emails","ticket emails"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=outgoingemail"><![CDATA[{"lang_key":"outgoing_emails","restriction":"outgoingemail_manage","keywords":["support emails","ticket emails"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=outgoingemail&amp;searchResult=form_nexus_sout_autoreply"><![CDATA[{"lang_key":"nexus_sout_autoreply","restriction":"settings_manage","keywords":["support confirmation","ticket confirmation"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=outgoingemail&amp;searchResult=form_nexus_sout_chrome"><![CDATA[{"lang_key":"nexus_sout_chrome","restriction":"settings_manage","keywords":["email format","email template"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=outgoingemail&amp;searchResult=form_nexus_sout_from"><![CDATA[{"lang_key":"nexus_sout_from","restriction":"settings_manage","keywords":["email from"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=severities"><![CDATA[{"lang_key":"severities","restriction":"severities_manage","keywords":["critical","emergency","severities","severity","urgency","urgent"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=statuses"><![CDATA[{"lang_key":"statuses","restriction":"settings_manage","keywords":["closed","open","resolved","statuses","tags"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=settings&amp;tab=stockactions"><![CDATA[{"lang_key":"stock_actions","restriction":"stockactions_manage","keywords":["defined","pre defined","pre set","predefined","preset","stock","stock actions","stock messages","stock replies"]}]]></acpsearch>
<acpsearch key="app=nexus&amp;module=support&amp;controller=volume"><![CDATA[{"lang_key":"menu__nexus_support_volume","restriction":"volume_manage","keywords":["new ticket stats","support statistics","support stats"]}]]></acpsearch>
<hook key="clientAreaLinkLoad"><![CDATA[{"type":"C","class":"\\IPS\\Data\\Store\\Database"}]]></hook>
<hook key="clientAreaLink"><![CDATA[{"type":"S","class":"\\IPS\\Theme\\class_core_front_global"}]]></hook>
<hook key="frontDispatcher"><![CDATA[{"type":"C","class":"\\IPS\\Dispatcher\\Front"}]]></hook>
<hook key="DispatcherAdmin"><![CDATA[{"type":"C","class":"\\IPS\\Dispatcher\\Admin"}]]></hook>
<hook key="register"><![CDATA[{"type":"C","class":"\\IPS\\core\\modules\\front\\system\\register"}]]></hook>
<hook key="Database"><![CDATA[{"type":"C","class":"\\IPS\\Data\\Store\\Database"}]]></hook>
<themesetting key="cm_store_view"><![CDATA[{"sc_key":"cm_store_view","sc_type":"Select","sc_multiple":0,"sc_content":"[{\"key\":\"grid\",\"value\":\"cm_store_view_grid\"},{\"key\":\"list\",\"value\":\"cm_store_view_list\"}]","sc_app":"nexus","sc_default":"grid","sc_tab_key":"custom","sc_show_in_vse":0,"sc_title":"themesetting_cm_store_view","sc_order":11,"sc_condition":null}]]></themesetting>
</build>
@@ -12,7 +12,7 @@
namespace IPS\{app}\extensions\nexus\Item;
/* 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;
File diff suppressed because it is too large. Load diff
+146
View File
@@ -0,0 +1,146 @@
{
"core": {
"AdminNotifications": {
"Advertisement": "IPS\\nexus\\extensions\\core\\AdminNotifications\\Advertisement",
"ConfigurationError": "IPS\\nexus\\extensions\\core\\AdminNotifications\\ConfigurationError",
"HostingError": "IPS\\nexus\\extensions\\core\\AdminNotifications\\HostingError",
"Shipment": "IPS\\nexus\\extensions\\core\\AdminNotifications\\Shipment",
"Support": "IPS\\nexus\\extensions\\core\\AdminNotifications\\Support",
"Transaction": "IPS\\nexus\\extensions\\core\\AdminNotifications\\Transaction",
"Withdrawal": "IPS\\nexus\\extensions\\core\\AdminNotifications\\Withdrawal"
},
"CommunityEnhancements": {
"EasyPost": "IPS\\nexus\\extensions\\core\\CommunityEnhancements\\EasyPost",
"Enom": "IPS\\nexus\\extensions\\core\\CommunityEnhancements\\Enom",
"MaxMind": "IPS\\nexus\\extensions\\core\\CommunityEnhancements\\MaxMind"
},
"ContactUs": {
"SupportRequest": "IPS\\nexus\\extensions\\core\\ContactUs\\SupportRequest"
},
"ContentRouter": {
"Reviews": "IPS\\nexus\\extensions\\core\\ContentRouter\\Reviews"
},
"Dashboard": {
"Income": "IPS\\nexus\\extensions\\core\\Dashboard\\Income",
"PendingActions": "IPS\\nexus\\extensions\\core\\Dashboard\\PendingActions"
},
"EditorLocations": {
"Admin": "IPS\\nexus\\extensions\\core\\EditorLocations\\Admin",
"Customer": "IPS\\nexus\\extensions\\core\\EditorLocations\\Customer",
"Purchases": "IPS\\nexus\\extensions\\core\\EditorLocations\\Purchases",
"Store": "IPS\\nexus\\extensions\\core\\EditorLocations\\Store",
"Support": "IPS\\nexus\\extensions\\core\\EditorLocations\\Support"
},
"FileStorage": {
"Ads": "IPS\\nexus\\extensions\\core\\FileStorage\\Ads",
"Customer": "IPS\\nexus\\extensions\\core\\FileStorage\\Customer",
"PackageGroups": "IPS\\nexus\\extensions\\core\\FileStorage\\PackageGroups",
"Products": "IPS\\nexus\\extensions\\core\\FileStorage\\Products",
"PurchaseFields": "IPS\\nexus\\extensions\\core\\FileStorage\\PurchaseFields",
"Support": "IPS\\nexus\\extensions\\core\\FileStorage\\Support"
},
"FrontNavigation": {
"Addresses": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Addresses",
"Alternatives": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Alternatives",
"BillingAgreements": "IPS\\nexus\\extensions\\core\\FrontNavigation\\BillingAgreements",
"Cards": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Cards",
"Credit": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Credit",
"Donations": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Donations",
"Gifts": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Gifts",
"Info": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Info",
"NetworkStatus": "IPS\\nexus\\extensions\\core\\FrontNavigation\\NetworkStatus",
"Orders": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Orders",
"Purchases": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Purchases",
"Store": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Store",
"Subscriptions": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Subscriptions",
"Support": "IPS\\nexus\\extensions\\core\\FrontNavigation\\Support"
},
"IncomingEmail": {
"Support": "IPS\\nexus\\extensions\\core\\IncomingEmail\\Support"
},
"IpAddresses": {
"Payouts": "IPS\\nexus\\extensions\\core\\IpAddresses\\Payouts",
"Support": "IPS\\nexus\\extensions\\core\\IpAddresses\\Support",
"Transactions": "IPS\\nexus\\extensions\\core\\IpAddresses\\Transactions"
},
"LiveSearch": {
"Nexus": "IPS\\nexus\\extensions\\core\\LiveSearch\\Nexus"
},
"MemberACPProfileBlocks": {
"AccountInformation": "IPS\\nexus\\extensions\\core\\MemberACPProfileBlocks\\AccountInformation",
"Invoices": "IPS\\nexus\\extensions\\core\\MemberACPProfileBlocks\\Invoices",
"Notes": "IPS\\nexus\\extensions\\core\\MemberACPProfileBlocks\\Notes",
"ParentAccounts": "IPS\\nexus\\extensions\\core\\MemberACPProfileBlocks\\ParentAccounts",
"Purchases": "IPS\\nexus\\extensions\\core\\MemberACPProfileBlocks\\Purchases",
"Statistics": "IPS\\nexus\\extensions\\core\\MemberACPProfileBlocks\\Statistics",
"Support": "IPS\\nexus\\extensions\\core\\MemberACPProfileBlocks\\Support"
},
"MemberACPProfileTabs": {
"Main": "IPS\\nexus\\extensions\\core\\MemberACPProfileTabs\\Main"
},
"MemberExportPersonalInformation": {
"Customer": "IPS\\nexus\\extensions\\core\\MemberExportPersonalInformation\\Customer"
},
"MemberFilter": {
"Purchases": "IPS\\nexus\\extensions\\core\\MemberFilter\\Purchases",
"Subscriptions": "IPS\\nexus\\extensions\\core\\MemberFilter\\Subscriptions",
"TotalSpend": "IPS\\nexus\\extensions\\core\\MemberFilter\\TotalSpend"
},
"MemberHistory": {
"Nexus": "IPS\\nexus\\extensions\\core\\MemberHistory\\Nexus"
},
"MemberSync": {
"Nexus": "IPS\\nexus\\extensions\\core\\MemberSync\\Nexus"
},
"MFAArea": {
"AccountCredit": "IPS\\nexus\\extensions\\core\\MFAArea\\AccountCredit",
"Addresses": "IPS\\nexus\\extensions\\core\\MFAArea\\Addresses",
"Alternatives": "IPS\\nexus\\extensions\\core\\MFAArea\\Alternatives",
"BillingAgreements": "IPS\\nexus\\extensions\\core\\MFAArea\\BillingAgreements",
"BillingInfo": "IPS\\nexus\\extensions\\core\\MFAArea\\BillingInfo",
"Cards": "IPS\\nexus\\extensions\\core\\MFAArea\\Cards"
},
"OutputPlugins": {
"Length": "IPS\\nexus\\extensions\\core\\OutputPlugins\\Length",
"Money": "IPS\\nexus\\extensions\\core\\OutputPlugins\\Money",
"Weight": "IPS\\nexus\\extensions\\core\\OutputPlugins\\Weight"
},
"OverviewStatistics": {
"Products": "IPS\\nexus\\extensions\\core\\OverviewStatistics\\Products",
"Subscriptions": "IPS\\nexus\\extensions\\core\\OverviewStatistics\\Subscriptions"
},
"ProfileSteps": {
"CustomerFields": "IPS\\nexus\\extensions\\core\\ProfileSteps\\CustomerFields"
},
"Queue": {
"DeletePaymentMethod": "IPS\\nexus\\extensions\\core\\Queue\\DeletePaymentMethod",
"FixMissingAddresses": "IPS\\nexus\\extensions\\core\\Queue\\FixMissingAddresses",
"FixRefundTransactions": "IPS\\nexus\\extensions\\core\\Queue\\FixRefundTransactions",
"MassChangePurchases": "IPS\\nexus\\extensions\\core\\Queue\\MassChangePurchases",
"MoveCustomerHistory": "IPS\\nexus\\extensions\\core\\Queue\\MoveCustomerHistory",
"RecountTotalSpend": "IPS\\nexus\\extensions\\core\\Queue\\RecountTotalSpend"
},
"Uninstall": {
"DisablePOP": "IPS\\nexus\\extensions\\core\\Uninstall\\DisablePOP"
}
},
"nexus": {
"Item": {
"AccountCreditIncrease": "IPS\\nexus\\extensions\\nexus\\Item\\AccountCreditIncrease",
"Bandwidth": "IPS\\nexus\\extensions\\nexus\\Item\\Bandwidth",
"CouponDiscount": "IPS\\nexus\\extensions\\nexus\\Item\\CouponDiscount",
"CustomPackage": "IPS\\nexus\\extensions\\nexus\\Item\\CustomPackage",
"DedicatedServer": "IPS\\nexus\\extensions\\nexus\\Item\\DedicatedServer",
"Domain": "IPS\\nexus\\extensions\\nexus\\Item\\Domain",
"Donation": "IPS\\nexus\\extensions\\nexus\\Item\\Donation",
"GiftVoucher": "IPS\\nexus\\extensions\\nexus\\Item\\GiftVoucher",
"MiscellaneousCharge": "IPS\\nexus\\extensions\\nexus\\Item\\MiscellaneousCharge",
"Package": "IPS\\nexus\\extensions\\nexus\\Item\\Package",
"ShippingCharge": "IPS\\nexus\\extensions\\nexus\\Item\\ShippingCharge",
"Subscription": "IPS\\nexus\\extensions\\nexus\\Item\\Subscription",
"SubscriptionUpgrade": "IPS\\nexus\\extensions\\nexus\\Item\\SubscriptionUpgrade",
"SupportCharge": "IPS\\nexus\\extensions\\nexus\\Item\\SupportCharge",
"UpgradeCharge": "IPS\\nexus\\extensions\\nexus\\Item\\UpgradeCharge"
}
}
}
-4
View File
@@ -142,10 +142,6 @@
"friendly": "clients",
"real": "app=nexus&module=clients&controller=splash"
},
"referral": {
"friendly": "refer/{#id}",
"real": "app=nexus&module=promotion&controller=referral"
},
"nexus_network_status": {
"friendly": "network-status",
"real": "app=nexus&module=clients&controller=networkStatus"
+16 -12
View File
@@ -1,16 +1,4 @@
{
"Database": {
"type": "C",
"class": "\\IPS\\Data\\Store\\Database"
},
"register": {
"type": "C",
"class": "\\IPS\\core\\modules\\front\\system\\register"
},
"frontDispatcher": {
"type": "C",
"class": "\\IPS\\Dispatcher\\Front"
},
"clientAreaLinkLoad": {
"type": "C",
"class": "\\IPS\\Data\\Store\\Database"
@@ -18,5 +6,21 @@
"clientAreaLink": {
"type": "S",
"class": "\\IPS\\Theme\\class_core_front_global"
},
"frontDispatcher": {
"type": "C",
"class": "\\IPS\\Dispatcher\\Front"
},
"DispatcherAdmin": {
"type": "C",
"class": "\\IPS\\Dispatcher\\Admin"
},
"register": {
"type": "C",
"class": "\\IPS\\core\\modules\\front\\system\\register"
},
"Database": {
"type": "C",
"class": "\\IPS\\Data\\Store\\Database"
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+26 -13
View File
@@ -2,57 +2,70 @@
"front": {
"store": {
"default_controller": "store",
"protected": 0
"protected": 0,
"default": 1
},
"checkout": {
"default_controller": null,
"protected": 1
"protected": 1,
"default": 0
},
"support": {
"default_controller": "home",
"protected": 0
"protected": 0,
"default": 0
},
"clients": {
"default_controller": "purchases",
"protected": 0
"protected": 0,
"default": 0
},
"promotion": {
"default_controller": "",
"protected": 0
"protected": 0,
"default": 0
},
"subscriptions": {
"default_controller": "",
"protected": 0
"protected": 0,
"default": 0
}
},
"admin": {
"payments": {
"default_controller": "transactions",
"protected": 0
"protected": 0,
"default": 1
},
"customers": {
"default_controller": null,
"protected": 0
"protected": 0,
"default": 0
},
"support": {
"default_controller": "",
"protected": 0
"protected": 0,
"default": 0
},
"store": {
"default_controller": "",
"protected": 0
"protected": 0,
"default": 0
},
"hosting": {
"default_controller": "",
"protected": 0
"protected": 0,
"default": 0
},
"reports": {
"default_controller": "",
"protected": 0
"protected": 0,
"default": 0
},
"subscriptions": {
"default_controller": "subscriptions",
"protected": 0
"protected": 0,
"default": 0
}
}
}
File diff suppressed because it is too large. Load diff
+8 -8
View File
@@ -16,12 +16,12 @@
},
{
"key": "cm_invoice_generate",
"default": "10",
"default": "12",
"report": "full"
},
{
"key": "cm_invoice_warning",
"default": "3",
"default": "72",
"report": "full"
},
{
@@ -29,11 +29,6 @@
"default": "",
"report": "bool"
},
{
"key": "cm_ref_on",
"default": "0",
"report": "full"
},
{
"key": "customer_fields",
"default": "0",
@@ -94,6 +89,11 @@
"default": "",
"report": "bool"
},
{
"key": "idm_nexus_mincost",
"default": "{}",
"report": "bool"
},
{
"key": "idm_nexus_on",
"default": "0",
@@ -261,7 +261,7 @@
},
{
"key": "nexus_hosting_bandwidth",
"default": "",
"default": "[]",
"report": "bool"
},
{
+1 -1
View File
@@ -1 +1 @@
{"capture":"P0Y0M0DT1H0M0S","sendInvoiceWarnings":"P0Y0M0DT1H0M0S","generateRenewalInvoices":"P0Y0M0DT0H30M0S","expirePurchases":"P0Y0M0DT1H0M0S","expireInvoices":"P0Y0M0DT1H0M0S","supportAutoresolve":"P0Y0M0DT1H0M0S","supportAssignedReminder":"P0Y0M1DT0H0M0S","monitor":"P0Y0M0DT0H5M0S","terminateHosting":"P0Y0M1DT0H0M0S","expectedOutputMonitoring":"P0Y0M0DT0H30M0S","billingAgreements":"P0Y0M0DT0H10M0S","cartCleanup":"P0Y0M1DT0H0M0S","gatewayPending":"P0Y0M0DT0H2M0S"}
{"capture":"P0Y0M0DT1H0M0S","sendInvoiceWarnings":"P0Y0M0DT1H0M0S","generateRenewalInvoices":"P0Y0M0DT0H30M0S","expirePurchases":"P0Y0M0DT1H0M0S","expireInvoices":"P0Y0M0DT1H0M0S","supportAutoresolve":"P0Y0M0DT1H0M0S","supportAssignedReminder":"P0Y0M1DT0H0M0S","monitor":"P0Y0M0DT0H5M0S","terminateHosting":"P0Y0M1DT0H0M0S","expectedOutputMonitoring":"P0Y0M0DT0H30M0S","cartCleanup":"P0Y0M1DT0H0M0S"}
File diff suppressed because it is too large. Load diff
+1 -14
View File
@@ -3,7 +3,7 @@
"sc_key": "cm_store_view",
"sc_type": "Select",
"sc_multiple": 0,
"sc_content": "[{\"key\":\"grid\",\"value\":\"Grid\"},{\"key\":\"list\",\"value\":\"List\"}]",
"sc_content": "[{\"key\":\"grid\",\"value\":\"cm_store_view_grid\"},{\"key\":\"list\",\"value\":\"cm_store_view_list\"}]",
"sc_app": "nexus",
"sc_default": "grid",
"sc_tab_key": "custom",
@@ -11,18 +11,5 @@
"sc_title": "themesetting_cm_store_view",
"sc_order": 11,
"sc_condition": null
},
{
"sc_key": "subscription_active_color",
"sc_type": "Color",
"sc_multiple": 0,
"sc_content": "[]",
"sc_app": "nexus",
"sc_default": "#3d6594",
"sc_tab_key": "frontendcolors",
"sc_show_in_vse": 0,
"sc_title": "themesetting_subscription_active",
"sc_order": 42,
"sc_condition": null
}
]
+93 -1
View File
@@ -310,5 +310,97 @@
"103035": "4.3.6",
"103036": "4.3.6",
"103037": "4.3.6",
"103038": "4.3.6"
"103038": "4.3.6",
"103039": "4.3.6",
"104000": "4.4.0 Beta 1",
"104001": "4.4.0 Beta 2",
"104002": "4.4.0 Beta 3",
"104004": "4.4.0 Beta 4",
"104003": "4.4.0 Beta 4",
"104005": "4.4.0",
"104006": "4.4.0",
"104007": "4.4.0",
"104008": "4.4.0",
"104009": "4.4.1",
"104010": "4.4.1 Beta 2",
"104011": "4.4.1",
"104012": "4.4.1",
"104013": "4.4.1",
"104014": "4.4.1",
"104015": "4.4.2 Beta 1",
"104016": "4.4.2",
"104017": "4.4.2",
"104018": "4.4.2",
"104019": "4.4.2",
"104020": "4.4.2",
"104021": "4.4.3 Beta 1",
"104022": "4.4.3 Beta 2",
"104023": "4.4.3",
"104024": "4.4.3",
"104025": "4.4.3",
"104026": "4.4.4 Beta 1",
"104027": "4.4.4",
"104028": "4.4.4",
"104029": "4.4.4",
"104030": "4.4.5 Beta 1",
"104031": "4.4.5 Beta 2",
"104032": "4.4.5 Beta 2",
"104033": "4.4.5",
"104034": "4.4.5",
"104035": "4.4.5",
"104036": "4.4.5",
"104037": "4.4.5",
"104038": "4.4.6",
"104039": "4.4.6",
"104040": "4.4.6",
"104041": "4.4.7 Beta 1",
"104042": "4.4.7 Beta 2",
"104043": "4.4.7 Beta 3",
"104044": "4.4.7",
"104045": "4.4.8 Beta 1",
"104046": "4.4.8 Beta 2",
"104047": "4.4.8",
"104048": "4.4.9 Beta 1",
"104049": "4.4.9",
"104050": "4.4.9",
"104051": "4.4.9",
"104052": "4.4.9",
"104053": "4.4.9.1",
"104054": "4.4.9.1",
"104055": "4.4.9.2",
"104056": "4.4.9.2",
"104057": "4.4.10 Beta 1",
"104058": "4.4.10 Beta 2",
"104059": "4.4.10 Beta 3",
"104060": "4.4.10 Beta 4",
"104061": "4.4.10",
"104062": "4.4.10",
"104063": "4.4.10",
"104064": "4.4.10",
"104065": "4.4.10",
"104066": "4.4.10",
"104067": "4.4.10",
"104068": "4.4.10",
"104069": "4.4.10",
"105013": "4.5.0 Beta 1",
"105014": "4.5.0 Beta 1",
"105015": "4.5.0 Beta 2",
"105016": "4.5.0 Beta 3",
"105017": "4.5.0 Beta 4",
"105018": "4.5.0 Beta 4",
"105019": "4.5.0 Beta 4",
"105020": "4.5.0 Beta 4",
"105021": "4.5.0 Beta 5",
"105022": "4.5.0 Beta 6",
"105023": "4.5.0 Beta 6",
"105024": "4.5.0 Beta 7",
"105025": "4.5.0 Beta 8",
"105026": "4.5.0 Beta 8",
"105027": "4.5.0 Beta 8",
"105028": "4.5.0 Beta 9",
"105029": "4.5.0 Beta 10",
"105030": "4.5.0 Beta 11",
"105031": "4.5.0 Beta 11",
"105032": "4.5.0 Beta 12",
"105100": "4.5.0"
}
+44
View File
@@ -31,5 +31,49 @@
"allow_reuse": false,
"menu_style": "menu",
"embeddable": true
},
"bestSellers": {
"class": "\\IPS\\Widget\\PermissionCache",
"restrict": [
"sidebar",
"cms"
],
"default_area": "",
"allow_reuse": true,
"menu_style": "menu",
"embeddable": true
},
"latestProducts": {
"class": "\\IPS\\Widget\\PermissionCache",
"restrict": [
"sidebar",
"cms"
],
"default_area": "",
"allow_reuse": true,
"menu_style": "menu",
"embeddable": true
},
"recentCommerceReviews": {
"class": "\\IPS\\Widget\\PermissionCache",
"restrict": [
"sidebar",
"cms"
],
"default_area": "",
"allow_reuse": true,
"menu_style": "menu",
"embeddable": true
},
"featuredProduct": {
"class": "\\IPS\\Widget\\PermissionCache",
"restrict": [
"sidebar",
"cms"
],
"default_area": "",
"allow_reuse": true,
"menu_style": "menu",
"embeddable": true
}
}
@@ -0,0 +1,194 @@
<?php
/**
* @brief ACP Notification: Advertisements Requiring Approval
* @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
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ACP Notification: Advertisements Requiring Approval
*/
class _Advertisement extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 4;
/**
* Title for settings
*
* @return string
*/
public static function settingsTitle()
{
return 'acp_notification_Advertisement';
}
/**
* 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(*)', 'core_advertisements', array( 'ad_active=-1' ) )->first();
}
return $this->count;
}
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
{
return $member->hasAcpRestriction( 'core', 'promotion', 'advertisements_manage' ) and \IPS\Db::i()->select( 'COUNT(*)', 'nexus_packages_ads' )->first();
}
/**
* Notification Title (full HTML, must be escaped where necessary)
*
* @return string
*/
public function title()
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusAdvertisements', FALSE, array( 'pluralize' => array( $this->count() ) ) );
}
/**
* Notification Subtitle (no HTML)
*
* @return string
*/
public function subtitle()
{
try
{
return \IPS\DateTime::ts( \IPS\Db::i()->select( 'ad_start', 'core_advertisements', array( 'ad_active=-1' ), 'ad_start asc', 1 )->first() )->relative();
}
catch ( \UnderflowException $e )
{
return NULL;
}
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
*/
public function body()
{
$table = \IPS\core\modules\admin\promotion\advertisements::table( \IPS\Http\Url::internal('app=core&module=overview&controller=notifications&_table=nexus_Advertisement') );
$table->limit = 10;
$table->filters = array();
$table->quickSearch = NULL;
$table->advancedSearch = NULL;
$table->where[] = array( 'ad_active=-1' );
return (string) $table;
}
/**
* Severity
*
* @return string
*/
public function severity()
{
return static::SEVERITY_OPTIONAL;
}
/**
* Dismissible?
*
* @return string
*/
public function dismissible()
{
return static::DISMISSIBLE_NO;
}
/**
* Style
*
* @return bool
*/
public function style()
{
return static::STYLE_INFORMATION;
}
/**
* Quick link from popup menu
*
* @return bool
*/
public function link()
{
return \IPS\Http\Url::internal('app=core&module=promotion&controller=advertisements&filter=ad_filters_pending');
}
/**
* 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();
}
}
@@ -0,0 +1,210 @@
<?php
/**
* @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/
* @subpackage Commerce
* @since 29 Oct 2019
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ACP Notification Extension
*/
class _ConfigurationError extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 5;
/**
* Title for settings
*
* @return string
*/
public static function settingsTitle()
{
return 'acp_notification_ConfigurationError';
}
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
{
return $member->hasAcpRestriction( 'nexus', 'payments', 'gateways_manage' );
}
/**
* 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;
}
/**
* Notification Title (full HTML, must be escaped where necessary)
*
* @return string
*/
public function title()
{
if( mb_substr( $this->extra, 0, 2 ) === 'pm' )
{
return \IPS\Member::loggedIn()->language()->addToStack('acp_notification_nexus_config_error_paymethod');
}
else
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusBACancelErrors', FALSE, array( 'pluralize' => array( \count( json_decode( $this->extra, TRUE ) ) ) ) );
}
}
/**
* Notification Subtitle (no HTML)
*
* @return string
*/
public function subtitle()
{
if( mb_substr( $this->extra, 0, 2 ) === 'pm' )
{
try
{
$method = \IPS\nexus\Gateway::load( \substr( $this->extra, 2 ) );
return \IPS\Member::loggedIn()->language()->addToStack( 'acp_notification_nexus_config_error_paymethod_desc', FALSE, array( 'sprintf' => array( $method->_title ) ) );
}
catch ( \OutOfRangeException $e ) { }
}
else
{
return '';
}
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
*/
public function body()
{
if( mb_substr( $this->extra, 0, 2 ) === 'pm' )
{
try
{
$method = \IPS\nexus\Gateway::load( \substr( $this->extra, 2 ) );
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus', 'admin' )->paymentMethodError( $method );
}
catch ( \OutOfRangeException $e )
{
return '';
}
}
else
{
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus', 'admin' )->baCancellationError( json_decode( $this->extra, TRUE ) );
}
}
/**
* Severity
*
* @return string
*/
public function severity()
{
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' ) ? static::SEVERITY_CRITICAL : static::SEVERITY_OPTIONAL;
}
/**
* Dismissible?
*
* @return string
*/
public function dismissible()
{
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' ) ? static::DISMISSIBLE_NO : static::DISMISSIBLE_PERMANENT;
}
/**
* Should this notification dismiss itself?
*
* @note This is checked every time the notification shows. Should be lightweight.
* @return bool
*/
public function selfDismiss()
{
if( mb_substr( $this->extra, 0, 2 ) === 'pm' )
{
try
{
\IPS\nexus\Gateway::load( \substr( $this->extra, 2 ) );
return FALSE;
}
catch( \OutOfRangeException $e )
{
return TRUE;
}
}
else
{
return parent::selfDismiss();
}
}
/**
* Style
*
* @return bool
*/
public function style()
{
return ( mb_substr( $this->extra, 0, 2 ) === 'pm' ) ? static::STYLE_ERROR : static::STYLE_WARNING;
}
/**
* Quick link from popup menu
*
* @return \IPS\Http\Url
*/
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();
}
}
@@ -0,0 +1,190 @@
<?php
/**
* @brief ACP Notification: Hosting Errors
* @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
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ACP Notification: Pending Shipping Orders
*/
class _HostingError extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 5;
/**
* Title for settings
*
* @return string
*/
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;
}
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
{
return $member->hasAcpRestriction( 'nexus', 'hosting', 'errors_manage' ) and \IPS\Db::i()->select( 'COUNT(*)', 'nexus_hosting_servers' )->first();
}
/**
* 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() ) ) );
}
/**
* Notification Subtitle (no HTML)
*
* @return string
*/
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;
}
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
*/
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;
}
/**
* Severity
*
* @return string
*/
public function severity()
{
return static::SEVERITY_OPTIONAL;
}
/**
* Dismissible?
*
* @return string
*/
public function dismissible()
{
return static::DISMISSIBLE_NO;
}
/**
* Style
*
* @return bool
*/
public function style()
{
return static::STYLE_ERROR;
}
/**
* Quick link from popup menu
*
* @return bool
*/
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();
}
}
@@ -0,0 +1,194 @@
<?php
/**
* @brief ACP Notification: Pending Shipping Orders
* @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 26 Jul 2018
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ACP Notification: Pending Shipping Orders
*/
class _Shipment extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 3;
/**
* Title for settings
*
* @return string
*/
public static function settingsTitle()
{
return 'acp_notification_Shipments';
}
/**
* 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_ship_orders', array( 'o_status=?', 'pend' ) )->first();
}
return $this->count;
}
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
{
return $member->hasAcpRestriction( 'nexus', 'payments', 'shiporders_manage' ) and \IPS\Db::i()->select( 'COUNT(*)', 'nexus_shipping' )->first();
}
/**
* Notification Title (full HTML, must be escaped where necessary)
*
* @return string
*/
public function title()
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusShipments', FALSE, array( 'pluralize' => array( $this->count() ) ) );
}
/**
* Notification Subtitle (no HTML)
*
* @return string
*/
public function subtitle()
{
try
{
return \IPS\DateTime::ts( \IPS\Db::i()->select( 'o_date', 'nexus_ship_orders', array( 'o_status=?', 'pend' ), 'o_date asc', 1 )->first() )->relative();
}
catch ( \UnderflowException $e )
{
return NULL;
}
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
*/
public function body()
{
$table = \IPS\nexus\Shipping\Order::table( \IPS\Http\Url::internal('app=core&module=overview&controller=notifications&_table=nexus_Shipment') );
$table->limit = 10;
$table->filters = array();
$table->quickSearch = NULL;
$table->advancedSearch = NULL;
$table->where[] = array( 'o_status=?', 'pend' );
return $table;
}
/**
* Severity
*
* @return string
*/
public function severity()
{
return static::SEVERITY_OPTIONAL;
}
/**
* Dismissible?
*
* @return string
*/
public function dismissible()
{
return static::DISMISSIBLE_NO;
}
/**
* Style
*
* @return bool
*/
public function style()
{
return static::STYLE_INFORMATION;
}
/**
* Quick link from popup menu
*
* @return bool
*/
public function link()
{
return \IPS\Http\Url::internal('app=nexus&module=payments&controller=shipping');
}
/**
* 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();
}
}
@@ -0,0 +1,268 @@
<?php
/**
* @brief ACP Notification: Open Support Requests
* @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 26 Jul 2018
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ACP Notification: Open Support Requests
*/
class _Support extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 1;
/**
* Title for settings
*
* @return string
*/
public static function settingsTitle()
{
return 'acp_notification_Support';
}
/**
* 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 (that this admin can see)
*/
protected $count = NULL;
/**
* Get count
*
* @param \IPS\Member $member The member
* @return bool
*/
public function count( \IPS\Member $member = NULL )
{
if ( $this->count === NULL )
{
$member = $member ?: \IPS\Member::loggedIn();
$where = array();
$openStatuses = array();
foreach ( \IPS\nexus\Support\Status::roots() as $status )
{
if ( $status->open )
{
$openStatuses[] = $status->_id;
}
}
$where[] = array( \IPS\Db::i()->in( 'r_status', $openStatuses ) );
$departments = array_keys( iterator_to_array( \IPS\nexus\Support\Department::departmentsWithPermission( $member ) ) );
if ( $departments )
{
$where[] = array( \IPS\Db::i()->in( 'r_department', $departments ) );
}
$this->count = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_support_requests', $where )->first();
}
return $this->count;
}
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
{
return $member->hasAcpRestriction( 'nexus', 'support', 'requests_manage' ) and \count( \IPS\nexus\Support\Department::departmentsWithPermission( $member ) );
}
/**
* Notification Title (full HTML, must be escaped where necessary)
*
* @return string
*/
public function title()
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusSupport', FALSE, array( 'pluralize' => array( $this->count() ) ) );
}
/**
* Notification Subtitle (no HTML)
*
* @return string
*/
public function subtitle()
{
try
{
$where = array();
$openStatuses = array();
foreach ( \IPS\nexus\Support\Status::roots() as $status )
{
if ( $status->open )
{
$openStatuses[] = $status->_id;
}
}
$where[] = array( \IPS\Db::i()->in( 'r_status', $openStatuses ) );
$departments = array_keys( iterator_to_array( \IPS\nexus\Support\Department::departmentsWithPermission( \IPS\Member::loggedIn() ) ) );
if ( $departments )
{
$where[] = array( \IPS\Db::i()->in( 'r_department', $departments ) );
}
return \IPS\DateTime::ts( \IPS\Db::i()->select( 'r_started', 'nexus_support_requests', $where, 'r_started asc', 1 )->first() )->relative();
}
catch ( \UnderflowException $e )
{
return NULL;
}
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
*/
public function body()
{
$sortBy = ( isset( \IPS\Request::i()->cookie['support_sort'] ) and \in_array( \IPS\Request::i()->cookie['support_sort'], array( 'r_started', 'r_last_new_reply', 'r_last_reply', 'r_last_staff_reply' ) ) ) ? \IPS\Request::i()->cookie['support_sort'] : 'r_last_new_reply';
$sortDir = ( isset( \IPS\Request::i()->cookie['support_order'] ) and \in_array( \IPS\Request::i()->cookie['support_order'], array( 'ASC', 'DESC' ) ) ) ? \IPS\Request::i()->cookie['support_order'] : 'ASC';
$i = 0;
$results = array();
$allIds = array();
foreach ( \IPS\nexus\Support\Stream::myStreams( \IPS\Member::loggedIn() ) as $stream )
{
$results[ $stream->id ] = $stream->results( \IPS\Member::loggedIn(), "{$sortBy} {$sortDir}", 1, 3 );
$allIds += array_keys( iterator_to_array( $results[ $stream->id ] ) );
$i++;
if ( $i >= 3 )
{
break;
}
}
$tracked = iterator_to_array( \IPS\Db::i()->select( array( 'request_id', 'notify' ), 'nexus_support_tracker', array( array( 'member_id=?', \IPS\Member::loggedIn()->member_id ), array( \IPS\Db::i()->in( 'request_id', $allIds ) ) ) )->setKeyField( 'request_id' )->setValueField( 'notify' ) );
$participatedIn = iterator_to_array( \IPS\Db::i()->select( 'DISTINCT reply_request', 'nexus_support_replies', array( array( 'reply_member=?', \IPS\Member::loggedIn()->member_id ), array( \IPS\Db::i()->in( 'reply_request', $allIds ) ) ) ) );
$resultsHtml = array();
foreach ( $results as $streamId => $resultSet )
{
$resultsHtml[ $streamId ] = \IPS\Theme::i()->getTemplate( 'support', 'nexus' )->requestsTableResults( $resultSet, NULL, FALSE, $tracked, $participatedIn, FALSE );
}
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'support.css', 'nexus', 'admin' ) );
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus' )->support( $resultsHtml );
}
/**
* Severity
*
* @return string
*/
public function severity()
{
return static::SEVERITY_DYNAMIC;
}
/**
* Dismissible?
*
* @return string
*/
public function dismissible()
{
return static::DISMISSIBLE_NO;
}
/**
* Style
*
* @return bool
*/
public function style()
{
return static::STYLE_INFORMATION;
}
/**
* Quick link from popup menu
*
* @return bool
*/
public function link()
{
return \IPS\Http\Url::internal('app=nexus&module=support&controller=requests');
}
/**
* For dynamic notifications: should this show for this member?
*
* @note This is checked every time the notification shows. Should be lightweight.
* @param \IPS\Member $member The member
* @return bool
*/
public function dynamicShow( \IPS\Member $member )
{
return (bool) $this->count( $member );
}
/**
* Custom per-admin setting for if email shoild be sent for this notification
*
* @param string $key Setting field key
* @param mixed $value Current value
* @return \IPS\Helpers\Form\FormAbstract|NULL
*/
public static function customEmailConfigurationSetting( $key, $value )
{
return new \IPS\Helpers\Form\Custom( $key, NULL, FALSE, array( 'getHtml' => function() {
return \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->basicUrl( \IPS\Http\Url::internal('app=nexus&module=support&controller=requests&do=preferences'), TRUE, \IPS\Member::loggedIn()->language()->addToStack('acp_notifications_email_configure') );
} ) );
}
}
@@ -0,0 +1,216 @@
<?php
/**
* @brief ACP Notification: Transactions Requiring Attention
* @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 25 Jul 2018
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ACP Notification: Transactions Requiring Attention
*/
class _Transaction extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 2;
/**
* Get queue HTML
*
* @param string $status Status to show
* @return string
*/
public static function queueHtml( $status )
{
$select = \IPS\Db::i()->select( '*', 'nexus_transactions', array( 't_status=?', $status ), 't_date ASC', array( 0, 12 ) );
if ( \count( $select ) )
{
return \IPS\Theme::i()->getTemplate( 'notifications', 'nexus' )->transactions( new \IPS\Patterns\ActiveRecordIterator( $select, 'IPS\nexus\Transaction' ) );
}
else
{
return '';
}
}
/**
* Title for settings
*
* @return string
*/
public static function settingsTitle()
{
return 'acp_notification_Transaction';
}
/**
* 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_transactions', array( 't_status=?', $this->extra ) )->first();
}
return $this->count;
}
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
{
return $member->hasAcpRestriction( 'nexus', 'payments', 'transactions_manage' );
}
/**
* Notification Title (full HTML, must be escaped where necessary)
*
* @return string
*/
public function title()
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusTransaction_' . $this->extra, FALSE, array( 'pluralize' => array( $this->count() ) ) );
}
/**
* Notification Subtitle (no HTML)
*
* @return string
*/
public function subtitle()
{
try
{
return \IPS\DateTime::ts( \IPS\Db::i()->select( 't_date', 'nexus_transactions', array( 't_status=?', $this->extra ), 't_date asc', 1 )->first() )->relative();
}
catch ( \UnderflowException $e )
{
return NULL;
}
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
*/
public function body()
{
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('admin_notifications.js', 'nexus') );
return static::queueHtml( $this->extra );
}
/**
* Severity
*
* @return string
*/
public function severity()
{
return static::SEVERITY_OPTIONAL;
}
/**
* Dismissible?
*
* @return string
*/
public function dismissible()
{
return static::DISMISSIBLE_NO;
}
/**
* Style
*
* @return bool
*/
public function style()
{
if ( $this->extra === \IPS\nexus\Transaction::STATUS_DISPUTED )
{
return static::STYLE_WARNING;
}
else
{
return static::STYLE_INFORMATION;
}
}
/**
* Quick link from popup menu
*
* @return bool
*/
public function link()
{
return \IPS\Http\Url::internal('app=nexus&module=payments&controller=transactions&attn=1');
}
/**
* 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();
}
}
@@ -0,0 +1,193 @@
<?php
/**
* @brief ACP Notification: Pending Credit Withdrawals
* @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 26 Jul 2018
*/
namespace IPS\nexus\extensions\core\AdminNotifications;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ACP Notification: Pending Credit Withdrawals
*/
class _Withdrawal extends \IPS\core\AdminNotification
{
/**
* @brief Identifier for what to group this notification type with on the settings form
*/
public static $group = 'commerce';
/**
* @brief Priority 1-5 (1 being highest) for this group compared to others
*/
public static $groupPriority = 4;
/**
* @brief Priority 1-5 (1 being highest) for this notification type compared to others in the same group
*/
public static $itemPriority = 4;
/**
* Title for settings
*
* @return string
*/
public static function settingsTitle()
{
return 'acp_notification_Withdrawals';
}
/**
* 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_payouts', array( 'po_status=?', \IPS\nexus\Payout::STATUS_PENDING ) )->first();
}
return $this->count;
}
/**
* Can a member access this type of notification?
*
* @param \IPS\Member $member The member
* @return bool
*/
public static function permissionCheck( \IPS\Member $member )
{
return \IPS\Settings::i()->nexus_payout and $member->hasAcpRestriction( 'nexus', 'payments', 'payouts_manage' );
}
/**
* Notification Title (full HTML, must be escaped where necessary)
*
* @return string
*/
public function title()
{
return \IPS\Member::loggedIn()->language()->addToStack( 'acpNotification_nexusWithdrawals', FALSE, array( 'pluralize' => array( $this->count() ) ) );
}
/**
* Notification Subtitle (no HTML)
*
* @return string
*/
public function subtitle()
{
try
{
return \IPS\DateTime::ts( \IPS\Db::i()->select( 'po_date', 'nexus_payouts', array( 'po_status=?', \IPS\nexus\Payout::STATUS_PENDING ), 'po_date asc', 1 )->first() )->relative();
}
catch ( \UnderflowException $e )
{
return NULL;
}
}
/**
* Notification Body (full HTML, must be escaped where necessary)
*
* @return string
*/
public function body()
{
$table = \IPS\nexus\Payout::table( array( 'po_status=?', 'pend' ), \IPS\Http\Url::internal('app=nexus&module=payments&controller=payouts&filter=postatus_pend') );
$table->limit = 10;
$table->filters = array();
$table->quickSearch = NULL;
$table->advancedSearch = NULL;
return $table;
}
/**
* Severity
*
* @return string
*/
public function severity()
{
return static::SEVERITY_OPTIONAL;
}
/**
* Dismissible?
*
* @return string
*/
public function dismissible()
{
return static::DISMISSIBLE_NO;
}
/**
* Style
*
* @return bool
*/
public function style()
{
return static::STYLE_INFORMATION;
}
/**
* Quick link from popup menu
*
* @return bool
*/
public function link()
{
return \IPS\Http\Url::internal('app=nexus&module=payments&controller=payouts&filter=postatus_pend');
}
/**
* 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();
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\CommunityEnhancements;
/* 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;
@@ -81,14 +81,34 @@ class _EasyPost
'options' => array( 1 => 'easypost_show_rates_1', 0 => 'easypost_show_rates_0' ),
'toggles' => array( 1 => array( 'easypost_tax', 'easypost_price_adjustment', 'easypost_delivery_adjustment' ) )
), NULL, NULL, NULL, 'easypost_show_rates' ) );
$form->add( new \IPS\Helpers\Form\Node( 'easypost_tax', \IPS\Settings::i()->easypost_tax, FALSE, array( 'class' => '\IPS\nexus\Tax', 'zeroVal' => 'do_not_tax' ), NULL, NULL, NULL, 'easypost_tax' ) );
$taxClass = NULL;
if( \IPS\Settings::i()->easypost_tax )
{
try
{
$taxClass = \IPS\nexus\Tax::load( \IPS\Settings::i()->easypost_tax );
}
catch( \OutOfRangeException $e ){}
}
$form->add( new \IPS\Helpers\Form\Node( 'easypost_tax', $taxClass, FALSE, array( 'class' => '\IPS\nexus\Tax', 'zeroVal' => 'do_not_tax' ), NULL, NULL, NULL, 'easypost_tax' ) );
$form->add( new \IPS\nexus\Form\Money( 'easypost_price_adjustment', \IPS\Settings::i()->easypost_price_adjustment, FALSE, array(), NULL, NULL, NULL, 'easypost_price_adjustment' ) );
$form->add( new \IPS\Helpers\Form\Number( 'easypost_delivery_adjustment', \IPS\Settings::i()->easypost_delivery_adjustment, FALSE, array(), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('days'), 'easypost_delivery_adjustment' ) );
$form->add( new \IPS\Helpers\Form\Interval( 'easypost_delivery_adjustment', \IPS\Settings::i()->easypost_delivery_adjustment, FALSE, array( 'valueAs' => \IPS\Helpers\Form\Interval::DAYS, 'min' => NULL ), NULL, NULL, NULL, 'easypost_delivery_adjustment' ) );
if ( $values = $form->values() )
{
$values['easypost_tax'] = $values['easypost_tax'] ? $values['easypost_tax']->_id : 0;
$values['easypost_price_adjustment'] = json_encode( $values['easypost_price_adjustment'] );
$values['easypost_address'] = ( !$haveSiteAddress or $values['easypost_address_select'] ) ? json_encode( $values['easypost_address_custom'] ) : '';
if( $haveSiteAddress )
{
unset( $values['easypost_address_select'] );
}
unset( $values['easypost_address_custom'] );
try
{
if ( $values['easypost_enable'] )
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\CommunityEnhancements;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\CommunityEnhancements;
/* 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;
@@ -73,7 +73,7 @@ class _MaxMind
{
unset( $values['maxmind_enable'] );
$this->testSettings( $values['maxmind_key'] );
$values['maxmind_gateways'] = is_array( $values['maxmind_gateways'] ) ? implode( ',', array_keys( $values['maxmind_gateways'] ) ) : '*';
$values['maxmind_gateways'] = \is_array( $values['maxmind_gateways'] ) ? implode( ',', array_keys( $values['maxmind_gateways'] ) ) : '*';
$form->saveAsSettings( $values );
}
else
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\ContactUs;
/* 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;
@@ -34,7 +34,7 @@ class _SupportRequest
*/
public function process( &$form, &$formFields, &$options, &$toggles, &$disabled )
{
if ( count( \IPS\nexus\Support\Department::roots() ) )
if ( \count( \IPS\nexus\Support\Department::roots() ) )
{
$options['contact_nexus_department'] = 'contact_nexus_department';
}
@@ -45,7 +45,7 @@ class _SupportRequest
}
$toggles['contact_nexus_department'] = array( 'contact_nexus' );
if ( count( \IPS\nexus\Support\Department::roots() ) )
if ( \count( \IPS\nexus\Support\Department::roots() ) )
{
$formFields[] = new \IPS\Helpers\Form\Node( 'contact_nexus_department', \IPS\Settings::i()->contact_nexus_department , FALSE, array( 'class' => 'IPS\nexus\Support\Department' ), function( $value ){
if( !$value AND \IPS\Request::i()->contact_type == 'contact_nexus_department' )
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\ContentRouter;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\Dashboard;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\Dashboard;
/* 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;
@@ -52,7 +52,7 @@ class _PendingActions
$pendingTransactions = NULL;
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'payments', 'transactions_manage' ) )
{
$pendingTransactions = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions', array( '( t_status=? OR t_status=? OR t_status=? )', \IPS\nexus\Transaction::STATUS_HELD, \IPS\nexus\Transaction::STATUS_REVIEW, \IPS\nexus\Transaction::STATUS_DISPUTED ) )->first();
$pendingTransactions = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions', array( \IPS\Db::i()->in( 't_status', array( \IPS\nexus\Transaction::STATUS_HELD, \IPS\nexus\Transaction::STATUS_WAITING, \IPS\nexus\Transaction::STATUS_REVIEW, \IPS\nexus\Transaction::STATUS_DISPUTED ) ) ) )->first();
if ( !$pendingTransactions and !\IPS\Db::i()->select( 'COUNT(*)', 'nexus_fraud_rules' )->first() )
{
$pendingTransactions = NULL;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\EditorLocations;
/* 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;
@@ -74,14 +74,20 @@ class _Admin
case 'pkg-pg':
$customer = \IPS\nexus\Customer::load( $member->member_id );
if ( count( \IPS\nexus\extensions\nexus\Item\Package::getPurchases( $customer, $id1, FALSE ) ) )
if ( \count( \IPS\nexus\extensions\nexus\Item\Package::getPurchases( $customer, $id1, FALSE ) ) )
{
$options = array( 'type' => 'attach', 'id' => $attachment['attach_id'], 'name' => $attachment['attach_file'] );
if ( isset( $_SERVER['HTTP_REFERER'] ) )
if ( \IPS\Request::i()->referrer() )
{
try
{
$purchase = \IPS\nexus\Purchase::loadFromUrl( \IPS\Http\Url\Friendly::createFromString( $_SERVER['HTTP_REFERER'] ) );
$purchase = \IPS\nexus\Purchase::loadFromUrl( \IPS\Request::i()->referrer() );
if( !$purchase->can( 'view', $member ) )
{
throw new \LogicException;
}
$options['ps_id'] = $purchase->id;
$options['ps_name'] = $purchase->name;
}
@@ -158,23 +164,22 @@ class _Admin
}
/**
* @brief Store image proxy status ( true = enabled )
* @brief Use the cached image URL instead of the original URL
*/
protected $_imageProxyStatus = null;
protected $proxyUrl = FALSE;
/**
* Rebuild content to add or remove image proxy
*
* @param int|null $offset Offset to start from
* @param int|null $max Maximum to parse
* @param bool $status Enable/Disable Image Proxy
* @param bool $proxyUrl Use the cached image URL instead of the original URL
* @return int Number completed
* @note This method is optional and will only be called if it exists
*/
public function rebuildImageProxy( $offset, $max, $status=TRUE )
public function rebuildImageProxy( $offset, $max, $proxyUrl = FALSE )
{
$this->_imageProxyStatus = $status;
$this->proxyUrl = $proxyUrl;
return $this->performRebuild( $offset, $max, 'parseImageProxy' );
}
@@ -191,6 +196,27 @@ class _Admin
return $this->performRebuild( $offset, $max, array( 'IPS\Text\LegacyParser', 'parseStatic' ) );
}
/**
* @brief Store lazy loading status ( true = enabled )
*/
protected $_lazyLoadStatus = null;
/**
* Rebuild content to add or remove lazy loading
*
* @param int|null $offset Offset to start from
* @param int|null $max Maximum to parse
* @param bool $status Enable/Disable lazy loading
* @return int Number completed
* @note This method is optional and will only be called if it exists
*/
public function rebuildLazyLoad( $offset, $max, $status=TRUE )
{
$this->_lazyLoadStatus = $status;
return $this->performRebuild( $offset, $max, 'parseLazyLoad' );
}
/**
* Perform rebuild - abstracted as the call for rebuildContent() and rebuildAttachmentImages() is nearly identical
*
@@ -211,11 +237,15 @@ class _Admin
{
if( $callback == 'parseImageProxy' )
{
$rebuilt = \IPS\Text\Parser::parseImageProxy( $word['word_custom'], $this->_imageProxyStatus );
$rebuilt = \IPS\Text\Parser::removeImageProxy( $word['word_custom'], $this->proxyUrl );
}
elseif( $callback == 'parseLazyLoad' )
{
$rebuilt = \IPS\Text\Parser::parseLazyLoad( $word['word_custom'], $this->_lazyLoadStatus );
}
else
{
$rebuilt = call_user_func( $callback, $word['word_custom'] );
$rebuilt = $callback( $word['word_custom'] );
}
}
catch( \InvalidArgumentException $e )
@@ -243,11 +273,15 @@ class _Admin
{
if( $callback == 'parseImageProxy' )
{
$newMessage = \IPS\Text\Parser::parseImageProxy( \IPS\Settings::i()->$k, $this->_imageProxyStatus );
$newMessage = \IPS\Text\Parser::removeImageProxy( \IPS\Settings::i()->$k );
}
elseif( $callback == 'parseLazyLoad' )
{
$newMessage = \IPS\Text\Parser::parseLazyLoad( \IPS\Settings::i()->$k, $this->_lazyLoadStatus );
}
else
{
$newMessage = call_user_func( $callback, \IPS\Settings::i()->$k );
$newMessage = $callback( \IPS\Settings::i()->$k );
}
}
catch( \InvalidArgumentException $e )
@@ -281,11 +315,15 @@ class _Admin
{
if( $callback == 'parseImageProxy' )
{
$rebuild = \IPS\Text\Parser::parseImageProxy( $package['p_page'], $this->_imageProxyStatus );
$rebuilt = \IPS\Text\Parser::removeImageProxy( $package['p_page'] );
}
elseif( $callback == 'parseLazyLoad' )
{
$rebuilt = \IPS\Text\Parser::parseLazyLoad( $package['p_page'], $this->_lazyLoadStatus );
}
else
{
$rebuilt = call_user_func( $callback, $package['p_page'], NULL, FALSE, 'nexus_Admin', $package['p_id'], NULL, 'pkg-pg' );
$rebuilt = $callback( $package['p_page'], NULL, FALSE, 'nexus_Admin', $package['p_id'], NULL, 'pkg-pg' );
}
}
catch( \InvalidArgumentException $e )
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\EditorLocations;
/* 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;
@@ -118,26 +118,46 @@ class _Customer
}
/**
* @brief Store image proxy status ( true = enabled )
* @brief Use the cached image URL instead of the original URL
*/
protected $_imageProxyStatus = null;
protected $proxyUrl = FALSE;
/**
* Rebuild content to add or remove image proxy
*
* @param int|null $offset Offset to start from
* @param int|null $max Maximum to parse
* @param bool $status Enable/Disable Image Proxy
* @param bool $proxyUrl Use the cached image URL instead of the original URL
* @return int Number completed
* @note This method is optional and will only be called if it exists
*/
public function rebuildImageProxy( $offset, $max, $status=TRUE )
public function rebuildImageProxy( $offset, $max, $proxyUrl = FALSE )
{
$this->_imageProxyStatus = $status;
$this->proxyUrl = $proxyUrl;
return $this->performRebuild( $offset, $max, 'parseImageProxy' );
}
/**
* @brief Store lazy loading status ( true = enabled )
*/
protected $_lazyLoadStatus = null;
/**
* Rebuild content to add or remove lazy loading
*
* @param int|null $offset Offset to start from
* @param int|null $max Maximum to parse
* @param bool $status Enable/Disable lazy loading
* @return int Number completed
* @note This method is optional and will only be called if it exists
*/
public function rebuildLazyLoad( $offset, $max, $status=TRUE )
{
$this->_lazyLoadStatus = $status;
return $this->performRebuild( $offset, $max, 'parseLazyLoad' );
}
/**
* Perform rebuild - abstracted as the call for rebuildContent() and rebuildAttachmentImages() is nearly identical
*
@@ -158,7 +178,7 @@ class _Customer
$editorFields[] = 'field_' . $field['f_id'];
}
if( !count( $editorFields ) )
if( !\count( $editorFields ) )
{
return $did;
}
@@ -177,11 +197,15 @@ class _Customer
{
if( $callback == 'parseImageProxy' )
{
$rebuilt = \IPS\Text\Parser::parseImageProxy( $member[ $fieldId ], $this->_imageProxyStatus );
$rebuilt = \IPS\Text\Parser::removeImageProxy( $member[ $fieldId ], $this->proxyUrl );
}
elseif( $callback == 'parseLazyLoad' )
{
$rebuilt = \IPS\Text\Parser::parseLazyLoad( $member[ $fieldId ], $this->_lazyLoadStatus );
}
else
{
$rebuilt = call_user_func( $callback, $member[ $fieldId ], \IPS\Member::load( $member['member_id'] ) );
$rebuilt = $callback( $member[ $fieldId ], \IPS\Member::load( $member['member_id'] ) );
}
}
catch( \InvalidArgumentException $e )
@@ -202,7 +226,7 @@ class _Customer
}
}
if( count( $toUpdate ) )
if( \count( $toUpdate ) )
{
\IPS\Db::i()->update( 'nexus_customers', $toUpdate, array( 'member_id=?', $member['member_id'] ) );
}
@@ -226,7 +250,7 @@ class _Customer
$editorFields[] = 'field_' . $field['f_id'];
}
if( !count( $editorFields ) )
if( !\count( $editorFields ) )
{
return 0;
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\EditorLocations;
/* 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;
@@ -72,7 +72,7 @@ class _Purchases
/* If it's in an invoice, we can check that */
if ( mb_substr( $id3, 0, 7 ) == 'invoice' )
{
return \IPS\nexus\Invoice::load( intval( mb_substr( $id3, 7 ) ) )->canView( $member );
return \IPS\nexus\Invoice::load( \intval( mb_substr( $id3, 7 ) ) )->canView( $member );
}
/* If it's in an purchase, we can link to that */
@@ -110,7 +110,7 @@ class _Purchases
/* If it's in an invoice, we can link to that */
if ( mb_substr( $id3, 0, 8 ) == 'invoice-' )
{
$invoice = \IPS\nexus\Invoice::load( intval( mb_substr( $id3, 8 ) ) );
$invoice = \IPS\nexus\Invoice::load( \intval( mb_substr( $id3, 8 ) ) );
return \IPS\Dispatcher::i()->controllerLocation == 'admin' ? $invoice->acpUrl() : $invoice->url();
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\EditorLocations;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\EditorLocations;
/* 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;
@@ -34,16 +34,6 @@ class _Support
return NULL;
}
/**
* Only allow local embeds?
*
* @return bool
*/
public function embedLocalOnly()
{
return TRUE;
}
/**
* Can we use attachments in this editor?
*
@@ -102,18 +92,4 @@ class _Support
{
return \IPS\nexus\Support\Reply::load( $id2 );
}
/**
* HTMLPurifier Configuration
*
* @param \HTMLPurifier_Config $config Configuration
* @return void
*/
public function htmlPurifierConfig( \HTMLPurifier_Config $config )
{
$config->set( 'URI.Munge', \IPS\Settings::i()->base_url . 'index.php?app=core&module=system&controller=redirect&url=%s&key=%t&resource=%r' );
$config->set( 'URI.MungeResources', TRUE );
$config->set( 'URI.MungeSecretKey', \IPS\Settings::i()->site_secret_key );
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FileStorage;
/* 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;
@@ -96,7 +96,7 @@ class _Ads
{
foreach ( \IPS\Db::i()->select( '*', 'core_advertisements', array( 'ad_member<>0 or ad_member IS NULL' ) ) as $ad )
{
if ( in_array( (string) $file, json_decode( $ad['ad_images'], TRUE ) ) )
if ( \in_array( (string) $file, json_decode( $ad['ad_images'], TRUE ) ) )
{
return TRUE;
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FileStorage;
/* 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;
@@ -35,7 +35,7 @@ class _Customer
{
$where[] = "field_{$field->id}<>''";
}
if ( !count( $where ) )
if ( !\count( $where ) )
{
return 0;
}
@@ -61,7 +61,7 @@ class _Customer
$ids[] = $field->id;
$where[] = "field_{$field->id}<>''";
}
if ( !count( $where ) )
if ( !\count( $where ) )
{
throw new \Underflowexception;
}
@@ -80,7 +80,7 @@ class _Customer
}
}
if ( count( $update ) )
if ( \count( $update ) )
{
foreach( $update as $k => $v )
{
@@ -90,7 +90,7 @@ class _Customer
}
}
if ( count( $update ) )
if ( \count( $update ) )
{
\IPS\Db::i()->update( 'nexus_customers', $update, array( 'member_id=?', $customer['member_id'] ) );
}
@@ -112,7 +112,7 @@ class _Customer
$ids[] = $field->id;
$where[] = "field_{$field->id}<>''";
}
if ( !count( $where ) )
if ( !\count( $where ) )
{
throw new \Underflowexception;
}
@@ -127,9 +127,9 @@ class _Customer
}
}
if ( count( $update ) )
if ( \count( $update ) )
{
if ( count( $update ) )
if ( \count( $update ) )
{
\IPS\Db::i()->update( 'nexus_customers', $update, array( 'member_id=?', $customer['member_id'] ) );
}
@@ -149,12 +149,12 @@ class _Customer
{
$_where[] = "field_{$field->id}=?";
}
if ( !count( $_where ) )
if ( !\count( $_where ) )
{
return FALSE;
}
$where = array_fill( 0, count( $_where ), (string) $file );
$where = array_fill( 0, \count( $_where ), (string) $file );
array_unshift( $where, implode( ' OR ', $_where ) );
return (bool) \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customers', $where )->first();
@@ -174,7 +174,7 @@ class _Customer
$ids[] = $field->id;
$where[] = "field_{$field->id}<>''";
}
if ( !count( $where ) )
if ( !\count( $where ) )
{
return;
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FileStorage;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FileStorage;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FileStorage;
/* 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;
@@ -45,7 +45,7 @@ class _PurchaseFields
public function move( $offset, $storageConfiguration, $oldConfiguration=NULL )
{
$customFields = \IPS\nexus\Package\CustomField::roots( NULL, NULL, array( 'cf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
$packages = array();
foreach ( $customFields as $field )
@@ -93,7 +93,7 @@ class _PurchaseFields
public function fixUrls( $offset )
{
$customFields = \IPS\nexus\Package\CustomField::roots( NULL, NULL, array( 'cf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
$packages = array();
foreach ( $customFields as $field )
@@ -137,9 +137,9 @@ class _PurchaseFields
public function isValidFile( $file )
{
$customFields = \IPS\nexus\Package\CustomField::roots( NULL, NULL, array( 'cf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
foreach ( \IPS\Db::i()->select( '*', 'nexus_purchases', array( "ps_custom_fields LIKE ?", "%" . str_replace( '\\', '\\\\', trim( json_encode( (string) $file ), '"' ) . "%" ) ) ) as $purchase )
foreach ( \IPS\Db::i()->select( '*', 'nexus_purchases', array( "ps_custom_fields LIKE ?", "%" . str_replace( '\\', '\\\\\\', trim( json_encode( (string) $file ), '"' ) . "%" ) ) ) as $purchase )
{
$fieldValues = json_decode( $purchase['ps_custom_fields'], TRUE );
foreach ( $customFields as $field )
@@ -162,7 +162,7 @@ class _PurchaseFields
public function delete()
{
$customFields = \IPS\nexus\Package\CustomField::roots( NULL, NULL, array( 'cf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
$packages = array();
foreach ( $customFields as $field )
@@ -1,115 +0,0 @@
<?php
/**
* @brief File Storage Extension: Referral Banners
* @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 18 Aug 2014
*/
namespace IPS\nexus\extensions\core\FileStorage;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* File Storage Extension: Referral Banners
*/
class _ReferralBanners
{
/**
* Count stored files
*
* @return int
*/
public function count()
{
return \IPS\Db::i()->select( 'COUNT(*)', 'nexus_referral_banners', 'rb_upload=1' )->first();
}
/**
* Move stored files
*
* @param int $offset This will be sent starting with 0, increasing to get all files stored by this extension
* @param int $storageConfiguration New storage configuration ID
* @param int|NULL $oldConfiguration Old storage configuration ID
* @throws \Underflowexception When file record doesn't exist. Indicating there are no more files to move
* @return void
*/
public function move( $offset, $storageConfiguration, $oldConfiguration=NULL )
{
$record = \IPS\Db::i()->select( '*', 'nexus_referral_banners', 'rb_upload=1', 'rb_id', array( $offset, 1 ) )->first();
try
{
$file = \IPS\File::get( $oldConfiguration ?: 'nexus_ReferralBanners', $record['rb_url'] )->move( $storageConfiguration );
if ( (string) $file != $record['rb_url'] )
{
\IPS\Db::i()->update( 'nexus_referral_banners', array( 'rb_url' => (string) $file ), array( 'rb_id=?', $record['rb_id'] ) );
}
}
catch( \Exception $e )
{
/* Any issues are logged */
}
}
/**
* Fix all URLs
*
* @param int $offset This will be sent starting with 0, increasing to get all files stored by this extension
* @return void
*/
public function fixUrls( $offset )
{
$record = \IPS\Db::i()->select( '*', 'nexus_referral_banners', 'rb_upload=1', 'rb_id', array( $offset, 1 ) )->first();
if ( $new = \IPS\File::repairUrl( $record['rb_url'] ) )
{
\IPS\Db::i()->update( 'nexus_referral_banners', array( 'rb_url' => $new ), array( 'rb_id=?', $record['rb_id'] ) );
}
}
/**
* Check if a file is valid
*
* @param string $file The file path to check
* @return bool
*/
public function isValidFile( $file )
{
try
{
\IPS\Db::i()->select( '*', 'nexus_referral_banners', array( 'rb_url=? and rb_upload=1', (string) $file ) )->first();
return TRUE;
}
catch ( \UnderflowException $e )
{
return FALSE;
}
}
/**
* Delete all stored files
*
* @return void
*/
public function delete()
{
foreach( \IPS\Db::i()->select( '*', 'nexus_referral_banners', 'rb_upload=1' ) as $banner )
{
try
{
\IPS\File::get( 'nexus_ReferralBanners', $banner['rb_url'] )->delete();
}
catch( \Exception $e ){}
}
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FileStorage;
/* 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;
@@ -45,7 +45,7 @@ class _Support
public function move( $offset, $storageConfiguration, $oldConfiguration=NULL )
{
$customFields = \IPS\nexus\Support\CustomField::roots( NULL, NULL, array( 'sf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
$where = array();
$departments = array();
@@ -99,7 +99,7 @@ class _Support
public function fixUrls( $offset )
{
$customFields = \IPS\nexus\Support\CustomField::roots( NULL, NULL, array( 'sf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
$where = array();
$departments = array();
@@ -149,9 +149,9 @@ class _Support
public function isValidFile( $file )
{
$customFields = \IPS\nexus\Support\CustomField::roots( NULL, NULL, array( 'sf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
foreach ( \IPS\Db::i()->select( '*', 'nexus_support_requests', array( "r_cfields LIKE ?", "%" . str_replace( '\\', '\\\\', trim( json_encode( (string) $file ), '"' ) . "%" ) ) ) as $request )
foreach ( \IPS\Db::i()->select( '*', 'nexus_support_requests', array( "r_cfields LIKE ?", "%" . str_replace( '\\', '\\\\\\', trim( json_encode( (string) $file ), '"' ) . "%" ) ) ) as $request )
{
$fieldValues = json_decode( $request['r_cfields'], TRUE );
foreach ( $customFields as $field )
@@ -175,7 +175,7 @@ class _Support
public function delete()
{
$customFields = \IPS\nexus\Support\CustomField::roots( NULL, NULL, array( 'sf_type=?', 'upload' ) );
if ( count( $customFields ) )
if ( \count( $customFields ) )
{
$where = array();
$departments = array();
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -43,7 +43,7 @@ class _Credit extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public static function isEnabled()
{
return ( \IPS\Settings::i()->nexus_min_topup or ( is_array( json_decode( \IPS\Settings::i()->nexus_payout, TRUE ) ) AND count( json_decode( \IPS\Settings::i()->nexus_payout, TRUE ) ) ) );
return ( \IPS\Settings::i()->nexus_min_topup or ( \is_array( json_decode( \IPS\Settings::i()->nexus_payout, TRUE ) ) AND \count( json_decode( \IPS\Settings::i()->nexus_payout, TRUE ) ) ) );
}
/**
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -1,28 +1,28 @@
<?php
/**
* @brief Front Navigation Extension: Referrals
* @brief Front Navigation Extension: Gift Cards
* @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
* @since 28 Aug 2018
*/
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
}
/**
* Front Navigation Extension: Referrals
* Front Navigation Extension: Gift Cards
*/
class _Referrals extends \IPS\core\FrontNavigation\FrontNavigationAbstract
{
class _Gifts extends \IPS\core\FrontNavigation\FrontNavigationAbstract
{
/**
* Get Type Title which will display in the AdminCP Menu Manager
*
@@ -30,7 +30,7 @@ class _Referrals extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public static function typeTitle()
{
return \IPS\Member::loggedIn()->language()->addToStack('client_referrals');
return \IPS\Member::loggedIn()->language()->addToStack('gift_vouchers');
}
/**
@@ -42,19 +42,9 @@ class _Referrals extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public static function isEnabled()
{
return \IPS\Settings::i()->cm_ref_on;
return ( ( \IPS\Settings::i()->nexus_gift_vouchers and \count( json_decode( \IPS\Settings::i()->nexus_gift_vouchers, TRUE ) ) ) or \IPS\Settings::i()->nexus_gift_vouchers_free );
}
/**
* Can the currently logged in user access the content this item links to?
*
* @return bool
*/
public function canAccessContent()
{
return ( \IPS\Member::loggedIn()->member_id AND \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'nexus', 'clients' ) ) );
}
/**
* Get Title
*
@@ -62,7 +52,7 @@ class _Referrals extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public function title()
{
return \IPS\Member::loggedIn()->language()->addToStack('client_referrals');
return \IPS\Member::loggedIn()->language()->addToStack('gift_vouchers');
}
/**
@@ -72,7 +62,7 @@ class _Referrals extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public function link()
{
return \IPS\Http\Url::internal( "app=nexus&module=clients&controller=referrals", 'front', 'clientsreferrals' );
return \IPS\Http\Url::internal( "app=nexus&module=store&controller=gifts", 'front', 'store_giftvouchers' );
}
/**
@@ -82,6 +72,6 @@ class _Referrals extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public function active()
{
return \IPS\Dispatcher::i()->application->directory === 'nexus' and \IPS\Dispatcher::i()->module and \IPS\Dispatcher::i()->module->key === 'clients' and \IPS\Dispatcher::i()->controller == 'referrals';
return \IPS\Dispatcher::i()->application->directory === 'nexus' and \IPS\Dispatcher::i()->module and \IPS\Dispatcher::i()->module->key === 'store' and \IPS\Dispatcher::i()->controller == 'gifts';
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -70,6 +70,6 @@ class _Store extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public function active()
{
return \IPS\Dispatcher::i()->application->directory === 'nexus' and \IPS\Dispatcher::i()->module and ( \IPS\Dispatcher::i()->module->key === 'store' or \IPS\Dispatcher::i()->module->key === 'subscriptions' );
return \IPS\Dispatcher::i()->application->directory === 'nexus' and \IPS\Dispatcher::i()->module and \IPS\Dispatcher::i()->module->key === 'store' and \in_array( \IPS\Dispatcher::i()->controller, array( 'cart', 'product', 'store' ) );
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\FrontNavigation;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\IncomingEmail;
/* 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;
@@ -37,7 +37,7 @@ class _Support
/* Replying? */
$request = $this->_emailIsReplyForRequest( $email );
$department = $this->_getDepartment( $email );
if ( $request )
{
/* IS this request locked? */
@@ -73,6 +73,11 @@ class _Support
$this->_processNewRequest( $email, $member, $department );
return TRUE;
}
/**
* @brief Track a property in the reply-to header for reference later
*/
protected $_lastMessageId = NULL;
/**
* Is reply?
@@ -98,6 +103,12 @@ class _Support
preg_match( '/\=5BSR(\d+?)\.(.+?)(\.(\d+))?\=5D/', $email->raw, $matches )
)
{
/* We have to store this now so we can inspect it later in _processReply() */
if( isset( $matches[4] ) AND $matches[4] )
{
$this->_lastMessageId = $matches[4];
}
try
{
$request = \IPS\nexus\Support\Request::load( $matches[1] );
@@ -109,12 +120,21 @@ class _Support
catch ( \OutOfRangeException $e ) { }
}
/* If the same email generated a new support request within the last 10 minutes, add this as a reply to that */
/* If the same email generated a new support request within the last 10 minutes and the department is the same, add this as a reply to that */
try
{
$recentRequest = \IPS\Db::i()->select( '*', 'nexus_support_requests', array( 'r_email=? AND r_started>?', $email->from, ( time() - 600 ) ) )->first();
return \IPS\nexus\Support\Request::constructFromData( $recentRequest );
$department = $this->_getDepartment( $email );
$where = array();
$where[] = array( 'r_email=?', $email->from );
$where[] = array( 'r_started>?', time() - 600 );
if ( $department )
{
$where[] = array( 'r_department=?', $department->_id );
}
$recentRequest = \IPS\Db::i()->select( '*', 'nexus_support_requests', $where )->first();
return \IPS\nexus\Support\Request::constructFromData( $recentRequest );
}
catch ( \UnderflowException $e ) { }
@@ -149,15 +169,15 @@ class _Support
$pending = FALSE;
$newMessage = NULL;
if ( $staff and isset( $matches[4] ) )
if ( $staff and $this->_lastMessageId )
{
$newMessage = $request->comments( 1, 0, 'date', 'desc' );
if ( $matches[4] != $newMessage->id )
if ( $newMessage and $this->_lastMessageId != $newMessage->id )
{
$pending = TRUE;
}
}
$request->status = \IPS\nexus\Support\Status::load( TRUE, $staff ? 'status_default_staff' : 'status_default_member' );
$request->last_reply = time();
$request->last_reply_by = (int) $member->member_id;
@@ -175,6 +195,7 @@ class _Support
$reply->raw = $email->raw;
$reply->save();
static::makeAndClaimAttachments( $email->attachments, $reply, $member );
static::storeAttachmentMappings( $email->mappedAttachments, $reply, $member );
if ( $pending )
{
@@ -233,7 +254,7 @@ class _Support
protected function _processNewRequest( \IPS\Email\Incoming\Email $email, \IPS\Member $member, \IPS\nexus\Support\Department $department, \IPS\nexus\Support\Request $previousRequest = NULL )
{
/* Make sure we're looking at the right department. */
if ( !is_null( $previousRequest ) )
if ( !\is_null( $previousRequest ) )
{
/* Use the existing requests department instead. */
$department = $previousRequest->department;
@@ -259,8 +280,8 @@ class _Support
if ( $previousRequest )
{
$request->log( 'previous_request', $previousRequest, NULL, $member );
$previousRequest->log( 'previous_request', NULL, $request, $member );
$request->log( 'previous_request', $previousRequest, NULL, ( $member->member_id ) ? $member : FALSE );
$previousRequest->log( 'previous_request', NULL, $request, ( $member->member_id ) ? $member : FALSE );
}
$request->sendNotifications();
@@ -313,7 +334,7 @@ class _Support
$reply = $this->_createReply( $email, $request, $member, $quoted, $originallyFromEmail );
/* Create a hidden note */
if ( trim( $email->message ) or count( $email->attachments ) )
if ( trim( $email->message ) or \count( $email->attachments ) )
{
$note = new \IPS\nexus\Support\Reply;
$note->request = $request->id;
@@ -325,6 +346,7 @@ class _Support
$note->save();
static::makeAndClaimAttachments( $email->attachments, $note, $member );
static::storeAttachmentMappings( $email->mappedAttachments, $note, $member );
}
/* Return */
@@ -363,13 +385,6 @@ class _Support
$notify[] = array( 'type' => 'e', 'value' => $cc );
}
}
foreach( ( $email->bcc ?: array() ) as $cc )
{
if ( $cc !== $department->email )
{
$notify[] = array( 'type' => 'e', 'value' => $cc, 'bcc' => 1 );
}
}
$request->notify = $notify;
$request->save();
@@ -377,6 +392,7 @@ class _Support
/* Create the reply */
$reply = $this->_createReply( $email, $request, $member, $email->message . $email->quote, $email->from );
static::makeAndClaimAttachments( $email->attachments, $reply, $member );
static::storeAttachmentMappings( $email->mappedAttachments, $reply, $member );
/* Send confirmation email */
if ( \IPS\Settings::i()->nexus_sout_autoreply )
@@ -498,7 +514,7 @@ class _Support
) );
}
if ( count( $replacements ) )
if ( \count( $replacements ) )
{
foreach ( $replacements as $find => $replace )
{
@@ -507,4 +523,25 @@ class _Support
$reply->save();
}
}
/**
* Store attachment mappings if a previous attachment was reused in this email
*
* @param array $attachments Attachment IDs
* @param \IPS\nexus\Support\Reply $reply The support request reply
* @param \IPS\Member $member The member it's from
* @return void
*/
public static function storeAttachmentMappings( array $attachments, \IPS\nexus\Support\Reply $reply, \IPS\Member $member )
{
foreach ( $attachments as $id )
{
\IPS\Db::i()->insert( 'core_attachments_map', array(
'attachment_id' => $id,
'location_key' => 'nexus_Support',
'id1' => $reply->request,
'id2' => $reply->id,
) );
}
}
}
@@ -1,37 +0,0 @@
<?php
/**
* @brief IP Address Lookup extension
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage
* @since 18 Sep 2014
* @version SVN_VERSION_NUMBER
* @deprecated 4.3
*/
namespace IPS\nexus\extensions\core\IpAddresses;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* IP Address Lookup extension
*/
class _CustomerHistory
{
/**
* @deprecated
*
*@return bool
*/
final public function deprecated()
{
return TRUE;
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\IpAddresses;
/* 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;
@@ -85,6 +85,6 @@ class _Payouts
*/
public function findByMember( $member )
{
return \IPS\Db::i()->select( "po_ip AS ip, COUNT(*) AS count, MIN(po_date) AS first, MAX(po_date) AS last", 'nexus_payouts', array( "po_member=?", $member->member_id ), NULL, NULL, "po_ip" )->setKeyField( 'ip' );
return \IPS\Db::i()->select( "po_ip AS ip, count(*) AS count, MIN(po_date) AS first, MAX(po_date) AS last", 'nexus_payouts', array( "po_member=?", $member->member_id ), NULL, NULL, "po_ip" )->setKeyField( 'ip' );
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\IpAddresses;
/* 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;
@@ -42,7 +42,7 @@ class _Support
*/
public function supportedInModCp()
{
return TRUE;
return FALSE;
}
/**
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\IpAddresses;
/* 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;
@@ -85,6 +85,6 @@ class _Transactions
*/
public function findByMember( $member )
{
return \IPS\Db::i()->select( "t_ip AS ip, COUNT(*) AS count, MIN(t_date) AS first, MAX(t_date) AS last", 'nexus_transactions', array( "t_member=?", $member->member_id ), NULL, NULL, "t_ip" )->setKeyField( 'ip' );
return \IPS\Db::i()->select( "t_ip AS ip, count(*) AS count, MIN(t_date) AS first, MAX(t_date) AS last", 'nexus_transactions', array( "t_member=?", $member->member_id ), NULL, NULL, "t_ip" )->setKeyField( 'ip' );
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\LiveSearch;
/* 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;
@@ -26,7 +26,7 @@ class _Nexus
/**
* Check we have access
*
* @return void
* @return bool
*/
public function hasAccess()
{
@@ -41,7 +41,7 @@ class _Nexus
/**
* Get the search results
*
* @param string Search Term
* @param string $searchTerm Search Term
* @return array Array of results
*/
public function getResults( $searchTerm )
@@ -49,7 +49,7 @@ class _Nexus
$results = array();
/* Numeric */
if ( is_numeric( $searchTerm ) )
if ( \is_numeric( $searchTerm ) )
{
/* Invoice */
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'payments', 'invoices_manage' ) )
@@ -144,7 +144,16 @@ class _Nexus
/* Customers */
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view' ) )
{
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_customers', array( "LOWER( core_members.name ) LIKE CONCAT( '%', ?, '%' ) OR LOWER( core_members.email ) LIKE CONCAT( '%', ?, '%' ) OR CONCAT( LOWER( nexus_customers.cm_first_name ), ' ', LOWER( nexus_customers.cm_last_name ) ) LIKE CONCAT( '%', ?, '%' )", mb_strtolower( $searchTerm ), mb_strtolower( $searchTerm ), mb_strtolower( $searchTerm ) ), NULL, 50 )->join( 'core_members', 'core_members.member_id=nexus_customers.member_id' ), 'IPS\nexus\Customer' ) as $customer )
if( \IPS\core\extensions\core\LiveSearch\Members::canPerformInlineSearch() )
{
$query = \IPS\Db::i()->select( '*', 'nexus_customers', array( \IPS\Db::i()->like( array( 'core_members.name', 'core_members.email', "CONCAT( LOWER( nexus_customers.cm_first_name ), ' ', LOWER( nexus_customers.cm_last_name ) )" ), $searchTerm, TRUE, TRUE, TRUE ) ), NULL, 50 )->join( 'core_members', 'core_members.member_id=nexus_customers.member_id' );
}
else
{
$query = \IPS\Db::i()->select( '*', 'nexus_customers', array( \IPS\Db::i()->like( array( 'core_members.name', 'core_members.email', 'nexus_customers.cm_first_name', 'nexus_customers.cm_last_name', "CONCAT( LOWER( nexus_customers.cm_first_name ), ' ', LOWER( nexus_customers.cm_last_name ) )" ), $searchTerm, TRUE, TRUE, FALSE ) ), NULL, 50 )->join( 'core_members', 'core_members.member_id=nexus_customers.member_id' );
}
foreach ( new \IPS\Patterns\ActiveRecordIterator( $query, 'IPS\nexus\Customer' ) as $customer )
{
$results[] = \IPS\Theme::i()->getTemplate('livesearch', 'nexus')->customer( $customer );
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MFAArea;
/* 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;
@@ -30,6 +30,6 @@ class _AccountCredit
*/
public function isEnabled()
{
return ( \IPS\Settings::i()->nexus_min_topup or count( json_decode( \IPS\Settings::i()->nexus_payout, TRUE ) ) );
return ( \IPS\Settings::i()->nexus_min_topup or \count( json_decode( \IPS\Settings::i()->nexus_payout, TRUE ) ) );
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MFAArea;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MFAArea;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MFAArea;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MFAArea;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MFAArea;
/* 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;
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileBlocks;
/* 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;
@@ -36,14 +36,14 @@ class _AccountInformation extends \IPS\core\MemberACPProfile\TabbedBlock
'count' => 0
)
);
if ( count( \IPS\nexus\Gateway::cardStorageGateways() ) )
if ( \count( \IPS\nexus\Gateway::cardStorageGateways() ) )
{
$tabs['cards'] = array(
'icon' => 'credit-card',
'count' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_cards', array( 'card_member=?', $this->member->member_id ) )->first()
);
}
if ( count( \IPS\nexus\Gateway::billingAgreementGateways() ) )
if ( \count( \IPS\nexus\Gateway::billingAgreementGateways() ) )
{
$tabs['paypal'] = array(
'icon' => 'paypal',
@@ -54,10 +54,7 @@ class _AccountInformation extends \IPS\core\MemberACPProfile\TabbedBlock
'icon' => 'user',
'count' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_alternate_contacts', array( 'main_id=?', $this->member->member_id ) )->first()
);
$tabs['referrers'] = array(
'icon' => 'retweet',
'count' => \IPS\Db::i()->select( 'COUNT(*)', 'nexus_referrals', array( 'referred_by=?', $this->member->member_id ) )->first()
);
return $tabs;
}
@@ -71,7 +68,7 @@ class _AccountInformation extends \IPS\core\MemberACPProfile\TabbedBlock
/* Sparkline */
$sparkline = NULL;
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customer', 'customers_view_statistics' ) )
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) )
{
$rows = array();
$oneYearAgo = \IPS\DateTime::create()->sub( new \DateInterval( 'P1Y' ) );
@@ -142,32 +139,17 @@ class _AccountInformation extends \IPS\core\MemberACPProfile\TabbedBlock
),
) );
}
/* Referrals */
try
{
$referredBy = \IPS\nexus\Customer::load( \IPS\Db::i()->select( 'referred_by', 'nexus_referrals', array( 'member_id=?', $this->member->member_id ) )->first() );
}
catch ( \UnderflowException $e )
{
$referredBy = NULL;
}
/* Primary Billing Address */
$primaryBillingAddress = NULL;
try
{
$primaryBillingAddress = \IPS\nexus\Customer\Address::constructFromData( \IPS\Db::i()->select( '*', 'nexus_customer_addresses', array( 'member=? AND primary_billing=1', $this->member->member_id ) )->first() )->address;
}
catch ( \UnderflowException $e ) { }
$addressCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_addresses', array( 'member=?', $this->member->member_id ) )->first();
$primaryBillingAddress = $this->member->primaryBillingAddress();
$addressCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_customer_addresses', array( '`member`=?', $this->member->member_id ) )->first();
/* Display */
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->accountInformationOverview( $this->member, $sparkline, $referredBy, $primaryBillingAddress, $addressCount );
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->accountInformationOverview( $this->member, $sparkline, $primaryBillingAddress, $addressCount );
}
/**
* Get output: CARDS
* Get output: STORED PAYMENT METHODS
*
* @param bool $edit Edit view?
* @return string
@@ -184,21 +166,25 @@ class _AccountInformation extends \IPS\core\MemberACPProfile\TabbedBlock
'id' => $card->id,
'card_type' => $cardData->type,
'card_member' => $card->member->member_id,
'card_number' => $cardData->lastFour,
'card_expire' => ( !is_null( $cardData->expMonth ) AND !is_null( $cardData->expYear ) ) ? str_pad( $cardData->expMonth , 2, '0', STR_PAD_LEFT ). '/' . $cardData->expYear : NULL
'card_number' => $cardData->lastFour ?: $cardData->number,
'card_expire' => ( !\is_null( $cardData->expMonth ) AND !\is_null( $cardData->expYear ) ) ? str_pad( $cardData->expMonth , 2, '0', STR_PAD_LEFT ). '/' . $cardData->expYear : NULL
);
}
catch ( \Exception $e ) { }
}
$cards = new \IPS\Helpers\Table\Custom( $cards, $this->member->acpUrl()->setQueryString( 'view', 'cards' ) );
$cards->rootButtons = array(
'add' => array(
'link' => \IPS\Http\Url::internal("app=nexus&module=customers&controller=view&id={$this->member->member_id}")->setQueryString( 'do', 'addCard' ),
'title' => 'add',
'icon' => 'plus',
'data' => array( 'ipsDialog' => true, 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('add_card') )
)
);
if ( \IPS\nexus\Gateway::cardStorageGateways( TRUE ) )
{
$cards->rootButtons = array(
'add' => array(
'link' => \IPS\Http\Url::internal("app=nexus&module=customers&controller=view&id={$this->member->member_id}")->setQueryString( 'do', 'addCard' ),
'title' => 'add',
'icon' => 'plus',
'data' => array( 'ipsDialog' => true, 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('add_card') )
)
);
}
$cards->rowButtons = function( $row )
{
return array(
@@ -368,76 +354,7 @@ class _AccountInformation extends \IPS\core\MemberACPProfile\TabbedBlock
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->accountInformationTablePreview( $this->member, $alternativeContacts, \IPS\Member::loggedIn()->language()->addToStack( 'num_alternate_contacts', FALSE, array( 'pluralize' => array( $altContactCount ) ) ), 'alts' );
}
}
/**
* Get output: REFERRERS
*
* @param bool $edit Edit view?
* @return string
*/
protected function _referrers( $edit = FALSE )
{
$referCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_referrals', array( 'referred_by=?', $this->member->member_id ) )->first();
$referrals = new \IPS\Helpers\Table\Db( 'nexus_referrals', $this->member->acpUrl()->setQueryString( 'view', 'referrals' ), array( 'referred_by=?', $this->member->member_id ) );
$referrals->langPrefix = 'ref_';
$referrals->include = array( 'member_id', 'amount' );
$referrals->sortBy = $referrals->sortBy ?: 'member_id';
$referrals->parsers = array(
'member_id' => function( $v )
{
try
{
return \IPS\Theme::i()->getTemplate( 'global', 'nexus' )->userLink( \IPS\nexus\Customer::load( $v ) );
}
catch ( \OutOfRangeException $e )
{
return \IPS\Member::loggedIn()->language()->addToStack('deleted_member');
}
},
'email' => function( $v, $row )
{
try
{
return htmlspecialchars( \IPS\nexus\Customer::load( $row['member_id'] )->email, ENT_DISALLOWED, 'UTF-8', FALSE );
}
catch ( \OutOfRangeException $e )
{
return \IPS\Member::loggedIn()->language()->addToStack('deleted_member');
}
},
'amount' => function( $v )
{
$return = array();
if ( $v )
{
foreach ( json_decode( $v, TRUE ) as $currency => $amount )
{
$return[] = new \IPS\nexus\Money( $amount, $currency );
}
}
else
{
$return[] = new \IPS\nexus\Money( 0, \IPS\nexus\Customer::load( $this->member )->defaultCurrency() );
}
return implode( '<br>', $return );
}
);
if ( $edit )
{
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->customerPopup( $referrals );
}
else
{
$referrals->include[] = 'email';
$referrals->limit = 2;
$referrals->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'customers', 'nexus' ), 'referralsOverview' );
$referrals->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'customers', 'nexus' ), 'referralsOverviewRows' );
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->accountInformationTablePreview( $this->member, $referrals, \IPS\Member::loggedIn()->language()->addToStack( 'num_refer_count', FALSE, array( 'pluralize' => array( $referCount ) ) ), 'referrers' );
}
}
/**
* Get output
*
@@ -472,7 +389,7 @@ class _AccountInformation extends \IPS\core\MemberACPProfile\TabbedBlock
public function output()
{
$tabs = $this->tabs();
if ( !count( $tabs ) )
if ( !\count( $tabs ) )
{
return '';
}
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileBlocks;
/* 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;
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileBlocks;
/* 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;
@@ -92,7 +92,7 @@ class _Notes extends \IPS\core\MemberACPProfile\Block
'link' => \IPS\Http\Url::internal("app=nexus&module=customers&controller=view&id={$this->member->member_id}")->setQueryString( array( 'do' => 'deleteNote', 'note_id' => $row['note_id'], 'support' => isset( \IPS\Request::i()->support ) ? \IPS\Request::i()->support : 0 ) ),
'title' => 'delete',
'icon' => 'times-circle',
'data' => array( 'delete' => '' )
'data' => array( 'confirm' => '' )
);
}
return $return;
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileBlocks;
/* 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;
@@ -35,7 +35,7 @@ class _ParentAccounts extends \IPS\core\MemberACPProfile\Block
$parents[] = \IPS\nexus\Customer::load( $row );
}
if ( count( $parents ) )
if ( \count( $parents ) )
{
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->parentAccounts( $parents );
}
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileBlocks;
/* 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;
@@ -20,7 +20,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
/**
* @brief ACP Member Profile: Purchases
*/
class _Purchases extends \IPS\core\MemberACPProfile\Block
class _Purchases extends \IPS\core\MemberACPProfile\TabbedBlock
{
/**
* Purchase tree
@@ -28,22 +28,33 @@ class _Purchases extends \IPS\core\MemberACPProfile\Block
protected $_purchases = NULL;
/**
* Get purchase table
* Get Tab Names
*
* @return \IPS\Helpers\Tree\Tree
* @return string
*/
protected function purchases()
public function tabs()
{
if ( $this->_purchases === NULL )
{
$this->_purchases = \IPS\nexus\Purchase::tree( $this->member->acpUrl()->setQueryString( 'blockKey', 'nexus_Purchases' ), array( array( 'ps_member=?', $this->member->member_id ) ) );
$this->_purchases->rootsPerPage = 15;
$this->_purchases->getTotalRoots = function()
{
return NULL;
};
}
return $this->_purchases;
$tabs = array();
$activeCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', array( 'ps_member=? AND ps_show=1 AND ps_active=1 AND ps_parent = 0', $this->member->member_id ) )->first();
$tabs['active'] = array(
'icon' => 'credit-card',
'count' => $activeCount,
);
$expiredCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', array( 'ps_member=? AND ps_active = 0 AND ps_cancelled = 0 AND ps_parent = 0 AND ps_expire <?', $this->member->member_id, \IPS\DateTime::create()->getTimestamp() ) )->first();
$tabs['expired'] = array(
'icon' => 'credit-card',
'count' => $expiredCount,
);
$canceledCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', array( 'ps_member=? AND ps_cancelled=1 AND ps_parent = 0', $this->member->member_id ) )->first();
$tabs['canceled'] = array(
'icon' => 'credit-card',
'count' => $canceledCount,
);
return $tabs;
}
/**
@@ -53,19 +64,48 @@ class _Purchases extends \IPS\core\MemberACPProfile\Block
*/
public function output()
{
$purchaseCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', array( 'ps_member=? AND ps_show=1', $this->member->member_id ) )->first();
$purchaseRootCount = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_purchases', array( 'ps_member=? AND ps_show=1 AND ps_parent=0', $this->member->member_id ) )->first();
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->purchases( $this->member, $this->purchases(), $purchaseCount, $purchaseRootCount );
$tabs = $this->tabs();
if ( !\count( $tabs ) )
{
return '';
}
$tabKeys = array_keys( $tabs );
$activeTabKey = ( isset( \IPS\Request::i()->block['nexus_Purchase'] ) and array_key_exists( \IPS\Request::i()->block['nexus_Purchases'], $tabs ) ) ? \IPS\Request::i()->block['nexus_Purchases'] : array_shift( $tabKeys );
return \IPS\Theme::i()->getTemplate( 'customers', 'nexus' )->purchases( $this->member, $tabs, $activeTabKey, $this->tabOutput( $activeTabKey ) );
}
/**
* Get output
*
* @return string
*/
public function tabOutput()
public function tabOutput( $activeTabKey )
{
return (string) $this->purchases();
if ( $this->_purchases === NULL )
{
$where = array();
$where[] = array( 'ps_member=?', $this->member->member_id );
switch ( $activeTabKey )
{
case 'active':
$where[] = array( 'ps_active=1' );
break;
case 'canceled':
$where[] = array( 'ps_cancelled=1' );
break;
case 'expired':
$where[] = array( 'ps_active = 0 and ps_cancelled = 0 and ps_expire <?', \IPS\DateTime::create()->getTimestamp() );
break;
}
$this->_purchases = \IPS\nexus\Purchase::tree( $this->member->acpUrl()->setQueryString( 'blockKey', 'nexus_Purchases' ), $where );
$this->_purchases->getTotalRoots = function()
{
return NULL;
};
}
return $this->_purchases;
}
}
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileBlocks;
/* 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;
@@ -90,12 +90,12 @@ class _Statistics extends \IPS\core\MemberACPProfile\LazyLoadingBlock
'highval' => $comparisons['max'],
'avgval' => $comparisons['avg'],
'thisval' => $val,
'avgpct' => floatval( $comparisons['max'] ) ? round( ( ( $comparisons['avg'] - $comparisons['min'] ) / $comparisons['max'] ) * 100, 1 ) : 0,
'thispct' => floatval( $comparisons['max'] ) ? round( ( ( $val - $comparisons['min'] ) / $comparisons['max'] ) * 100, 1 ) : 0,
'avgpct' => \floatval( $comparisons['max'] ) ? round( ( ( $comparisons['avg'] - $comparisons['min'] ) / $comparisons['max'] ) * 100, 1 ) : 0,
'thispct' => \floatval( $comparisons['max'] ) ? round( ( ( $val - $comparisons['min'] ) / $comparisons['max'] ) * 100, 1 ) : 0,
'type' => 'timetopay'
);
$sum = "LEAST( ( COUNT(*) / ( ( {$time} - core_members.joined ) / 2592000 ) ), COUNT(*) )";
$sum = "LEAST( ( count(*) / ( ( {$time} - core_members.joined ) / 2592000 ) ), count(*) )";
try
{
$val = \IPS\Db::i()->select( "{$sum} as sum", 'nexus_support_requests', array( 'r_member=?', $this->member->member_id ), 'joined', NULL, 'joined' )->join( 'core_members', 'member_id=r_member' )->first();
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileBlocks;
/* 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;
Whitespace-only changes.
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberACPProfileTabs;
/* 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;
@@ -64,7 +64,7 @@ class _Main extends \IPS\core\MemberACPProfile\MainTab
{
$return = array();
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_credit' ) )
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) )
{
$return[] = 'IPS\nexus\extensions\core\MemberACPProfileBlocks\Statistics';
}
Whitespace-only changes.
@@ -11,7 +11,7 @@
namespace IPS\nexus\extensions\core\MemberExportPersonalInformation;
/* 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;
@@ -42,7 +42,7 @@ class _Customer
'last_name' => $customer->cm_last_name
);
foreach( \IPS\Db::i()->select( '*', 'nexus_customer_addresses', array( 'member=?', $member->member_id ) ) as $address )
foreach( \IPS\Db::i()->select( '*', 'nexus_customer_addresses', array( '`member`=?', $member->member_id ) ) as $address )
{
$return['addresses'][] = \IPS\GeoLocation::buildFromJson( $address['address'] )->toString( "," );
}
@@ -66,7 +66,7 @@ class _Customer
$return['credit_cards'][ $card->id ] = array(
'card_type' => $cardData->type,
'card_number' => $cardData->lastFour,
'card_expire' => ( !is_null( $cardData->expMonth ) AND !is_null( $cardData->expYear ) ) ? str_pad( $cardData->expMonth , 2, '0', STR_PAD_LEFT ). '/' . $cardData->expYear : NULL
'card_expire' => ( !\is_null( $cardData->expMonth ) AND !\is_null( $cardData->expYear ) ) ? str_pad( $cardData->expMonth , 2, '0', STR_PAD_LEFT ). '/' . $cardData->expYear : NULL
);
}
catch ( \Exception $e ) {}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MemberFilter;
/* 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;
@@ -31,7 +31,7 @@ class _Purchases
*/
public function availableIn( $area )
{
return in_array( $area, array( 'bulkmail' ) );
return \in_array( $area, array( 'bulkmail' ) );
}
/**
@@ -78,7 +78,7 @@ class _Purchases
*/
public function save( $post )
{
if ( is_array( $post['nexus_bm_filters_packages'] ) )
if ( \is_array( $post['nexus_bm_filters_packages'] ) )
{
$ids = array();
foreach ( $post['nexus_bm_filters_packages'] as $package )
@@ -88,14 +88,14 @@ class _Purchases
$return = array(
'nexus_bm_filters_packages' => implode( ',', $ids ),
'nexus_bm_filters_pkg_active' => (bool) ( in_array( "active", $post['nexus_bm_filters_type'] ) ),
'nexus_bm_filters_pkg_canceled' => (bool) ( in_array( "canceled", $post['nexus_bm_filters_type'] ) ),
'nexus_bm_filters_pkg_active' => (bool) ( \in_array( "active", $post['nexus_bm_filters_type'] ) ),
'nexus_bm_filters_pkg_canceled' => (bool) ( \in_array( "canceled", $post['nexus_bm_filters_type'] ) ),
'nexus_bm_filters_pkg_expired' => NULL
);
if( isset( $post['nexus_bm_filters_pkg_expired'][2] ) AND $post['nexus_bm_filters_pkg_expired'][2] == 'days' )
{
$return['nexus_bm_filters_pkg_expired'] = $post['nexus_bm_filters_pkg_expired'][1] ? array( 'days' => intval( $post['nexus_bm_filters_pkg_expired'][1] ) ) : FALSE;
$return['nexus_bm_filters_pkg_expired'] = $post['nexus_bm_filters_pkg_expired'][1] ? array( 'days' => \intval( $post['nexus_bm_filters_pkg_expired'][1] ) ) : FALSE;
}
else
{
@@ -114,7 +114,7 @@ class _Purchases
* Get where clause to add to the member retrieval database query
*
* @param mixed $data The array returned from the save() method
* @return array|NULL Where clause - must be a single array( "clause", ...binds )
* @return array|NULL Where clause - must be a single array( "clause" )
*/
public function getQueryWhereClause( $data )
{
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MemberFilter;
/* 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;
@@ -31,7 +31,7 @@ class _Subscriptions
*/
public function availableIn( $area )
{
return in_array( $area, array( 'bulkmail' ) );
return \in_array( $area, array( 'bulkmail' ) );
}
/**
@@ -77,7 +77,7 @@ class _Subscriptions
*/
public function save( $post )
{
if ( is_array( $post['nexus_bm_filters_subscription_pkgs'] ) )
if ( \is_array( $post['nexus_bm_filters_subscription_pkgs'] ) )
{
$ids = array();
foreach ( $post['nexus_bm_filters_subscription_pkgs'] as $package )
@@ -87,13 +87,13 @@ class _Subscriptions
$return = array(
'nexus_bm_filters_subscription_pkgs' => implode( ',', $ids ),
'nexus_bm_filters_subscription_active' => (bool) ( in_array( "active", $post['nexus_bm_filters_subscription_type'] ) ),
'nexus_bm_filters_subscription_canceled' => (bool) ( in_array( "canceled", $post['nexus_bm_filters_subscription_type'] ) ),
'nexus_bm_filters_subscription_active' => (bool) ( \in_array( "active", $post['nexus_bm_filters_subscription_type'] ) ),
'nexus_bm_filters_subscription_canceled' => (bool) ( \in_array( "canceled", $post['nexus_bm_filters_subscription_type'] ) ),
);
if( isset( $post['nexus_bm_filters_type_expired_date'][2] ) AND $post['nexus_bm_filters_type_expired_date'][2] == 'days' )
{
$return['nexus_bm_filters_type_expired_date'] = $post['nexus_bm_filters_type_expired_date'][1] ? array( 'days' => intval( $post['nexus_bm_filters_type_expired_date'][1] ) ) : FALSE;
$return['nexus_bm_filters_type_expired_date'] = $post['nexus_bm_filters_type_expired_date'][1] ? array( 'days' => \intval( $post['nexus_bm_filters_type_expired_date'][1] ) ) : FALSE;
}
else
{
@@ -112,7 +112,7 @@ class _Subscriptions
* Get where clause to add to the member retrieval database query
*
* @param mixed $data The array returned from the save() method
* @return array|NULL Where clause - must be a single array( "clause", ...binds )
* @return array|NULL Where clause - must be a single array( "clause" )
*/
public function getQueryWhereClause( $data )
{
@@ -0,0 +1,156 @@
<?php
/**
* @brief Member filter 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
* @subpackage Nexus
* @since 8 Aug 2018
*/
namespace IPS\nexus\extensions\core\MemberFilter;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Member filter extension
*/
class _TotalSpend
{
/**
* Determine if the filter is available in a given area
*
* @param string $area Area to check
* @return bool
*/
public function availableIn( $area )
{
return \in_array( $area, array( 'bulkmail' ) );
}
/**
* Get Setting Field
*
* @param mixed $criteria Value returned from the save() method
* @return array Array of form elements
*/
public function getSettingField( $criteria )
{
return array( $this->_combine( 'nexus_bm_filters_total_spend', 'IPS\nexus\Form\Money', $criteria ) );
}
/**
* Save the filter data
*
* @param array $post Form values
* @return mixed False, or an array of data to use later when filtering the members
* @throws \LogicException
*/
public function save( $post )
{
$amounts = array();
foreach( $post['nexus_bm_filters_total_spend'][1] as $amount )
{
$amounts[$amount->currency] = $amount->amount;
}
return array( 'total_spend_operator' => $post['nexus_bm_filters_total_spend'][0], 'total_spend_amounts' => json_encode( $amounts ) );
}
/**
* Get where clause to add to the member retrieval database query
*
* @param mixed $data The array returned from the save() method
* @return string|array|NULL Where clause
*/
public function getQueryWhereClause( $data )
{
if ( ( isset( $data['total_spend_operator'] ) and $data['total_spend_operator'] !== 'any' ) and isset( $data['total_spend_amounts'] ) )
{
$where = array();
foreach( json_decode( $data['total_spend_amounts'], true ) as $currency => $amount )
{
switch ( $data['total_spend_operator'] )
{
case 'gt':
$operator = ">";
break;
case 'lt':
$operator = "<";
break;
}
$where[] = "(nexus_customer_spend.spend_amount{$operator}'{$amount}' and nexus_customer_spend.spend_currency='{$currency}')";
}
return array( implode( ' OR ', $where ) );
}
return NULL;
}
/**
* Callback for member retrieval database query
* Can be used to set joins
*
* @param mixed $data The array returned from the save() method
* @param \IPS\Db\Query $query The query
* @return void
*/
public function queryCallback( $data, &$query )
{
$currencies = \IPS\nexus\Money::currencies();
$defaultCurrency = array_shift( $currencies );
if ( ( isset( $data['total_spend_operator'] ) and $data['total_spend_operator'] !== 'any' ) and isset( $data['total_spend_amounts'] ) )
{
$query->join( 'nexus_customer_spend', "core_members.member_id=nexus_customer_spend.spend_member_id AND nexus_customer_spend.spend_currency='{$defaultCurrency}'" );
}
}
/**
* Combine two fields
*
* @param string $name Field name
* @param bool $field2Class Classname for second field
* @param mixed $criteria Value returned from the save() method
* @return \IPS\Helpers\Form\Custom
*/
public function _combine( $name, $field2Class, $criteria )
{
$validate = NULL;
$options = array(
'options' => array(
'any' => 'any_value',
'gt' => 'gt',
'lt' => 'lt'
),
'toggles' => array(
'gt' => array( $name . '_unit' ),
'lt' => array( $name . '_unit' ),
)
);
$field1 = new \IPS\Helpers\Form\Select( $name . '_type', isset($criteria['total_spend_operator']) ? $criteria['total_spend_operator'] : '', FALSE, $options, NULL, NULL, NULL );
$field2 = new $field2Class( $name . '_unit', isset( $criteria['total_spend_amounts'] ) ? $criteria['total_spend_amounts'] : NULL, FALSE, array() );
return new \IPS\Helpers\Form\Custom( $name, array( "gt", NULL ), FALSE, array(
'getHtml' => function() use ( $name, $field1, $field2 )
{
return \IPS\Theme::i()->getTemplate( 'forms', 'nexus', 'global' )->combined( $name, $field1, $field2 );
},
'formatValue' => function() use ( $field1, $field2 )
{
return array( $field1->value, $field2->value );
}
) );
}
}
Whitespace-only changes.
@@ -1,35 +0,0 @@
<?php
/**
* @brief Admin CP Member Form
* @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 18 Sep 2014
*/
namespace IPS\nexus\extensions\core\MemberForm;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Admin CP Member Form
*/
class _Nexus
{
/**
* @deprecated
*
* @return bool
*/
final public function deprecated()
{
return TRUE;
}
}
@@ -12,7 +12,7 @@
namespace IPS\nexus\extensions\core\MemberHistory;
/* 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;
@@ -47,7 +47,8 @@ class _Nexus
'support',
'custom',
'billingagreement',
'note'
'note',
'subscription'
);
}
@@ -328,7 +329,14 @@ class _Nexus
return \IPS\Member::loggedIn()->language()->addToStack( 'history_purchase_transfer_to', FALSE, array( 'htmlsprintf' => array( $purchase, $from, $byStaff ) ) );
case 'cancel':
return \IPS\Member::loggedIn()->language()->addToStack( 'history_purchase_canceled', FALSE, array( 'htmlsprintf' => array( $purchase, $byStaff ) ) );
if( isset( $val['by'] ) AND $val['by'] == 'api' )
{
return \IPS\Member::loggedIn()->language()->addToStack( 'history_purchase_canceled_api', FALSE, array( 'htmlsprintf' => array( $purchase, $byStaff ) ) );
}
else
{
return \IPS\Member::loggedIn()->language()->addToStack( 'history_purchase_canceled', FALSE, array( 'htmlsprintf' => array( $purchase, $byStaff ) ) );
}
case 'uncancel':
return \IPS\Member::loggedIn()->language()->addToStack( 'history_purchase_reactivated', FALSE, array( 'htmlsprintf' => array( $purchase, $byStaff ) ) );
@@ -447,7 +455,7 @@ class _Nexus
if ( isset( $val['name'] ) )
{
$name = is_array( $val['name'] ) ? implode( ' ', array_values( $val['name'] ) ) : $val['name'];
$name = \is_array( $val['name'] ) ? implode( ' ', array_values( $val['name'] ) ) : $val['name'];
$changes[] = \IPS\Member::loggedIn()->language()->addToStack('history_name_changed_from', FALSE, array( 'sprintf' => array( $name ) ) );
}
@@ -456,7 +464,7 @@ class _Nexus
foreach ( $val['other'] as $change )
{
/* Older versions may not have stored the display value, so we need to account for that */
if( mb_strpos( $change['name'], 'nexus_ccfield_' ) !== FALSE AND is_array( $change['value'] ) )
if( mb_strpos( $change['name'], 'nexus_ccfield_' ) !== FALSE AND \is_array( $change['value'] ) )
{
try
{
@@ -479,7 +487,7 @@ class _Nexus
/* We will just loop and implode so we have a string */
foreach( $change['value'] as $k => $v )
{
if( is_array( $v ) )
if( \is_array( $v ) )
{
foreach( $v as $_k => $_v )
{
Loaded 100 of 3791 files, more files were not shown because too many files have changed in this diff. Show more