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,27 +11,35 @@
|
||||
namespace IPS\gallery\extensions\core\MemberRestrictions;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\core\MemberACPProfile\Restriction;
|
||||
use IPS\Helpers\Form;
|
||||
use IPS\Helpers\Form\YesNo;
|
||||
use IPS\Member;
|
||||
use function defined;
|
||||
use function intval;
|
||||
|
||||
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 Member Restrictions: Gallery
|
||||
*/
|
||||
class _Gallery extends \IPS\core\MemberACPProfile\Restriction
|
||||
class Gallery extends Restriction
|
||||
{
|
||||
/**
|
||||
* Modify Edit Restrictions form
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form The form
|
||||
* @param Form $form The form
|
||||
* @return void
|
||||
*/
|
||||
public function form( \IPS\Helpers\Form $form )
|
||||
public function form( Form $form ) : void
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'remove_gallery_access', !$this->member->members_bitoptions['remove_gallery_access'], FALSE, array( 'togglesOn' => array( 'remove_gallery_upload' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'remove_gallery_upload', !$this->member->members_bitoptions['remove_gallery_upload'], FALSE, array(), NULL, NULL, NULL, 'remove_gallery_upload' ) );
|
||||
$form->add( new YesNo( 'remove_gallery_access', !$this->member->members_bitoptions['remove_gallery_access'], FALSE, array( 'togglesOn' => array( 'remove_gallery_upload' ) ) ) );
|
||||
$form->add( new YesNo( 'remove_gallery_upload', !$this->member->members_bitoptions['remove_gallery_upload'], FALSE, array(), NULL, NULL, NULL, 'remove_gallery_upload' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,7 +48,7 @@ class _Gallery extends \IPS\core\MemberACPProfile\Restriction
|
||||
* @param array $values Values from form
|
||||
* @return array
|
||||
*/
|
||||
public function save( $values )
|
||||
public function save( array $values ): array
|
||||
{
|
||||
$return = array();
|
||||
|
||||
@@ -64,7 +72,7 @@ class _Gallery extends \IPS\core\MemberACPProfile\Restriction
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function activeRestrictions()
|
||||
public function activeRestrictions(): array
|
||||
{
|
||||
$return = array();
|
||||
|
||||
@@ -95,7 +103,7 @@ class _Gallery extends \IPS\core\MemberACPProfile\Restriction
|
||||
{
|
||||
if ( isset( $changes[ $k ] ) )
|
||||
{
|
||||
$return[] = \IPS\Member::loggedIn()->language()->addToStack( 'history_restrictions_' . $k . '_' . \intval( $changes[ $k ]['new'] ) );
|
||||
$return[] = Member::loggedIn()->language()->addToStack( 'history_restrictions_' . $k . '_' . intval( $changes[ $k ]['new'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user