Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+19 -6
View File
@@ -12,7 +12,7 @@
namespace IPS\downloads;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -92,7 +92,6 @@ class _Field extends \IPS\CustomField
/**
* Get topic format
*
* @param \IPS\Helpers\Form $form The form
* @return void
*/
public function get_topic_format()
@@ -109,12 +108,21 @@ class _Field extends \IPS\CustomField
public function form( &$form )
{
parent::form( $form );
$form->add( new \IPS\Helpers\Form\Radio( 'downloads_field_location', $this->id ? $this->display_location : 'below', FALSE, array( 'options' => array( 'sidebar' => 'idm_cfield_sidebar', 'below' => 'idm_cfield_below', 'tab' => 'idm_cfield_tab' ) ), NULL, NULL, NULL, 'idm_field_location' ) );
if ( \IPS\Application::appIsEnabled( 'nexus' ) and \IPS\Settings::i()->idm_nexus_on )
{
$form->add( new \IPS\Helpers\Form\YesNo( 'downloads_field_paid', $this->id ? $this->paid_field : FALSE, FALSE, array( 'togglesOff' => array( 'idm_cf_topic', 'idm_pf_format', 'form_' . ( $this->id ?? 'new' ) . '_header_category_forums_integration' ) ) ) );
}
if ( \IPS\Application::appIsEnabled( 'forums' ) )
{
$form->addHeader('category_forums_integration');
$form->add( new \IPS\Helpers\Form\YesNo( 'cf_topic', $this->topic ) );
$form->add( new \IPS\Helpers\Form\TextArea( 'pf_format', $this->id ? $this->topic_format : '', FALSE, array( 'placeholder' => "<strong>{title}:</strong> {content}" ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'cf_topic', $this->topic, FALSE, array(), NULL, NULL, NULL, 'idm_cf_topic' ) );
$form->add( new \IPS\Helpers\Form\TextArea( 'pf_format', $this->id ? $this->topic_format : '', FALSE, array(), NULL, NULL, NULL, 'idm_pf_format' ) );
\IPS\Member::loggedIn()->language()->words['pf_format_desc'] = \IPS\Member::loggedIn()->language()->addToStack('cf_format_desc');
}
}
@@ -128,7 +136,8 @@ class _Field extends \IPS\CustomField
{
if ( \IPS\Application::appIsEnabled( 'forums' ) AND isset( $values['cf_topic'] ) )
{
$values['topic'] = $values['cf_topic'];
/* Forcibly disable include in topic option if it is a paid field */
$values['topic'] = ( isset( $values['downloads_field_paid'] ) AND $values['downloads_field_paid'] ) ? $values['cf_topic'] : 0;
unset( $values['cf_topic'] );
}
@@ -137,6 +146,10 @@ class _Field extends \IPS\CustomField
unset( $values['pf_search_type'] );
unset( $values['pf_allow_attachments'] );
$values['display_location'] = $values['downloads_field_location'];
$values['paid_field'] = $values['downloads_field_paid'];
unset( $values['downloads_field_location'], $values['downloads_field_paid'] );
return parent::formatFormValues( $values );
}
}