Version 5.0.0 beta 2

This commit is contained in:
Neo committed 2025-12-19 16:39:01 -08:00
1 parent 15c7beabc5
commit f61b0da85d
181 files changed
+3182 -1533

No files matched your search

@@ -300,11 +300,15 @@ class Rank extends Model
}
/* Generate a custom SVG for this badge if we're not using a custom image */
if ( ( !array_key_exists( 'rank_use_image', $values ) and !$this->rank_use_image ) or ( array_key_exists( 'rank_use_image', $values ) and !$values['rank_use_image'] ) )
if( !array_key_exists( 'rank_use_image', $values ) or !$values['rank_use_image'] )
{
CustomBadge::saveRecordBadge( $this, CustomBadge::generateBadgeFromFormValues( $values, 'rank' ) );
}
else
{
CustomBadge::clearCustomBadgeFields( $values, 'rank' );
}
return $values;
}
@@ -154,13 +154,13 @@ class Field extends CustomField
/* If we are using the "default" formatting, set that up now */
$format = $this->format ?: "<strong data-i-el='title'>{\$title}:</strong><div data-i-el='value'>{\$processedContent}</div>";
return $this->parseHtmlLogic( $format, $value, $formattedValue, $member );
return $this->parseHtmlLogic( $format, $value ?? '', $formattedValue, $member );
case ( static::PROFILE ):
case ( static::PROFILE_COMPLETION ):
if( $this->profile_format and !$bypassCustomFormatting )
{
return $this->parseHtmlLogic( $this->profile_format, $value, $formattedValue, $member );
return $this->parseHtmlLogic( $this->profile_format, $value ?? '', $formattedValue, $member );
}
else
{
@@ -442,10 +442,10 @@ class Field extends CustomField
$formatOptions = array( 'default' => 'custom_field_format_default', 'custom' => 'custom_field_format_custom' );
$form->add( new Radio( 'pf_profile_format', $this->profile_format ? 'custom' : 'default', TRUE, array( 'options' => $formatOptions, 'toggles' => array( 'custom' => array( 'pf_profile_format_custom' ) ) ), NULL, NULL, NULL, 'pf_profile_format' ) );
$form->add( new TextArea( 'pf_profile_format_custom', $this->profile_format, FALSE, array( 'placeholder' => "<strong>{\$title}:</strong> {\$content}" ), NULL, NULL, NULL, 'pf_profile_format_custom' ) );
$form->add( new TextArea( 'pf_profile_format_custom', $this->profile_format, null, array( 'placeholder' => "<strong>{\$title}:</strong> {\$content}" ), NULL, NULL, NULL, 'pf_profile_format_custom' ) );
$form->add( new Radio( 'pf_format', $this->format ? 'custom' : 'default', TRUE, array( 'options' => $formatOptions, 'toggles' => array( 'custom' => array( 'pf_format_custom' ) ) ), NULL, NULL, NULL, 'pf_format' ) );
$form->add( new TextArea( 'pf_format_custom', $this->format, FALSE, array( 'placeholder' => "<strong>{\$title}:</strong> {\$content}" ), NULL, NULL, NULL, 'pf_format_custom' ) );
$form->add( new TextArea( 'pf_format_custom', $this->format, null, array( 'placeholder' => "<strong>{\$title}:</strong> {\$content}" ), NULL, NULL, NULL, 'pf_format_custom' ) );
}
/**
+15 -6
View File
@@ -104,12 +104,16 @@ class Rules extends Model
$form->add( new Number( 'automaticmoderation_points', $this->id ? $this->points_needed : 10, TRUE, array( 'min' => 1, 'max' => 9999 ), NULL, NULL, Member::loggedIn()->language()->addToStack('automaticmoderation_points_suffix') ) );
$options = array();
foreach(Types::roots() as $type )
if( count( Types::roots() ) > 0 )
{
$options[ $type->id ] = $type->_title;
foreach(Types::roots() as $type )
{
$options[ $type->id ] = $type->_title;
}
$form->add( new CheckboxSet( 'automaticmoderation_type', $this->types ? explode( ',', $this->types ) : array(), TRUE, array( 'options' => $options ) ) );
}
$form->add( new CheckboxSet( 'automaticmoderation_type', $this->types ? explode( ',', $this->types ) : array(), TRUE, array( 'options' => $options ) ) );
/* Loop over our member filters */
$form->addHeader( 'automaticmoderation_generic_filters' );
@@ -201,7 +205,11 @@ class Rules extends Model
$values['rule_filters'] = json_encode( $_options );
$values['rule_points_needed'] = $values['automaticmoderation_points'];
$values['rule_enabled'] = $values['automaticmoderation_enabled'];
$values['rule_types'] = $values['automaticmoderation_type'];
if( isset( $values['automaticmoderation_type'] ) )
{
$values['rule_types'] = $values['automaticmoderation_type'];
}
/* Now we have to remove any fields that aren't valid... */
foreach( $values as $k => $v )
@@ -378,10 +386,11 @@ class Rules extends Model
/* Loop over the filters */
$descriptions = array();
foreach( $this->_filters as $key => $filter )
if( $this->_filters )
{
if( isset( static::$extensions[ $key ] ) )
foreach( $this->_filters as $key => $filter )
{
if( isset( static::$extensions[ $key ] ) )
/* Ask the extension if this member matches the defined rule...if not, just return FALSE now */
if( method_exists( static::$extensions[ $key ], 'getDescription' ) and $description = static::$extensions[ $key ]->getDescription( $filter ) )
{