Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -46,6 +46,7 @@ use IPS\Content\Shareable;
|
||||
use IPS\Content\Taggable;
|
||||
use IPS\Content\Statistics;
|
||||
use IPS\Content\ViewUpdates;
|
||||
use IPS\core\DataLayer;
|
||||
use IPS\DateTime;
|
||||
use IPS\Db;
|
||||
use IPS\Events\Event;
|
||||
@@ -287,20 +288,22 @@ class Records extends Item implements
|
||||
* Most, if not all of these are the same for different events, so we can just have one method
|
||||
*
|
||||
* @param Comment|null $comment A comment item, leave null for these keys to be omitted
|
||||
* @param array $createOrEditValues =[] Values from the create or edit form, if applicable.
|
||||
* @param bool $clearCache=false
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDataLayerProperties( ?Comment $comment = null ): array
|
||||
public function getDataLayerProperties( ?Comment $comment = null, array $createOrEditValues = [], bool $clearCache = false ): array
|
||||
{
|
||||
$commentIdColumn = $comment ? $comment::$databaseColumnId : null;
|
||||
$index = $commentIdColumn ? ( $comment->$commentIdColumn ?: 0 ) : 0;
|
||||
if ( isset( $this->_dataLayerProperties[$index] ) )
|
||||
$index = "idx_" . ( $commentIdColumn ? ( $comment->$commentIdColumn ?: 0 ) : -1 );
|
||||
if ( !$clearCache and isset( $this->_dataLayerProperties[$index] ) )
|
||||
{
|
||||
return $this->_dataLayerProperties[$index];
|
||||
}
|
||||
|
||||
/* Set the content_type and comment_type to lower case for consistency */
|
||||
$properties = parent::getDataLayerProperties( $comment );
|
||||
$properties = parent::getDataLayerProperties( $comment, $createOrEditValues, $clearCache );
|
||||
if ( isset( $properties['content_type'] ) )
|
||||
{
|
||||
$properties['content_type'] = strtolower( Lang::load( Lang::defaultLanguage() )->addToStack( static::$title ) );
|
||||
@@ -1520,9 +1523,18 @@ class Records extends Item implements
|
||||
{
|
||||
if ( ! isset( $this->customDisplayFields['all'][ $type ] ) )
|
||||
{
|
||||
$this->customDisplayFields['all'][ $type ] = [];
|
||||
$fieldsClass = '\IPS\cms\Fields' . static::$customDatabaseId;
|
||||
/* @var $fieldsClass Fields */
|
||||
$this->customDisplayFields['all'][ $type ] = $fieldsClass::display( $this->fieldValues(), $type, $this->container(), 'key', $this );
|
||||
|
||||
/* @var $fieldsClass Fields */
|
||||
foreach( $fieldsClass::display( $this->fieldValues(), $type, $this->container(), 'key', $this ) as $k => $fieldValue )
|
||||
{
|
||||
/* We only show these if there is a value anyway */
|
||||
if( $fieldValue )
|
||||
{
|
||||
$this->customDisplayFields['all'][ $type ][ $k ] = $fieldValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->customDisplayFields['all'][ $type ];
|
||||
@@ -1924,7 +1936,7 @@ class Records extends Item implements
|
||||
*/
|
||||
public function get__record_image_thumb() : string
|
||||
{
|
||||
return $this->record_image_thumb ?: $this->record_image;
|
||||
return $this->record_image_thumb ?: ( $this->record_image ?? '' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3027,19 +3039,7 @@ class Records extends Item implements
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Am I a Moderator with edit permissions ?*/
|
||||
if ( static::modPermission( 'edit', $member, $this->containerWrapper() ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ( parent::canEdit( $member ) )
|
||||
{
|
||||
/* Test against specific perms for this category */
|
||||
return $this->container()->can( 'edit', $member );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return parent::canEdit( $member );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3814,7 +3814,7 @@ class Records extends Item implements
|
||||
*/
|
||||
public function isTopicSyncEnabled() : bool
|
||||
{
|
||||
return $this->_forum_record and $this->_forum_comments and Application::appIsEnabled('forums');
|
||||
return $this->_forum_record and Application::appIsEnabled('forums');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user