Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

@@ -457,11 +457,6 @@ class _admin extends \IPS\Dispatcher\Controller
'ctime' => function( $val )
{
return (string) \IPS\DateTime::ts( $val );
},
'module' => function( $val, $key )
{
$key = "module__{$key['appcomponent']}_{$val}";
return \IPS\Member::loggedIn()->language()->addToStack( $key );
}
);
$table->sortBy = $table->sortBy ?: 'ctime';
@@ -472,7 +467,6 @@ class _admin extends \IPS\Dispatcher\Controller
'member_id' => \IPS\Helpers\Table\SEARCH_MEMBER,
'ip_address' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
'ctime' => \IPS\Helpers\Table\SEARCH_DATE_RANGE,
'module' => array( \IPS\Helpers\Table\SEARCH_NODE, array( 'class' => 'IPS\Application', 'subnodeWhere' => array( 'sys_module_area=?', 'admin' ), 'searchProp' => 'key' ) ),
'note' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
);
$table->quickSearch = 'note';
@@ -279,6 +279,9 @@ class _moderators extends \IPS\Dispatcher\Controller
}
}
}
/* We need to remember which keys are 'nodes' so we can adjust values upon submit */
$nodeFields = array();
/* Build */
$form = new \IPS\Helpers\Form;
@@ -304,6 +307,12 @@ class _moderators extends \IPS\Dispatcher\Controller
/* Class */
$type = is_array( $data ) ? $data[0] : $data;
$class = '\IPS\Helpers\Form\\' . ( $type );
/* Remember 'nodes' */
if( $type == 'Node' )
{
$nodeFields[ $name ] = $name;
}
/* Current Value */
if ( $currentPermissions === '*' )
@@ -326,6 +335,12 @@ class _moderators extends \IPS\Dispatcher\Controller
else
{
$currentValue = ( isset( $currentPermissions[ $name ] ) ? $currentPermissions[ $name ] : NULL );
/* We translate nodes to -1 so the moderator permissions merging works as expected allowing "all" to override individual node selections */
if( $type == 'Node' AND $currentValue == -1 )
{
$currentValue = 0;
}
}
/* Options */
@@ -360,6 +375,16 @@ class _moderators extends \IPS\Dispatcher\Controller
{
foreach ( $values as $k => $v )
{
/* For node fields, if the value is 0 translate it to -1 so mod permissions can merge properly */
if( in_array( $k, $nodeFields ) )
{
if( $v == 0 )
{
$v = -1;
$values[ $k ] = $v;
}
}
if ( is_array( $v ) )
{
foreach ( $v as $l => $w )
@@ -422,6 +447,7 @@ class _moderators extends \IPS\Dispatcher\Controller
/* Display */
\IPS\Output::i()->title = $_name;
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_members.js', 'core', 'admin' ) );
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'members' )->moderatorPermissions( $_name, $form );
}
@@ -541,11 +567,6 @@ class _moderators extends \IPS\Dispatcher\Controller
'ctime' => function( $val )
{
return (string) \IPS\DateTime::ts( $val );
},
'module' => function( $val, $key )
{
$key = "module__{$key['appcomponent']}_{$val}";
return \IPS\Member::loggedIn()->language()->addToStack( $key );
}
);
$table->sortBy = $table->sortBy ?: 'ctime';
@@ -556,7 +577,6 @@ class _moderators extends \IPS\Dispatcher\Controller
'member_id' => \IPS\Helpers\Table\SEARCH_MEMBER,
'ip_address' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
'ctime' => \IPS\Helpers\Table\SEARCH_DATE_RANGE,
'module' => array( \IPS\Helpers\Table\SEARCH_NODE, array( 'class' => 'IPS\Application', 'subnodeWhere' => array( 'sys_module_area=?', 'front' ), 'searchProp' => 'key' ) )
);
/* Add a button for settings */