Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

+26 -16
View File
@@ -12,45 +12,55 @@
namespace IPS\downloads\widgets;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\Application;
use IPS\Content\Widget;
use IPS\Helpers\Form;
use IPS\Helpers\Form\Radio;
use IPS\Output;
use IPS\Settings;
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;
}
/**
* Files Entry Feed Widget
*/
class _fileFeed extends \IPS\Content\Widget
class fileFeed extends Widget
{
/**
* @brief Widget Key
*/
public $key = 'fileFeed';
public string $key = 'fileFeed';
/**
* @brief App
*/
public $app = 'downloads';
public string $app = 'downloads';
/**
* @brief Plugin
*/
public $plugin = '';
public string $plugin = '';
/**
* Class
*/
protected static $class = 'IPS\downloads\File';
protected static string $class = 'IPS\downloads\File';
/**
* Init the widget
*
* @return void
*/
public function init()
public function init(): void
{
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'widgets.css', 'downloads', 'front' ) );
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, Theme::i()->css( 'widgets.css', 'downloads', 'front' ) );
\IPS\downloads\Application::outputCss();
parent::init();
}
@@ -58,14 +68,14 @@ class _fileFeed extends \IPS\Content\Widget
/**
* Specify widget configuration
*
* @param null|\IPS\Helpers\Form $form Form object
* @return null|\IPS\Helpers\Form
* @param null|Form $form Form object
* @return Form
*/
public function configuration( &$form=null )
public function configuration( Form &$form=null ): Form
{
$form = parent::configuration( $form );
if ( \IPS\Application::appIsEnabled( 'nexus' ) and \IPS\Settings::i()->idm_nexus_on )
if ( Application::appIsEnabled( 'nexus' ) and Settings::i()->idm_nexus_on )
{
$options = array(
'free' => 'file_free',
@@ -73,7 +83,7 @@ class _fileFeed extends \IPS\Content\Widget
'any' => 'any'
);
$form->add( new \IPS\Helpers\Form\Radio( 'file_cost_type', isset( $this->configuration['file_cost_type'] ) ? $this->configuration['file_cost_type'] : 'any', TRUE, array( 'options' => $options ) ) );
$form->add( new Radio( 'file_cost_type', $this->configuration['file_cost_type'] ?? 'any', TRUE, array( 'options' => $options ) ) );
}
return $form;
@@ -84,11 +94,11 @@ class _fileFeed extends \IPS\Content\Widget
*
* @return array
*/
protected function buildWhere()
protected function buildWhere(): array
{
$where = parent::buildWhere();
if ( \IPS\Application::appIsEnabled( 'nexus' ) and \IPS\Settings::i()->idm_nexus_on )
if ( Application::appIsEnabled( 'nexus' ) and Settings::i()->idm_nexus_on )
{
if( isset( $this->configuration['file_cost_type'] ) )
{