Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -90,6 +90,7 @@ class _Downloads extends Core
|
||||
'per_cycle' => 250,
|
||||
'dependencies' => $dependencies,
|
||||
'link_type' => 'downloads_files',
|
||||
'requires_rebuild' => TRUE
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -102,6 +103,7 @@ class _Downloads extends Core
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertDownloadsFiles' ),
|
||||
'link_type' => 'downloads_comments',
|
||||
'requires_rebuild' => TRUE
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -114,6 +116,7 @@ class _Downloads extends Core
|
||||
'per_cycle' => 1500,
|
||||
'dependencies' => array( 'convertDownloadsFiles' ),
|
||||
'link_type' => 'downloads_reviews',
|
||||
'requires_rebuild' => TRUE
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -178,6 +181,8 @@ class _Downloads extends Core
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$return = $this->software->extraMenuRows( $return );
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -202,7 +207,7 @@ class _Downloads extends Core
|
||||
switch( $k )
|
||||
{
|
||||
case 'convertDownloadsCategories':
|
||||
$return['convertDownloadsCategories'] = array( 'downloads_categories' => NULL );
|
||||
$return['convertDownloadsCategories'] = array( 'downloads_categories' => NULL, 'core_permission_index' => array( 'app=? AND perm_type=?', 'downloads', 'category' ) );
|
||||
break;
|
||||
|
||||
case 'convertDownloadsCfields':
|
||||
@@ -1010,13 +1015,11 @@ class _Downloads extends Core
|
||||
}
|
||||
|
||||
/* We need the file storage to copy the file rather than move it */
|
||||
\IPS\File\FileSystem::$converterCopy = TRUE;
|
||||
\IPS\File::$copyFiles = TRUE;
|
||||
|
||||
if ( $record['record_type'] == 'link' )
|
||||
{
|
||||
$record['record_location'] = $record['file_path'];
|
||||
unset( $record['file_path'] );
|
||||
|
||||
$record['record_size'] = 0;
|
||||
}
|
||||
else if ( $record['record_type'] == 'upload' )
|
||||
@@ -1034,7 +1037,7 @@ class _Downloads extends Core
|
||||
{
|
||||
$file = \IPS\File::create( 'downloads_Screenshots', $record['record_realname'], $record['file_data'], NULL, TRUE, $record['file_path'] );
|
||||
$record['record_location'] = (string) $file;
|
||||
$record['record_thumb'] = (string) $file->thumbnail( 'downloads_Files' );
|
||||
$record['record_thumb'] = (string) $file->thumbnail( 'downloads_Screenshots' );
|
||||
$record['record_size'] = $file->filesize();
|
||||
}
|
||||
}
|
||||
@@ -1050,8 +1053,8 @@ class _Downloads extends Core
|
||||
}
|
||||
|
||||
/* Revert file system to default functionality */
|
||||
\IPS\File\FileSystem::$converterCopy = FALSE;
|
||||
unset( $record['file_data'], $file );
|
||||
\IPS\File::$copyFiles = FALSE;
|
||||
unset( $record['file_data'], $file, $record['file_path'] );
|
||||
|
||||
if ( isset( $record['record_time'] ) )
|
||||
{
|
||||
@@ -1239,11 +1242,11 @@ class _Downloads extends Core
|
||||
$this->software->app->log( 'download_review_missing_ids', __METHOD__, \IPS\convert\App::LOG_WARNING );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( empty( $info['review_text'] ) )
|
||||
|
||||
/* We'll allow reviews to be posted without text, since they may just be a rating - we allow for this for upgrades from 3.x. */
|
||||
if ( !isset( $info['review_text'] ) )
|
||||
{
|
||||
$this->software->app->log( 'download_review_missing_content', __METHOD__, \IPS\convert\App::LOG_WARNING, $info['review_id'] );
|
||||
return FALSE;
|
||||
$info['review_text'] = '';
|
||||
}
|
||||
|
||||
if ( !isset( $info['review_rating'] ) OR $info['review_rating'] < 1 )
|
||||
@@ -1428,7 +1431,7 @@ class _Downloads extends Core
|
||||
* @param string|NULL $filedata Binary data for the file, or NULL.
|
||||
* @return integer|boolean The ID of the newly inserted attachment, or FALSE on failure.
|
||||
*/
|
||||
public function convertAttachment( $info=array(), $map=array(), $filepath=NULL, $filedata=NULL )
|
||||
public function convertAttachment( $info=array(), $map=array(), $filepath=NULL, $filedata=NULL, $thumbnailpath = NULL )
|
||||
{
|
||||
$map['location_key'] = 'downloads_Downloads';
|
||||
$map['id1_type'] = 'downloads_files';
|
||||
@@ -1449,7 +1452,7 @@ class _Downloads extends Core
|
||||
$map['id2_type'] = 'downloads_reviews';
|
||||
}
|
||||
|
||||
return parent::convertAttachment( $info, $map, $filepath, $filedata );
|
||||
return parent::convertAttachment( $info, $map, $filepath, $filedata, $thumbnailpath );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user