Version 5.0.0 beta 10

This commit is contained in:
Neo committed 2025-12-19 17:53:48 -08:00
1 parent 56979f8ee8
commit 264eeb97e0
325 files changed
+6442 -1849

No files matched your search

+26 -1
View File
@@ -13,13 +13,16 @@ namespace IPS\Helpers\CoverPhoto;
/* To prevent PHP errors (extending class does not exist) revealing path */
use Exception;
use IPS\Content;
use IPS\Dispatcher;
use IPS\Dispatcher\Controller as DispatcherController;
use IPS\Helpers\CoverPhoto;
use IPS\Helpers\Form;
use IPS\Helpers\Form\Upload;
use IPS\Http\Url;
use IPS\Node\Model;
use IPS\Output;
use IPS\Output\UI\UiExtension;
use IPS\Request;
use IPS\Session;
use IPS\Theme;
@@ -59,7 +62,16 @@ abstract class Controller extends DispatcherController
$photo->delete();
}
catch ( Exception $e ) { }
$this->_coverPhotoSet( new CoverPhoto( $values['cover_photo'], 0 ), 'new' );
$coverPhoto = new CoverPhoto( $values['cover_photo'], 0 );
$this->_coverPhotoSet( $coverPhoto, 'new' );
/* Call any UI Extensions that might be linked to this object */
if( $photo->object instanceof Content or $photo->object instanceof Model )
{
UiExtension::i()->run( $photo->object, 'formPostSave', [ [ 'cover_photo' => $coverPhoto ] ] );
}
Output::i()->redirect( $this->_coverPhotoReturnUrl()->setQueryString( array( '_position' => 1 ) ) );
}
@@ -94,6 +106,13 @@ abstract class Controller extends DispatcherController
catch ( Exception $e ) { }
$this->_coverPhotoSet( new CoverPhoto( NULL, 0 ), 'remove' );
/* Call any UI Extensions that might be linked to this object */
if( $photo->object instanceof Content or $photo->object instanceof Model )
{
UiExtension::i()->run( $photo->object, 'formPostSave', [ [ 'cover_photo' => null, 'cover_photo_offset' => 0 ] ] );
}
if ( Request::i()->isAjax() )
{
Output::i()->json( 'OK' );
@@ -120,6 +139,12 @@ abstract class Controller extends DispatcherController
$photo->offset = Request::i()->offset;
$this->_coverPhotoSet( $photo, 'reposition' );
/* Call any UI Extensions that might be linked to this object */
if( $photo->object instanceof Content or $photo->object instanceof Model )
{
UiExtension::i()->run( $photo->object, 'formPostSave', [ [ 'cover_photo_offset' => $photo->offset ] ] );
}
if ( Request::i()->isAjax() )
{