Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -72,16 +72,21 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
}*/
|
||||
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_attachments', \IPS\Http\Url::internal( 'app=core&module=overview&controller=files' ) );
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'dashboard' ), 'fileTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'dashboard' ), 'fileTableRows' );
|
||||
$table->filters = array(
|
||||
'images' => "attach_is_image=1",
|
||||
'files' => "attach_is_image=0",
|
||||
);
|
||||
$table->include = array( 'attach_file', 'attach_filesize', 'attach_date', 'attach_member_id' );
|
||||
|
||||
$table->include = array( 'attach_id', 'attach_file', 'attach_filesize', 'attach_date', 'attach_member_id' );
|
||||
$table->rowClasses = array( 'attach_file' => array( 'ipsTable_wrap' ) );
|
||||
|
||||
if ( $table->filter !== 'images' )
|
||||
{
|
||||
$table->include[] = 'attach_hits';
|
||||
}
|
||||
$table->noSort = array( 'attach_type' );
|
||||
$table->noSort = array( 'attach_type', 'attach_id' );
|
||||
$table->quickSearch = 'attach_file';
|
||||
$table->parsers = array(
|
||||
'attach_file' => function( $val, $row ) use ( $table )
|
||||
@@ -94,7 +99,7 @@ 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'] )->makeSafeForAcp( FALSE );
|
||||
$val = htmlentities( $val, \IPS\HTMLENTITIES, 'UTF-8', FALSE );
|
||||
$val = htmlentities( $val, ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
return "<a href='{$url}' target='_blank'>{$val}</a>";
|
||||
}
|
||||
},
|
||||
@@ -133,7 +138,7 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<a href='" . \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=edit&id=' . $val ) . "'>" . htmlentities( \IPS\Member::load( $val )->name, \IPS\HTMLENTITIES, 'UTF-8', FALSE ) . '</a>';
|
||||
return "<a href='" . \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=edit&id=' . $val ) . "'>" . htmlentities( \IPS\Member::load( $val )->name, ENT_DISALLOWED, 'UTF-8', FALSE ) . '</a>';
|
||||
|
||||
}
|
||||
}
|
||||
@@ -168,7 +173,9 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
|
||||
return $buttons;
|
||||
};
|
||||
|
||||
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'dashboard/files.css', 'core', 'admin' ) );
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_files.js', 'core', 'admin' ) );
|
||||
\IPS\Output::i()->output = (string) $table;
|
||||
}
|
||||
|
||||
@@ -393,8 +400,7 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
\IPS\Task::queue( 'core', 'DeleteMovedFiles', array( 'delete' => true ), 5, array( 'delete' ) ); /* We use a key in the data array just to trigger the code that deletes duplicate tasks */
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( $values ) ), array( 'conf_key=?', 'upload_settings' ) );
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
\IPS\Settings::i()->changeValues( array( 'upload_settings' => json_encode( $values ) ) );
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
@@ -558,7 +564,7 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
$toggles = array();
|
||||
foreach ( new \DirectoryIterator( \IPS\ROOT_PATH . '/system/File' ) as $f )
|
||||
{
|
||||
if ( !$f->isDot() and mb_substr( $f, -4 ) === '.php' and $f != 'File.php' and $f != 'Iterator.php' )
|
||||
if ( !$f->isDot() and mb_substr( $f, -4 ) === '.php' and $f != 'File.php' and $f != 'Iterator.php' and $f != 'Exception.php' )
|
||||
{
|
||||
$key = mb_substr( $f, 0, -4 );
|
||||
|
||||
@@ -566,6 +572,12 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Hide FTP option from form unless it's already in use */
|
||||
if ( ( $key === 'Ftp' AND isset( $current['method'] ) AND $current['method'] !== 'Ftp' ) OR ( $key === 'Ftp' AND !isset( $current['method'] ) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$handlers[ $key ] = 'filehandler__' . $key;
|
||||
|
||||
@@ -713,8 +725,7 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( $settings ) ), array( 'conf_key=?', 'upload_settings' ) );
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
\IPS\Settings::i()->changeValues( array( 'upload_settings' => json_encode( $settings ) ) );
|
||||
|
||||
if ( $values['filestorage_move'] )
|
||||
{
|
||||
@@ -853,4 +864,37 @@ class _files extends \IPS\Dispatcher\Controller
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=overview&controller=files" ), 'orphaned_files_tasks_added' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Multimod
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function multimod()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'files_delete' );
|
||||
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
if( !isset( \IPS\Request::i()->multimod ) OR !is_array( \IPS\Request::i()->multimod ) OR !count( \IPS\Request::i()->multimod ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'nothing_mm_selected', '2C158/6', 403, '' );
|
||||
}
|
||||
|
||||
foreach ( \IPS\Db::i()->select( '*', 'core_attachments', \IPS\Db::i()->in( 'attach_id', array_keys( \IPS\Request::i()->multimod ) ) ) as $attachment )
|
||||
{
|
||||
\IPS\File::get( 'core_Attachment', $attachment['attach_location'] )->delete();
|
||||
|
||||
if( $attachment['attach_thumb_location'] )
|
||||
{
|
||||
\IPS\File::get( 'core_Attachment', $attachment['attach_thumb_location'] )->delete();
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__file_deleted', array( $attachment['attach_file'] => FALSE ) );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( 'core_attachments', \IPS\Db::i()->in( 'attach_id', array_keys( \IPS\Request::i()->multimod ) ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=overview&controller=files" ), 'deleted' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user