Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -634,7 +634,10 @@ class _Image extends \IPS\Content\Item implements
|
||||
public static function searchEngineFiltering( &$filters, &$query )
|
||||
{
|
||||
/* Make sure our CSS is output */
|
||||
\IPS\gallery\Application::outputCss();
|
||||
if( \IPS\Dispatcher::hasInstance() )
|
||||
{
|
||||
\IPS\gallery\Application::outputCss();
|
||||
}
|
||||
|
||||
/* Loop through and see if we are also including albums */
|
||||
$includingAlbums = FALSE;
|
||||
@@ -1181,6 +1184,7 @@ class _Image extends \IPS\Content\Item implements
|
||||
/* 'template' => "...", // This is the javascript template for the submission form */
|
||||
/* This has to be converted from kB to mB */
|
||||
'maxFileSize' => \IPS\Member::loggedIn()->group['g_max_upload'] ? ( \IPS\Member::loggedIn()->group['g_max_upload'] / 1024 ) : NULL,
|
||||
'canBeModerated' => TRUE
|
||||
) );
|
||||
}
|
||||
else
|
||||
@@ -1193,6 +1197,7 @@ class _Image extends \IPS\Content\Item implements
|
||||
/* 'template' => "...", // This is the javascript template for the submission form */
|
||||
/* This has to be converted from kB to mB */
|
||||
'maxFileSize' => \IPS\Member::loggedIn()->group['g_max_upload'] ? ( \IPS\Member::loggedIn()->group['g_max_upload'] / 1024 ) : NULL,
|
||||
'canBeModerated' => TRUE
|
||||
) );
|
||||
}
|
||||
}
|
||||
@@ -1224,6 +1229,8 @@ class _Image extends \IPS\Content\Item implements
|
||||
parent::processForm( $values );
|
||||
|
||||
/* Set a few details */
|
||||
$oldContent = NULL;
|
||||
$sendFilterNotifications = FALSE;
|
||||
if ( isset( $values['image_description'] ) )
|
||||
{
|
||||
if ( !$this->_new )
|
||||
@@ -1231,11 +1238,6 @@ class _Image extends \IPS\Content\Item implements
|
||||
$oldContent = $this->description;
|
||||
}
|
||||
$this->description = $values['image_description'];
|
||||
$sendFilterNotifications = $this->checkProfanityFilters( FALSE, $this->_new );
|
||||
if ( !$this->_new AND $sendFilterNotifications === FALSE )
|
||||
{
|
||||
$this->sendAfterEditNotifications( $oldContent );
|
||||
}
|
||||
}
|
||||
if ( isset( $values['image_copyright'] ) )
|
||||
{
|
||||
@@ -1253,9 +1255,14 @@ class _Image extends \IPS\Content\Item implements
|
||||
}
|
||||
|
||||
/* Get the file... */
|
||||
$file = NULL;
|
||||
if( isset( $values['imageLocation'] ) AND $values['imageLocation'] )
|
||||
{
|
||||
$file = \IPS\File::get( 'gallery_Images', $values['imageLocation'] );
|
||||
if ( isset( $values['imageRequiresModeration'] ) )
|
||||
{
|
||||
$file->requiresModeration = $values['imageRequiresModeration'];
|
||||
}
|
||||
$this->original_file_name = (string) $file;
|
||||
|
||||
/* Get some details about the file */
|
||||
@@ -1322,6 +1329,38 @@ class _Image extends \IPS\Content\Item implements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check profanity filters */
|
||||
$filesForImageScanner = [];
|
||||
if ( ( isset( $values['imageLocation'] ) AND $values['imageLocation'] AND ( $values['imageLocation'] instanceof \IPS\File ) ) )
|
||||
{
|
||||
$filesForImageScanner[] = $values['imageLocation'];
|
||||
}
|
||||
elseif ( $file )
|
||||
{
|
||||
$filesForImageScanner[] = $file;
|
||||
}
|
||||
if ( $this->media and isset( $values['image_thumbnail'] ) and $values['image_thumbnail'] )
|
||||
{
|
||||
if ( $values['image_thumbnail'] instanceof \IPS\File )
|
||||
{
|
||||
$filesForImageScanner[] = $values['image_thumbnail'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$thumbnail = \IPS\File::get( 'gallery_Images', $values['image_thumbnail'] );
|
||||
if ( isset( $values['image_thumbnail_requires_moderation'] ) and $values['image_thumbnail_requires_moderation'] )
|
||||
{
|
||||
$thumbnail->requiresModeration = TRUE;
|
||||
}
|
||||
$filesForImageScanner[] = $thumbnail;
|
||||
}
|
||||
}
|
||||
$sendFilterNotifications = $this->checkProfanityFilters( FALSE, !$this->_new, NULL, NULL, NULL, NULL, $filesForImageScanner );
|
||||
if ( !$this->_new AND $sendFilterNotifications === FALSE )
|
||||
{
|
||||
$this->sendAfterEditNotifications( $oldContent );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1447,8 +1486,8 @@ class _Image extends \IPS\Content\Item implements
|
||||
$thumbnailDimensions = array();
|
||||
$watermarks = explode( ',', \IPS\Settings::i()->gallery_watermark_images );
|
||||
|
||||
/* Create the various thumbnails */
|
||||
$largeImage = \IPS\File::create( 'gallery_Images', 'large.' . $file->originalFilename, $this->createImageFile( $file, explode( 'x', \IPS\Settings::i()->gallery_large_dims ), FALSE, \in_array( 'large', $watermarks ) ), $file->container );
|
||||
/* Create the various thumbnails - For animated gifs use the original image for the large version */
|
||||
$largeImage = $file->isAnimatedImage() ? $file : \IPS\File::create( 'gallery_Images', 'large.' . $file->originalFilename, $this->createImageFile( $file, explode( 'x', \IPS\Settings::i()->gallery_large_dims ), FALSE, \in_array( 'large', $watermarks ) ), $file->container );
|
||||
$this->masked_file_name = (string) $largeImage;
|
||||
|
||||
$thumbnailDimensions['large'] = $largeImage->getImageDimensions();
|
||||
@@ -2039,7 +2078,7 @@ class _Image extends \IPS\Content\Item implements
|
||||
}
|
||||
}
|
||||
|
||||
return array( '( gallery_images.image_album_id IS NULL OR gallery_images.image_album_id IN(?) )', \IPS\Db::i()->select( 'album_id', 'gallery_albums', $subQuery ) );
|
||||
return array( '( gallery_images.image_album_id=0 OR gallery_images.image_album_id IN( ' . \IPS\Db::i()->select( 'album_id', 'gallery_albums', $subQuery )->returnFullQuery() . ' ) )' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2051,7 +2090,7 @@ class _Image extends \IPS\Content\Item implements
|
||||
* @param string|NULL $permissionKey A key which has a value in the permission map (either of the container or of this class) matching a column ID in core_permission_index or NULL to ignore permissions
|
||||
* @param mixed $includeHiddenItems Include hidden items? NULL to detect if currently logged in member has permission, -1 to return public content only, TRUE to return unapproved content and FALSE to only return unapproved content the viewing member submitted
|
||||
* @param int $queryFlags Select bitwise flags
|
||||
* @param \IPS\Member $member The member (NULL to use currently logged in member)
|
||||
* @param \IPS\Member|NULL $member The member (NULL to use currently logged in member)
|
||||
* @param bool $joinContainer If true, will join container data (set to TRUE if your $where clause depends on this data)
|
||||
* @param bool $joinComments If true, will join comment data (set to TRUE if your $where clause depends on this data)
|
||||
* @param bool $joinReviews If true, will join review data (set to TRUE if your $where clause depends on this data)
|
||||
@@ -2133,7 +2172,7 @@ class _Image extends \IPS\Content\Item implements
|
||||
*/
|
||||
public static function followWhere( &$joinContainer, &$joins )
|
||||
{
|
||||
return array_merge( parent::followWhere( $joinContainer, $joins ), array( static::getItemsWithPermissionWhere( array(), \IPS\Member::loggedIn(), $joins ) ) );
|
||||
return array_merge( parent::followWhere( $joinContainer, $joins ), static::getItemsWithPermissionWhere( array(), \IPS\Member::loggedIn(), $joins ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2343,7 +2382,7 @@ class _Image extends \IPS\Content\Item implements
|
||||
|
||||
$result[] = array( 'gallery_Images' => $this->masked_file_name );
|
||||
|
||||
return $result;
|
||||
return \array_slice( $result, 0, $limit );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2409,4 +2448,4 @@ class _Image extends \IPS\Content\Item implements
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user