Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,26 +11,34 @@
|
||||
namespace IPS\nexus\extensions\core\MemberACPProfileTabs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\core\MemberACPProfile\MainTab;
|
||||
use IPS\Member;
|
||||
use IPS\nexus\Customer;
|
||||
use IPS\Output;
|
||||
use IPS\Theme;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ACP Member Profile: Customer Tab
|
||||
*/
|
||||
class _Main extends \IPS\core\MemberACPProfile\MainTab
|
||||
class Main extends MainTab
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\Member $member Member
|
||||
* @param Member $member Member
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Member $member )
|
||||
public function __construct( Member $member )
|
||||
{
|
||||
$this->member = \IPS\nexus\Customer::load( $member->member_id );
|
||||
$this->member = Customer::load( $member->member_id );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,9 +46,9 @@ class _Main extends \IPS\core\MemberACPProfile\MainTab
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canView()
|
||||
public function canView(): bool
|
||||
{
|
||||
return (bool) \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view' );
|
||||
return (bool) Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +56,7 @@ class _Main extends \IPS\core\MemberACPProfile\MainTab
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function leftColumnBlocks()
|
||||
public function leftColumnBlocks(): array
|
||||
{
|
||||
return array(
|
||||
'IPS\nexus\extensions\core\MemberACPProfileBlocks\AccountInformation',
|
||||
@@ -60,37 +68,32 @@ class _Main extends \IPS\core\MemberACPProfile\MainTab
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function mainColumnBlocks()
|
||||
public function mainColumnBlocks(): array
|
||||
{
|
||||
$return = array();
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) )
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customers_view_statistics' ) )
|
||||
{
|
||||
$return[] = 'IPS\nexus\extensions\core\MemberACPProfileBlocks\Statistics';
|
||||
}
|
||||
|
||||
$return[] = 'IPS\nexus\extensions\core\MemberACPProfileBlocks\ParentAccounts';
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customer_notes_view' ) )
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'customer_notes_view' ) )
|
||||
{
|
||||
$return[] = 'IPS\nexus\extensions\core\MemberACPProfileBlocks\Notes';
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'purchases_view' ) )
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'purchases_view' ) )
|
||||
{
|
||||
$return[] = 'IPS\nexus\extensions\core\MemberACPProfileBlocks\Purchases';
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'payments', 'invoices_manage' ) )
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'nexus', 'payments', 'invoices_manage' ) )
|
||||
{
|
||||
$return[] = 'IPS\nexus\extensions\core\MemberACPProfileBlocks\Invoices';
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'support', 'requests_manage' ) )
|
||||
{
|
||||
$return[] = 'IPS\nexus\extensions\core\MemberACPProfileBlocks\Support';
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -99,17 +102,10 @@ class _Main extends \IPS\core\MemberACPProfile\MainTab
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function output()
|
||||
public function output(): string
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'customer.css', 'nexus', 'admin' ) );
|
||||
|
||||
if ( \IPS\Theme::i()->settings['responsive'] )
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'customer_responsive.css', 'nexus', 'admin' ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'support.css', 'nexus', 'admin' ) );
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_customer.js', 'nexus', 'admin' ) );
|
||||
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, Theme::i()->css( 'customer.css', 'nexus', 'admin' ) );
|
||||
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'admin_customer.js', 'nexus', 'admin' ) );
|
||||
|
||||
return parent::output();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user