Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -194,7 +194,12 @@ class _Application extends \IPS\Application
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Cached menu counts
|
||||
*/
|
||||
protected $menuCounts = array();
|
||||
|
||||
/**
|
||||
* ACP Menu Numbers
|
||||
*
|
||||
@@ -207,24 +212,48 @@ class _Application extends \IPS\Application
|
||||
switch ( $queryString['controller'] )
|
||||
{
|
||||
case 'transactions':
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'nexus_transactions', array( 't_status=?', \IPS\nexus\Transaction::STATUS_HELD ) )->first();
|
||||
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();
|
||||
}
|
||||
return $this->menuCounts['transactions'];
|
||||
break;
|
||||
|
||||
case 'shipping':
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'nexus_ship_orders', array( 'o_status=?', \IPS\nexus\Shipping\Order::STATUS_PENDING ) )->first();
|
||||
if( !isset( $this->menuCounts['shipping'] ) )
|
||||
{
|
||||
$this->menuCounts['shipping'] = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_ship_orders', array( 'o_status=?', \IPS\nexus\Shipping\Order::STATUS_PENDING ) )->first();
|
||||
}
|
||||
|
||||
return $this->menuCounts['shipping'];
|
||||
break;
|
||||
|
||||
case 'payouts':
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'nexus_payouts', array( 'po_status=?', \IPS\nexus\Payout::STATUS_PENDING ) )->first();
|
||||
if( !isset( $this->menuCounts['payouts'] ) )
|
||||
{
|
||||
$this->menuCounts['payouts'] = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_payouts', array( 'po_status=?', \IPS\nexus\Payout::STATUS_PENDING ) )->first();
|
||||
}
|
||||
|
||||
return $this->menuCounts['payouts'];
|
||||
break;
|
||||
|
||||
case 'requests':
|
||||
$myStream = \IPS\nexus\Support\Stream::myStream();
|
||||
return $myStream->count( \IPS\Member::loggedIn() );
|
||||
if( !isset( $this->menuCounts['requests'] ) )
|
||||
{
|
||||
$myStream = \IPS\nexus\Support\Stream::myStream();
|
||||
$this->menuCounts['requests'] = $myStream->count( \IPS\Member::loggedIn() );
|
||||
}
|
||||
|
||||
return $this->menuCounts['requests'];
|
||||
break;
|
||||
|
||||
case 'errors':
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'nexus_hosting_errors' )->first();
|
||||
if( !isset( $this->menuCounts['errors'] ) )
|
||||
{
|
||||
$this->menuCounts['errors'] = \IPS\Db::i()->select( 'COUNT(*)', 'nexus_hosting_errors' )->first();
|
||||
}
|
||||
|
||||
return $this->menuCounts['errors'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -265,7 +294,10 @@ class _Application extends \IPS\Application
|
||||
*/
|
||||
public function allowGuestAccess( \IPS\Application\Module $module, $controller, $do )
|
||||
{
|
||||
return $module->key == 'store';
|
||||
if( \IPS\Settings::i()->nexus_reg_force AND ( $module->key == 'store' OR $module->key == 'checkout' ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -298,6 +330,7 @@ class _Application extends \IPS\Application
|
||||
array(
|
||||
'key' => 'Store',
|
||||
'children' => array(
|
||||
array( 'key' => 'Subscriptions' ),
|
||||
array( 'key' => 'Donations' ),
|
||||
array( 'key' => 'Orders' ),
|
||||
array( 'key' => 'Purchases' ),
|
||||
|
||||
Reference in new issue
Block a user