Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -94,6 +94,10 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
else
|
||||
{
|
||||
$url = \IPS\Http\Url::external( \IPS\Settings::i()->base_url . "applications/core/interface/file/attachment.php" )->setQueryString( 'id', $row['attach_id'] );
|
||||
if ( $row['attach_security_key'] )
|
||||
{
|
||||
$url = $url->setQueryString( 'key', $row['attach_security_key'] );
|
||||
}
|
||||
$val = htmlentities( $val, ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
return "<a href='{$url}' target='_blank' rel='noreferrer'>{$val}</a>";
|
||||
}
|
||||
@@ -303,12 +307,24 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$settings = json_decode( \IPS\Settings::i()->upload_settings, TRUE );
|
||||
|
||||
$configurations = array();
|
||||
$configurations = array();
|
||||
$cicDisabled = FALSE;
|
||||
|
||||
if( \IPS\CIC )
|
||||
{
|
||||
$cicDisabled = array();
|
||||
}
|
||||
|
||||
foreach ( \IPS\Db::i()->select( '*', 'core_file_storage' ) as $row )
|
||||
{
|
||||
$handlers = \IPS\File::storageHandlers( $row );
|
||||
$classname = $handlers[ $row['method'] ];
|
||||
$configurations[ $row['id'] ] = $classname::displayName( json_decode( $row['configuration'], TRUE ) );
|
||||
|
||||
if( $row['method'] == 'FileSystem' AND \IPS\CIC )
|
||||
{
|
||||
$cicDisabled[ $row['id'] ] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form;
|
||||
@@ -341,7 +357,14 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'filestorage__' . $name, (int) $value, TRUE, array( 'options' => $configurations, 'disabled' => $disabled, 'toggles' => $toggles ) ) );
|
||||
$handlerDisabled = $cicDisabled;
|
||||
|
||||
if( isset( $handlerDisabled[ $value ] ) )
|
||||
{
|
||||
unset( $handlerDisabled[ $value ] );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'filestorage__' . $name, (int) $value, TRUE, array( 'options' => $configurations, 'disabled' => $disabled ?: $handlerDisabled, 'toggles' => $toggles ) ) );
|
||||
|
||||
if ( $disabled )
|
||||
{
|
||||
@@ -353,6 +376,18 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
/* Block moves to filesystem on CIC */
|
||||
foreach ( $values as $k => $v )
|
||||
{
|
||||
if ( isset( $settings[ $k ] ) AND !\is_array( $settings[ $k ] ) )
|
||||
{
|
||||
if( $settings[ $k ] != $v AND $k != 'filestorage_move' AND \in_array( $v, $cicDisabled ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'file_storage_cic_filesystem', '3C158/7', 403, '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( isset( $values['filestorage_move'] ) AND $values['filestorage_move'] )
|
||||
{
|
||||
$rebuild = FALSE;
|
||||
@@ -376,7 +411,7 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
if ( $settings[ $k ] != $v and $k != 'filestorage__core_Theme' AND $k != 'filestorage_move' )
|
||||
{
|
||||
/* Do we need to move files at all? */
|
||||
$configurations = \IPS\File::getConfigurations();
|
||||
$configurations = \IPS\File::getStore();
|
||||
$exploded = explode( '_', $k );
|
||||
$classname = "IPS\\{$exploded[2]}\\extensions\\core\\FileStorage\\{$exploded[3]}";
|
||||
$extension = new $classname;
|
||||
@@ -434,11 +469,19 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_file_storage', \IPS\Http\Url::internal( "app=core&module=overview&controller=files&do=settings&tab=configurations" ) );
|
||||
$table->include = array( 'filestorage_method' );
|
||||
$table->noSort = array( 'filestorage_method' );
|
||||
$table->mainColumn = 'filestorage_method';
|
||||
$table->parsers = array( 'filestorage_method' => function( $val, $row )
|
||||
{
|
||||
$handlers = \IPS\File::storageHandlers( $row );
|
||||
$classname = $handlers[ $row['method'] ];
|
||||
return $classname::displayName( json_decode( $row['configuration'], TRUE ) );
|
||||
$title = $classname::displayName( json_decode( $row['configuration'], TRUE ) );
|
||||
|
||||
if( \IPS\CIC AND $row['method'] == 'FileSystem' )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'dashboard' )->filesystemNotCic( $title );
|
||||
}
|
||||
|
||||
return $title;
|
||||
} );
|
||||
|
||||
$table->rootButtons = array( 'add' => array(
|
||||
|
||||
Reference in new issue
Block a user