Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,55 +11,62 @@
|
||||
namespace IPS\Helpers;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\File;
|
||||
use IPS\Output;
|
||||
use IPS\Request;
|
||||
use IPS\Theme;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cover Photo Helper
|
||||
*/
|
||||
class _CoverPhoto
|
||||
class CoverPhoto
|
||||
{
|
||||
/**
|
||||
* File
|
||||
*/
|
||||
public $file;
|
||||
public ?File $file = NULL;
|
||||
|
||||
/**
|
||||
* Offset
|
||||
*/
|
||||
public $offset = 0;
|
||||
public int $offset = 0;
|
||||
|
||||
/**
|
||||
* Editable
|
||||
*/
|
||||
public $editable = FALSE;
|
||||
public bool $editable = FALSE;
|
||||
|
||||
/**
|
||||
* Maximum file size
|
||||
*/
|
||||
public $maxSize = NULL;
|
||||
public ?int $maxSize = NULL;
|
||||
|
||||
/**
|
||||
* Overlay
|
||||
*/
|
||||
public $overlay;
|
||||
public ?string $overlay = null;
|
||||
|
||||
/**
|
||||
* Object
|
||||
*/
|
||||
public $object;
|
||||
public ?object $object;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\File|NULL $file The file
|
||||
* @param int $offset The offset
|
||||
* @param bool $editable User can edit?
|
||||
* @param File|NULL $file The file
|
||||
* @param int $offset The offset
|
||||
* @param bool $editable User can edit?
|
||||
*/
|
||||
public function __construct( \IPS\File $file = NULL, $offset = 0, $editable = FALSE )
|
||||
public function __construct( File $file = NULL, int $offset = 0, bool $editable=FALSE )
|
||||
{
|
||||
$this->file = $file;
|
||||
$this->offset = $offset;
|
||||
@@ -72,12 +79,12 @@ class _CoverPhoto
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if( !\IPS\Request::i()->isAjax() )
|
||||
if( !Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_core.js', 'core' ) );
|
||||
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front_core.js', 'core' ) );
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'core' )->coverPhoto( $this->object->url(), $this );
|
||||
return Theme::i()->getTemplate( 'global', 'core' )->coverPhoto( $this->object->url(), $this );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +92,7 @@ class _CoverPhoto
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
public function delete() : void
|
||||
{
|
||||
if ( $this->file )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user