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
@@ -12,24 +12,36 @@
|
||||
namespace IPS\forums\extensions\core\AdvertisementLocations;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Extensions\AdvertisementLocationsAbstract;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Advertisement locations extension
|
||||
*/
|
||||
class _ForumListing
|
||||
class ForumListing extends AdvertisementLocationsAbstract
|
||||
{
|
||||
/**
|
||||
* If this ad location is used in a list view, we allow the admin
|
||||
* to define intervals or fixed positions within the list
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public static bool $listView = true;
|
||||
|
||||
/**
|
||||
* Get the locations and the additional settings
|
||||
*
|
||||
* @param array $settings Current setting values
|
||||
* @return array Array with two elements: 'locations' which should have keys as the location keys and values as the fields to toggle, and 'settings' which are additional fields to add to the form
|
||||
*/
|
||||
public function getSettings( $settings )
|
||||
public function getSettings( array $settings ): array
|
||||
{
|
||||
return array( 'locations' => array( 'ad_forum_listing' => array() ), 'settings' => array() );
|
||||
}
|
||||
@@ -40,7 +52,7 @@ class _ForumListing
|
||||
* @param array $values Values from the form submission
|
||||
* @return array Array of setting key => value to store
|
||||
*/
|
||||
public function parseSettings( $values )
|
||||
public function parseSettings( array $values ): array
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -12,32 +12,39 @@
|
||||
namespace IPS\forums\extensions\core\AdvertisementLocations;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Extensions\AdvertisementLocationsAbstract;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Advertisement locations extension
|
||||
*/
|
||||
class _IndexView
|
||||
class IndexView extends AdvertisementLocationsAbstract
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* If this ad location is used in a list view, we allow the admin
|
||||
* to define intervals or fixed positions within the list
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public static bool $listView = true;
|
||||
|
||||
/**
|
||||
* Get the locations and the additional settings
|
||||
*
|
||||
* @param array $settings Current setting values
|
||||
* @return array Array with two elements: 'locations' which should have keys as the location keys and values as the fields to toggle, and 'settings' which are additional fields to add to the form
|
||||
*/
|
||||
public function getSettings( $settings )
|
||||
public function getSettings( array $settings ): array
|
||||
{
|
||||
return array(
|
||||
'locations' => array( 'ad_fluid_index_view' => array( 'ad_fluid_index_view_number', 'ad_fluid_index_view_repeat' ) ),
|
||||
'settings' => array(
|
||||
/* Some communities may already have a 0 stored for `ad_fluid_index_view_number`, we now need to make sure it's at least 1 */
|
||||
new \IPS\Helpers\Form\Number( 'ad_fluid_index_view_number', ( isset( $settings['ad_fluid_index_view_number'] ) AND $settings['ad_fluid_index_view_number'] ) ? $settings['ad_fluid_index_view_number'] : 1, FALSE, array( 'min' => 1 ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('ad_fluid_index_view_number_suffix'), 'ad_fluid_index_view_number' ),
|
||||
new \IPS\Helpers\Form\Number( 'ad_fluid_index_view_repeat', ( isset( $settings['ad_fluid_index_view_repeat'] ) ) ? $settings['ad_fluid_index_view_repeat'] : 0, FALSE, array( 'unlimited' => -1 ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('ad_fluid_index_view_repeat_suffix'), 'ad_fluid_index_view_repeat' )
|
||||
)
|
||||
'locations' => array( 'ad_fluid_index_view' => array() )
|
||||
);
|
||||
}
|
||||
|
||||
@@ -47,11 +54,8 @@ class _IndexView
|
||||
* @param array $values Values from the form submission
|
||||
* @return array Array of setting key => value to store
|
||||
*/
|
||||
public function parseSettings( $values )
|
||||
public function parseSettings( array $values ): array
|
||||
{
|
||||
return array(
|
||||
'ad_fluid_index_view_number' => $values['ad_fluid_index_view_number'],
|
||||
'ad_fluid_index_view_repeat' => $values['ad_fluid_index_view_repeat']
|
||||
);
|
||||
return array();
|
||||
}
|
||||
}
|
||||
@@ -12,24 +12,36 @@
|
||||
namespace IPS\forums\extensions\core\AdvertisementLocations;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Extensions\AdvertisementLocationsAbstract;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Advertisement locations extension
|
||||
*/
|
||||
class _TopicView
|
||||
class TopicView extends AdvertisementLocationsAbstract
|
||||
{
|
||||
/**
|
||||
* If this ad location is used in a list view, we allow the admin
|
||||
* to define intervals or fixed positions within the list
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public static bool $listView = true;
|
||||
|
||||
/**
|
||||
* Get the locations and the additional settings
|
||||
*
|
||||
* @param array $settings Current setting values
|
||||
* @return array Array with two elements: 'locations' which should have keys as the location keys and values as the fields to toggle, and 'settings' which are additional fields to add to the form
|
||||
*/
|
||||
public function getSettings( $settings )
|
||||
public function getSettings( array $settings ): array
|
||||
{
|
||||
return array( 'locations' => array( 'ad_topic_view' => array() ), 'settings' => array() );
|
||||
}
|
||||
@@ -40,7 +52,7 @@ class _TopicView
|
||||
* @param array $values Values from the form submission
|
||||
* @return array Array of setting key => value to store
|
||||
*/
|
||||
public function parseSettings( $values )
|
||||
public function parseSettings( array $values ): array
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user