Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+29 -11
View File
@@ -21,7 +21,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
* Cover Photo Controller
*/
abstract class _Controller extends \IPS\Dispatcher\Controller
{
{
/**
* Upload Cover Photo
*
@@ -46,16 +46,18 @@ abstract class _Controller extends \IPS\Dispatcher\Controller
}
catch ( \Exception $e ) { }
$returnURL = ( isset( $_SERVER['HTTP_REFERER'] ) AND $_SERVER['HTTP_REFERER'] ) ? \IPS\Http\Url::createFromString( $_SERVER['HTTP_REFERER'] ) : \IPS\Request::i()->url()->stripQueryString( 'do' );
if ( !( $returnURL instanceof \IPS\Http\Url\Internal ) )
{
$returnURL = \IPS\Request::i()->url()->stripQueryString( 'do' );
}
$this->_coverPhotoSet( new \IPS\Helpers\CoverPhoto( $values['cover_photo'], 0 ) );
\IPS\Output::i()->redirect( $returnURL->setQueryString( array( '_position' => 1 ) ) );
$this->_coverPhotoSet( new \IPS\Helpers\CoverPhoto( $values['cover_photo'], 0 ), 'new' );
\IPS\Output::i()->redirect( $this->_coverPhotoReturnUrl()->setQueryString( array( '_position' => 1 ) ) );
}
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
if ( \IPS\Dispatcher::hasInstance() and \IPS\Dispatcher::i()->controllerLocation == 'admin' )
{
\IPS\Output::i()->output = $form;
}
else
{
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
}
}
/**
@@ -78,7 +80,7 @@ abstract class _Controller extends \IPS\Dispatcher\Controller
}
catch ( \Exception $e ) { }
$this->_coverPhotoSet( new \IPS\Helpers\CoverPhoto( NULL, 0 ) );
$this->_coverPhotoSet( new \IPS\Helpers\CoverPhoto( NULL, 0 ), 'remove' );
if ( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->json( 'OK' );
@@ -104,7 +106,7 @@ abstract class _Controller extends \IPS\Dispatcher\Controller
}
$photo->offset = \IPS\Request::i()->offset;
$this->_coverPhotoSet( $photo );
$this->_coverPhotoSet( $photo, 'reposition' );
if ( \IPS\Request::i()->isAjax() )
{
@@ -127,6 +129,7 @@ abstract class _Controller extends \IPS\Dispatcher\Controller
* Set Cover Photo
*
* @param \IPS\Helpers\CoverPhoto $photo New Photo
* @param string $type 'new', 'remove', 'reposition'
* @return void
*/
abstract protected function _coverPhotoSet( \IPS\Helpers\CoverPhoto $photo );
@@ -137,4 +140,19 @@ abstract class _Controller extends \IPS\Dispatcher\Controller
* @return \IPS\Helpers\CoverPhoto
*/
abstract protected function _coverPhotoGet();
/**
* Get URL to return to after editing cover photo
*
* @return \IPS\Http\Url
*/
protected function _coverPhotoReturnUrl()
{
$returnURL = ( isset( $_SERVER['HTTP_REFERER'] ) AND $_SERVER['HTTP_REFERER'] ) ? \IPS\Http\Url::createFromString( $_SERVER['HTTP_REFERER'] ) : \IPS\Request::i()->url()->stripQueryString( 'do' );
if ( !( $returnURL instanceof \IPS\Http\Url\Internal ) )
{
$returnURL = \IPS\Request::i()->url()->stripQueryString( 'do' );
}
return $returnURL;
}
}