Version 5.0.0 beta 6

This commit is contained in:
Neo committed 2025-12-19 17:12:27 -08:00
1 parent 57d9db6ce2
commit fa2a720105
115 files changed
+1823 -1147

No files matched your search

+34 -9
View File
@@ -25,7 +25,6 @@ use IPS\cms\Records\Revisions;
use IPS\Content\Anonymous;
use IPS\Content\Assignable;
use IPS\Content\Comment;
use IPS\Content\ContentMenuLink;
use IPS\Content\Embeddable;
use IPS\Content\Filter;
use IPS\Content\Followable;
@@ -53,6 +52,7 @@ use IPS\Events\Event;
use IPS\File;
use IPS\forums\Topic;
use IPS\forums\Topic\Post;
use IPS\Helpers\CoverPhoto;
use IPS\Helpers\Form\Checkbox;
use IPS\Helpers\Form\CheckboxSet;
use IPS\Helpers\Form\Date;
@@ -60,7 +60,6 @@ use IPS\Helpers\Form\Text;
use IPS\Helpers\Form\TextArea;
use IPS\Helpers\Form\Upload;
use IPS\Helpers\Form\YesNo;
use IPS\Helpers\Menu;
use IPS\Helpers\Table\Content as TableHelper;
use IPS\Http\Url;
use IPS\Http\Url\Friendly;
@@ -73,7 +72,6 @@ use IPS\Output;
use IPS\Patterns\ActiveRecordIterator;
use IPS\Request;
use IPS\Settings;
use IPS\Text\Parser;
use IPS\Theme;
use LogicException;
use OutOfRangeException;
@@ -90,7 +88,6 @@ use function is_array;
use function is_int;
use function is_numeric;
use function is_string;
use function round;
use function strtolower;
use const IPS\ENFORCE_ACCESS;
@@ -737,7 +734,7 @@ class Records extends Item implements
{
if ( Settings::i()->edit_log == 2 )
{
$formElements['record_edit_reason'] = new Text( 'record_edit_reason', $item?->record_edit_reason, FALSE, array( 'maxLength' => 255 ) );
$formElements['record_edit_reason'] = new Text( 'record_edit_reason', $item->record_edit_reason, FALSE, array( 'maxLength' => 255 ) );
}
if ( Member::loggedIn()->group['g_append_edit'] )
{
@@ -1654,7 +1651,7 @@ class Records extends Item implements
}
}
}
else
elseif( !empty( $fieldValues[ $fieldName ] ) )
{
$obj = File::get( 'cms_Records', $fieldValues[ $fieldName ] );
if ( $obj->isImage() )
@@ -2021,6 +2018,12 @@ class Records extends Item implements
$this->record_last_comment_name = $member->name;
}
}
/* Did we change the title? Update the URL */
if( !$new and isset( $this->changed[ static::$databaseColumnMap['title'] ] ) and !isset( $this->changed['record_dynamic_furl'] ) )
{
$this->record_dynamic_furl = Friendly::seoTitle( $this->_title );
}
parent::save();
@@ -2804,8 +2807,12 @@ class Records extends Item implements
/* Store the real count so it is not accidentally written as the actual value */
$realCount = $topic->posts;
/* Compensate for the first post (which is actually the record) */
$topic->posts = ( $topic->posts - 1 ) > 0 ? $topic->posts - 1 : 0;
/* 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();
@@ -3844,7 +3851,25 @@ class Records extends Item implements
{
/* @var Fields $fieldClass */
$fieldClass = 'IPS\cms\Fields' . static::$customDatabaseId;
return $fieldClass::fixedFieldFormShow( 'record_image' );
return $fieldClass::fixedFieldFormShow( 'record_image', 'perm_view' );
}
/**
* Cover Photo
*
* @return mixed
*/
public function coverPhoto(): mixed
{
$photo = parent::coverPhoto();
if( $photo instanceof CoverPhoto )
{
/* @var Fields $fieldClass */
$fieldClass = 'IPS\cms\Fields' . static::$customDatabaseId;
$photo->editable = $fieldClass::fixedFieldFormShow( 'record_image' );
}
return $photo;
}
/**