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
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @brief Profile Fields and Settings
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
@@ -11,40 +12,47 @@
|
||||
namespace IPS\core\modules\admin\membersettings;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\core\ProfileFields\Field;
|
||||
use IPS\Dispatcher;
|
||||
use IPS\Member;
|
||||
use IPS\Node\Controller;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Profile Fields and Settings
|
||||
*/
|
||||
class _profilefields extends \IPS\Node\Controller
|
||||
class profilefields extends Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
public static bool $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Node Class
|
||||
*/
|
||||
protected $nodeClass = '\IPS\core\ProfileFields\Group';
|
||||
protected string $nodeClass = '\IPS\core\ProfileFields\Group';
|
||||
|
||||
/**
|
||||
* Show the "add" button in the page root rather than the table root
|
||||
*/
|
||||
protected $_addButtonInRoot = FALSE;
|
||||
protected bool $_addButtonInRoot = FALSE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
public function execute() : void
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'profilefields_manage' );
|
||||
Dispatcher::i()->checkAcpPermission( 'profilefields_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
@@ -53,8 +61,9 @@ class _profilefields extends \IPS\Node\Controller
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function _getRootButtons()
|
||||
public function _getRootButtons(): array
|
||||
{
|
||||
/* @var Field $nodeClass */
|
||||
$nodeClass = $this->nodeClass;
|
||||
|
||||
if ( $nodeClass::canAddRoot() )
|
||||
@@ -63,7 +72,7 @@ class _profilefields extends \IPS\Node\Controller
|
||||
'icon' => 'plus',
|
||||
'title' => 'add',
|
||||
'link' => $this->url->setQueryString( 'do', 'form' ),
|
||||
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('add') ) : array() )
|
||||
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => Member::loggedIn()->language()->addToStack('add') ) : array() )
|
||||
);
|
||||
|
||||
return array( 'add' => $add );
|
||||
|
||||
Reference in new issue
Block a user