Version 5.0.0 beta 8

This commit is contained in:
Neo committed 2025-12-19 17:30:12 -08:00
1 parent 54d5dcd0a0
commit 214f649f1d
483 files changed
+35354 -33568

No files matched your search

+39 -43
View File
@@ -370,7 +370,8 @@ class Records extends Item implements
return Topic::getCommentsPerPage();
}
return static::database()->field_perpage;
$databaseSetting = static::database()->comments_perpage;
return ( is_int( $databaseSetting ) and $databaseSetting > 0 ) ? $databaseSetting : static::database()->field_perpage;
}
/**
@@ -543,12 +544,13 @@ class Records extends Item implements
* Indefinite Article
*
* @param Lang|null $lang The language to use, or NULL for the language of the currently logged in member
* @param array $options
* @return string
*/
public function indefiniteArticle( ?Lang $lang = NULL ): string
public function indefiniteArticle( ?Lang $lang = NULL, array $options=array() ): string
{
$lang = $lang ?: Member::loggedIn()->language();
return $lang->addToStack( 'content_db_lang_ia_' . static::$customDatabaseId, FALSE );
return $lang->addToStack( 'content_db_lang_ia_' . static::$customDatabaseId, FALSE, $options );
}
/**
@@ -556,12 +558,13 @@ class Records extends Item implements
*
* @param array|null $containerData Container data
* @param Lang|null $lang The language to use, or NULL for the language of the currently logged in member
* @param array $options
* @return string
*/
public static function _indefiniteArticle( ?array $containerData = NULL, ?Lang $lang = NULL ): string
public static function _indefiniteArticle( ?array $containerData = NULL, ?Lang $lang = NULL, array $options=array() ): string
{
$lang = $lang ?: Member::loggedIn()->language();
return $lang->addToStack( 'content_db_lang_ia_' . static::$customDatabaseId, FALSE );
return $lang->addToStack( 'content_db_lang_ia_' . static::$customDatabaseId, FALSE, $options );
}
/**
@@ -2768,47 +2771,40 @@ class Records extends Item implements
{
if ( $this->recordCommentPageCount === NULL or $recache === TRUE )
{
/* If the database has a custom per page set, use that. */
if ( static::database()->comments_perpage )
if ( $this->useForumComments() )
{
$this->recordCommentPageCount = parent::commentPageCount( $recache );
try
{
$topic = $this->topic();
if ( $topic !== null )
{
/* Store the real count so it is not accidentally written as the actual value */
$realCount = $topic->posts;
/* If we are NOT featuring the first post in the topics, then we need to
compensate for the first post (which is actually the record) */
if ( !Member::loggedIn()->getLayoutValue( 'forum_topic_view_firstpost' ) )
{
$topic->posts = ( $topic->posts - 1 ) > 0 ? $topic->posts - 1 : 0;
}
/* Get our page count considering all of that */
$this->recordCommentPageCount = $topic->commentPageCount();
/* Reset the count back to the real count */
$topic->posts = $realCount;
}
else
{
$this->recordCommentPageCount = 1;
}
}
catch ( Exception $e ) {}
}
/* Otherwise do the normal stuff */
else
{
if ( $this->useForumComments() )
{
try
{
$topic = $this->topic();
if ( $topic !== null )
{
/* Store the real count so it is not accidentally written as the actual value */
$realCount = $topic->posts;
/* If we are NOT featuring the first post in the topics, then we need to
compensate for the first post (which is actually the record) */
if ( !Member::loggedIn()->getLayoutValue( 'forum_topic_view_firstpost' ) )
{
$topic->posts = ( $topic->posts - 1 ) > 0 ? $topic->posts - 1 : 0;
}
/* Get our page count considering all of that */
$this->recordCommentPageCount = $topic->commentPageCount();
/* Reset the count back to the real count */
$topic->posts = $realCount;
}
else
{
$this->recordCommentPageCount = 1;
}
}
catch ( Exception $e )
{
}
}
$this->recordCommentPageCount = parent::commentPageCount( $recache );
}
}
@@ -3846,7 +3842,7 @@ class Records extends Item implements
{
/* @var Fields $fieldClass */
$fieldClass = 'IPS\cms\Fields' . static::$customDatabaseId;
$photo->editable = $fieldClass::fixedFieldFormShow( 'record_image' );
$photo->editable = ( $this->canEdit() and $fieldClass::fixedFieldFormShow( 'record_image' ) );
}
return $photo;