Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -61,7 +61,7 @@ class _NodeController extends \IPS\Api\Controller
|
||||
$select,
|
||||
isset( \IPS\Request::i()->page ) ? \IPS\Request::i()->page : 1,
|
||||
$class,
|
||||
$select->count(),
|
||||
NULL,
|
||||
$this->member,
|
||||
isset( \IPS\Request::i()->perPage ) ? \IPS\Request::i()->perPage : NULL
|
||||
);
|
||||
@@ -148,7 +148,7 @@ class _NodeController extends \IPS\Api\Controller
|
||||
* @param \IPS\node\Model $node The node
|
||||
* @return \IPS\node\Model
|
||||
*/
|
||||
protected function _createOrUpdate( \IPS\node\Model $node )
|
||||
protected function _createOrUpdate( \IPS\Node\Model $node )
|
||||
{
|
||||
$node->save();
|
||||
|
||||
|
||||
@@ -231,7 +231,8 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
$this->_descriptionHtml,
|
||||
$node->canAdd(),
|
||||
( $node instanceof $nodeClass ),
|
||||
$this->_getRowHtml( $node )
|
||||
$this->_getRowHtml( $node ),
|
||||
isset( $node->_lockedLang ) ? $node->_lockedLang : null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -565,11 +566,18 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Get the value */
|
||||
$key = \IPS\Request::i()->key;
|
||||
$sessionKey = 'MC' . $key;
|
||||
$dummyForm = new \IPS\Helpers\Form;
|
||||
$node->form( $dummyForm );
|
||||
if( isset( $_SESSION[ $key ] ) )
|
||||
|
||||
if( isset( \IPS\Request::i()->value ) )
|
||||
{
|
||||
$value = $_SESSION[ $key ];
|
||||
$_SESSION[ $sessionKey ] = \IPS\Request::i()->value;
|
||||
}
|
||||
|
||||
if( isset( $_SESSION[ $sessionKey ] ) )
|
||||
{
|
||||
$value = $_SESSION[ $sessionKey ];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -586,7 +594,7 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[ $key ] = $value;
|
||||
$_SESSION[ $sessionKey ] = $value;
|
||||
}
|
||||
|
||||
/* Build Form */
|
||||
@@ -609,7 +617,7 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
$multiRedirectUrl = $multiRedirectUrl->setQueryString( 'subnode', 1 );
|
||||
}
|
||||
\IPS\Output::i()->output = new \IPS\Helpers\MultipleRedirect( $multiRedirectUrl,
|
||||
function( $doneSoFar ) use ( $nodeClass )
|
||||
function( $doneSoFar ) use ( $nodeClass, $sessionKey )
|
||||
{
|
||||
$count = \IPS\Db::i()->select( 'COUNT(*)', $nodeClass::$databaseTable, \IPS\Request::i()->nodes == 0 ? NULL : \IPS\Db::i()->in( $nodeClass::$databasePrefix . $nodeClass::$databaseColumnId, explode( ',',\IPS\Request::i()->nodes) ) )->first();
|
||||
if ( !$count )
|
||||
@@ -625,9 +633,9 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
$did++;
|
||||
$_node = $nodeClass::constructFromData( $row );
|
||||
|
||||
if ( $_node->canCopyValue( \IPS\Request::i()->key, $_SESSION[ \IPS\Request::i()->key ] ) )
|
||||
if ( $_node->canCopyValue( \IPS\Request::i()->key, $_SESSION[ $sessionKey ] ) )
|
||||
{
|
||||
$values = $_node->formatFormValues( array( \IPS\Request::i()->key => $_SESSION[ \IPS\Request::i()->key ] ) );
|
||||
$values = $_node->formatFormValues( array( \IPS\Request::i()->key => $_SESSION[ $sessionKey ] ) );
|
||||
|
||||
foreach( $values as $k => $v )
|
||||
{
|
||||
@@ -661,13 +669,13 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
$doneSoFar += 50;
|
||||
return array( $doneSoFar, \IPS\Member::loggedIn()->language()->addToStack('copying'), 100 / $count * $doneSoFar );
|
||||
},
|
||||
function() use( $url )
|
||||
function() use( $url, $sessionKey )
|
||||
{
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
/* Clear the value in the session */
|
||||
unset( $_SESSION[ \IPS\Request::i()->key ] );
|
||||
unset( $_SESSION[ $sessionKey ] );
|
||||
|
||||
/* And redirect */
|
||||
$finishUrl = $url->setQueryString( array( 'do' => 'form', 'id' => \IPS\Request::i()->from ) );
|
||||
|
||||
+44
-1
@@ -854,6 +854,16 @@ abstract class _Model extends \IPS\Patterns\ActiveRecord
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* [Node] Get a lang string to display when hovering over the locked toggle, or null to display nothing
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected function get__lockedLang()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* [Node] Get position
|
||||
*
|
||||
@@ -2049,13 +2059,34 @@ abstract class _Model extends \IPS\Patterns\ActiveRecord
|
||||
{
|
||||
$groupsToCheck[] = \IPS\Settings::i()->member_group;
|
||||
}
|
||||
$where[] = array( \IPS\Db::i()->findInSet( 'core_permission_index.perm_' . static::$permissionMap[ $permission ], $groupsToCheck ) . ' OR core_permission_index.perm_' . static::$permissionMap[ $permission ] . "='*'" );
|
||||
|
||||
if ( \IPS\Settings::i()->clubs AND \IPS\Settings::i()->club_nodes_in_apps AND \IPS\IPS::classUsesTrait( \get_called_class(), 'IPS\Content\ClubContainer' ) )
|
||||
{
|
||||
$clubWhere = array();
|
||||
foreach( $member->clubs() AS $club )
|
||||
{
|
||||
$clubWhere[] = "core_permission_index.perm_" . static::$permissionMap[ $permission ] . "='cm,c{$club}'";
|
||||
}
|
||||
if ( \count( $clubWhere ) )
|
||||
{
|
||||
$where[] = array( \IPS\Db::i()->findInSet( 'core_permission_index.perm_' . static::$permissionMap[ $permission ], $groupsToCheck ) . ' OR core_permission_index.perm_' . static::$permissionMap[ $permission ] . "='*' OR core_permission_index.perm_" . static::$permissionMap[ $permission ] . "='ca' OR " . implode( ' OR ', $clubWhere ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = array( \IPS\Db::i()->findInSet( 'core_permission_index.perm_' . static::$permissionMap[ $permission ], $groupsToCheck ) . ' OR core_permission_index.perm_' . static::$permissionMap[ $permission ] . "='*' OR core_permission_index.perm_" . static::$permissionMap[ $permission ] . "='ca'" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = array( \IPS\Db::i()->findInSet( 'core_permission_index.perm_' . static::$permissionMap[ $permission ], $groupsToCheck ) . ' OR core_permission_index.perm_' . static::$permissionMap[ $permission ] . "='*'" );
|
||||
}
|
||||
|
||||
/* Run query and return */
|
||||
if ( static::$databaseColumnEnabledDisabled )
|
||||
{
|
||||
$where[] = array( static::$databasePrefix . static::$databaseColumnEnabledDisabled . '=1' );
|
||||
}
|
||||
|
||||
static::$_canOnAny[ $_key ][ $permission ] = (bool) \IPS\Db::i()->select( 'COUNT(*)', static::$databaseTable, $where )
|
||||
->join( 'core_permission_index', array( "core_permission_index.app=? AND core_permission_index.perm_type=? AND core_permission_index.perm_type_id=" . static::$databaseTable . "." . static::$databasePrefix . static::$databaseColumnId, static::$permApp, static::$permType ) )
|
||||
->first();
|
||||
@@ -3850,4 +3881,16 @@ abstract class _Model extends \IPS\Patterns\ActiveRecord
|
||||
return $this->_dataLayerProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Content was held for approval by container
|
||||
* Allow node classes that can determine if content should be held for approval in individual nodes
|
||||
*
|
||||
* @param string $content The type of content we are checking (item, comment, review).
|
||||
* @param \IPS\Member|NULL $member Member to check or NULL for currently logged in member.
|
||||
* @return bool
|
||||
*/
|
||||
public function contentHeldForApprovalByNode( string $content, ?\IPS\Member $member = NULL ): bool
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user