Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+67 -3
View File
@@ -2,10 +2,10 @@
/**
* @brief Files Feed Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage forums
* @package IPS Community Suite
* @subpackage Downloads
* @since 22 Jun 2015
* @version SVN_VERSION_NUMBER
*/
@@ -43,4 +43,68 @@ class _fileFeed extends \IPS\Content\Widget
* Class
*/
protected static $class = 'IPS\downloads\File';
/**
* Init the widget
*
* @return void
*/
public function init()
{
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'widgets.css', 'downloads', 'front' ) );
parent::init();
}
/**
* Specify widget configuration
*
* @param null|\IPS\Helpers\Form $form Form object
* @return null|\IPS\Helpers\Form
*/
public function configuration( &$form=null )
{
$form = parent::configuration( $form );
if ( \IPS\Application::appIsEnabled( 'nexus' ) and \IPS\Settings::i()->idm_nexus_on )
{
$options = array(
'free' => 'file_free',
'paid' => 'file_paid',
'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 ) ) );
}
return $form;
}
/**
* Get where clause
*
* @return array
*/
protected function buildWhere()
{
$where = parent::buildWhere();
if ( \IPS\Application::appIsEnabled( 'nexus' ) and \IPS\Settings::i()->idm_nexus_on )
{
if( isset( $this->configuration['file_cost_type'] ) )
{
switch( $this->configuration['file_cost_type'] )
{
case 'free':
$where[] = array( "( ( file_cost='' OR file_cost IS NULL ) AND ( file_nexus='' OR file_nexus IS NULL ) )" );
break;
case 'paid':
$where[] = array( "( file_cost<>'' OR file_nexus>0 )" );
break;
}
}
}
return $where;
}
}