Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -86,12 +86,14 @@ class _Rules extends \IPS\Node\Model
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'automaticmoderation_points', $this->id ? $this->points_needed : 10, TRUE, array( 'min' => 1, 'max' => 9999 ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('automaticmoderation_points_suffix') ) );
|
||||
|
||||
$options = array();
|
||||
foreach( \IPS\core\Reports\Types::roots() as $type )
|
||||
if( count( \IPS\core\Reports\Types::roots() ) > 0 )
|
||||
{
|
||||
$options[ $type->id ] = $type->_title;
|
||||
foreach( \IPS\core\Reports\Types::roots() as $type )
|
||||
{
|
||||
$options[ $type->id ] = $type->_title;
|
||||
}
|
||||
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'automaticmoderation_type', $this->types ? explode( ',', $this->types ) : array(), TRUE, array( 'options' => $options ) ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'automaticmoderation_type', $this->types ? explode( ',', $this->types ) : array(), TRUE, array( 'options' => $options ) ) );
|
||||
|
||||
/* Loop over our member filters */
|
||||
$form->addHeader( 'automaticmoderation_generic_filters' );
|
||||
@@ -183,7 +185,11 @@ class _Rules extends \IPS\Node\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 )
|
||||
@@ -360,17 +366,21 @@ class _Rules extends \IPS\Node\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 )
|
||||
{
|
||||
/* 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 ) )
|
||||
if( isset( static::$extensions[ $key ] ) )
|
||||
{
|
||||
$descriptions[] = $description; /* Is this descriptive enough? */
|
||||
/* 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 ) )
|
||||
{
|
||||
$descriptions[] = $description; /* Is this descriptive enough? */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'automaticmoderation_row_desc', TRUE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $descriptions ) ) ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user