Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -17,6 +17,7 @@ use IPS\Db;
|
||||
use IPS\Dispatcher;
|
||||
use IPS\Dispatcher\Controller;
|
||||
use IPS\File;
|
||||
use IPS\gallery\Image;
|
||||
use IPS\GeoLocation;
|
||||
use IPS\Helpers\Form;
|
||||
use IPS\Helpers\Form\CheckboxSet;
|
||||
@@ -126,10 +127,25 @@ class settings extends Controller
|
||||
|
||||
$form->addHeader( 'gallery_options' );
|
||||
$form->add( new YesNo( 'gallery_rss_enabled', SettingsClass::i()->gallery_rss_enabled ) );
|
||||
$form->add( new Radio( 'gallery_metadata', SettingsClass::i()->gallery_metadata, false, [
|
||||
'options' => [
|
||||
Image::IMAGE_METADATA_NONE => 'gallery_metadata_none',
|
||||
Image::IMAGE_METADATA_ALL => 'gallery_metadata_all',
|
||||
Image::IMAGE_METADATA_NOSENSITIVE => 'gallery_metadata_sensitive'
|
||||
],
|
||||
'descriptions' => [
|
||||
Image::IMAGE_METADATA_NOSENSITIVE => 'gallery_metadata_sensitive_desc'
|
||||
],
|
||||
'toggles' => [
|
||||
Image::IMAGE_METADATA_ALL => [ 'gallery_maps_default' ]
|
||||
]
|
||||
] ) );
|
||||
|
||||
Member::loggedIn()->language()->words['gallery_metadata_desc'] = Member::loggedIn()->language()->addToStack( SettingsClass::i()->image_suite == 'imagemagick' ? 'gallery_metadata_desc_imagick' : 'gallery_metadata_desc_gd' );
|
||||
|
||||
if( GeoLocation::enabled() )
|
||||
{
|
||||
$form->add( new YesNo( 'gallery_maps_default', SettingsClass::i()->gallery_maps_default ) );
|
||||
$form->add( new YesNo( 'gallery_maps_default', SettingsClass::i()->gallery_maps_default, id: 'gallery_maps_default' ) );
|
||||
}
|
||||
|
||||
$form->add( new YesNo( 'gallery_nsfw', SettingsClass::i()->gallery_nsfw ) );
|
||||
@@ -190,6 +206,7 @@ class settings extends Controller
|
||||
'gallery_recent_updated_albums_count' => $values['gallery_recent_updated_albums_count'],
|
||||
'gallery_show_new_images' => $values['gallery_show_new_images'],
|
||||
'gallery_new_images_count' => $values['gallery_new_images_count'],
|
||||
'gallery_metadata' => $values['gallery_metadata']
|
||||
) );
|
||||
|
||||
Session::i()->log( 'acplogs__gallery_settings' );
|
||||
|
||||
@@ -374,7 +374,7 @@ class browse extends Controller
|
||||
}
|
||||
|
||||
/* Data Layer Page Context */
|
||||
if ( Settings::i()->core_datalayer_enabled AND !Request::i()->isAjax() )
|
||||
if ( DataLayer::enabled() AND !Request::i()->isAjax() )
|
||||
{
|
||||
foreach ( $category->getDataLayerProperties() as $property => $value )
|
||||
{
|
||||
@@ -387,6 +387,7 @@ class browse extends Controller
|
||||
$category->updateViews();
|
||||
}
|
||||
|
||||
Output::i()->bodyAttributes['contentClass'] = Category::class;
|
||||
Output::i()->contextualSearchOptions[ Member::loggedIn()->language()->addToStack( 'search_contextual_item_categories' ) ] = array( 'type' => 'gallery_image', 'nodes' => $category->_id );
|
||||
Output::i()->output = Theme::i()->getTemplate( 'browse' )->category( $category, $albums, (string) $table );
|
||||
}
|
||||
@@ -523,6 +524,7 @@ class browse extends Controller
|
||||
$albumItem->updateViews();
|
||||
}
|
||||
|
||||
Output::i()->bodyAttributes['contentClass'] = Album::class;
|
||||
Output::i()->breadcrumb[] = array( NULL, $album->_title );
|
||||
Output::i()->output = Theme::i()->getTemplate( 'browse' )->album( $album, (string) $table, $commentsAndReviews );
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ use DomainException;
|
||||
use Exception;
|
||||
use IPS\Content\Controller;
|
||||
use IPS\Content\Item;
|
||||
use IPS\core\DataLayer;
|
||||
use IPS\core\FrontNavigation;
|
||||
use IPS\DateTime;
|
||||
use IPS\Db;
|
||||
@@ -189,7 +190,7 @@ class view extends Controller
|
||||
|
||||
if ( count( $tabs ) > 1 )
|
||||
{
|
||||
$commentsAndReviews = count( $tabs ) ? Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $tab, $activeTabContents, Request::i()->lightbox ? $this->image->url()->setQueryString( 'lightbox', 1 ) : $this->image->url(), 'tab', FALSE, FALSE, Request::i()->lightbox ? 'ipsTabs--small ipsTabs--stretch' : '' ) : NULL;
|
||||
$commentsAndReviews = count( $tabs ) ? Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $tab, $activeTabContents, Request::i()->lightbox ? $this->image->url()->setQueryString( 'lightbox', 1 ) : $this->image->url(), 'tab', FALSE, FALSE, Request::i()->lightbox ? 'ipsTabs--small ipsTabs--stretch' : '', forceURLUpdate: true ) : NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -343,19 +344,54 @@ class view extends Controller
|
||||
/* Display */
|
||||
if( Request::i()->isAjax() && isset( Request::i()->browse ) )
|
||||
{
|
||||
/* Set navigation and title */
|
||||
$this->_setBreadcrumbAndTitle( $this->image, FALSE );
|
||||
Output::i()->buildMetaTags();
|
||||
$return = array(
|
||||
'title' => htmlspecialchars( $this->image->mapped('title'), ENT_DISALLOWED | ENT_QUOTES, 'UTF-8', FALSE ),
|
||||
'title' => Output::i()->getTitle( Output::i()->title ),
|
||||
'breadcrumb_top' => Theme::i()->getTemplate( 'global', 'core' )->breadcrumb( "top" ),
|
||||
'breadcrumb_bottom' => Theme::i()->getTemplate( 'global', 'core' )->breadcrumb( "bottom" ),
|
||||
'breadcrumb_mobile' => Theme::i()->getTemplate( 'global', 'core' )->breadcrumb( "mobile" ),
|
||||
'breadcrumb_off_canvas' => Theme::i()->getTemplate( 'global', 'core' )->mobileFooterNav(),
|
||||
'image' => Theme::i()->getTemplate( 'view' )->imageFrame( $this->image ),
|
||||
'info' => Theme::i()->getTemplate( 'view' )->imageInfo( $this->image )
|
||||
'info' => Theme::i()->getTemplate( 'view' )->imageInfo( $this->image ),
|
||||
'url' => $this->image->url(),
|
||||
'id' => $this->image->id,
|
||||
'images_prev' => [],
|
||||
'images_next' => [],
|
||||
'image_link_current' => Theme::i()->getTemplate( 'view' )->imageCarouselLink( $this->image )
|
||||
);
|
||||
|
||||
/* Add the prev and next images to make sure the carousel stays updated */
|
||||
if ( $this->image->hasPreviousOrNext() )
|
||||
{
|
||||
$prev = array_reverse( array_slice( $this->image->fetchNextOrPreviousImages( 9, 'ASC' ), 0, 4 ) );
|
||||
$next = $this->image->fetchNextOrPreviousImages( 9, 'DESC' );
|
||||
$counter = 1;
|
||||
foreach ( $prev as $prevImage )
|
||||
{
|
||||
$return['images_prev'][] = [ 'id' => (int) $prevImage->id, 'content' => Theme::i()->getTemplate( 'view' )->imageCarouselLink( $prevImage ) ];
|
||||
$counter++;
|
||||
}
|
||||
|
||||
foreach ( $next as $nextImage )
|
||||
{
|
||||
$return['images_next'][] = [ 'id' => (int) $nextImage->id, 'content' => Theme::i()->getTemplate( 'view' )->imageCarouselLink( $nextImage ) ];
|
||||
if ( $counter >= 10 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( $this->image->directContainer()->allow_comments )
|
||||
{
|
||||
$return['comments'] = $commentsAndReviews;
|
||||
$return['comments'] = Theme::i()->getTemplate( 'view' )->imageComments( $this->image, $commentsAndReviews );
|
||||
}
|
||||
|
||||
/* Data Layer Properties */
|
||||
if ( Settings::i()->core_datalayer_enabled )
|
||||
if ( DataLayer::enabled() )
|
||||
{
|
||||
$return['dataLayer'] = $this->image->getDataLayerProperties();
|
||||
}
|
||||
@@ -439,6 +475,7 @@ class view extends Controller
|
||||
|
||||
Output::i()->sendHeader( "Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
Output::i()->sendHeader( "X-Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
Output::i()->sendHeader( "Cross-Origin-Opener-Policy: same-origin" );
|
||||
|
||||
if( $image !== NULL )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user