Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

@@ -341,6 +341,8 @@ class _submit extends \IPS\Dispatcher\Controller
\IPS\Api\Webhook::fire( 'galleryAlbum_create', $album, $album->webhookFilters() );
\IPS\Member::loggedIn()->achievementAction( 'core', 'NewContentItem', $album->asItem() );
return array( 'category' => $category, 'album' => $album, 'guest_email' => isset( \IPS\Request::i()->guest_email ) ? \IPS\Request::i()->guest_email : NULL );
}
@@ -276,7 +276,7 @@ class _view extends \IPS\Content\Controller
'height' => $dimensions['large'][1],
);
if( \count( $this->image->metadata ) )
if( \is_countable( $this->image->metadata ) AND \count( $this->image->metadata ) )
{
\IPS\Output::i()->jsonLd['gallery']['image']['exifData'] = array();
@@ -661,6 +661,28 @@ class _view extends \IPS\Content\Controller
}
}
/**
* Get the next image
*
* @return void
*/
protected function next()
{
$image = $this->image->nextItem() ? $this->image->nextItem() : $this->image->fetchFirstOrLast('first');
$this->redirectToUrl( $image );
}
/**
* Get the previous image
*
* @return void
*/
protected function previous()
{
$image = $this->image->prevItem() ? $this->image->prevItem() : $this->image->fetchFirstOrLast('last');
$this->redirectToUrl( $image );
}
/**
* Move
*
@@ -764,4 +786,36 @@ class _view extends \IPS\Content\Controller
$title = ( isset( \IPS\Request::i()->page ) and \IPS\Request::i()->page > 1 ) ? \IPS\Member::loggedIn()->language()->addToStack( 'title_with_page_number', FALSE, array( 'sprintf' => array( $this->image->mapped('title'), \intval( \IPS\Request::i()->page ) ) ) ) : $this->image->mapped('title');
\IPS\Output::i()->title = $container ? ( $title . ' - ' . $container->_title ) : $title;
}
/**
* Redirect to the URL or album/category on error
*
* @param $image
* @return void
*/
protected function redirectToUrl( $image ): void
{
if ( $image )
{
$url = $image->url();
if ( \IPS\Request::i()->url()->queryString )
{
foreach ( \IPS\Request::i()->url()->queryString as $k => $v )
{
if ( $k != 'do' )
{
$url = $url->setQueryString( $k, $v );
}
}
}
\IPS\Output::i()->redirect( $url );
}
else
{
/* Go to the album or category */
\IPS\Output::i()->redirect( $this->image->directContainer()->url() );
}
}
}