Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -115,7 +115,7 @@ class SavedAction extends Model
|
||||
{
|
||||
foreach ( static::getStore() as $action )
|
||||
{
|
||||
if ( $action['mm_enabled'] and ( $action['mm_forums'] == '*' or in_array( $forum->id, array_filter( explode( ',', $action['mm_forums'] ) ) ) ) )
|
||||
if ( $action['mm_enabled'] and ( $action['mm_forums'] == '*' or in_array( $forum->id, $forum->normalizeIds( $action['mm_forums'] ) ) ) )
|
||||
{
|
||||
$return[ $action['mm_id'] ] = static::constructFromData( $action );
|
||||
}
|
||||
@@ -158,16 +158,27 @@ class SavedAction extends Model
|
||||
{
|
||||
$form->addHeader( 'settings' );
|
||||
$form->add( new Translatable( 'mm_title', NULL, TRUE, array( 'app' => 'forums', 'key' => ( $this->mm_id ? "forums_mmod_{$this->mm_id}" : NULL ) ) ) );
|
||||
$form->add( new Node( 'mm_forums', ( $this->mm_id and $this->mm_forums != '*' ) ? $this->mm_forums : 0, FALSE, array( 'class' => 'IPS\forums\Forum', 'multiple' => TRUE, 'zeroVal' => 'all' ) ) );
|
||||
$form->add( new Node( 'mm_forums', ( $this->mm_id and $this->mm_forums != '*' ) ? $this->mm_forums : 0, FALSE, array(
|
||||
'class' => 'IPS\forums\Forum',
|
||||
'multiple' => true,
|
||||
'nodeGroups' => true,
|
||||
'clubs' => true,
|
||||
'zeroVal' => 'all' )
|
||||
) );
|
||||
|
||||
$form->addHeader( 'topic_properties' );
|
||||
$form->add( new Radio( 'topic_state', $this->mm_id ? $this->topic_state : 'leave', FALSE, array( 'options' => array( 'leave' => 'mm_leave', 'open' => 'unlock', 'close' => 'lock' ) ) ) );
|
||||
$form->add( new Radio( 'topic_pin', $this->mm_id ? $this->topic_pin : 'leave', FALSE, array( 'options' => array( 'leave' => 'mm_leave', 'pin' => 'pin', 'unpin' => 'unpin' ) ) ) );
|
||||
$form->add( new Radio( 'topic_approve', $this->mm_id ? $this->topic_approve : 0, FALSE, array( 'options' => array( 0 => 'mm_leave', 1 => 'unhide', 2 => 'hide' ) ) ) );
|
||||
$form->add( new Node( 'topic_move', ( $this->mm_id and $this->topic_move != -1 ) ? $this->topic_move : 0, FALSE, array( 'class' => 'IPS\forums\Forum', 'zeroVal' => 'topic_move_none', 'zeroValTogglesOff' => array( 'topic_move_link' ), 'permissionCheck' => function ( $forum )
|
||||
{
|
||||
return $forum->sub_can_post and !$forum->redirect_url;
|
||||
} ) ) );
|
||||
$form->add( new Node( 'topic_move', ( $this->mm_id and $this->topic_move != -1 ) ? $this->topic_move : 0, FALSE, array(
|
||||
'class' => 'IPS\forums\Forum',
|
||||
'zeroVal' => 'topic_move_none',
|
||||
'zeroValTogglesOff' => array( 'topic_move_link' ),
|
||||
'permissionCheck' => function ( $forum )
|
||||
{
|
||||
return $forum->sub_can_post and !$forum->redirect_url;
|
||||
} )
|
||||
) );
|
||||
$form->add( new YesNo( 'topic_move_link', $this->mm_id ? $this->topic_move_link : TRUE, FALSE, array(), NULL, NULL, NULL, 'topic_move_link' ) );
|
||||
|
||||
$form->addHeader( 'topic_title' );
|
||||
@@ -198,13 +209,7 @@ class SavedAction extends Model
|
||||
}
|
||||
else
|
||||
{
|
||||
$forums = array();
|
||||
foreach ( $values['mm_forums'] as $forum )
|
||||
{
|
||||
$forums[] = $forum->_id;
|
||||
}
|
||||
|
||||
$values['mm_forums'] = ( implode( ',', $forums ) );
|
||||
$values['mm_forums'] = array_keys( $values['mm_forums'] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user