Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -77,22 +77,25 @@ abstract class _AbstractAchievementAction
|
||||
/**
|
||||
* Get the labels for the people this action might give awards to
|
||||
*
|
||||
* @param array|NULL $filters Current filter values
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function awardOptions(): array
|
||||
public function awardOptions( ?array $filters ): array
|
||||
{
|
||||
return [
|
||||
'subject' => '',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the "other" people we need to award =stuff to
|
||||
*
|
||||
* @param mixed $extra Any additional information about what is happening (e.g. if a post is being made: the post object)
|
||||
* @param mixed $extra Any additional information about what is happening (e.g. if a post is being made: the post object)
|
||||
* @param array|NULL $filters Current filter values
|
||||
* @return array
|
||||
*/
|
||||
public function awardOther( $extra = NULL ): array
|
||||
public function awardOther( $extra = NULL, ?array $filters = NULL ): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
+31
-4
@@ -122,7 +122,7 @@ abstract class _AbstractContentAchievementAction extends AbstractAchievementActi
|
||||
$return[ $k ] = $v;
|
||||
}
|
||||
$return['milestone'] = $nthFilter;
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ abstract class _AbstractContentAchievementAction extends AbstractAchievementActi
|
||||
{
|
||||
$item = $extra->item();
|
||||
}
|
||||
|
||||
|
||||
if ( isset( $filters[ 'nodes_' . str_replace( '\\', '-', \get_class( $item ) ) ] ) )
|
||||
{
|
||||
if ( !\in_array( $item->container()->_id, $filters[ 'nodes_' . str_replace( '\\', '-', \get_class( $item ) ) ] ) )
|
||||
@@ -193,9 +193,36 @@ abstract class _AbstractContentAchievementAction extends AbstractAchievementActi
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
else
|
||||
{
|
||||
/* Make sure the class is a contentRouter approved class, mostly to stop private messages being awarded points */
|
||||
foreach ( \IPS\Application::allExtensions( 'core', 'ContentRouter', FALSE ) as $extension )
|
||||
{
|
||||
foreach ( $extension->classes as $class )
|
||||
{
|
||||
if ( \get_class( $extra ) == $class )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
elseif ( isset( $class::$commentClass ) and \get_class( $extra ) == $class::$commentClass )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
elseif ( isset( $class::$reviewClass ) and \get_class( $extra ) == $class::$reviewClass )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Stop PHPStorm from complaining about incorrect return types >_> */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user