Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+31 -6
View File
@@ -688,10 +688,10 @@ class _File extends \IPS\Content\Item implements
public function contentImages( $limit = NULL, $ignorePermissions = FALSE )
{
$images = parent::contentImages( $limit, $ignorePermissions ) ?: array();
$count = 0;
$count = \count( $images );
foreach( $this->screenshots( 0, FALSE ) as $image )
{
if ( $count == $limit )
if ( $count >= $limit )
{
break;
}
@@ -700,7 +700,7 @@ class _File extends \IPS\Content\Item implements
$count++;
}
return \count( $images ) ? $images : NULL;
return \count( $images ) ? \array_slice( $images, 0, $limit ) : NULL;
}
/**
@@ -1655,8 +1655,33 @@ class _File extends \IPS\Content\Item implements
}
$this->desc = $values['file_desc'];
$sendFilterNotifications = $this->checkProfanityFilters( FALSE, $new );
$imageUploads = isset( $values['files'] ) ? $values['files'] : [];
$editorLookups = $new ? [ ( isset( $values['_bulkKey'] ) ? $values['_bulkKey'] : '' ) . 'downloads-new-file'] : [ [ $this->id, NULL, 'desc' ] ];
if ( isset( $values['screenshots'] ) and $values['screenshots'] )
{
$imageUploads = array_merge( $imageUploads, $values['screenshots'] );
}
foreach ( $this->container()->cfields as $field )
{
$helper = $field->buildHelper( NULL, NULL, $new ? NULL : $this );
if ( $helper instanceof \IPS\Helpers\Form\Upload )
{
if ( \is_array( $values["downloads_field_{$field->id}"] ) )
{
$imageUploads = array_merge( $imageUploads, $values["downloads_field_{$field->id}"] );
}
elseif ( $values["downloads_field_{$field->id}"] )
{
$imageUploads[] = $values["downloads_field_{$field->id}"];
}
}
elseif ( $helper instanceof \IPS\Helpers\Form\Editor )
{
$editorLookups[] = $new ? md5( 'IPS\downloads\Field-' . ( isset( $values['_bulkKey'] ) ? $values['_bulkKey'] : '' ) . $field->id . '-new' ) : [ $this->id, $field->id, 'fields' ];
}
}
$sendFilterNotifications = $this->checkProfanityFilters( FALSE, !$new, NULL, NULL, 'downloads_Downloads', $editorLookups, $imageUploads );
if ( !$new AND $sendFilterNotifications === FALSE )
{
$this->sendAfterEditNotifications( $oldContent );
@@ -2002,7 +2027,7 @@ class _File extends \IPS\Content\Item implements
'b_filetitle' => $this->name,
'b_filedesc' => $this->desc,
'b_hidden' => FALSE,
'b_backup' => $this->updated,
'b_backup' => $this->published,
'b_updated' => time(),
'b_records' => implode( ',', iterator_to_array( \IPS\Db::i()->select( 'record_id', 'downloads_files_records', array( 'record_file_id=? AND record_backup=0 AND record_hidden=0', $this->id ) ) ) ),
'b_version' => $this->version,