Version 5.0.0 release

This commit is contained in:
Neo committed 2025-12-19 18:37:58 -08:00
1 parent 90e8c7e903
commit a3a4a9ccbd
651 files changed
+7275 -9481

No files matched your search

+15 -12
View File
@@ -170,10 +170,13 @@ class Rule extends Model
}
$exploded = explode( '\\', get_class( $achievementAction ) );
$options[ "{$exploded[1]}_{$exploded[5]}" ] = "AchievementAction__{$exploded[5]}";
$app = $exploded[1];
$extClass = $exploded[5];
$inputKey = implode( "_", [$app, $extClass] );
$options[ $inputKey ] = "AchievementAction__{$extClass}";
$toggles[ "{$exploded[1]}_{$exploded[5]}" ] = [ "{$exploded[1]}_{$exploded[5]}_award_subject" ];
$toggles[ "{$exploded[1]}_{$exploded[5]}" ][] = "{$exploded[1]}_{$exploded[5]}_award_subject_badge";
$toggles[ $inputKey ] = [ "{$inputKey}_award_subject" ];
$toggles[ $inputKey ][] = "{$inputKey}_award_subject_badge";
foreach ($achievementAction->filters( $this->filters, Url::internal( $this->id ? "app=core&module=achievements&controller=rules&do=form&id={$this->id}" : 'app=core&module=achievements&controller=rules&do=form' ) ) as $filterKey => $filterElement )
{
if ( is_array( $this->filters ) and array_key_exists( $filterKey, $this->filters ) )
@@ -184,35 +187,35 @@ class Rule extends Model
{
$filterElement->htmlId = $filterElement->name;
}
$toggles[ "{$exploded[1]}_{$exploded[5]}" ][] = $filterElement->htmlId;
$toggles[ $inputKey ][] = $filterElement->htmlId;
$extraElements[] = $filterElement;
}
$awardTo = $achievementAction->awardOptions( $this->filters );
$awardSubjectField = new Custom( "{$exploded[1]}_{$exploded[5]}_award_subject", [ 'points' => $this->points_subject, 'badge' => $this->badge_subject ], FALSE, [
$awardSubjectField = new Custom( "{$inputKey}_award_subject", [ 'points' => $this->points_subject, 'badge' => $this->badge_subject ], FALSE, [
'getHtml' => function( $field ) {
return Theme::i()->getTemplate('achievements')->awardField( $field->name, $field->value );
}
], NULL, NULL, NULL, "{$exploded[1]}_{$exploded[5]}_award_subject" );
], NULL, NULL, NULL, "{$inputKey}_award_subject" );
if ( isset( $awardTo['subject'] ) )
{
$awardSubjectField->label = Member::loggedIn()->language()->addToStack( $awardTo['subject'] );
}
$extraElements[] = $awardSubjectField;
$extraElements[] = new Translatable( "{$exploded[1]}_{$exploded[5]}_award_subject_badge", NULL, NULL, [ 'app' => 'core', 'key' => ( $this->id ) ? "core_award_subject_badge_" . $this->id : NULL ], NULL, NULL, NULL, "{$exploded[1]}_{$exploded[5]}_award_subject_badge" );
$extraElements[] = new Translatable( "{$inputKey}_award_subject_badge", NULL, NULL, [ 'app' => 'core', 'key' => ( $this->id ) ? "core_award_subject_badge_" . $this->id : NULL ], NULL, NULL, NULL, "{$inputKey}_award_subject_badge" );
if ( isset( $awardTo['other'] ) )
{
$awardOtherField = new Custom( "{$exploded[1]}_{$exploded[5]}_award_other", [ 'points' => $this->points_other, 'badge' => $this->badge_other ], FALSE, [
$awardOtherField = new Custom( "{$inputKey}_award_other", [ 'points' => $this->points_other, 'badge' => $this->badge_other ], FALSE, [
'getHtml' => function( $field ) {
return Theme::i()->getTemplate('achievements')->awardField( $field->name, $field->value );
}
], NULL, NULL, NULL, "{$exploded[1]}_{$exploded[5]}_award_other" );
], NULL, NULL, NULL, "{$inputKey}_award_other" );
$awardOtherField->label = Member::loggedIn()->language()->addToStack( $awardTo['other'] );
$extraElements[] = $awardOtherField;
$extraElements[] = new Translatable( "{$exploded[1]}_{$exploded[5]}_award_other_badge", NULL, NULL, [ 'app' => 'core', 'key' => ( $this->id ) ? "core_award_other_badge_" . $this->id : NULL ], NULL, NULL, NULL, "{$exploded[1]}_{$exploded[5]}_award_other_badge" );
$toggles[ "{$exploded[1]}_{$exploded[5]}" ][] = "{$exploded[1]}_{$exploded[5]}_award_other";
$toggles[ "{$exploded[1]}_{$exploded[5]}" ][] = "{$exploded[1]}_{$exploded[5]}_award_other_badge";
$extraElements[] = new Translatable( "{$inputKey}_award_other_badge", NULL, NULL, [ 'app' => 'core', 'key' => ( $this->id ) ? "core_award_other_badge_" . $this->id : NULL ], NULL, NULL, NULL, "{$inputKey}_award_other_badge" );
$toggles[ $inputKey ][] = "{$inputKey}_award_other";
$toggles[ $inputKey ][] = "{$inputKey}_award_other_badge";
}
}
+3 -3
View File
@@ -38,6 +38,7 @@ use IPS\Member;
use IPS\Member\Club;
use IPS\Node\Model;
use IPS\Patterns\ActiveRecord;
use IPS\Patterns\ActiveRecordIterator;
use IPS\Request;
use IPS\Settings;
use OutOfRangeException;
@@ -614,9 +615,8 @@ class Stream extends Model
if( static::$ourClubs === NULL )
{
static::$ourClubs = iterator_to_array(
Club::clubs( Member::loggedIn(), NULL, 'name', TRUE, array(), Settings::i()->clubs_require_approval ? array( 'approved=1' ) : NULL )
);
$clubs = Club::clubs( Member::loggedIn(), NULL, 'name', TRUE, array(), Settings::i()->clubs_require_approval ? array( 'approved=1' ) : NULL );
static::$ourClubs = ( $clubs instanceof ActiveRecordIterator) ? iterator_to_array( $clubs ) : $clubs;
}
return static::$ourClubs;