Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -252,7 +252,7 @@ class files extends Controller
|
||||
catch ( OutOfRangeException $e ){ }
|
||||
}
|
||||
|
||||
if ( isset( $loadedExtensions[ $map['location_key'] ] ) AND method_exists( $loadedExtensions[ $map['location_key'] ], 'attachmentLookup' ) )
|
||||
if ( isset( $loadedExtensions[ $map['location_key'] ] ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -261,7 +261,7 @@ class files extends Controller
|
||||
$locations[] = $url;
|
||||
}
|
||||
}
|
||||
catch ( LogicException $e ) { }
|
||||
catch ( LogicException | OutOfRangeException $e ) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,6 +389,11 @@ class files extends Controller
|
||||
{
|
||||
$cicDisabled[ $row['id'] ] = $row['id'];
|
||||
}
|
||||
|
||||
if ( $row['method'] == 'Amazon' AND CIC AND json_decode( $row['configuration'], TRUE )['bucket'] == 'ips-cic-filestore' )
|
||||
{
|
||||
$cicDisabled[ $row['id'] ] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$form = new Form;
|
||||
@@ -477,7 +482,15 @@ class files extends Controller
|
||||
/* Do we need to move files at all? */
|
||||
$configurations = File::getStore();
|
||||
$exploded = explode( '_', $k );
|
||||
$classname = "IPS\\{$exploded[2]}\\extensions\\core\\FileStorage\\{$exploded[3]}";
|
||||
try
|
||||
{
|
||||
$classname = Application::getExtensionClass( $exploded[2], 'FileStorage', $exploded[3] );
|
||||
}
|
||||
catch( OutOfRangeException )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$extension = new $classname;
|
||||
$currentClass = File::getClass( intval( $settings[ $k ] ) );
|
||||
$newClass = File::getClass( intval( $v ) );
|
||||
@@ -561,6 +574,18 @@ class files extends Controller
|
||||
$settings = json_decode( Settings::i()->upload_settings, TRUE );
|
||||
$table->rowButtons = function( $row ) use ( $settings )
|
||||
{
|
||||
$config = json_decode( $row['configuration'], true );
|
||||
if( CIC AND ( ( $row['method'] == 'Amazon' AND $config['bucket'] == 'ips-cic-filestore' ) OR $row['method'] == 'Cloud' ) )
|
||||
{
|
||||
return array(
|
||||
'log' => array(
|
||||
'icon' => 'search',
|
||||
'title' => 'file_config_log_title',
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=overview&controller=files&do=configurationLog&id={$row['id']}" )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$buttons = array(
|
||||
'log' => array(
|
||||
'icon' => 'search',
|
||||
@@ -829,19 +854,16 @@ class files extends Controller
|
||||
$exploded = explode( '_', $k );
|
||||
try
|
||||
{
|
||||
$classname = "IPS\\{$exploded[2]}\\extensions\\core\\FileStorage\\{$exploded[3]}";
|
||||
$classname = Application::getExtensionClass( $exploded[2], 'FileStorage', $exploded[3] );
|
||||
|
||||
if( Application::appIsEnabled( $exploded[2] ) AND class_exists( $classname ) )
|
||||
$extension = new $classname;
|
||||
$count = $extension->count();
|
||||
|
||||
/* Don't bother with this task if there is nothing to move */
|
||||
if( $count > 0 )
|
||||
{
|
||||
$extension = new $classname;
|
||||
$count = $extension->count();
|
||||
|
||||
/* Don't bother with this task if there is nothing to move */
|
||||
if( $count > 0 )
|
||||
{
|
||||
$totalCount += $count;
|
||||
Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => $k, 'oldConfiguration' => $v, 'newConfiguration' => $newStorageId, 'count' => $count ), 2 );
|
||||
}
|
||||
$totalCount += $count;
|
||||
Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => $k, 'oldConfiguration' => $v, 'newConfiguration' => $newStorageId, 'count' => $count ), 2 );
|
||||
}
|
||||
|
||||
$settings[ $k ] = $newStorageId;
|
||||
@@ -877,7 +899,7 @@ class files extends Controller
|
||||
$cicConfigurations = 0;
|
||||
if( CIC )
|
||||
{
|
||||
$cicConfigurations = (int) Db::i()->select( 'count(*)', 'core_file_storage', array( "method=? AND configuration LIKE CONCAT( '%', ?, '%' )", 'Amazon', 'ips-cic-filestore' ) )->first();
|
||||
$cicConfigurations = (int) Db::i()->select( 'count(*)', 'core_file_storage', array( "method=?", 'Cloud' ) )->first();
|
||||
}
|
||||
if( $totalConfigurations - $cicConfigurations > 0 )
|
||||
{
|
||||
@@ -890,6 +912,11 @@ class files extends Controller
|
||||
$toggles = array();
|
||||
foreach ( File::storageHandlers( NULL ) as $key => $class )
|
||||
{
|
||||
if ( CIC AND $key == 'Cloud' AND !\IPS\Member::loggedIn()->members_bitoptions['is_support_account'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$handlers[ $key ] = 'filehandler__' . $key;
|
||||
foreach ( $class::settings() as $k => $v )
|
||||
{
|
||||
@@ -916,7 +943,7 @@ class files extends Controller
|
||||
|
||||
/* Build form */
|
||||
$form = new Form;
|
||||
$form->add( new Radio( 'filestorage_method', ( CIC ? 'Amazon' : 'FileSystem' ), TRUE, array( 'options' => $handlers, 'toggles' => $toggles ) ) );
|
||||
$form->add( new Radio( 'filestorage_method', ( CIC ? 'Cloud' : 'FileSystem' ), TRUE, array( 'options' => $handlers, 'toggles' => $toggles ) ) );
|
||||
foreach ( $handlerSettings as $handlerKey => $settings )
|
||||
{
|
||||
foreach ( $settings as $setting )
|
||||
|
||||
Reference in new issue
Block a user