Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+12 -8
View File
@@ -12,7 +12,7 @@
namespace IPS\gallery\Image;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -32,6 +32,7 @@ class _Table extends \IPS\Helpers\Table\Content
* @param \IPS\Node\Model|NULL $container The container
* @param bool|null $includeHidden Flag to pass to getItemsWithPermission() method for $includeHiddenContent, defaults to NULL
* @param string|NULL $permCheck Permission key to check
* @param bool $honorPinned Honor pinned status (show pinned items first)
* @return void
*/
public function __construct( $class, \IPS\Http\Url $baseUrl, $where=NULL, \IPS\Node\Model $container=NULL, $includeHidden=\IPS\Content\Hideable::FILTER_AUTOMATIC, $permCheck='view', $honorPinned=TRUE )
@@ -69,10 +70,13 @@ class _Table extends \IPS\Helpers\Table\Content
* @param \IPS\Node\Model $currentContainer Current image container
* @param string $class Class to use
* @param array $extraAlbumOptions Additional options to use for the album helper (e.g. to force owner)
* @param \IPS\Member|NULL $member Member to check, or NULL for currently logged in member.
* @return \IPS\Helpers\Form
*/
static public function buildMoveForm( $currentContainer, $class, $extraAlbumOptions=array() )
static public function buildMoveForm( $currentContainer, $class, $extraAlbumOptions=array(), $member=NULL )
{
$member = $member ?: \IPS\Member::loggedIn();
$form = new \IPS\Helpers\Form( 'form', 'move' );
$form->class = 'ipsForm_vertical';
if ( \IPS\gallery\Category::canOnAny('add') and \IPS\gallery\Album::canOnAny('add') )
@@ -107,7 +111,7 @@ class _Table extends \IPS\Helpers\Table\Content
$form->add( new \IPS\Helpers\Form\Node( 'move_to_category', NULL, NULL, array(
'clubs' => true,
'class' => 'IPS\\gallery\\Category',
'permissionCheck' => function( $node ) use ( $currentContainer, $class )
'permissionCheck' => function( $node ) use ( $currentContainer, $class, $member )
{
/* If the image is in the same category already, we can't move it there */
if( $currentContainer instanceof \IPS\gallery\Category and $currentContainer->id == $node->id )
@@ -133,7 +137,7 @@ class _Table extends \IPS\Helpers\Table\Content
catch( \OutOfBoundsException $e ) { }
/* Can we add in this category? */
if ( $node->can( 'add' ) )
if ( $node->can( 'add', $member ) )
{
return true;
}
@@ -149,7 +153,7 @@ class _Table extends \IPS\Helpers\Table\Content
$form->add( new \IPS\Helpers\Form\Node( 'move_to_album', NULL, NULL, array_merge( array(
'class' => 'IPS\\gallery\\Album',
'permissionCheck' => function( $node ) use ( $currentContainer )
'permissionCheck' => function( $node ) use ( $currentContainer, $member )
{
/* If the image is in the same album already, we can't move it there */
if( $currentContainer instanceof \IPS\gallery\Album and $currentContainer->id == $node->id )
@@ -158,7 +162,7 @@ class _Table extends \IPS\Helpers\Table\Content
}
/* Do we have permission to add? */
if( !$node->can( 'add' ) )
if( !$node->can( 'add', $member ) )
{
return false;
}
@@ -226,7 +230,7 @@ class _Table extends \IPS\Helpers\Table\Content
return $params;
}
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
\IPS\Output::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'forms', 'core' ), 'popupTemplate' ) );
if ( \IPS\Request::i()->isAjax() )
{
@@ -234,7 +238,7 @@ class _Table extends \IPS\Helpers\Table\Content
}
else
{
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( \IPS\Output::i()->title, \IPS\Output::i()->output, array( 'app' => \IPS\Dispatcher::i()->application->directory, 'module' => \IPS\Dispatcher::i()->module->key, 'controller' => \IPS\Dispatcher::i()->controller ) ), 200, 'text/html', \IPS\Output::i()->httpHeaders );
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( \IPS\Output::i()->title, \IPS\Output::i()->output, array( 'app' => \IPS\Dispatcher::i()->application->directory, 'module' => \IPS\Dispatcher::i()->module->key, 'controller' => \IPS\Dispatcher::i()->controller ) ), 200, 'text/html' );
}
return;
}