Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -23,16 +23,95 @@ class _Application extends \IPS\Application
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
/* If the viewing member cannot view the board (ex: guests must login first), then send a 404 Not Found header here, before the Login page shows in the dispatcher */
|
||||
if ( \IPS\Dispatcher::hasInstance() AND \IPS\Dispatcher::i()->controllerLocation === 'front')
|
||||
/* Handle RSS requests */
|
||||
if ( \IPS\Request::i()->module == 'gallery' and \IPS\Request::i()->controller == 'browse' and \IPS\Request::i()->do == 'rss' )
|
||||
{
|
||||
if ( !\IPS\Member::loggedIn()->group['g_view_board'] and ( \IPS\Request::i()->module == 'gallery' and \IPS\Request::i()->controller == 'browse' and \IPS\Request::i()->do == 'rss' )
|
||||
or ( \IPS\Member::loggedIn()->members_bitoptions['remove_gallery_access'] )
|
||||
)
|
||||
$member = NULL;
|
||||
if( \IPS\Request::i()->member AND \IPS\Request::i()->key )
|
||||
{
|
||||
$member = \IPS\Member::load( \IPS\Request::i()->member );
|
||||
if( !\IPS\Login::compareHashes( md5( ( $member->members_pass_hash ?: $member->email ) . $member->members_pass_salt ), (string) \IPS\Request::i()->key ) )
|
||||
{
|
||||
$member = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
$this->sendGalleryRss( $member ?? new \IPS\Member );
|
||||
|
||||
if( !\IPS\Member::loggedIn()->group['g_view_board'] )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G218/1', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
if( \IPS\Member::loggedIn()->members_bitoptions['remove_gallery_access'] )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G218/1', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the gallery RSS feed for the indicated member
|
||||
*
|
||||
* @param \IPS\Member $member Member
|
||||
* @return void
|
||||
* @note We use a template so that we can embed image directly into feed while still allowing it to be customized
|
||||
*/
|
||||
protected function sendGalleryRss( $member )
|
||||
{
|
||||
if( !\IPS\Settings::i()->gallery_rss_enabled )
|
||||
{
|
||||
\IPS\Output::i()->error( 'gallery_rss_offline', '2G189/3', 403, 'gallery_rss_offline_admin' );
|
||||
}
|
||||
|
||||
$where = array();
|
||||
|
||||
if( isset( \IPS\Request::i()->category ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$category = \IPS\gallery\Category::load( \IPS\Request::i()->category );
|
||||
|
||||
if( !$category->can( 'read', $member ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
|
||||
$where[] = array( 'image_category_id=?', $category->id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/8', 404, '' );
|
||||
}
|
||||
}
|
||||
else if ( isset( \IPS\Request::i()->album ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$album = \IPS\gallery\Album::load( \IPS\Request::i()->album );
|
||||
|
||||
if( !$album->can( 'read', $member ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
|
||||
$where[] = array( 'image_album_id=?', $album->id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/9', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
$document = \IPS\Xml\Rss::newDocument( isset( $category ) ? $category->url() : ( isset( $album ) ? $album->url() : \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ) ), $member->language()->get('gallery_rss_title'), $member->language()->get('gallery_rss_title') );
|
||||
|
||||
foreach ( \IPS\gallery\Image::getItemsWithPermission( $where, NULL, 10, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, $member ) as $image )
|
||||
{
|
||||
$document->addItem( $image->caption, $image->url(), \IPS\Theme::i()->getTemplate( 'view' )->rssContent( $image ), \IPS\DateTime::ts( $image->updated ), $image->id );
|
||||
}
|
||||
|
||||
/* @note application/rss+xml is not a registered IANA mime-type so we need to stick with text/xml for RSS */
|
||||
\IPS\Output::i()->sendOutput( $document->asXML(), 200, 'text/xml', array(), TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +218,7 @@ class _Application extends \IPS\Application
|
||||
*/
|
||||
public static function outputCss()
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'gallery.css', 'gallery' ) );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'gallery.css', 'gallery' ), \IPS\Theme::i()->css( 'global.css', 'gallery' ) );
|
||||
if ( \IPS\Theme::i()->settings['responsive'] )
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'gallery_responsive.css', 'gallery', 'front' ) );
|
||||
@@ -156,4 +235,17 @@ class _Application extends \IPS\Application
|
||||
/* Apps can overload this */
|
||||
return array( 'gallery_watermark_path' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of specific links to add to the sitemap
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sitemapLinks()
|
||||
{
|
||||
return array(
|
||||
\IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=categories', 'front', 'gallery_categories' ),
|
||||
\IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: Image query
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 23 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL\Queries;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Image query for GraphQL API
|
||||
*/
|
||||
class _Image
|
||||
{
|
||||
/*
|
||||
* @brief Query description
|
||||
*/
|
||||
public static $description = "Returns a gallery image";
|
||||
|
||||
/*
|
||||
* Query arguments
|
||||
*/
|
||||
public function args()
|
||||
{
|
||||
return array(
|
||||
'id' => TypeRegistry::nonNull( TypeRegistry::id() )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the query return type
|
||||
*/
|
||||
public function type()
|
||||
{
|
||||
return \IPS\gallery\api\GraphQL\TypeRegistry::image();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves this query
|
||||
*
|
||||
* @param mixed Value passed into this resolver
|
||||
* @param array Arguments
|
||||
* @param array Context values
|
||||
* @return \IPS\gallery\Image
|
||||
*/
|
||||
public function resolve($val, $args, $context, $info)
|
||||
{
|
||||
try
|
||||
{
|
||||
$topic = \IPS\gallery\Image::loadAndCheckPerms( $args['id'] );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'NO_IMAGE', '1F294/2', 400 );
|
||||
}
|
||||
|
||||
if( !$topic->can('read') )
|
||||
{
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'INVALID_ID', '2F294/9', 403 );
|
||||
}
|
||||
|
||||
return $topic;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: Gallery queries
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 23 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\Types;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forums queries for GraphQL API
|
||||
*/
|
||||
abstract class _Query
|
||||
{
|
||||
/**
|
||||
* Get the supported query types in this app
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function queries()
|
||||
{
|
||||
return [
|
||||
'image' => new \IPS\gallery\api\GraphQL\Queries\Image(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: Types registry
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 23 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\Types;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gallery type registry. GraphQL requires exactly one instance of each type,
|
||||
* so we'll generate singletons here.
|
||||
* @todo automate this somehow?
|
||||
*/
|
||||
class _TypeRegistry
|
||||
{
|
||||
protected static $album;
|
||||
protected static $albumComment;
|
||||
protected static $albumItem;
|
||||
protected static $image;
|
||||
protected static $imageComment;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Defined to suppress static warnings
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ImageType
|
||||
*/
|
||||
public static function album()
|
||||
{
|
||||
return self::$album ?: (self::$album = new \IPS\gallery\api\GraphQL\Types\AlbumType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AlbumCommentType
|
||||
*/
|
||||
public static function albumComment()
|
||||
{
|
||||
return self::$albumComment ?: (self::$albumComment = new \IPS\gallery\api\GraphQL\Types\AlbumCommentType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AlbumCommentType
|
||||
*/
|
||||
public static function albumItem()
|
||||
{
|
||||
return self::$albumItem ?: (self::$albumItem = new \IPS\gallery\api\GraphQL\Types\AlbumItemType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ImageType
|
||||
*/
|
||||
public static function image()
|
||||
{
|
||||
return self::$image ?: (self::$image = new \IPS\gallery\api\GraphQL\Types\ImageType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ImageCommentType
|
||||
*/
|
||||
public static function imageComment()
|
||||
{
|
||||
return self::$imageComment ?: (self::$imageComment = new \IPS\gallery\api\GraphQL\Types\ImageCommentType());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: AlbumComment Type
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 23 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL\Types;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* AlbumCommentType for GraphQL API
|
||||
*/
|
||||
class _AlbumCommentType extends \IPS\Content\Api\GraphQL\CommentType
|
||||
{
|
||||
/*
|
||||
* @brief The item classname we use for this type
|
||||
*/
|
||||
protected static $commentClass = '\IPS\gallery\Album\Comment';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type name
|
||||
*/
|
||||
protected static $typeName = 'gallery_AlbumComment';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type description
|
||||
*/
|
||||
protected static $typeDescription = 'An album comment';
|
||||
|
||||
/**
|
||||
* Get the item type that goes with this item type
|
||||
*
|
||||
* @return ObjectType
|
||||
*/
|
||||
public static function getItemType()
|
||||
{
|
||||
return \IPS\gallery\api\GraphQL\TypeRegistry::album();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the fields available in this type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fields()
|
||||
{
|
||||
$defaultFields = parent::fields();
|
||||
return $defaultFields;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: Album Item Type
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 24 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL\Types;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* AlbumItemType for GraphQL API
|
||||
*/
|
||||
class _AlbumItemType extends \IPS\Content\Api\GraphQL\ItemType
|
||||
{
|
||||
/*
|
||||
* @brief The item classname we use for this type
|
||||
*/
|
||||
protected static $itemClass = '\IPS\gallery\Album\Item';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type name
|
||||
*/
|
||||
protected static $typeName = 'gallery_AlbumItem';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type description
|
||||
*/
|
||||
protected static $typeDescription = 'An album';
|
||||
|
||||
/*
|
||||
* @brief Follow data passed in to FollowType resolver
|
||||
*/
|
||||
protected static $followData = array('app' => 'gallery', 'area' => 'album');
|
||||
|
||||
/**
|
||||
* Return the fields available in this type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fields()
|
||||
{
|
||||
// Extend our fields with image-specific stuff
|
||||
$defaultFields = parent::fields();
|
||||
|
||||
// Remove duplicated fields
|
||||
unset( $defaultFields['views'] );
|
||||
unset( $defaultFields['poll'] );
|
||||
unset( $defaultFields['hasPoll'] );
|
||||
|
||||
return $defaultFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the comment type that goes with this item type
|
||||
*
|
||||
* @return ObjectType
|
||||
*/
|
||||
protected static function getCommentType()
|
||||
{
|
||||
return \IPS\gallery\api\GraphQL\TypeRegistry::albumComment();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: Album Type
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 24 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL\Types;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* AlbumType for GraphQL API
|
||||
*/
|
||||
class _AlbumType extends \IPS\Node\Api\GraphQL\NodeType
|
||||
{
|
||||
/*
|
||||
* @brief The item classname we use for this type
|
||||
*/
|
||||
protected static $nodeClass = '\IPS\gallery\Album';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type name
|
||||
*/
|
||||
protected static $typeName = 'gallery_Album';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type description
|
||||
*/
|
||||
protected static $typeDescription = 'An album';
|
||||
|
||||
/*
|
||||
* @brief Follow data passed in to FollowType resolver
|
||||
*/
|
||||
protected static $followData = array('app' => 'gallery', 'area' => 'album');
|
||||
|
||||
/**
|
||||
* Return the fields available in this type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fields()
|
||||
{
|
||||
$defaultFields = parent::fields();
|
||||
$albumFields = array(
|
||||
'owner' => [
|
||||
'type' => \IPS\core\api\GraphQL\TypeRegistry::member(),
|
||||
'resolve' => function ($album) {
|
||||
return $album->owner();
|
||||
}
|
||||
],
|
||||
'lastImage' => [
|
||||
'type' => \IPS\gallery\api\GraphQL\TypeRegistry::image(),
|
||||
'resolve' => function ($album) {
|
||||
return $album->lastImage();
|
||||
}
|
||||
],
|
||||
'latestImages' => [
|
||||
'type' => TypeRegistry::listOf( \IPS\gallery\api\GraphQL\TypeRegistry::image() ),
|
||||
'resolve' => function ($album) {
|
||||
return $album->_latestImages;
|
||||
}
|
||||
],
|
||||
'item' => [
|
||||
'type' => \IPS\gallery\api\GraphQL\TypeRegistry::albumItem(),
|
||||
'resolve' => function ($album) {
|
||||
return $album->asItem();
|
||||
}
|
||||
]
|
||||
);
|
||||
|
||||
// Remove unnecessary fields
|
||||
unset( $defaultFields['children'] );
|
||||
|
||||
return array_merge( $defaultFields, $albumFields );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the item type that goes with this node type
|
||||
*
|
||||
* @return ObjectType
|
||||
*/
|
||||
public static function getItemType()
|
||||
{
|
||||
return \IPS\gallery\api\GraphQL\TypeRegistry::image();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: ImageComment Type
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 23 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL\Types;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ImageCommentType for GraphQL API
|
||||
*/
|
||||
class _ImageCommentType extends \IPS\Content\Api\GraphQL\CommentType
|
||||
{
|
||||
/*
|
||||
* @brief The item classname we use for this type
|
||||
*/
|
||||
protected static $commentClass = '\IPS\gallery\Image\Comment';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type name
|
||||
*/
|
||||
protected static $typeName = 'gallery_ImageComment';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type description
|
||||
*/
|
||||
protected static $typeDescription = 'An image comment';
|
||||
|
||||
/**
|
||||
* Get the item type that goes with this item type
|
||||
*
|
||||
* @return ObjectType
|
||||
*/
|
||||
public static function getItemType()
|
||||
{
|
||||
return \IPS\gallery\api\GraphQL\TypeRegistry::image();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the fields available in this type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fields()
|
||||
{
|
||||
$defaultFields = parent::fields();
|
||||
return $defaultFields;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief GraphQL: Image Type
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @since 23 Feb 2019
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api\GraphQL\Types;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ImageType for GraphQL API
|
||||
*/
|
||||
class _ImageType extends \IPS\Content\Api\GraphQL\ItemType
|
||||
{
|
||||
/*
|
||||
* @brief The item classname we use for this type
|
||||
*/
|
||||
protected static $itemClass = '\IPS\gallery\Image';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type name
|
||||
*/
|
||||
protected static $typeName = 'gallery_Image';
|
||||
|
||||
/*
|
||||
* @brief GraphQL type description
|
||||
*/
|
||||
protected static $typeDescription = 'An image';
|
||||
|
||||
/*
|
||||
* @brief Follow data passed in to FollowType resolver
|
||||
*/
|
||||
protected static $followData = array('app' => 'gallery', 'area' => 'image');
|
||||
|
||||
/**
|
||||
* Return the fields available in this type
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fields()
|
||||
{
|
||||
// Extend our fields with image-specific stuff
|
||||
$defaultFields = parent::fields();
|
||||
$imageFields = array(
|
||||
'caption' => [
|
||||
'type' => TypeRegistry::string(),
|
||||
'resolve' => function ($image) {
|
||||
return $image->caption;
|
||||
}
|
||||
],
|
||||
'hasAlbum' => [
|
||||
'type' => TypeRegistry::boolean(),
|
||||
'resolve' => function ($image) {
|
||||
return (bool) $image->album_id;
|
||||
}
|
||||
],
|
||||
'album' => [
|
||||
'type' => \IPS\gallery\api\GraphQL\TypeRegistry::album(),
|
||||
'resolve' => function ($image) {
|
||||
if( $image->album_id )
|
||||
{
|
||||
return \IPS\gallery\Album::load( $image->album_id );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
],
|
||||
'nextImage' => [
|
||||
'type' => \IPS\gallery\api\GraphQL\TypeRegistry::image(),
|
||||
'resolve' => function ($image) {
|
||||
return $image->nextItem();
|
||||
}
|
||||
],
|
||||
'prevImage' => [
|
||||
'type' => \IPS\gallery\api\GraphQL\TypeRegistry::image(),
|
||||
'resolve' => function ($image) {
|
||||
return $image->prevItem();
|
||||
}
|
||||
],
|
||||
'credit' => [
|
||||
'type' => TypeRegistry::string(),
|
||||
'resolve' => function ($image) {
|
||||
return $image->credit_info;
|
||||
}
|
||||
],
|
||||
'copyright' => [
|
||||
'type' => TypeRegistry::string(),
|
||||
'resolve' => function ($image) {
|
||||
return $image->copyright;
|
||||
}
|
||||
],
|
||||
'isMedia' => [
|
||||
'type' => TypeRegistry::boolean(),
|
||||
'resolve' => function ($image) {
|
||||
return (bool) $image->media;
|
||||
}
|
||||
],
|
||||
'maskedFileName' => [
|
||||
'type' => TypeRegistry::string(),
|
||||
'resolve' => function ($image) {
|
||||
return (string) \IPS\File::get( 'gallery_Images', $image->masked_file_name )->url;
|
||||
}
|
||||
],
|
||||
'originalFileName' => [
|
||||
'type' => TypeRegistry::string(),
|
||||
'resolve' => function ($image) {
|
||||
return (string) \IPS\File::get( 'gallery_Images', $image->original_file_name )->url;
|
||||
}
|
||||
],
|
||||
'smallFileName' => [
|
||||
'type' => TypeRegistry::string(),
|
||||
'resolve' => function ($image) {
|
||||
return (string) \IPS\File::get( 'gallery_Images', $image->small_file_name )->url;
|
||||
}
|
||||
],
|
||||
'fileSize' => [
|
||||
'type' => TypeRegistry::int(),
|
||||
'resolve' => function ($image) {
|
||||
return $image->file_size;
|
||||
}
|
||||
],
|
||||
'location' => [
|
||||
'type' => \IPS\GeoLocation\Api\GraphQL\TypeRegistry::geolocation(),
|
||||
'resolve' => function ($image) {
|
||||
if( $image->gps_raw )
|
||||
{
|
||||
return \IPS\GeoLocation::buildFromJson( $image->gps_raw );
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
],
|
||||
'dims' => [
|
||||
'type' => new ObjectType([
|
||||
'name' => 'gallery_ImageSize',
|
||||
'fields' => [
|
||||
'width' => [
|
||||
'type' => TypeRegistry::int(),
|
||||
'resolve' => function ($size) {
|
||||
return $size[0];
|
||||
}
|
||||
],
|
||||
'height' => [
|
||||
'type' => TypeRegistry::int(),
|
||||
'resolve' => function ($size) {
|
||||
return $size[1];
|
||||
}
|
||||
]
|
||||
]
|
||||
]),
|
||||
'args' => [
|
||||
'size' => TypeRegistry::string()
|
||||
],
|
||||
'resolve' => function ($image, $args) {
|
||||
$imageSizes = json_decode( $image->data, true );
|
||||
|
||||
if( isset( $imageSizes[ $args['size'] ] ) ){
|
||||
return $imageSizes[ $args['size'] ];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
]
|
||||
);
|
||||
|
||||
// Duplicate fields that have different names in topics
|
||||
/*$topicFields['forum'] = $defaultFields['container'];
|
||||
$topicFields['posts'] = $defaultFields['comments'];
|
||||
$topicFields['postCount'] = $defaultFields['commentCount'];
|
||||
$topicFields['lastPostAuthor'] = $defaultFields['lastCommentAuthor'];
|
||||
$topicFields['lastPostDate'] = $defaultFields['lastCommentDate'];*/
|
||||
|
||||
// Remove duplicated fields
|
||||
unset( $defaultFields['poll'] );
|
||||
unset( $defaultFields['hasPoll'] );
|
||||
|
||||
return array_merge( $defaultFields, $imageFields );
|
||||
}
|
||||
|
||||
/*public static function args()
|
||||
{
|
||||
return array_merge( parent::args(), array(
|
||||
'password' => [
|
||||
'type' => TypeRegistry::string()
|
||||
]
|
||||
));
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Get the comment type that goes with this item type
|
||||
*
|
||||
* @return ObjectType
|
||||
*/
|
||||
protected static function getCommentType()
|
||||
{
|
||||
return \IPS\gallery\api\GraphQL\TypeRegistry::imageComment();
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\api;
|
||||
|
||||
/* 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;
|
||||
@@ -77,7 +77,7 @@ class _albums extends \IPS\Api\Controller
|
||||
}
|
||||
|
||||
/* Sort */
|
||||
if ( isset( \IPS\Request::i()->sortBy ) and in_array( \IPS\Request::i()->sortBy, array( 'name', 'count_images' ) ) )
|
||||
if ( isset( \IPS\Request::i()->sortBy ) and \in_array( \IPS\Request::i()->sortBy, array( 'name', 'count_images' ) ) )
|
||||
{
|
||||
$sortBy = 'album_' . \IPS\Request::i()->sortBy;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class _albums extends \IPS\Api\Controller
|
||||
{
|
||||
$sortBy = 'album_id';
|
||||
}
|
||||
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
|
||||
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and \in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
|
||||
|
||||
/* Get results */
|
||||
if ( $this->member )
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Gallery Categories API
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Gallery
|
||||
* @since 20 Feb 2020
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\api;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gallery Categories API
|
||||
*/
|
||||
class _categories extends \IPS\Node\Api\NodeController
|
||||
{
|
||||
|
||||
/**
|
||||
* Class
|
||||
*/
|
||||
protected $class = 'IPS\gallery\Category';
|
||||
|
||||
/**
|
||||
* GET /gallery/categories
|
||||
* Get list of gallery categories
|
||||
*
|
||||
* @apiparam string sortBy What to sort by. Can be 'count_imgs' for number of entries, 'last_img_date' for last image date or do not specify for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
* @return \IPS\Api\PaginatedResponse<IPS\blog\Entry>
|
||||
*/
|
||||
public function GETindex()
|
||||
{
|
||||
/* Where clause */
|
||||
$where = array();
|
||||
|
||||
/* Sort */
|
||||
if ( isset( \IPS\Request::i()->sortBy ) and \in_array( \IPS\Request::i()->sortBy, array( 'count_imgs', 'last_img_date' ) ) )
|
||||
{
|
||||
$sortBy = 'category_' . \IPS\Request::i()->sortBy;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortBy = 'category_id';
|
||||
}
|
||||
$sortDir = ( isset( \IPS\Request::i()->sortDir ) and \in_array( mb_strtolower( \IPS\Request::i()->sortDir ), array( 'asc', 'desc' ) ) ) ? \IPS\Request::i()->sortDir : 'asc';
|
||||
|
||||
/* Return */
|
||||
return new \IPS\Api\PaginatedResponse(
|
||||
200,
|
||||
\IPS\Db::i()->select( '*', 'gallery_categories', $where, "{$sortBy} {$sortDir}" ),
|
||||
isset( \IPS\Request::i()->page ) ? \IPS\Request::i()->page : 1,
|
||||
'IPS\gallery\Category',
|
||||
\IPS\Db::i()->select( 'COUNT(*)', 'gallery_categories', $where )->first(),
|
||||
$this->member,
|
||||
isset( \IPS\Request::i()->perPage ) ? \IPS\Request::i()->perPage : NULL
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /gallery/categories/{id}
|
||||
* Get information about a specific gallery category
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @return \IPS\blog\Blog
|
||||
*/
|
||||
public function GETitem( $id )
|
||||
{
|
||||
return $this->_view( $id );
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\api;
|
||||
|
||||
/* 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;
|
||||
@@ -93,7 +93,7 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* POST /gallery/comments
|
||||
* Create a comment
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authenticated user has permission to hide content).
|
||||
* @reqapiparam int image The ID number of the image the comment is for
|
||||
* @reqapiparam int author The ID number of the member making the comment (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
@@ -159,7 +159,7 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* POST /gallery/comments/{id}
|
||||
* Edit a comment
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authenticated user has permission to hide content).
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author The ID number of the member making the comment (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\api;
|
||||
|
||||
/* 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;
|
||||
@@ -39,7 +39,7 @@ class _images extends \IPS\Content\Api\ItemController
|
||||
* @apiparam int locked If 1, only images which are locked are returned, if 0 only unlocked
|
||||
* @apiparam int hidden If 1, only images which are hidden are returned, if 0 only not hidden
|
||||
* @apiparam int featured If 1, only images which are featured are returned, if 0 only not featured
|
||||
* @apiparam string sortBy What to sort by. Can be 'date' for creation date, 'title' or leave unspecified for ID
|
||||
* @apiparam string sortBy What to sort by. Can be 'date' for creation date, 'title', 'updated' or leave unspecified for ID
|
||||
* @apiparam string sortDir Sort direction. Can be 'asc' or 'desc' - defaults to 'asc'
|
||||
* @apiparam int page Page number
|
||||
* @apiparam int perPage Number of results per page - defaults to 25
|
||||
@@ -84,7 +84,7 @@ class _images extends \IPS\Content\Api\ItemController
|
||||
* POST /gallery/images
|
||||
* Upload an image
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authentictaed user has permission to lock images).
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock images).
|
||||
* @reqapiparam int album The ID number of the album the image should be created in - not required if category is provided (only provide one or the other)
|
||||
* @reqapiparam int category The ID number of the category the image should be created in - not required if album is provided (only provide one or the other)
|
||||
* @reqapiparam int author The ID number of the member uploading the image (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
|
||||
@@ -113,7 +113,7 @@ class _images extends \IPS\Content\Api\ItemController
|
||||
* @return \IPS\gallery\Image
|
||||
*/
|
||||
public function POSTindex()
|
||||
{
|
||||
{
|
||||
/* Get category or album */
|
||||
if ( isset( \IPS\Request::i()->album ) )
|
||||
{
|
||||
@@ -210,7 +210,7 @@ class _images extends \IPS\Content\Api\ItemController
|
||||
if( \IPS\Image::exifSupported() )
|
||||
{
|
||||
$image->metadata = $imageObject->parseExif();
|
||||
if( count( $image->metadata ) )
|
||||
if( \count( $image->metadata ) )
|
||||
{
|
||||
$image->parseGeolocation();
|
||||
$image->gps_show = isset( \IPS\Request::i()->gpsShow ) ? \IPS\Request::i()->gpsShow : 1;
|
||||
@@ -233,7 +233,7 @@ class _images extends \IPS\Content\Api\ItemController
|
||||
* POST /gallery/images/{id}
|
||||
* Edit an image
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authentictaed user has permission to lock topics).
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock topics).
|
||||
* @apiparam int album The ID number of the album (only provide this or category to move image)
|
||||
* @apiparam int category The ID number of the category (only provide this or category to move image)
|
||||
* @apiparam int author The ID number of the member uploading the image (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
|
||||
@@ -244,12 +244,12 @@ class _images extends \IPS\Content\Api\ItemController
|
||||
* @apiparam int gpsShow If the image contains the location in it's EXIF data, 1/0 indicating if a map should be shown (defaults to 1)
|
||||
* @apiparam string prefix Prefix tag
|
||||
* @apiparam string tags Comma-separated list of tags (do not include prefix)
|
||||
* @apiparam datetime date The date/time that should be used for the image post date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam string ip_address The IP address that should be stored for the image. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam int locked 1/0 indicating if the image should be locked
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam int pinned 1/0 indicating if the image should be locked
|
||||
* @apiparam int featured 1/0 indicating if the image should be featured
|
||||
* @param int $id ID Number
|
||||
* @throws 2G316/7 INVALID_ID The image ID is invalid or the authorized user does not have permission to view it
|
||||
* @throws 1G316/8 NO_CATEGORY_OR_ALBUM The category or album does not exist or the authorized user does not have permission to post in it
|
||||
* @throws 1G316/9 NO_AUTHOR The author ID does not exist
|
||||
|
||||
File renamed without changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\api;
|
||||
|
||||
/* 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;
|
||||
@@ -93,7 +93,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* POST /gallery/reviews
|
||||
* Create a review
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authenticated user has permission to hide content).
|
||||
* @reqapiparam int image The ID number of the image the review is for
|
||||
* @reqapiparam int author The ID number of the member making the review (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
@@ -154,7 +154,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
}
|
||||
|
||||
/* Check we have a rating */
|
||||
if ( !\IPS\Request::i()->rating or !in_array( (int) \IPS\Request::i()->rating, range( 1, \IPS\Settings::i()->reviews_rating_out_of ) ) )
|
||||
if ( !\IPS\Request::i()->rating or !\in_array( (int) \IPS\Request::i()->rating, range( 1, \IPS\Settings::i()->reviews_rating_out_of ) ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_RATING', '2G318/8', 403 );
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* POST /gallery/reviews/{id}
|
||||
* Edit a review
|
||||
*
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authentictaed user has permission to hide content).
|
||||
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, hidden will only be honoured if the authenticated user has permission to hide content).
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author The ID number of the member making the review (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
@@ -196,7 +196,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
}
|
||||
|
||||
/* Check */
|
||||
if ( isset( \IPS\Request::i()->rating ) and !in_array( (int) \IPS\Request::i()->rating, range( 1, \IPS\Settings::i()->reviews_rating_out_of ) ) )
|
||||
if ( isset( \IPS\Request::i()->rating ) and !\in_array( (int) \IPS\Request::i()->rating, range( 1, \IPS\Settings::i()->reviews_rating_out_of ) ) )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_RATING', '1G318/A', 403 );
|
||||
}
|
||||
|
||||
@@ -352,13 +352,7 @@
|
||||
"keywords": [
|
||||
"image dimensions",
|
||||
"image size",
|
||||
"small image dimensions"
|
||||
]
|
||||
},
|
||||
"app=gallery&module=gallery&controller=settings&searchResult=form_gallery_thumb_dims": {
|
||||
"lang_key": "gallery_thumb_dims",
|
||||
"restriction": "settings_manage",
|
||||
"keywords": [
|
||||
"small image dimensions",
|
||||
"thumbnail dimensions"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<build>
|
||||
<module key="admin/gallery"><![CDATA[{"default_controller":"categories","protected":0,"default":1}]]></module>
|
||||
<module key="admin/stats"><![CDATA[{"default_controller":null,"protected":0,"default":0}]]></module>
|
||||
<module key="front/gallery"><![CDATA[{"default_controller":"browse","protected":0,"default":1}]]></module>
|
||||
<task frequency="P0Y0M1DT0H0M0S">clearBandwidthLog</task>
|
||||
<task frequency="P0Y0M1DT0H0M0S">clearUploads</task>
|
||||
<setting key="gallery_bandwidth_period"><![CDATA[{"key":"gallery_bandwidth_period","default":"-1","report":"full"}]]></setting>
|
||||
<setting key="gallery_detailed_bandwidth"><![CDATA[{"key":"gallery_detailed_bandwidth","default":"1","report":"full"}]]></setting>
|
||||
<setting key="gallery_large_dims"><![CDATA[{"key":"gallery_large_dims","default":"1600x1200","report":"full"}]]></setting>
|
||||
<setting key="gallery_maps_default"><![CDATA[{"key":"gallery_maps_default","default":"0","report":"full"}]]></setting>
|
||||
<setting key="gallery_rss_enabled"><![CDATA[{"key":"gallery_rss_enabled","default":"1","report":"full"}]]></setting>
|
||||
<setting key="gallery_small_dims"><![CDATA[{"key":"gallery_small_dims","default":"600x600","report":"full"}]]></setting>
|
||||
<setting key="gallery_use_square_thumbnails"><![CDATA[{"key":"gallery_use_square_thumbnails","default":"0","report":"full"}]]></setting>
|
||||
<setting key="gallery_use_watermarks"><![CDATA[{"key":"gallery_use_watermarks","default":"0","report":"full"}]]></setting>
|
||||
<setting key="gallery_watermark_images"><![CDATA[{"key":"gallery_watermark_images","default":"large","report":"full"}]]></setting>
|
||||
<setting key="gallery_watermark_path"><![CDATA[{"key":"gallery_watermark_path","default":"","report":"none"}]]></setting>
|
||||
<widget key="galleryStats"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":[],"default_area":""}]]></widget>
|
||||
<widget key="recentComments"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true}]]></widget>
|
||||
<widget key="imageFeed"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":true,"menu_style":"modal","embeddable":true}]]></widget>
|
||||
<widget key="recentImageReviews"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":false,"menu_style":"menu","embeddable":true}]]></widget>
|
||||
<widget key="albums"><![CDATA[{"class":"\\IPS\\Widget\\PermissionCache","restrict":["sidebar","cms"],"default_area":"","allow_reuse":true,"menu_style":"menu","embeddable":true}]]></widget>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories"><![CDATA[{"lang_key":"menu__gallery_gallery_categories","restriction":"categories_manage","keywords":["gallery categories","image categories"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&do=form"><![CDATA[{"lang_key":"menu__gallery_gallery_categories","restriction":"categories_manage","keywords":["add category"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=category_allow_comments"><![CDATA[{"lang_key":"category_allow_comments","restriction":"categories_manage","keywords":["allow comments","comments"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=category_approve_com"><![CDATA[{"lang_key":"category_approve_com","restriction":"categories_manage","keywords":["comments approved","must approved"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=category_can_tag"><![CDATA[{"lang_key":"category_can_tag","restriction":"categories_manage","keywords":["allow tags","tags"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=category_sort_options"><![CDATA[{"lang_key":"category_sort_options","restriction":"categories_manage","keywords":["default sort","sort order"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=category_tag_prefixes"><![CDATA[{"lang_key":"category_tag_prefixes","restriction":"categories_manage","keywords":["allow prefixes","prefixes"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_category_allow_albums"><![CDATA[{"lang_key":"category_allow_albums","restriction":"categories_manage","keywords":["allow albums"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_category_allow_reviews"><![CDATA[{"lang_key":"category_allow_reviews","restriction":"categories_manage","keywords":["allow reviews","reviews"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_category_approve_img"><![CDATA[{"lang_key":"category_approve_img","restriction":"categories_manage","keywords":["images must","must approved"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_category_description"><![CDATA[{"lang_key":"category_description","restriction":"categories_manage","keywords":["category description"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_category_name"><![CDATA[{"lang_key":"category_name","restriction":"categories_manage","keywords":["category name"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_category_show_rules"><![CDATA[{"lang_key":"category_show_rules","restriction":"categories_manage","keywords":["gallery rules","rules","show rules"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_gcategory_allow_rating"><![CDATA[{"lang_key":"gcategory_allow_rating","restriction":"categories_manage","keywords":["allow ratings","ratings"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_1_gcategory_parent_id"><![CDATA[{"lang_key":"gcategory_parent_id","restriction":"categories_manage","keywords":["parent category"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_category_allow_albums"><![CDATA[{"lang_key":"category_allow_albums","restriction":"categories_manage","keywords":["albums","allow albums"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_category_allow_reviews"><![CDATA[{"lang_key":"category_allow_reviews","restriction":"categories_manage","keywords":["allow reviews","reviews"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_category_approve_img"><![CDATA[{"lang_key":"category_approve_img","restriction":"categories_manage","keywords":["items approved","must approved"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_category_description"><![CDATA[{"lang_key":"category_description","restriction":"categories_manage","keywords":["category description"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_category_name"><![CDATA[{"lang_key":"category_name","restriction":"categories_manage","keywords":["category name"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_category_show_rules"><![CDATA[{"lang_key":"category_show_rules","restriction":"categories_manage","keywords":["rules","show rules"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_gcategory_allow_rating"><![CDATA[{"lang_key":"gcategory_allow_rating","restriction":"categories_manage","keywords":["allow ratings","ratings"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=form_new_gcategory_parent_id"><![CDATA[{"lang_key":"gcategory_parent_id","restriction":"categories_manage","keywords":["parent","parent category"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&searchResult=gallery_permission_custom_error"><![CDATA[{"lang_key":"category_permission_custom_error","restriction":"categories_manage","keywords":["custom error","permission denied"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=category_allow_comments"><![CDATA[{"lang_key":"category_allow_comments","restriction":"categories_manage","keywords":["allow comments","comments"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=category_approve_com"><![CDATA[{"lang_key":"category_approve_com","restriction":"categories_manage","keywords":["comments must","must approved"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=category_can_tag"><![CDATA[{"lang_key":"category_can_tag","restriction":"categories_manage","keywords":["allow tags","tags"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=category_sort_options"><![CDATA[{"lang_key":"category_sort_options","restriction":"categories_manage","keywords":["default sort","sort order"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=category_tag_prefixes"><![CDATA[{"lang_key":"category_tag_prefixes","restriction":"categories_manage","keywords":["allow prefixes","prefixes"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_category_allow_albums"><![CDATA[{"lang_key":"category_allow_albums","restriction":"categories_manage","keywords":["allow albums"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_category_allow_reviews"><![CDATA[{"lang_key":"category_allow_reviews","restriction":"categories_manage","keywords":["allow reviews","reviews"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_category_approve_img"><![CDATA[{"lang_key":"category_approve_img","restriction":"categories_manage","keywords":["approved","images must","must approved"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_category_description"><![CDATA[{"lang_key":"category_description","restriction":"categories_manage","keywords":["category description"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_category_name"><![CDATA[{"lang_key":"category_name","restriction":"categories_manage","keywords":["category name"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_category_show_rules"><![CDATA[{"lang_key":"category_show_rules","restriction":"categories_manage","keywords":["rules","show rules"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_gcategory_allow_rating"><![CDATA[{"lang_key":"gcategory_allow_rating","restriction":"categories_manage","keywords":["allow ratings","ratings"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=form_new_gcategory_parent_id"><![CDATA[{"lang_key":"gcategory_parent_id","restriction":"categories_manage","keywords":["parent","parent category"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=categories&subnode=0&parent=1&searchResult=gallery_permission_custom_error"><![CDATA[{"lang_key":"category_permission_custom_error","restriction":"categories_manage","keywords":["custom error","custom permission denied"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings"><![CDATA[{"lang_key":"menu__gallery_gallery_settings","restriction":"settings_manage","keywords":["gallery settings"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_bandwidth_period"><![CDATA[{"lang_key":"gallery_bandwidth_period","restriction":"settings_manage","keywords":["bandwidth log retention","bandwidth logs","number of hours"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_detailed_bandwidth"><![CDATA[{"lang_key":"gallery_detailed_bandwidth","restriction":"settings_manage","keywords":["bandwidth","bandwidth logs","store bandwidth logs"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_large_dims"><![CDATA[{"lang_key":"gallery_large_dims","restriction":"settings_manage","keywords":["image dimensions","image size","large image"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_medium_dims"><![CDATA[{"lang_key":"gallery_medium_dims","restriction":"settings_manage","keywords":["image dimensions","image size","medium image size"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_rss_enabled"><![CDATA[{"lang_key":"gallery_rss_enabled","restriction":"settings_manage","keywords":["gallery rss","image rss"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_small_dims"><![CDATA[{"lang_key":"gallery_small_dims","restriction":"settings_manage","keywords":["image dimensions","image size","small image dimensions","thumbnail dimensions"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_use_square_thumbnails"><![CDATA[{"lang_key":"gallery_use_square_thumbnails","restriction":"settings_manage","keywords":["square thumbnails"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_use_watermarks"><![CDATA[{"lang_key":"gallery_use_watermarks","restriction":"settings_manage","keywords":["watermark images"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=gallery&controller=settings&searchResult=form_gallery_watermark_path"><![CDATA[{"lang_key":"gallery_watermark_path","restriction":"settings_manage","keywords":["watermark"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=stats&controller=bandwidth"><![CDATA[{"lang_key":"menu__gallery_stats_bandwidth","restriction":"bandwidth_manage","keywords":["bandwidth","gallery bandwidth"]}]]></acpsearch>
|
||||
<acpsearch key="app=gallery&module=stats&controller=diskspace"><![CDATA[{"lang_key":"menu__gallery_stats_diskspace","restriction":"diskspace_manage","keywords":["top uploaders"]}]]></acpsearch>
|
||||
<acpsearch key="app=core&module=members&controller=members&searchResult=form_remove_gallery_access"><![CDATA[{"lang_key":"remove_gallery_access","restriction":null,"keywords":["Access","Allowed to","Gallery"]}]]></acpsearch>
|
||||
<acpsearch key="app=core&module=members&controller=members&searchResult=remove_gallery_upload"><![CDATA[{"lang_key":"remove_gallery_upload","restriction":null,"keywords":["Can Upload","Gallery Upload","Images"]}]]></acpsearch>
|
||||
<acpsearch key="app=core&module=members&controller=groups&searchResult=4_g_max_upload"><![CDATA[{"lang_key":"g_max_upload","restriction":"groups_manage","keywords":["gallery image size","gallery max image size","gallery maximum image size","max size of image","maximum image size"]}]]></acpsearch>
|
||||
<acpsearch key="app=core&module=members&controller=groups&searchResult=4_g_movies"><![CDATA[{"lang_key":"g_movies","restriction":"groups_manage","keywords":["ability to upload movies","movie upload ability","movies","upload movie permission","upload movies"]}]]></acpsearch>
|
||||
<acpsearch key="app=core&module=members&controller=groups&searchResult=4_g_create_albums"><![CDATA[{"lang_key":"g_create_albums","restriction":"groups_manage","keywords":["albums","albums permission","create albums","create albums permission"]}]]></acpsearch>
|
||||
</build>
|
||||
@@ -1,11 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<emails><template><template_app>gallery</template_app><template_name>digests__item</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<emails><template><template_app>gallery</template_app><template_name>_imageContent</template_name><template_content_html><![CDATA[{{if $includeAuthor}}
|
||||
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
|
||||
<tr>
|
||||
<td dir='{dir}' width='40' valign='top' class='hidePhone' style='width: 0; max-height: 0; overflow: hidden; float: left;'>
|
||||
<img src='{$content->author()->get_photo( true, true )}' width='40' height='40' style='border: 1px solid #777777; vertical-align: middle;'>
|
||||
</td>
|
||||
<td dir='{dir}' width='30' valign='top' class='hidePhone' style='width: 0; max-height: 0; overflow: hidden; float: left;'>
|
||||
<br />
|
||||
<span style='display: block; width: 0px; height: 0px; border-width: 15px; border-color: transparent #f9f9f9 transparent transparent; border-style: solid'></span>
|
||||
</td>
|
||||
<td dir='{dir}' valign='top' style='background: #f9f9f9;'>
|
||||
{{endif}}
|
||||
<table width='100%' cellpadding='10' cellspacing='0' border='0'>
|
||||
<tr>
|
||||
<td dir='{dir}' width='120' align='center' valign='top'>
|
||||
<img src='{file="$content->small_file_name" extension="gallery_Images"}' style='border: 1px solid #000; vertical-align: middle;' width='100' height='100'>
|
||||
</td>
|
||||
<td dir='{dir}' align='left'>
|
||||
<table width='100%' cellpadding='5' cellspacing='0' border='0'>
|
||||
{{if $container = $content->containerWrapper()}}
|
||||
<tr>
|
||||
<td dir='{dir}' style="font-family: 'Helvetica Neue', helvetica, sans-serif; line-height: 1.5; font-size: 14px; color: #8d8d8d">
|
||||
{$email->language->addToStack("email_posted_in", FALSE, array( 'sprintf' => array( $container->getTitleForLanguage( $email->language ) ) ) )}
|
||||
</td>
|
||||
</tr>
|
||||
{{endif}}
|
||||
<tr>
|
||||
<td dir='{dir}' style="font-family: 'Helvetica Neue', helvetica, sans-serif; line-height: 1.5; font-size: 14px;">
|
||||
<strong>{$content->mapped('title')}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td dir='{dir}' style="font-family: 'Helvetica Neue', helvetica, sans-serif; line-height: 1.5; font-size: 14px;">
|
||||
{$email->parseTextForEmail( $content->content(), $email->language )|raw}
|
||||
</td>
|
||||
</tr>
|
||||
{{if $includeLinks}}
|
||||
<tr>
|
||||
<td dir='{dir}'>
|
||||
<a href='{$content->url()}' style="color: #ffffff; font-family: 'Helvetica Neue', helvetica, sans-serif; text-decoration: none; font-size: 14px; background: {setting="email_color"}; line-height: 32px; padding: 0 10px; display: inline-block; border-radius: 3px;">{$email->language->addToStack("go_to_this_x", FALSE, array( 'sprintf' => array( mb_strtolower( $email->language->addToStack( $content::$title, FALSE ) ) ) ) )}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{endif}}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{{if $includeAuthor}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{{endif}}]]></template_content_html><template_data>$content, $includeLinks, $includeAuthor, $email</template_data><template_content_plaintext/><template_pinned>0</template_pinned></template><template><template_app>gallery</template_app><template_name>digests__item</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td dir='{dir}' width='120' align='center' valign='top'>
|
||||
<img src='{file="$image->small_file_name" extension="gallery_Images"}' style='border: 1px solid #000; vertical-align: middle;' width='100' height='100'>
|
||||
</td>
|
||||
<td dir='{dir}' align='left'>
|
||||
<p style='font-family: "Helvetica Neue", helvetica, sans-serif; margin: 0; font-size: 13px; font-weight: bold'>
|
||||
{$email->language->addToStack("x_added_image_in", FALSE, array( 'sprintf' => array( $image->author()->name, $image->container()->_title ) ) )}
|
||||
{$email->language->addToStack("x_added_image_in", FALSE, array( 'sprintf' => array( $image->author()->name, $image->container()->getTitleForLanguage( $email->language ) ) ) )}
|
||||
</p>
|
||||
<h2 style="font-family: 'Helvetica Neue', helvetica, sans-serif; font-size: 20px; font-weight: 500 !important; margin: 0;">
|
||||
<a href='{$image->url()}' style='text-decoration: none;'>{$image->mapped('name')}</a>
|
||||
@@ -22,7 +73,7 @@
|
||||
<strong style='font-family: "Helvetica Neue", helvetica, sans-serif; '><img src='{resource="email/comment.png" location="interface" app="core"}' width='13' height='12' style='vertical-align: middle'> {$email->language->addToStack("num_comments", FALSE, array( 'pluralize' => array( $image->comments ) ) )}</strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>]]></template_content_html><template_data>$image, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_added_image_in", FALSE, array( 'sprintf' => array( $image->author()->name, $image->container()->_title ) ) )}: {$image->mapped('name')} ({$image->url()})]]></template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>gallery</template_app><template_name>digests__comment</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
</tr>]]></template_content_html><template_data>$image, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_added_image_in", FALSE, array( 'htmlsprintf' => array( $image->author()->name, $image->container()->getTitleForLanguage( $email->language ) ) ) )}: {$image->mapped('name')} ({$image->url()})]]></template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>gallery</template_app><template_name>digests__comment</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td dir='{dir}' width='120' align='center' valign='top'>
|
||||
<img src='{file="$comment->item()->small_file_name" extension="gallery_Images"}' style='border: 1px solid #000; vertical-align: middle;' width='100' height='100'>
|
||||
</td>
|
||||
@@ -37,5 +88,5 @@
|
||||
{$email->parseTextForEmail( $comment->content(), $email->language )|raw}
|
||||
</div>
|
||||
</td>
|
||||
</tr>]]></template_content_html><template_data>$comment, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_commented_photo", FALSE, array( 'sprintf' => array( $comment->author()->name ) ) )}: {$comment->item()->name} ({$comment->url()})
|
||||
</tr>]]></template_content_html><template_data>$comment, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_commented_photo", FALSE, array( 'htmlsprintf' => array( $comment->author()->name ) ) )}: {$comment->item()->name} ({$comment->url()})
|
||||
]]></template_content_plaintext><template_pinned>0</template_pinned></template></emails>
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"core": {
|
||||
"AdvertisementLocations": {
|
||||
"ImageLightbox": "IPS\\gallery\\extensions\\core\\AdvertisementLocations\\ImageLightbox"
|
||||
},
|
||||
"ContentRouter": {
|
||||
"gallery": "IPS\\gallery\\extensions\\core\\ContentRouter\\gallery"
|
||||
},
|
||||
"CreateMenu": {
|
||||
"gallery": "IPS\\gallery\\extensions\\core\\CreateMenu\\gallery"
|
||||
},
|
||||
"Dashboard": {
|
||||
"Overview": "IPS\\gallery\\extensions\\core\\Dashboard\\Overview"
|
||||
},
|
||||
"EditorLocations": {
|
||||
"Albums": "IPS\\gallery\\extensions\\core\\EditorLocations\\Albums",
|
||||
"Categories": "IPS\\gallery\\extensions\\core\\EditorLocations\\Categories",
|
||||
"Gallery": "IPS\\gallery\\extensions\\core\\EditorLocations\\Gallery",
|
||||
"Images": "IPS\\gallery\\extensions\\core\\EditorLocations\\Images"
|
||||
},
|
||||
"EditorMedia": {
|
||||
"Images": "IPS\\gallery\\extensions\\core\\EditorMedia\\Images"
|
||||
},
|
||||
"FileStorage": {
|
||||
"Images": "IPS\\gallery\\extensions\\core\\FileStorage\\Images"
|
||||
},
|
||||
"FrontNavigation": {
|
||||
"Gallery": "IPS\\gallery\\extensions\\core\\FrontNavigation\\Gallery"
|
||||
},
|
||||
"GroupForm": {
|
||||
"Gallery": "IPS\\gallery\\extensions\\core\\GroupForm\\Gallery"
|
||||
},
|
||||
"GroupLimits": {
|
||||
"Album": "IPS\\gallery\\extensions\\core\\GroupLimits\\Album"
|
||||
},
|
||||
"LiveSearch": {
|
||||
"Categories": "IPS\\gallery\\extensions\\core\\LiveSearch\\Categories"
|
||||
},
|
||||
"MemberACPProfileContentTab": {
|
||||
"Gallery": "IPS\\gallery\\extensions\\core\\MemberACPProfileContentTab\\Gallery"
|
||||
},
|
||||
"MemberFilter": {
|
||||
"Album": "IPS\\gallery\\extensions\\core\\MemberFilter\\Album"
|
||||
},
|
||||
"MemberRestrictions": {
|
||||
"Gallery": "IPS\\gallery\\extensions\\core\\MemberRestrictions\\Gallery"
|
||||
},
|
||||
"MemberSync": {
|
||||
"Gallery": "IPS\\gallery\\extensions\\core\\MemberSync\\Gallery"
|
||||
},
|
||||
"Permissions": {
|
||||
"Permissions": "IPS\\gallery\\extensions\\core\\Permissions\\Permissions"
|
||||
},
|
||||
"Profile": {
|
||||
"gallery": "IPS\\gallery\\extensions\\core\\Profile\\gallery"
|
||||
},
|
||||
"Queue": {
|
||||
"CleanUpGalleryImages": "IPS\\gallery\\extensions\\core\\Queue\\CleanUpGalleryImages",
|
||||
"Follow": "IPS\\gallery\\extensions\\core\\Queue\\Follow",
|
||||
"RebuildGalleryImages": "IPS\\gallery\\extensions\\core\\Queue\\RebuildGalleryImages"
|
||||
},
|
||||
"Sitemap": {
|
||||
"Images": "IPS\\gallery\\extensions\\core\\Sitemap\\Images",
|
||||
"Videos": "IPS\\gallery\\extensions\\core\\Sitemap\\Videos"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,8 @@
|
||||
"gallery_album": {
|
||||
"friendly": "album/{#album}-{?}",
|
||||
"real": "app=gallery&module=gallery&controller=browse",
|
||||
"verify": "\\IPS\\gallery\\Album"
|
||||
"verify": "\\IPS\\gallery\\Album",
|
||||
"seoPagination": true
|
||||
},
|
||||
"gallery_categories": {
|
||||
"friendly": "categories",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="gallery">
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.lightbox.js" javascript_type="controller" javascript_version="103038" javascript_position="1000200"><![CDATA[/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.lightbox.js" javascript_type="controller" javascript_version="105100" javascript_position="1000200"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -20,6 +20,7 @@
|
||||
initialize: function () {
|
||||
this.on( 'click', '[data-imageLightbox]', this.launchLightbox );
|
||||
this.on( document, 'keydown', this.keyDown );
|
||||
this.on( document, 'click', '.cLightboxClose', this.closeLightbox );
|
||||
|
||||
// Primary event that watches for URL changes
|
||||
History.Adapter.bind( window, 'statechange', _.bind( this.stateChange, this ) );
|
||||
@@ -38,11 +39,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Monitor state change and close lightbox if we go back again
|
||||
*/
|
||||
closeLightboxNextStateChange: false,
|
||||
|
||||
/**
|
||||
* Handles URL state changes
|
||||
*
|
||||
@@ -52,21 +48,14 @@
|
||||
var state = History.getState();
|
||||
|
||||
// Monitor for back button when we're on the 'first' image
|
||||
if( state.data.controller == 'gallery.front.browse.imageLightbox' && ( !_.isUndefined( state.data.initialLaunch ) && state.data.initialLaunch == true ) ) {
|
||||
this.closeLightboxNextStateChange = true;
|
||||
}
|
||||
|
||||
if( state.data.controller != 'gallery.front.view.image' ){
|
||||
if( state.data.controller == 'gallery.front.browse.imageLightbox' && ( _.isUndefined( state.data.initialLaunch ) || state.data.initialLaunch != true ) ) {
|
||||
this.closeLightboxNextStateChange = false;
|
||||
Debug.log( state.data );
|
||||
this.closeLightbox();
|
||||
this.hideLightbox();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.closeLightboxNextStateChange = false;
|
||||
|
||||
// We are looking for next/prev clicks in the lightbox, so make sure we know which was done
|
||||
if( _.isUndefined( state.data.direction ) ){
|
||||
return;
|
||||
@@ -128,8 +117,6 @@
|
||||
$('#cLightbox').css({
|
||||
zIndex: ips.ui.zIndex()
|
||||
});
|
||||
|
||||
$('.cLightboxClose').on( 'click', this.closeLightbox );
|
||||
} else if( !$('#cLightbox').is(':visible') ) {
|
||||
$('#cLightbox').show();
|
||||
}
|
||||
@@ -175,25 +162,38 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the lightbox
|
||||
* Close the lightbox and update the state history
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
closeLightbox: function( e ) {
|
||||
// Hide the lightbox
|
||||
$('#cLightbox').fadeOut( 400, function(){
|
||||
// Empty the lightbox
|
||||
$('#cLightbox > .cLightboxBack').html('');
|
||||
});
|
||||
|
||||
$('body').removeClass('ipsNoScroll');
|
||||
closeLightbox: function( e ) {
|
||||
this.hideLightbox();
|
||||
|
||||
// Store a history entry
|
||||
History.pushState( { controller: 'gallery.front.browse.imageLightbox', bypassStateAdjustment: true }, $('#cLightbox').attr('data-originalTitle'), $('#cLightbox').attr('data-originalUrl') );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Hides the lightbox
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
hideLightbox: function() {
|
||||
// Hide the lightbox
|
||||
$('#cLightbox').fadeOut( 400 );
|
||||
$('body').removeClass('ipsNoScroll');
|
||||
|
||||
// If it's a video, pause it to stop the sound
|
||||
if( $('#cLightbox video').length )
|
||||
{
|
||||
_.each( $('#cLightbox video'), function( elem ) {
|
||||
elem.pause();
|
||||
} );
|
||||
}
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="103038" javascript_position="1000200">/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="105100" javascript_position="1000200">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -241,7 +241,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="gallery" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.settings.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
<file javascript_app="gallery" javascript_location="admin" javascript_path="controllers/settings" javascript_name="ips.settings.settings.js" javascript_type="controller" javascript_version="105100" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -298,7 +298,7 @@
|
||||
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.chooseCategory.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.chooseCategory.js" javascript_type="controller" javascript_version="105100" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -314,13 +314,18 @@
|
||||
_chosen: false,
|
||||
_resizeTimer: null,
|
||||
|
||||
initialize: function () {
|
||||
initialize: function () {
|
||||
this.on( 'nodeItemSelected', '[data-name="image_category"]', this.chooseCategory );
|
||||
this.on( 'nodeSelectedChanged', '[data-name="image_category"]', this.chooseCategoryInitially );
|
||||
this.on( 'click', '[data-action="continueNoAlbum"]', this.continueNoAlbum );
|
||||
this.on( 'click', '[data-type]:not([data-disabled])', this.chooseAlbumType );
|
||||
|
||||
// Try to set the dialog title
|
||||
this.setup();
|
||||
|
||||
// But in some cases we finish loading before the wrapper controller, so also listen for the wrapper controller to finish
|
||||
// and set the title then, if appropriate
|
||||
this.on( document, 'gallery.wrapperInit', this.setup );
|
||||
},
|
||||
|
||||
setup: function () {
|
||||
@@ -389,7 +394,7 @@
|
||||
}
|
||||
|
||||
form.show().css({
|
||||
opacity: 0.001
|
||||
opacity: "0.001"
|
||||
});
|
||||
|
||||
if( this.scope.closest('.ipsDialog').length ){
|
||||
@@ -397,7 +402,7 @@
|
||||
}
|
||||
|
||||
form.animate({
|
||||
opacity: 1
|
||||
opacity: "1"
|
||||
}, function () {
|
||||
if( self.scope.closest('.ipsDialog').length ){
|
||||
self._resizeTimer = setInterval( function () {
|
||||
@@ -491,8 +496,9 @@
|
||||
},
|
||||
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.existingAlbums.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
}(jQuery, _));
|
||||
]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.existingAlbums.js" javascript_type="controller" javascript_version="105100" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -539,7 +545,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.uploadImages.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.uploadImages.js" javascript_type="controller" javascript_version="105100" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -670,7 +676,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.wrapper.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.wrapper.js" javascript_type="controller" javascript_version="105100" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -694,6 +700,7 @@
|
||||
initialize: function () {
|
||||
// Intercept form submissions
|
||||
this.on( 'submit', 'form', this.submitForm );
|
||||
this.on( 'click', '[data-role="submitForm"]', this.maybeSubmitForm );
|
||||
|
||||
// If another controller tells us to do something, do it
|
||||
this.on( 'gallery.submit.response', this._updateWrapper );
|
||||
@@ -717,7 +724,11 @@
|
||||
this.on( 'gallery.enlargeUploader', this.enlargeUploader );
|
||||
this.on( 'gallery.updateTitle', this.updateTitle );
|
||||
|
||||
// Set us up
|
||||
this.setup();
|
||||
|
||||
// Let everyone know we're done in case they're waiting
|
||||
this.trigger('gallery.wrapperInit');
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -934,7 +945,7 @@
|
||||
}
|
||||
} else {
|
||||
// Otherwise, clone our existing form to use
|
||||
$('[data-role="defaultImageDetailsForm"]').find('#cke_image_description_DEFAULT').remove();
|
||||
$('[data-role="defaultImageDetailsForm"]').find('#cke_filedata__image_description_DEFAULT').remove();
|
||||
var htmlToInsert = $('[data-role="defaultImageDetailsForm"]').html();
|
||||
htmlToInsert = '<div id="image_details_' + imageId + '">' + htmlToInsert.replace( /name="image_tags_DEFAULT"/g, 'name="image_tags_DEFAULT" data-ipsAutocomplete ').replace( /_DEFAULT/g, '_' + imageId ) + "</div>";
|
||||
|
||||
@@ -1015,7 +1026,7 @@
|
||||
if( !show ){
|
||||
detailsPanel
|
||||
.animate({
|
||||
opacity: 0,
|
||||
opacity: "0",
|
||||
top: '400px'
|
||||
}, 400, function () {
|
||||
detailsPanel.hide()
|
||||
@@ -1024,11 +1035,11 @@
|
||||
detailsPanel
|
||||
.show()
|
||||
.css({
|
||||
opacity: 0,
|
||||
opacity: "0",
|
||||
top: '400px'
|
||||
})
|
||||
.animate({
|
||||
opacity: 1,
|
||||
opacity: "1",
|
||||
top: '0px'
|
||||
}, 400 );
|
||||
}
|
||||
@@ -1062,6 +1073,25 @@
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* IE11 doesn't support submit buttons outside of a <form> like HTML5 does.
|
||||
* So, if we click the button, are on IE11, and not inside a form, manually trigger a submit.
|
||||
*
|
||||
* @param {event} e Event object
|
||||
* @returns {void}
|
||||
*/
|
||||
maybeSubmitForm: function (e) {
|
||||
var isIE11 = !(window.ActiveXObject) && "ActiveXObject" in window;
|
||||
|
||||
if( !$( e.currentTarget ).closest('form').length && $( e.currentTarget ).is('[form]') && isIE11 ){
|
||||
var form = $('#' + $( e.currentTarget ).attr('form'));
|
||||
|
||||
if( form.length ){
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler for submitting forms inside the wizard
|
||||
*
|
||||
@@ -1070,7 +1100,7 @@
|
||||
*/
|
||||
submitForm: function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
var form = $( e.currentTarget );
|
||||
var url = form.attr('action');
|
||||
|
||||
@@ -1102,7 +1132,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
form.find('input[name="images_autofollow_all"]').val( $('#check_image_auto_follow_wrapper').hasClass('ipsToggle_on') ? 1 : 0 );
|
||||
if( ips.getSetting('memberID') )
|
||||
{
|
||||
form.find('input[name="images_autofollow_all"]').val( $('#check_image_auto_follow_wrapper').hasClass('ipsToggle_on') ? 1 : 0 );
|
||||
}
|
||||
|
||||
// Get the order of the images and store this in the submission
|
||||
var imageOrder = [];
|
||||
@@ -1187,6 +1220,7 @@
|
||||
* @returns {void}
|
||||
*/
|
||||
_updateContents: function ( response ) {
|
||||
|
||||
var wrapper = $('[data-role="submitWrapper"]');
|
||||
var container = wrapper.find('[data-role="container"]');
|
||||
|
||||
@@ -1315,45 +1349,57 @@
|
||||
_enlargeUploadStep: function (callback) {
|
||||
var wrapper = $('[data-role="submitWrapper"]');
|
||||
var dialogElem = this.scope.closest('.cGalleryDialog_outer > div');
|
||||
var dialogElemPos = ips.utils.position.getElemPosition( dialogElem );
|
||||
var viewportSize = { width: $( window ).width(), height: $( window ).height() };
|
||||
var left = ( viewportSize.width - dialogElem.width() ) / 2;
|
||||
|
||||
// Set the size of the dialog div, and then animate expanding to fullscreen size
|
||||
this.scope.closest('.cGalleryDialog_outer > div').css({
|
||||
width: 'auto',
|
||||
maxWidth: '100%',
|
||||
position: 'fixed',
|
||||
margin: 0,
|
||||
top: dialogElemPos.absPos.top + 'px',
|
||||
left: left + 'px',
|
||||
right: viewportSize.width - ( left + dialogElem.width() ) + 'px'
|
||||
}).animate({
|
||||
left: '10px',
|
||||
right: '10px',
|
||||
bottom: '10px',
|
||||
top: '10px',
|
||||
}, function () {
|
||||
if( dialogElem.length )
|
||||
{
|
||||
var dialogElemPos = ips.utils.position.getElemPosition( dialogElem );
|
||||
var viewportSize = { width: $( window ).width(), height: $( window ).height() };
|
||||
var left = ( viewportSize.width - dialogElem.width() ) / 2;
|
||||
|
||||
// Now fade in the wrapper
|
||||
wrapper.find('[data-role="images"]').css({
|
||||
opacity: 0.0001,
|
||||
}).show();
|
||||
// Set the size of the dialog div, and then animate expanding to fullscreen size
|
||||
this.scope.closest('.cGalleryDialog_outer > div').css({
|
||||
width: 'auto',
|
||||
maxWidth: '100%',
|
||||
position: 'fixed',
|
||||
margin: 0,
|
||||
top: dialogElemPos.absPos.top + 'px',
|
||||
left: left + 'px',
|
||||
right: viewportSize.width - ( left + dialogElem.width() ) + 'px'
|
||||
}).animate({
|
||||
left: '10px',
|
||||
right: '10px',
|
||||
bottom: '10px',
|
||||
top: '10px',
|
||||
}, function () {
|
||||
|
||||
// Now fade in the wrapper
|
||||
wrapper.find('[data-role="images"]').css({
|
||||
opacity: "0.0001",
|
||||
}).show();
|
||||
|
||||
if( callback ){
|
||||
callback();
|
||||
}
|
||||
|
||||
wrapper.find('[data-role="images"]').animate({
|
||||
opacity: "1"
|
||||
});
|
||||
|
||||
$( document ).trigger( 'contentChange', [ wrapper ] );
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if( callback ){
|
||||
callback();
|
||||
}
|
||||
|
||||
wrapper.find('[data-role="images"]').animate({
|
||||
opacity: 1
|
||||
});
|
||||
|
||||
$( document ).trigger( 'contentChange', [ wrapper ] );
|
||||
});
|
||||
}
|
||||
|
||||
// Positioning needed for upload step
|
||||
this.scope.find('.cGalleryDialog').css({ minHeight: 0, position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 });
|
||||
this.scope.closest('.ipsDialog_content').css({ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 });
|
||||
this.scope.find('.cGalleryDialog').css({ minHeight: "0", position: 'absolute', top: "0", left: "0", right: "0", bottom: "0" });
|
||||
this.scope.closest('.ipsDialog_content').css({ position: 'absolute', top: "0", left: "0", right: "0", bottom: "0" });
|
||||
|
||||
if( !wrapper.find('.cGallerySubmit_bottomBar').hasClass('ipsHide') ){
|
||||
wrapper.find('.cGallerySubmit_bottomBar').removeClass('ipsHide').fadeIn();
|
||||
@@ -1363,7 +1409,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.image.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150"><![CDATA[/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.image.js" javascript_type="controller" javascript_version="105100" javascript_position="1000150"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1434,17 +1480,25 @@
|
||||
// Add swipe left/right support
|
||||
delete Hammer.defaults.cssProps.userSelect; // see https://github.com/hammerjs/hammer.js/issues/81
|
||||
var mc = new Hammer( this.scope.find('.elGalleryHeader').get(0) ); // Can't touch this
|
||||
|
||||
var self = this;
|
||||
mc.on( 'swipeleft', function( e ) {
|
||||
$( document ).trigger('lightboxNextImage');
|
||||
if( !self.scope.find('.cGalleryNote_editing').length )
|
||||
{
|
||||
$( document ).trigger('lightboxNextImage');
|
||||
}
|
||||
} );
|
||||
mc.on( 'swiperight', function( e ) {
|
||||
$( document ).trigger('lightboxPrevImage');
|
||||
if( !self.scope.find('.cGalleryNote_editing').length )
|
||||
{
|
||||
$( document ).trigger('lightboxPrevImage');
|
||||
}
|
||||
} );
|
||||
|
||||
// Toggle document scrolling when dialogs open/close
|
||||
var self = this;
|
||||
$(document).on( 'hideDialog', function() {
|
||||
if( self.scope.closest('#cLightbox').length )
|
||||
if( self.scope.closest('#cLightbox').length && !ips.ui.dialog.hasOpenDialogs() )
|
||||
{
|
||||
$('body').addClass('ipsNoScroll');
|
||||
}
|
||||
@@ -1533,6 +1587,11 @@
|
||||
// Track page view
|
||||
ips.utils.analytics.trackPageView( state.data.realUrl );
|
||||
|
||||
// If the request was in the lightbox but the lightbox is closed, we must have closed the lightbox but then hit 'back' so now we need to relaunch it
|
||||
if( $('#cLightbox').length && !$('#cLightbox').is(':visible') ) {
|
||||
$('#cLightbox').show();
|
||||
}
|
||||
|
||||
// Scroll to the image but only if we're not in the lightbox
|
||||
if( !$('#cLightbox').length || !$('#cLightbox').is(':visible') ) {
|
||||
this._scrollPage();
|
||||
@@ -1748,6 +1807,19 @@
|
||||
if( !cacheOnly ){
|
||||
this.cleanContents();
|
||||
this._setImageLoading();
|
||||
|
||||
var urlToRequest = url;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We need to add preload=1 to the
|
||||
if( url.match(/\?/) ) {
|
||||
if( url.slice(-1) != '?' ){
|
||||
var urlToRequest = url + '&preload=1';
|
||||
}
|
||||
} else {
|
||||
var urlToRequest = url + '?preload=1';
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a regular load, set to loading
|
||||
@@ -1764,6 +1836,7 @@
|
||||
// Already have cached data? Just show it.
|
||||
if( self._cachedUrls[ url ] ){
|
||||
self._updateImage( self._cachedUrls[ url ] );
|
||||
self._markImageRead( url );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1775,7 +1848,7 @@
|
||||
this._ajaxObj = ajax;
|
||||
}
|
||||
|
||||
ajax( url, {
|
||||
ajax( urlToRequest, {
|
||||
dataType: 'json'
|
||||
} )
|
||||
.done( function (response) {
|
||||
@@ -1797,6 +1870,32 @@
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Mark an image read. When we fetch for caching we don't want the image marked as read, but when we move forward/back
|
||||
* to view the image in the lightbox, it should be marked at that point.
|
||||
*
|
||||
* @param {string} url URL of new image to fetch
|
||||
* @returns {void}
|
||||
*/
|
||||
_markImageRead: function (url) {
|
||||
var self = this;
|
||||
|
||||
if( url.match(/\?/) ) {
|
||||
if( url.slice(-1) != '?' ){
|
||||
url = url + '&do=markread';
|
||||
}
|
||||
} else {
|
||||
url = url + '?do=markread';
|
||||
}
|
||||
|
||||
ips.getAjax()( url, {
|
||||
dataType: 'json'
|
||||
} )
|
||||
.done( function (response) {
|
||||
Debug.log( "Marked read" );
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles a response from the server with new image info
|
||||
*
|
||||
@@ -2008,7 +2107,7 @@
|
||||
if( maxHeight < 400 ){
|
||||
maxHeight = 400;
|
||||
}
|
||||
console.dir(imageData);
|
||||
|
||||
if( imageData ){
|
||||
imageData = $.parseJSON( imageData );
|
||||
ratio = imageData['large'][ 0 ] / imageData['large'][ 1 ];
|
||||
@@ -2018,7 +2117,7 @@ console.dir(imageData);
|
||||
width: imageData['large'][0],
|
||||
height: imageData['large'][1]
|
||||
};
|
||||
console.dir(imageSize);
|
||||
|
||||
if( imageSize['width'] > maxWidth ){
|
||||
imageSize['width'] = maxWidth;
|
||||
imageSize['height'] = Math.round( imageSize['width'] / ratio );
|
||||
@@ -2085,7 +2184,7 @@ console.dir(imageSize);
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.note.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150"><![CDATA[/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.note.js" javascript_type="controller" javascript_version="105100" javascript_position="1000150"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2113,6 +2212,7 @@ console.dir(imageSize);
|
||||
this.on( 'mousedown', '.cGalleryNote_note', this.mouseDown );
|
||||
this.on( 'mouseenter', this.mouseEnter );
|
||||
this.on( 'mouseleave', this.mouseLeave );
|
||||
|
||||
this.setup();
|
||||
},
|
||||
|
||||
@@ -2124,7 +2224,8 @@ console.dir(imageSize);
|
||||
setup: function () {
|
||||
var self = this;
|
||||
|
||||
if( !_.isUndefined( this.scope.attr('data-editable') ) ){
|
||||
// Force disable for mobile as the behavior isn't terribly good on a small device
|
||||
if( !_.isUndefined( this.scope.attr('data-editable') ) && !ips.utils.responsive.currentIs('phone') ){
|
||||
this._editable = true;
|
||||
}
|
||||
|
||||
@@ -2155,7 +2256,7 @@ console.dir(imageSize);
|
||||
|
||||
this.scope.draggable('enable');
|
||||
|
||||
if( !$.trim( note ) ){
|
||||
if( !note.trim() ){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2262,7 +2363,7 @@ console.dir(imageSize);
|
||||
* @returns {void}
|
||||
*/
|
||||
mouseDown: function () {
|
||||
this.scope.draggable('disable');
|
||||
// this.scope.draggable('disable');
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -2276,6 +2377,12 @@ console.dir(imageSize);
|
||||
return;
|
||||
}
|
||||
|
||||
if( this._editing === true )
|
||||
{
|
||||
this.scope.find('.cGalleryNote_note > div textarea').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
this._editing = true;
|
||||
|
||||
this.scope
|
||||
@@ -2477,6 +2584,34 @@ console.dir(imageSize);
|
||||
_updatePosition: function () {
|
||||
var self = this;
|
||||
|
||||
// If the note block is now out of view, flip it to the other side
|
||||
var parent = this.scope.closest('.cGalleryViewImage');
|
||||
var notePos = this.scope.position();
|
||||
|
||||
var posLeft = this.scope.find('.cGalleryNote_note').css('left');
|
||||
var posRight = this.scope.find('.cGalleryNote_note').css('right');
|
||||
|
||||
// If the text box is on the right side, and is now past the boundary of the image, flip it to the left side
|
||||
if( parseInt( posLeft ) > 0 ) {
|
||||
if( notePos['left'] + parseInt( this.scope.width() ) + parseInt( this.scope.find('.cGalleryNote_note').width() ) > parent.width() ) {
|
||||
// But don't bother doing it if it will just be off the other side now
|
||||
if( notePos['left'] - parseInt( this.scope.find('.cGalleryNote_note').width() ) > 0 ) {
|
||||
this.scope.find('.cGalleryNote_note').css( 'left', posRight );
|
||||
this.scope.find('.cGalleryNote_note').css( 'right', posLeft );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( notePos['left'] - parseInt( this.scope.find('.cGalleryNote_note').width() ) < 0 ) {
|
||||
// Don't flip if it will be off the other side now
|
||||
if( notePos['left'] + parseInt( this.scope.width() ) + parseInt( this.scope.find('.cGalleryNote_note').width() ) < parent.width() ) {
|
||||
this.scope.find('.cGalleryNote_note').css( 'left', posRight );
|
||||
this.scope.find('.cGalleryNote_note').css( 'right', posLeft );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a new note, we don't want to update the position remotely yet.
|
||||
// We'll only do that once the note text is saved for the first time.
|
||||
if( this.scope.attr('data-noteID') == 'new' ){
|
||||
@@ -2515,7 +2650,7 @@ console.dir(imageSize);
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.notes.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150"><![CDATA[/**
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.notes.js" javascript_type="controller" javascript_version="105100" javascript_position="1000150"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2598,7 +2733,7 @@ console.dir(imageSize);
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.browse.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[ips.templates.set('gallery.patchwork.indexItem', " \
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.browse.js" javascript_type="template" javascript_version="105100" javascript_position="1000050"><![CDATA[ips.templates.set('gallery.patchwork.indexItem', " \
|
||||
{{#showThumb}}\
|
||||
<span class='cGalleryPatchwork_item' style='width: {{dims.width}}px; height: {{dims.height}}px; margin: {{dims.margin}}px {{dims.marginRight}}px {{dims.margin}}px {{dims.marginLeft}}px'>\
|
||||
{{/showThumb}}\
|
||||
@@ -2606,7 +2741,14 @@ console.dir(imageSize);
|
||||
<span class='cGalleryPatchwork_item ipsNoThumb ipsNoThumb_video' style='width: {{dims.width}}px; height: {{dims.height}}px; margin: {{dims.margin}}px {{dims.marginRight}}px {{dims.margin}}px {{dims.marginLeft}}px'>\
|
||||
{{/showThumb}}\
|
||||
<a data-imageLightbox title='{{image.caption}}' href='{{image.url}}'>\
|
||||
{{#showThumb}}<img src='{{image.src}}' alt='{{image.caption}}' class='cGalleryPatchwork_image'>{{/showThumb}}\
|
||||
{{#showThumb}}\
|
||||
{{#lazyLoad}}\
|
||||
<img src='{{blankImg}}' data-src='{{image.src}}' data-ratio='{{dims.ratio}}' alt='{{image.caption}}' class='cGalleryPatchwork_image'>\
|
||||
{{/lazyLoad}}\
|
||||
{{^lazyLoad}}\
|
||||
<img src='{{image.src}}' data-ratio='{{dims.ratio}}' alt='{{image.caption}}' class='cGalleryPatchwork_image'>\
|
||||
{{/lazyLoad}}\
|
||||
{{/showThumb}}\
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_mini'>\
|
||||
<img src='{{image.author.photo}}' class='ipsUserPhoto ipsUserPhoto_mini'>\
|
||||
<div>\
|
||||
@@ -2614,9 +2756,32 @@ console.dir(imageSize);
|
||||
<span class='ipsType_small ipsTruncate ipsTruncate_line'>{{#lang}}in{{/lang}} {{image.container}}</span>\
|
||||
</div>\
|
||||
</div>\
|
||||
{{#image.allowComments}}\
|
||||
<span class='cGalleryPatchwork_comments' data-commentCount='{{image.comments}}'><i class='fa fa-comment'></i> {{image.comments}}</span>\
|
||||
{{/image.allowComments}}\
|
||||
<ul class='ipsList_inline cGalleryPatchwork_stats'>\
|
||||
{{#image.unread}}\
|
||||
<li class='ipsPos_left'>\
|
||||
<span class='ipsItemStatus ipsItemStatus_small' data-ipsTooltip title='{{image.unread}}'><i class='fa fa-circle'></i></span>\
|
||||
</li>\
|
||||
{{/image.unread}}\
|
||||
{{#image.hasState}}\
|
||||
<li class='ipsPos_left'>\
|
||||
{{#image.state.hidden}}\
|
||||
<span class='ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning' data-ipsTooltip title='{{#lang}}hidden{{/lang}}'><i class='fa fa-eye-slash'></i></span>\
|
||||
{{/image.state.hidden}}\
|
||||
{{#image.state.pending}}\
|
||||
<span class='ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning' data-ipsTooltip title='{{#lang}}pending{{/lang}}'><i class='fa fa-warning'></i></span>\
|
||||
{{/image.state.pending}}\
|
||||
{{#image.state.pinned}}\
|
||||
<span class='ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive' data-ipsTooltip title='{{#lang}}pinned{{/lang}}'><i class='fa fa-thumb-tack'></i></span>\
|
||||
{{/image.state.pinned}}\
|
||||
{{#image.state.featured}}\
|
||||
<span class='ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive' data-ipsTooltip title='{{#lang}}featured{{/lang}}'><i class='fa fa-star'></i></span>\
|
||||
{{/image.state.featured}}\
|
||||
</li>\
|
||||
{{/image.hasState}}\
|
||||
{{#image.allowComments}}\
|
||||
<li class='ipsPos_right' data-commentCount='{{image.comments}}'><i class='fa fa-comment'></i> {{image.comments}}</li>\
|
||||
{{/image.allowComments}}\
|
||||
</ul>\
|
||||
</a>\
|
||||
</span>\
|
||||
");
|
||||
@@ -2629,7 +2794,14 @@ ips.templates.set('gallery.patchwork.tableItem', " \
|
||||
<div data-imageID='{{image.id}}' class='cGalleryPatchwork_item ipsNoThumb ipsNoThumb_video' style='width: {{dims.width}}px; height: {{dims.height}}px; margin: {{dims.margin}}px {{dims.marginRight}}px {{dims.margin}}px {{dims.marginLeft}}px'>\
|
||||
{{/showThumb}}\
|
||||
<a data-imageLightbox title='{{image.caption}}' href='{{image.url}}'>\
|
||||
{{#showThumb}}<img src='{{image.src}}' alt='{{image.caption}}' class='cGalleryPatchwork_image'>{{/showThumb}}\
|
||||
{{#showThumb}}\
|
||||
{{#lazyLoad}}\
|
||||
<img src='{{blankImg}}' data-src='{{image.src}}' data-ratio='{{dims.ratio}}' alt='{{image.caption}}' class='cGalleryPatchwork_image'>\
|
||||
{{/lazyLoad}}\
|
||||
{{^lazyLoad}}\
|
||||
<img src='{{image.src}}' data-ratio='{{dims.ratio}}' alt='{{image.caption}}' class='cGalleryPatchwork_image'>\
|
||||
{{/lazyLoad}}\
|
||||
{{/showThumb}}\
|
||||
<div class='ipsPhotoPanel ipsPhotoPanel_mini'>\
|
||||
<img src='{{image.author.photo}}' class='ipsUserPhoto ipsUserPhoto_mini'>\
|
||||
<div>\
|
||||
@@ -2676,7 +2848,7 @@ ips.templates.set('gallery.lightbox.wrapper', " \
|
||||
<div class='cLightboxBack'></div>\
|
||||
</div>\
|
||||
");]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.submit.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[ips.templates.set('gallery.submit.imageItem', " \
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.submit.js" javascript_type="template" javascript_version="105100" javascript_position="1000050"><![CDATA[ips.templates.set('gallery.submit.imageItem', " \
|
||||
<div class='ipsAttach ipsImageAttach ipsPad_half ipsAreaBackground_light {{#done}}ipsAttach_done{{/done}}' id='{{id}}' data-role='file' data-fileid='{{id}}' data-fullsizeurl='{{imagesrc}}' data-thumbnailurl='{{thumbnail}}' data-isImage='1'>\
|
||||
<ul class='ipsList_inline ipsImageAttach_controls'>\
|
||||
<li data-role='insert' {{#insertable}}style='display: none'{{/insertable}}><a href='#' data-action='insertFile' class='ipsAttach_selection' data-ipsTooltip title='{{#lang}}insertIntoPost{{/lang}}'><i class='fa fa-plus'></i></a></li>\
|
||||
@@ -2686,7 +2858,7 @@ ips.templates.set('gallery.lightbox.wrapper', " \
|
||||
<a href='#' data-role='deleteFile' class='ipsButton ipsButton_verySmall ipsButton_light' data-ipsTooltip title='{{#lang}}attachRemove{{/lang}}'><i class='fa fa-trash-o'></i></a>\
|
||||
</li>\
|
||||
</ul>\
|
||||
<div class='ipsImageAttach_thumb ipsType_center' data-role='preview' data-grid-ratio='65' data-action='insertFile' {{#thumb}}style='background-image: url( {{thumbnail}} )'{{/thumb}}>\
|
||||
<div class='ipsImageAttach_thumb ipsType_center' data-role='preview' data-grid-ratio='65' data-action='insertFile' {{#thumb}}style='background-image: url( \"{{thumbnail}}\" )'{{/thumb}}>\
|
||||
{{#status}}\
|
||||
<span class='ipsImageAttach_status ipsType_light' data-role='status'>{{{status}}}</span>\
|
||||
<span class='ipsAttachment_progress'><span data-role='progressbar'></span></span>\
|
||||
@@ -2703,7 +2875,7 @@ ips.templates.set('gallery.lightbox.wrapper', " \
|
||||
ips.templates.set('gallery.submit.imageItemWrapper', " \
|
||||
<div class='cGallerySubmit_fileList'>{{{content}}}</div>\
|
||||
");]]></file>
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.view.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[ips.templates.set('gallery.notes.wrapper', " \
|
||||
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.view.js" javascript_type="template" javascript_version="105100" javascript_position="1000050"><![CDATA[ips.templates.set('gallery.notes.wrapper', " \
|
||||
<div class='cGalleryNote' data-controller='gallery.front.view.note' data-noteID='{{id}}' data-note=\"{{note}}\" {{#editable}}data-editable{{/editable}} data-posLeft='{{left}}' data-posTop='{{top}}' data-dimWidth='{{width}}' data-dimHeight='{{height}}'>\
|
||||
<div class='cGalleryNote_border'></div>\
|
||||
<div class='cGalleryNote_note' style='display: none'>\
|
||||
@@ -2733,9 +2905,11 @@ controllers</order>
|
||||
jquery
|
||||
mustache
|
||||
jstz
|
||||
IntersectionObserver
|
||||
Debug.js
|
||||
app.js</order>
|
||||
<order app="global" path="/dev/js//library//jquery">jquery.js
|
||||
jquery-migrate.js
|
||||
jquery.history.js
|
||||
jquery.transform.js</order>
|
||||
<order app="global" path="/dev/js//library//linkify">linkify.min.js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="gallery" version="103038">
|
||||
<app key="gallery" version="105100">
|
||||
<word key="__app_gallery" js="0">Gallery</word>
|
||||
<word key="frontnavigation_gallery" js="0">Gallery</word>
|
||||
<word key="gallery_title" js="0">Gallery</word>
|
||||
@@ -18,7 +18,7 @@
|
||||
<word key="__defart_gallery_album_review" js="0">review on a gallery album</word>
|
||||
<word key="module__gallery_stats" js="0">Statistics</word>
|
||||
<word key="search_contextual_item_gallery_image" js="0">This Image</word>
|
||||
<word key="album_user_own_activity_item" js="0">%s added images to %s in </word>
|
||||
<word key="album_user_own_activity_item" js="0">%2$s added images to %1$s in </word>
|
||||
<word key="club_node_gallery" js="0">Club Images</word>
|
||||
<word key="community_image_categories" js="0">Community Images</word>
|
||||
<word key="menu__gallery_gallery" js="0">Gallery</word>
|
||||
@@ -70,6 +70,11 @@
|
||||
<word key="gallery_suffix_day" js="0">per day</word>
|
||||
<word key="gallery_suffix_kb_day" js="0">kB/day</word>
|
||||
<word key="gallery_requires_log" js="0">These settings rely on the detailed bandwidth log which can be disabled in the Gallery Settings and cleared periodically. If using these settings, it is recommended that you leave the log turned on and set not to clear more often than every 48 hours otherwise you may experience unexpected behavior.</word>
|
||||
<word key="g_download_original" js="0">Can download original image?</word>
|
||||
<word key="g_download_original_desc" js="0">Users will still be able to download the large size image through their browser</word>
|
||||
<word key="g_download_raw" js="0">Yes, without watermark</word>
|
||||
<word key="g_download_watermarked" js="0">Yes, with watermark</word>
|
||||
<word key="g_download_none" js="0">No</word>
|
||||
<word key="r__albums" js="0">Albums</word>
|
||||
<word key="r__albums_manage" js="0">Can view albums?</word>
|
||||
<word key="r__diskspace" js="0">Diskspace</word>
|
||||
@@ -86,7 +91,9 @@
|
||||
<word key="gcategory_allow_rating" js="0">Allow ratings?</word>
|
||||
<word key="category_can_tag" js="0">Allow tags?</word>
|
||||
<word key="category_tag_prefixes" js="0">Allow prefixes?</word>
|
||||
<word key="category_allow_albums_club" js="0">Allow albums?</word>
|
||||
<word key="category_allow_albums" js="0">Albums</word>
|
||||
<word key="category_allow_albums_desc" js="0"><![CDATA[You can control which groups are allowed to create albums from <a href='{internal.app=core&module=members&controller=groups}'>Group Settings</a>. If you require albums but the user does not have permission to create albums, they will not be able to submit to this category.]]></word>
|
||||
<word key="cat_no_allow_albums" js="0">Do not allow albums</word>
|
||||
<word key="cat_no_allow_albums_desc" js="0">Images can only be submitted directly to the category</word>
|
||||
<word key="cat_allow_albums" js="0">Allow albums</word>
|
||||
@@ -95,6 +102,7 @@
|
||||
<word key="cat_require_albums_desc" js="0">Images can only be submitted to albums within the category</word>
|
||||
<word key="category_watermark" js="0">Watermark images?</word>
|
||||
<word key="category_preset_tags" js="0">Preset tags</word>
|
||||
<word key="category_preset_tags_desc" js="0">If using a closed system, users will have to choose from these tags. If using an open system, tags entered here will show as suggestions.</word>
|
||||
<word key="perm__view" js="0">See Category</word>
|
||||
<word key="perm__read" js="0">View Images</word>
|
||||
<word key="perm__add" js="0">Upload Images</word>
|
||||
@@ -114,10 +122,15 @@
|
||||
<word key="category_rules_link" js="0">Link to rules</word>
|
||||
<word key="node_move_catsalbums" js="0">Move child categories and albums to</word>
|
||||
<word key="node_move_subalbums" js="0">Move albums to</word>
|
||||
<word key="node_mass_move_delete_albums" js="0">Move albums to / Delete</word>
|
||||
<word key="node_delete_children_catsalbums" js="0">Delete child categories and albums</word>
|
||||
<word key="node_delete_children_cats" js="0">Delete child categories</word>
|
||||
<word key="node_delete_children_albums" js="0">Delete albums</word>
|
||||
<word key="delete_or_move_pick_one" js="0">If you choose not to delete images in this category, you must select a new category or album to move them to instead</word>
|
||||
<word key="acplog__catalbum_mass_move" js="0">Mass Moved %s albums from %s to %s</word>
|
||||
<word key="acplog__catalbum_mass_delete" js="0">Mass Deleted %s albums From %s</word>
|
||||
<word key="galnode_mass_content_move_blurb" js="0"><![CDATA[<strong>%s albums</strong> will be moved to %s]]></word>
|
||||
<word key="galnode_mass_content_delete_blurb" js="0"><![CDATA[<strong>%s albums</strong> will be <strong>deleted</strong>.]]></word>
|
||||
<word key="error_messages" js="0">Error Messages</word>
|
||||
<word key="category_permission_custom_error" js="0">Custom permission denied message</word>
|
||||
<word key="category_permission_custom_error_desc" js="0">This error message will be shown to anyone who can browse the category but cannot view images within it</word>
|
||||
@@ -234,10 +247,11 @@
|
||||
<word key="gallery_bandwidth_period" js="0">Number of hours to keep bandwidth logs</word>
|
||||
<word key="gallery_options" js="0">General Options</word>
|
||||
<word key="gallery_rss_enabled" js="0">Enable latest images RSS feed</word>
|
||||
<word key="gallery_rss_enabled_desc" js="0"><![CDATA[Only content that is available to guests will be shown. For more options, create a <a href='{internal.app=core&module=discovery&controller=rss}'>Custom RSS Feed</a>]]></word>
|
||||
<word key="gallery_rebuildimages" js="0">Rebuilding images</word>
|
||||
<word key="rebuilding_gallery_images" js="0">Rebuilding gallery images</word>
|
||||
<word key="cleaning_up_gallery_images" js="0">Cleaning up Gallery images </word>
|
||||
<word key="gallery_maps_default" js="0">Enable maps by default</word>
|
||||
<word key="gallery_maps_default_desc" js="0">Users can choose whether or not to show a map next to images that have geolocation data embedded into the image. This option controls whether those maps are enabled by default or not, however users can override this preference while submitting their images.</word>
|
||||
<word key="member__gallery_Images" js="0">Gallery</word>
|
||||
<word key="remove_gallery_access" js="0">Allowed to access gallery?</word>
|
||||
<word key="remove_gallery_upload" js="0">Allowed to upload images?</word>
|
||||
@@ -284,6 +298,7 @@
|
||||
<word key="gallery_submit_prefix_album" js="0">Uploading to album "%s"</word>
|
||||
<word key="gallery_submit_prefix_cat" js="0">Uploading to category "%s"</word>
|
||||
<word key="loc_gallery_adding_image" js="0">Uploading an image</word>
|
||||
<word key="loc_gallery_adding_image_action" js="0">%s is uploading an image</word>
|
||||
<word key="upload_more_images" js="0">Upload more images</word>
|
||||
<word key="select_your_images" js="0">Select your images</word>
|
||||
<word key="select_your_movies" js="0">Select your movies</word>
|
||||
@@ -292,7 +307,7 @@
|
||||
<word key="image_ipaddress" js="0">IP Address</word>
|
||||
<word key="image_tags" js="0">Tags</word>
|
||||
<word key="image_auto_follow" js="0"></word>
|
||||
<word key="image_auto_follow_suffix" js="0">Notify me when other comments are posted</word>
|
||||
<word key="image_auto_follow_suffix" js="0">Follow this image</word>
|
||||
<word key="image_description" js="0">Description</word>
|
||||
<word key="image_credit_info" js="0">Credit</word>
|
||||
<word key="image_credit_info_desc" js="0">If credit must be provided for use of the image, supply the source of the image</word>
|
||||
@@ -310,17 +325,23 @@
|
||||
<word key="image__comment_placeholder" js="0">Add a comment...</word>
|
||||
<word key="image_submit_comment" js="0">Submit Comment</word>
|
||||
<word key="map_enabled" js="0">Show map?</word>
|
||||
<word key="map_enabled_lightbox" js="0">Show map?</word>
|
||||
<word key="map_privacy" js="0">Map privacy</word>
|
||||
<word key="set_image_as" js="0">Set as</word>
|
||||
<word key="loc_gallery_browsing" js="0">Browsing Gallery</word>
|
||||
<word key="loc_gallery_browsing_action" js="0">%s is browsing the gallery</word>
|
||||
<word key="loc_gallery_browsing_categories" js="0">Browsing gallery categories</word>
|
||||
<word key="loc_gallery_browsing_categories_action" js="0">%s is browsing gallery categories</word>
|
||||
<word key="featured_images" js="0">Featured Images</word>
|
||||
<word key="new_images" js="0">New Images</word>
|
||||
<word key="new_image_comments_notification" js="0">Notify me of comments on these images</word>
|
||||
<word key="images_no_number" js="0">{!# [1:image][?:images]}</word>
|
||||
<word key="loc_gallery_viewing_image" js="0">Viewing image: %s</word>
|
||||
<word key="loc_gallery_viewing_image_action" js="0">%s is viewing an image</word>
|
||||
<word key="loc_gallery_viewing_category" js="0">Viewing category: %s</word>
|
||||
<word key="loc_gallery_viewing_category_action" js="0">%s is browsing a gallery category</word>
|
||||
<word key="loc_gallery_viewing_album" js="0">Viewing album: %s</word>
|
||||
<word key="loc_gallery_viewing_album_action" js="0">%s is viewing an album</word>
|
||||
<word key="gallery_rss_title" js="0">Latest Images</word>
|
||||
<word key="gallery_rss_title_container" js="0">Latest Images: %s</word>
|
||||
<word key="gallery_rss_offline" js="0">This RSS feed is disabled</word>
|
||||
@@ -416,6 +437,7 @@
|
||||
<word key="unread_cat_images" js="0">This category has new images</word>
|
||||
<word key="image_tools" js="0">Image Tools</word>
|
||||
<word key="image_share" js="0">Share</word>
|
||||
<word key="cannot_download_original_image" js="0">You do not have permission to download images</word>
|
||||
<word key="cat_img_count" js="0">{# [1:image][?:images]}</word>
|
||||
<word key="cat_album_count" js="0">{# [1:album][?:albums]}</word>
|
||||
<word key="cat_comment_count" js="0">{# [1:comment][?:comments]}</word>
|
||||
@@ -489,7 +511,7 @@
|
||||
<word key="gallery_category_id" js="0">Category</word>
|
||||
<word key="profile_gallery_gallery" js="0">Albums</word>
|
||||
<word key="choose_album" js="0">Choose Album</word>
|
||||
<word key="choose_category" js="0">Select Category</word>
|
||||
<word key="choose_category" js="0">Choose Category</word>
|
||||
<word key="upload_images" js="0">Upload Images</word>
|
||||
<word key="image_information" js="0">Add Information</word>
|
||||
<word key="process" js="0">Finish</word>
|
||||
@@ -557,6 +579,11 @@
|
||||
<word key="tags_all_desc" js="0">Sets the tags for each image you're uploading except ones you individually specify tags for.</word>
|
||||
<word key="gallery_clear_uploads_error" js="0">Could not delete file %s : %s'</word>
|
||||
<word key="specify_image_tags" js="0">Set tags</word>
|
||||
<word key="gallery_guest_post_normal_header" js="0">You are posting as a guest</word>
|
||||
<word key="gallery_guest_post_pbr_blurb" js="0">You can submit your images now and register an account later.</word>
|
||||
<word key="gallery_guest_post_mod_approval" js="0"><![CDATA[<strong>Note:</strong> your images will require approval by a moderator after posting.]]></word>
|
||||
<word key="gallery_this_will_be_moderated" js="0">Because of a warning you received, your images will be hidden until a moderator approves them.</word>
|
||||
<word key="emailtpl__imageContent" js="0">Gallery image table</word>
|
||||
<word key="exif_title" js="0">Full EXIF data</word>
|
||||
<word key="gallery_focal_length_mm" js="0">%s mm</word>
|
||||
<word key="gallery_shutterspeed" js="0">1/%s second</word>
|
||||
@@ -592,7 +619,7 @@
|
||||
<word key="IFD0.Copyright" js="0">Copyright</word>
|
||||
<word key="IFD0.XResolution" js="0">X-Resolution</word>
|
||||
<word key="IFD0.YResolution" js="0">Y-Resolution</word>
|
||||
<word key="IFD0.DateTime" js="0">Date Taken</word>
|
||||
<word key="IFD0.DateTime" js="0">Last Modified</word>
|
||||
<word key="IFD0.Orientation" js="0">Orientation</word>
|
||||
<word key="IFD0.Orientation_map_1" js="0">The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side</word>
|
||||
<word key="IFD0.Orientation_map_2" js="0">The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side</word>
|
||||
@@ -783,6 +810,7 @@
|
||||
<word key="THUMBNAIL.YCbCrPositioning" js="0"></word>
|
||||
<word key="THUMBNAIL.YCbCrPositioning_map_1" js="0"></word>
|
||||
<word key="THUMBNAIL.YCbCrPositioning_map_2" js="0"></word>
|
||||
<word key="EXIF.UndefinedTag:0xA434" js="0">Lens Model</word>
|
||||
<word key="digest_area_gallery_image" js="0">Images</word>
|
||||
<word key="digest_area_gallery_album" js="0">Albums</word>
|
||||
<word key="digest_area_gallery_category" js="0">Categories</word>
|
||||
@@ -797,8 +825,11 @@
|
||||
<word key="__api_gallery_images" js="0">Images</word>
|
||||
<word key="__api_gallery_comments" js="0">Comments</word>
|
||||
<word key="__api_gallery_reviews" js="0">Reviews</word>
|
||||
<word key="__api_gallery_categories" js="0">Categories</word>
|
||||
<word key="gallery_bm_filters" js="0">Gallery</word>
|
||||
<word key="mf_has_album" js="0">Member has an Album?</word>
|
||||
<word key="sitemap_gallery_Images" js="0">Gallery Images</word>
|
||||
<word key="sitemap_gallery_Videos" js="0">Gallery Videos</word>
|
||||
<word key="delete_note" js="1">Delete note</word>
|
||||
<word key="save_note" js="1">Save</word>
|
||||
<word key="saving_note" js="1">Saving...</word>
|
||||
|
||||
@@ -2,17 +2,20 @@
|
||||
"admin": {
|
||||
"gallery": {
|
||||
"default_controller": "categories",
|
||||
"protected": 0
|
||||
"protected": 0,
|
||||
"default": 1
|
||||
},
|
||||
"stats": {
|
||||
"default_controller": null,
|
||||
"protected": 0
|
||||
"protected": 0,
|
||||
"default": 0
|
||||
}
|
||||
},
|
||||
"front": {
|
||||
"gallery": {
|
||||
"default_controller": "browse",
|
||||
"protected": 0
|
||||
"protected": 0,
|
||||
"default": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -479,18 +479,16 @@
|
||||
"zerofill": false
|
||||
},
|
||||
"album_meta_data": {
|
||||
"allow_null": true,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": 0,
|
||||
"length": 1,
|
||||
"name": "album_meta_data",
|
||||
"type": "BIT",
|
||||
"unsigned": false,
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
"allow_null": true,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"auto_increment": false
|
||||
},
|
||||
"album_last_comment": {
|
||||
"allow_null": true,
|
||||
@@ -2177,17 +2175,15 @@
|
||||
},
|
||||
"image_meta_data": {
|
||||
"name": "image_meta_data",
|
||||
"type": "BIT",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
"unsigned": true,
|
||||
"auto_increment": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
@@ -2453,6 +2449,18 @@
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"upload_exif": {
|
||||
"name": "upload_exif",
|
||||
"type": "MEDIUMTEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"auto_increment": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
"default": "1600x1200",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "gallery_maps_default",
|
||||
"default": "0",
|
||||
"report": "full"
|
||||
},
|
||||
{
|
||||
"key": "gallery_rss_enabled",
|
||||
"default": "1",
|
||||
|
||||
+1383
-1187
File diff suppressed because it is too large.
Load diff
@@ -282,5 +282,97 @@
|
||||
"103035": "4.3.6",
|
||||
"103036": "4.3.6",
|
||||
"103037": "4.3.6",
|
||||
"103038": "4.3.6"
|
||||
"103038": "4.3.6",
|
||||
"103039": "4.3.6",
|
||||
"104000": "4.4.0 Beta 1",
|
||||
"104001": "4.4.0 Beta 2",
|
||||
"104002": "4.4.0 Beta 3",
|
||||
"104004": "4.4.0 Beta 4",
|
||||
"104003": "4.4.0 Beta 4",
|
||||
"104005": "4.4.0",
|
||||
"104006": "4.4.0",
|
||||
"104007": "4.4.0",
|
||||
"104008": "4.4.0",
|
||||
"104009": "4.4.1",
|
||||
"104010": "4.4.1 Beta 2",
|
||||
"104011": "4.4.1",
|
||||
"104012": "4.4.1",
|
||||
"104013": "4.4.1",
|
||||
"104014": "4.4.1",
|
||||
"104015": "4.4.2 Beta 1",
|
||||
"104016": "4.4.2",
|
||||
"104017": "4.4.2",
|
||||
"104018": "4.4.2",
|
||||
"104019": "4.4.2",
|
||||
"104020": "4.4.2",
|
||||
"104021": "4.4.3 Beta 1",
|
||||
"104022": "4.4.3 Beta 2",
|
||||
"104023": "4.4.3",
|
||||
"104024": "4.4.3",
|
||||
"104025": "4.4.3",
|
||||
"104026": "4.4.4 Beta 1",
|
||||
"104027": "4.4.4",
|
||||
"104028": "4.4.4",
|
||||
"104029": "4.4.4",
|
||||
"104030": "4.4.5 Beta 1",
|
||||
"104031": "4.4.5 Beta 2",
|
||||
"104032": "4.4.5 Beta 2",
|
||||
"104033": "4.4.5",
|
||||
"104034": "4.4.5",
|
||||
"104035": "4.4.5",
|
||||
"104036": "4.4.5",
|
||||
"104037": "4.4.5",
|
||||
"104038": "4.4.6",
|
||||
"104039": "4.4.6",
|
||||
"104040": "4.4.6",
|
||||
"104041": "4.4.7 Beta 1",
|
||||
"104042": "4.4.7 Beta 2",
|
||||
"104043": "4.4.7 Beta 3",
|
||||
"104044": "4.4.7",
|
||||
"104045": "4.4.8 Beta 1",
|
||||
"104046": "4.4.8 Beta 2",
|
||||
"104047": "4.4.8",
|
||||
"104048": "4.4.9 Beta 1",
|
||||
"104049": "4.4.9",
|
||||
"104050": "4.4.9",
|
||||
"104051": "4.4.9",
|
||||
"104052": "4.4.9",
|
||||
"104053": "4.4.9.1",
|
||||
"104054": "4.4.9.1",
|
||||
"104055": "4.4.9.2",
|
||||
"104056": "4.4.9.2",
|
||||
"104057": "4.4.10 Beta 1",
|
||||
"104058": "4.4.10 Beta 2",
|
||||
"104059": "4.4.10 Beta 3",
|
||||
"104060": "4.4.10 Beta 4",
|
||||
"104061": "4.4.10",
|
||||
"104062": "4.4.10",
|
||||
"104063": "4.4.10",
|
||||
"104064": "4.4.10",
|
||||
"104065": "4.4.10",
|
||||
"104066": "4.4.10",
|
||||
"104067": "4.4.10",
|
||||
"104068": "4.4.10",
|
||||
"104069": "4.4.10",
|
||||
"105013": "4.5.0 Beta 1",
|
||||
"105014": "4.5.0 Beta 1",
|
||||
"105015": "4.5.0 Beta 2",
|
||||
"105016": "4.5.0 Beta 3",
|
||||
"105017": "4.5.0 Beta 4",
|
||||
"105018": "4.5.0 Beta 4",
|
||||
"105019": "4.5.0 Beta 4",
|
||||
"105020": "4.5.0 Beta 4",
|
||||
"105021": "4.5.0 Beta 5",
|
||||
"105022": "4.5.0 Beta 6",
|
||||
"105023": "4.5.0 Beta 6",
|
||||
"105024": "4.5.0 Beta 7",
|
||||
"105025": "4.5.0 Beta 8",
|
||||
"105026": "4.5.0 Beta 8",
|
||||
"105027": "4.5.0 Beta 8",
|
||||
"105028": "4.5.0 Beta 9",
|
||||
"105029": "4.5.0 Beta 10",
|
||||
"105030": "4.5.0 Beta 11",
|
||||
"105031": "4.5.0 Beta 11",
|
||||
"105032": "4.5.0 Beta 12",
|
||||
"105100": "4.5.0"
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\AdvertisementLocations;
|
||||
|
||||
/* 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;
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\ContentRouter;
|
||||
|
||||
/* 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;
|
||||
@@ -63,7 +63,7 @@ class _Gallery
|
||||
*/
|
||||
public function customTableHelper( $className, $url, $where=array() )
|
||||
{
|
||||
if( !in_array( $className, $this->classes ) or $className == 'IPS\gallery\Album\Item' )
|
||||
if( !\in_array( $className, $this->classes ) or $className == 'IPS\gallery\Album\Item' )
|
||||
{
|
||||
return new \IPS\Helpers\Table\Content( $className, $url, $where );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\CreateMenu;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Dashboard;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\EditorLocations;
|
||||
|
||||
/* 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;
|
||||
@@ -43,7 +43,7 @@ class _Albums
|
||||
*/
|
||||
public function canAttach( $member, $field )
|
||||
{
|
||||
return NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,4 +84,54 @@ class _Albums
|
||||
return \IPS\gallery\Album::load( $id1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild content post-upgrade
|
||||
*
|
||||
* @param int|null $offset Offset to start from
|
||||
* @param int|null $max Maximum to parse
|
||||
* @return int Number completed
|
||||
* @note This method is optional and will only be called if it exists
|
||||
*/
|
||||
public function rebuildContent( $offset, $max )
|
||||
{
|
||||
$did = 0;
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'gallery_albums', NULL, 'album_id ASC', array( $offset, $max ) ) as $album )
|
||||
{
|
||||
$did++;
|
||||
|
||||
try
|
||||
{
|
||||
$rebuilt = \IPS\Text\LegacyParser::parseStatic( $album['album_description'] );
|
||||
}
|
||||
catch( \InvalidArgumentException $e )
|
||||
{
|
||||
if( $e->getcode() == 103014 )
|
||||
{
|
||||
$rebuilt = preg_replace( "#\[/?([^\]]+?)\]#", '', $album['album_description'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
if( $rebuilt !== FALSE )
|
||||
{
|
||||
\IPS\Db::i()->update( 'gallery_albums', array( 'album_description' => $rebuilt ), 'album_id=' . $album['album_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
return $did;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total content count to be used in progress indicator
|
||||
*
|
||||
* @return int Total Count
|
||||
*/
|
||||
public function contentCount()
|
||||
{
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'gallery_albums' )->first();
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\EditorLocations;
|
||||
|
||||
/* 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;
|
||||
@@ -111,26 +111,46 @@ class _Categories
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Store image proxy status ( true = enabled )
|
||||
* @brief Use the cached image URL instead of the original URL
|
||||
*/
|
||||
protected $_imageProxyStatus = null;
|
||||
protected $proxyUrl = FALSE;
|
||||
|
||||
/**
|
||||
* Rebuild content to add or remove image proxy
|
||||
*
|
||||
* @param int|null $offset Offset to start from
|
||||
* @param int|null $max Maximum to parse
|
||||
* @param bool $status Enable/Disable Image Proxy
|
||||
* @param bool $proxyUrl Use the cached image URL instead of the original URL
|
||||
* @return int Number completed
|
||||
* @note This method is optional and will only be called if it exists
|
||||
*/
|
||||
public function rebuildImageProxy( $offset, $max, $status=TRUE )
|
||||
public function rebuildImageProxy( $offset, $max, $proxyUrl = FALSE )
|
||||
{
|
||||
$this->_imageProxyStatus = $status;
|
||||
|
||||
$this->proxyUrl = $proxyUrl;
|
||||
return $this->performRebuild( $offset, $max, 'parseImageProxy' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Store lazy loading status ( true = enabled )
|
||||
*/
|
||||
protected $_lazyLoadStatus = null;
|
||||
|
||||
/**
|
||||
* Rebuild content to add or remove lazy loading
|
||||
*
|
||||
* @param int|null $offset Offset to start from
|
||||
* @param int|null $max Maximum to parse
|
||||
* @param bool $status Enable/Disable lazy loading
|
||||
* @return int Number completed
|
||||
* @note This method is optional and will only be called if it exists
|
||||
*/
|
||||
public function rebuildLazyLoad( $offset, $max, $status=TRUE )
|
||||
{
|
||||
$this->_lazyLoadStatus = $status;
|
||||
|
||||
return $this->performRebuild( $offset, $max, 'parseLazyLoad' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform rebuild - abstracted as the call for rebuildContent() and rebuildAttachmentImages() is nearly identical
|
||||
*
|
||||
@@ -152,11 +172,15 @@ class _Categories
|
||||
{
|
||||
if( $callback == 'parseImageProxy' )
|
||||
{
|
||||
$rebuilt = \IPS\Text\Parser::parseImageProxy( $word['word_custom'], $this->_imageProxyStatus );
|
||||
$rebuilt = \IPS\Text\Parser::removeImageProxy( $word['word_custom'], $this->proxyUrl );
|
||||
}
|
||||
elseif( $callback == 'parseLazyLoad' )
|
||||
{
|
||||
$rebuilt = \IPS\Text\Parser::parseLazyLoad( $word['word_custom'], $this->_lazyLoadStatus );
|
||||
}
|
||||
else
|
||||
{
|
||||
$rebuilt = call_user_func( $callback, $word['word_custom'] );
|
||||
$rebuilt = $callback( $word['word_custom'] );
|
||||
}
|
||||
}
|
||||
catch( \InvalidArgumentException $e )
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\EditorLocations;
|
||||
|
||||
/* 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;
|
||||
@@ -23,4 +23,15 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Gallery extends \IPS\gallery\extensions\core\EditorLocations\Images
|
||||
{
|
||||
/**
|
||||
* Can we use attachments in this editor?
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param \IPS\Helpers\Form\Editor $field The editor field
|
||||
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
|
||||
*/
|
||||
public function canAttach( $member, $field )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\EditorLocations;
|
||||
|
||||
/* 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;
|
||||
@@ -43,7 +43,7 @@ class _Images
|
||||
*/
|
||||
public function canAttach( $member, $field )
|
||||
{
|
||||
return NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\EditorMedia;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\FileStorage;
|
||||
|
||||
/* 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;
|
||||
@@ -100,7 +100,7 @@ class _Images
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $update ) )
|
||||
if ( \count( $update ) )
|
||||
{
|
||||
foreach( $update as $k => $v )
|
||||
{
|
||||
@@ -110,7 +110,7 @@ class _Images
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $update ) )
|
||||
if ( \count( $update ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'gallery_images', $update, array( 'image_id=?', $image['image_id'] ) );
|
||||
}
|
||||
@@ -139,7 +139,7 @@ class _Images
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $update ) )
|
||||
if ( \count( $update ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'gallery_images', $update, array( 'image_id=?', $image['image_id'] ) );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\FrontNavigation;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\GroupForm;
|
||||
|
||||
/* 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;
|
||||
@@ -43,6 +43,20 @@ class _Gallery
|
||||
}
|
||||
|
||||
$form->addHeader( 'gallery_restrictions' );
|
||||
|
||||
if( \IPS\Settings::i()->gallery_use_watermarks )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'g_download_original', $group->g_download_original, FALSE, array( 'options' => array(
|
||||
\IPS\gallery\Image::DOWNLOAD_ORIGINAL_RAW => 'g_download_raw',
|
||||
\IPS\gallery\Image::DOWNLOAD_ORIGINAL_WATERMARKED => 'g_download_watermarked',
|
||||
\IPS\gallery\Image::DOWNLOAD_ORIGINAL_NONE => 'g_download_none'
|
||||
) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'g_download_original', $group->g_download_original, FALSE ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'g_movies', $group->g_movies, FALSE, array( 'togglesOn' => array( 'g_movie_size' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'g_movie_size', $group->g_movie_size, FALSE, array( 'unlimited' => 0 ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('gallery_suffix_kb'), 'g_movie_size' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'g_max_upload', $group->g_max_upload, FALSE, array( 'unlimited' => 0 ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('gallery_suffix_kb') ) );
|
||||
@@ -70,6 +84,7 @@ class _Gallery
|
||||
$group->g_img_album_limit = $values['g_img_album_limit'];
|
||||
}
|
||||
|
||||
$group->g_download_original = $values['g_download_original'];
|
||||
$group->g_movies = $values['g_movies'];
|
||||
$group->g_movie_size = $values['g_movie_size'];
|
||||
$group->g_max_upload = $values['g_max_upload'];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\GroupLimits;
|
||||
|
||||
/* 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;
|
||||
@@ -37,7 +37,36 @@ class _Album
|
||||
'exclude' => array(),
|
||||
'lessIsMore' => array(),
|
||||
'neg1IsBest' => array(),
|
||||
'zeroIsBest' => array( 'g_album_limit', 'g_img_album_limit', 'g_max_upload', 'g_max_transfer', 'g_max_views', 'g_movie_size' ),
|
||||
'zeroIsBest' => array( 'g_img_album_limit', 'g_max_upload', 'g_max_transfer', 'g_max_views', 'g_movie_size' ),
|
||||
'callback' => array( 'g_album_limit' => function( $a, $b, $k, $member ) {
|
||||
/* We only want to use the limit if this group can create albums */
|
||||
$limits = array();
|
||||
if ( $a['g_create_albums'] )
|
||||
{
|
||||
if ( $a[ $k ] == 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limits[] = $a[ $k ];
|
||||
}
|
||||
}
|
||||
|
||||
if ( $b['g_create_albums'] )
|
||||
{
|
||||
if ( $b[ $k ] == 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limits[] = $b[ $k ];
|
||||
}
|
||||
}
|
||||
|
||||
return \count( $limits ) ? \max( $limits ) : 0;
|
||||
} )
|
||||
);
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\LiveSearch;
|
||||
|
||||
/* 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;
|
||||
@@ -26,7 +26,7 @@ class _Categories
|
||||
/**
|
||||
* Check we have access
|
||||
*
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function hasAccess()
|
||||
{
|
||||
@@ -37,7 +37,7 @@ class _Categories
|
||||
/**
|
||||
* Get the search results
|
||||
*
|
||||
* @param string Search Term
|
||||
* @param string $searchTerm Search Term
|
||||
* @return array Array of results
|
||||
*/
|
||||
public function getResults( $searchTerm )
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\gallery\extensions\core\MemberACPProfileContentTab;
|
||||
|
||||
/* 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;
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\MemberFilter;
|
||||
|
||||
/* 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;
|
||||
@@ -31,7 +31,7 @@ class _Album
|
||||
*/
|
||||
public function availableIn( $area )
|
||||
{
|
||||
return in_array( $area, array( 'bulkmail', 'group_promotions' ) );
|
||||
return \in_array( $area, array( 'bulkmail', 'group_promotions' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ class _Album
|
||||
*/
|
||||
public function save( $post )
|
||||
{
|
||||
if( isset( $post['mf_has_album'] ) and in_array( $post['mf_has_album'], array( 'yes', 'no' ) ) )
|
||||
if( isset( $post['mf_has_album'] ) and \in_array( $post['mf_has_album'], array( 'yes', 'no' ) ) )
|
||||
{
|
||||
return array( 'has_album' => $post['mf_has_album'] );
|
||||
}
|
||||
@@ -70,7 +70,7 @@ class _Album
|
||||
* Get where clause to add to the member retrieval database query
|
||||
*
|
||||
* @param mixed $data The array returned from the save() method
|
||||
* @return array|NULL Where clause - must be a single array( "clause", ...binds )
|
||||
* @return array|NULL Where clause - must be a single array( "clause" )
|
||||
*/
|
||||
public function getQueryWhereClause( $data )
|
||||
{
|
||||
|
||||
Whitespace-only changes.
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Member Form Extension
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Gallery
|
||||
* @since 23 Mar 2017
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\extensions\core\MemberForm;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
class _Images
|
||||
{
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
final public function deprecated()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\gallery\extensions\core\MemberRestrictions;
|
||||
|
||||
/* 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;
|
||||
@@ -94,7 +94,7 @@ class _Gallery extends \IPS\core\MemberACPProfile\Restriction
|
||||
{
|
||||
if ( isset( $changes[ $k ] ) )
|
||||
{
|
||||
$return[] = \IPS\Member::loggedIn()->language()->addToStack( 'history_restrictions_' . $k . '_' . intval( $changes[ $k ]['new'] ) );
|
||||
$return[] = \IPS\Member::loggedIn()->language()->addToStack( 'history_restrictions_' . $k . '_' . \intval( $changes[ $k ]['new'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\MemberSync;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Template Plugin - Gallery: Background image formatting
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Content
|
||||
* @since 12 March 2014
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\extensions\core\OutputPlugins;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Template Plugin - Gallery: Background image formatting
|
||||
*/
|
||||
class _Backgroundimage
|
||||
{
|
||||
/**
|
||||
* @brief Can be used when compiling CSS
|
||||
*/
|
||||
public static $canBeUsedInCss = TRUE;
|
||||
|
||||
/**
|
||||
* Run the plug-in
|
||||
*
|
||||
* @param string $data The initial data from the tag
|
||||
* @param array $options Array of options
|
||||
* @return string Code to eval
|
||||
*/
|
||||
public static function runPlugin( $data, $options )
|
||||
{
|
||||
return "str_replace( array( '(', ')' ), array( '\(', '\)' ), " . $data . " );";
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Permissions;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Profile;
|
||||
|
||||
/* 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;
|
||||
@@ -48,7 +48,7 @@ class _gallery
|
||||
{
|
||||
$where = array( array( 'album_owner_id=?', $this->member->member_id ) );
|
||||
|
||||
if( count( \IPS\Member::loggedIn()->socialGroups() ) )
|
||||
if( \count( \IPS\Member::loggedIn()->socialGroups() ) )
|
||||
{
|
||||
$where[] = array( '( album_type=1 OR ( album_type=2 AND album_owner_id=? ) OR ( album_type=3 AND ( album_owner_id=? OR ( album_allowed_access IS NOT NULL AND album_allowed_access IN(' . implode( ',', \IPS\Member::loggedIn()->socialGroups() ) . ') ) ) ) )', \IPS\Member::loggedIn()->member_id, \IPS\Member::loggedIn()->member_id );
|
||||
}
|
||||
@@ -78,6 +78,8 @@ class _gallery
|
||||
$table = new \IPS\gallery\Album\Table( $this->member->url()->setQueryString( 'tab', 'node_gallery_gallery') );
|
||||
$table->setOwner( $this->member );
|
||||
$table->limit = 10;
|
||||
$table->sortBy = 'album_last_img_date';
|
||||
$table->sortDirection = 'desc';
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'global', 'gallery' ), 'profileAlbumTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'browse', 'gallery' ), 'albums' );
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Queue;
|
||||
|
||||
/* 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;
|
||||
@@ -66,7 +66,7 @@ class _CleanUpGalleryImages
|
||||
}
|
||||
|
||||
$last = NULL;
|
||||
foreach( \IPS\Db::i()->select( '*', 'gallery_images', array( 'image_media=?', 0 ), 'image_id ASC', array( $offset, 100 ) ) as $image )
|
||||
foreach( \IPS\Db::i()->select( '*', 'gallery_images', array( 'image_media=? AND image_id > ?', 0, (int) $offset ), 'image_id ASC', \IPS\REBUILD_SLOW ) as $image )
|
||||
{
|
||||
$data['did']++;
|
||||
|
||||
@@ -159,10 +159,11 @@ class _CleanUpGalleryImages
|
||||
/**
|
||||
* Perform post-completion processing
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data Data returned from preQueueData
|
||||
* @param bool $processed Was anything processed or not? If preQueueData returns NULL, this will be FALSE.
|
||||
* @return void
|
||||
*/
|
||||
public function postComplete( $data )
|
||||
public function postComplete( $data, $processed = TRUE )
|
||||
{
|
||||
\IPS\Db::i()->query( "ALTER TABLE `" . \IPS\Db::i()->prefix . "gallery_images` DROP COLUMN image_thumb_file_name, DROP COLUMN image_medium_file_name" );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Queue;
|
||||
|
||||
/* 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;
|
||||
@@ -34,7 +34,7 @@ class _Follow
|
||||
public function run( $data, $offset )
|
||||
{
|
||||
$category = \IPS\gallery\Category::load( $data['category_id'] );
|
||||
$album = ( !is_null( $data['album_id'] ) ) ? \IPS\gallery\Album::load( $data['album_id'] ) : NULL;
|
||||
$album = ( !\is_null( $data['album_id'] ) ) ? \IPS\gallery\Album::load( $data['album_id'] ) : NULL;
|
||||
$member = \IPS\Member::load( $data['member_id'] );
|
||||
$newOffset = \IPS\gallery\Image::_sendNotificationsBatch( $category, $album, $member, $offset );
|
||||
|
||||
@@ -56,25 +56,8 @@ class _Follow
|
||||
*/
|
||||
public function getProgress( $data, $offset )
|
||||
{
|
||||
if ( !is_null( $data['album_id'] ) )
|
||||
{
|
||||
$numberOfFollowers = \IPS\gallery\Image::_notificationRecipients( \IPS\gallery\Category::load( $data['category_id'] ), \IPS\gallery\Album::load( $data['album_id'] ) )->count( TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
$numberOfFollowers = \IPS\gallery\Image::_notificationRecipients( \IPS\gallery\Category::load( $data['category_id'] ) )->count( TRUE );
|
||||
}
|
||||
|
||||
if ( $numberOfFollowers )
|
||||
{
|
||||
$complete = round( 100 / $numberOfFollowers * $offset, 2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$complete = 100;
|
||||
}
|
||||
|
||||
$directContainer = ( !is_null( $data['album_id'] ) ) ? \IPS\gallery\Album::load( $data['album_id'] ) : \IPS\gallery\Category::load( $data['category_id'] );
|
||||
$complete = $data['followerCount'] ? round( 100 / $data['followerCount'] * $offset, 2 ) : 100;
|
||||
$directContainer = ( !\is_null( $data['album_id'] ) ) ? \IPS\gallery\Album::load( $data['album_id'] ) : \IPS\gallery\Category::load( $data['category_id'] );
|
||||
|
||||
return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack('backgroundQueue_follow', FALSE, array( 'htmlsprintf' => array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->basicUrl( $directContainer->url(), TRUE, $directContainer->_title, FALSE ) ) ) ), 'complete' => $complete );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Queue;
|
||||
|
||||
/* 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;
|
||||
@@ -26,7 +26,7 @@ class _RebuildGalleryImages
|
||||
/**
|
||||
* @brief Number of content items to rebuild per cycle
|
||||
*/
|
||||
public $rebuild = 20;
|
||||
public $rebuild = \IPS\REBUILD_SLOW;
|
||||
|
||||
/**
|
||||
* Parse data before queuing
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Sitemap;
|
||||
|
||||
/* 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;
|
||||
@@ -45,6 +45,15 @@ class _Images
|
||||
*/
|
||||
public function getFilenames()
|
||||
{
|
||||
$settings = \IPS\Settings::i()->sitemap_content_settings ? json_decode( \IPS\Settings::i()->sitemap_content_settings, TRUE ) : array();
|
||||
$class = 'IPS\\gallery\\Image';
|
||||
$limit = ( isset( $settings["sitemap_{$class::$title}_count"] ) ) ? $settings["sitemap_{$class::$title}_count"] : -1;
|
||||
|
||||
if( $limit == 0 )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$count = \IPS\gallery\Image::getItemsWithPermission( array( 'image_media=?', 0 ), NULL, 10, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, new \IPS\Member, FALSE, FALSE, FALSE, TRUE );
|
||||
$files = array();
|
||||
|
||||
@@ -74,7 +83,7 @@ class _Images
|
||||
|
||||
$exploded = explode( '_', $filename );
|
||||
$block = (int) array_pop( $exploded );
|
||||
$totalLimit = isset( $settings["sitemap_{$class::$title}_count"] ) AND $settings["sitemap_{$class::$title}_count"] ? $settings["sitemap_{$class::$title}_count"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_LIMIT;
|
||||
$totalLimit = ( isset( $settings["sitemap_{$class::$title}_count"] ) AND $settings["sitemap_{$class::$title}_count"] ) ? $settings["sitemap_{$class::$title}_count"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_LIMIT;
|
||||
$offset = ( $block - 1 ) * \IPS\Sitemap::MAX_PER_FILE;
|
||||
$limit = \IPS\Sitemap::MAX_PER_FILE;
|
||||
|
||||
@@ -121,7 +130,7 @@ class _Images
|
||||
if ( isset( $item::$databaseColumnMap['last_comment'] ) )
|
||||
{
|
||||
$lastCommentField = $item::$databaseColumnMap['last_comment'];
|
||||
if ( is_array( $lastCommentField ) )
|
||||
if ( \is_array( $lastCommentField ) )
|
||||
{
|
||||
foreach ( $lastCommentField as $column )
|
||||
{
|
||||
@@ -151,13 +160,14 @@ class _Images
|
||||
$data['image:image']['image:geo_location'] = $item->loc_short;
|
||||
}
|
||||
|
||||
$priority = ( $item->sitemapPriority() ?: ( intval( isset( $settings["sitemap_{$class::$title}_priority"] ) ? $settings["sitemap_{$class::$title}_priority"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_PRIORITY ) ) );
|
||||
$priority = ( $item->sitemapPriority() ?: ( \intval( isset( $settings["sitemap_{$class::$title}_priority"] ) ? $settings["sitemap_{$class::$title}_priority"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_PRIORITY ) ) );
|
||||
if ( $priority !== -1 )
|
||||
{
|
||||
$data['priority'] = $priority;
|
||||
$entries[] = $data;
|
||||
}
|
||||
|
||||
$entries[] = $data;
|
||||
|
||||
$lastId = $item->$idColumn;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\extensions\core\Sitemap;
|
||||
|
||||
/* 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;
|
||||
@@ -45,6 +45,15 @@ class _Videos
|
||||
*/
|
||||
public function getFilenames()
|
||||
{
|
||||
$settings = \IPS\Settings::i()->sitemap_content_settings ? json_decode( \IPS\Settings::i()->sitemap_content_settings, TRUE ) : array();
|
||||
$class = 'IPS\\gallery\\Image';
|
||||
$limit = ( isset( $settings["sitemap_{$class::$title}_count"] ) ) ? $settings["sitemap_{$class::$title}_count"] : -1;
|
||||
|
||||
if( $limit == 0 )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$count = \IPS\gallery\Image::getItemsWithPermission( array( 'image_media=?', 1 ), NULL, 10, 'read', \IPS\Content\Hideable::FILTER_AUTOMATIC, 0, new \IPS\Member, FALSE, FALSE, FALSE, TRUE );
|
||||
$files = array();
|
||||
|
||||
@@ -74,7 +83,7 @@ class _Videos
|
||||
|
||||
$exploded = explode( '_', $filename );
|
||||
$block = (int) array_pop( $exploded );
|
||||
$totalLimit = isset( $settings["sitemap_{$class::$title}_count"] ) AND $settings["sitemap_{$class::$title}_count"] ? $settings["sitemap_{$class::$title}_count"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_LIMIT;
|
||||
$totalLimit = ( isset( $settings["sitemap_{$class::$title}_count"] ) AND $settings["sitemap_{$class::$title}_count"] ) ? $settings["sitemap_{$class::$title}_count"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_LIMIT;
|
||||
$offset = ( $block - 1 ) * \IPS\Sitemap::MAX_PER_FILE;
|
||||
$limit = \IPS\Sitemap::MAX_PER_FILE;
|
||||
|
||||
@@ -121,7 +130,7 @@ class _Videos
|
||||
if ( isset( $item::$databaseColumnMap['last_comment'] ) )
|
||||
{
|
||||
$lastCommentField = $item::$databaseColumnMap['last_comment'];
|
||||
if ( is_array( $lastCommentField ) )
|
||||
if ( \is_array( $lastCommentField ) )
|
||||
{
|
||||
foreach ( $lastCommentField as $column )
|
||||
{
|
||||
@@ -157,13 +166,14 @@ class _Videos
|
||||
$data['video:video']['video:thumbnail_loc'] = (string) \IPS\File::get( 'gallery_Images', $item->masked_file_name )->url->setScheme( ( mb_substr( \IPS\Settings::i()->base_url, 0, 5 ) === 'https' ) ? 'https' : 'http' );
|
||||
}
|
||||
|
||||
$priority = ( $item->sitemapPriority() ?: ( intval( isset( $settings["sitemap_{$class::$title}_priority"] ) ? $settings["sitemap_{$class::$title}_priority"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_PRIORITY ) ) );
|
||||
$priority = ( $item->sitemapPriority() ?: ( \intval( isset( $settings["sitemap_{$class::$title}_priority"] ) ? $settings["sitemap_{$class::$title}_priority"] : \IPS\core\extensions\core\Sitemap\Content::RECOMMENDED_ITEM_PRIORITY ) ) );
|
||||
if ( $priority !== -1 )
|
||||
{
|
||||
$data['priority'] = $priority;
|
||||
$entries[] = $data;
|
||||
}
|
||||
|
||||
$entries[] = $data;
|
||||
|
||||
$lastId = $item->$idColumn;
|
||||
}
|
||||
|
||||
|
||||
Whitespace-only changes.
@@ -9,7 +9,7 @@
|
||||
* @since 30 May 2013
|
||||
*/
|
||||
|
||||
define('REPORT_EXCEPTIONS', TRUE);
|
||||
\define('REPORT_EXCEPTIONS', TRUE);
|
||||
require_once str_replace( 'applications/gallery/interface/legacy/image.php', '', str_replace( '\\', '/', __FILE__ ) ) . 'init.php';
|
||||
\IPS\Dispatcher\External::i();
|
||||
|
||||
@@ -29,6 +29,8 @@ try
|
||||
\IPS\Output::i()->sendHeader( $key . ': ' . $header );
|
||||
}
|
||||
\IPS\Output::i()->sendHeader( "Content-Length: " . $file->filesize() );
|
||||
\IPS\Output::i()->sendHeader( "Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
\IPS\Output::i()->sendHeader( "X-Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
|
||||
$file->printFile();
|
||||
exit;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\admin\gallery;
|
||||
|
||||
/* 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;
|
||||
@@ -23,6 +23,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _categories extends \IPS\Node\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Node Class
|
||||
*/
|
||||
@@ -53,4 +58,112 @@ class _categories extends \IPS\Node\Controller
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('add_category');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the form to mass move content
|
||||
*
|
||||
* @param \IPS\Helpers\Form $form The form helper object
|
||||
* @param mixed $data Data from the wizard helper
|
||||
* @param string $nodeClass Node class
|
||||
* @param \IPS\Node\Model $node Node we are working with
|
||||
* @param string $contentItemClass Content item class (if there is one)
|
||||
* @return \IPS\Helpers\Form
|
||||
*/
|
||||
protected function _buildMassMoveForm( $form, $data, $nodeClass, $node, $contentItemClass )
|
||||
{
|
||||
/* Add an option to move or delete albums - we won't worry about filters */
|
||||
$form->addHeader('node_mass_move_delete_albums');
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'node_move_subalbums', isset( $data['moveToAlbums'] ) ? $data['moveToClassAlbums']::load( $data['moveToAlbums'] ) : 0, TRUE, array( 'class' => $nodeClass, 'disabled' => array( $node->_id ), 'disabledLang' => 'node_move_delete', 'zeroVal' => 'node_delete_content', 'subnodes' => FALSE, 'permissionCheck' => function( $node )
|
||||
{
|
||||
return $node->can('add');
|
||||
} ) ) );
|
||||
|
||||
return parent::_buildMassMoveForm( $form, $data, $nodeClass, $node, $contentItemClass );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the mass move form submission
|
||||
*
|
||||
* @param array $values Values from form submission
|
||||
* @param mixed $data Data from the wizard helper
|
||||
* @param string $nodeClass Node class
|
||||
* @param \IPS\Node\Model $node Node we are working with
|
||||
* @param string $contentItemClass Content item class (if there is one)
|
||||
* @return array Wizard helper data
|
||||
*/
|
||||
protected function _processMassMoveForm( $values, $data, $nodeClass, $node, $contentItemClass )
|
||||
{
|
||||
$data = parent::_processMassMoveForm( $values, $data, $nodeClass, $node, $contentItemClass );
|
||||
|
||||
/* What are we doing with the albums? */
|
||||
if ( \is_object( $values['node_move_subalbums'] ) )
|
||||
{
|
||||
$data['moveToClassAlbums'] = \get_class( $values['node_move_subalbums'] );
|
||||
$data['moveToAlbums'] = $values['node_move_subalbums']->_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $data['moveToClassAlbums'] );
|
||||
unset( $data['moveToAlbums'] );
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually perform the mass move operation (called from the wizard helper)
|
||||
*
|
||||
* @param mixed $data Data from the wizard helper
|
||||
* @param \IPS\Node\Model $node Node we are working with
|
||||
* @param string $contentItemClass Content item class (if there is one)
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _performMassMove( $data, $node, $contentItemClass )
|
||||
{
|
||||
/* If we have confirmed the move, just handle albums now and then pass to the parent */
|
||||
if ( isset( \IPS\Request::i()->confirm ) )
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Loop over our albums */
|
||||
foreach( \IPS\gallery\Album\Item::getItemsWithPermission( array( array( 'album_category_id=?', $node->_id ) ), NULL, 1000, NULL, TRUE, 0, NULL, FALSE, FALSE, FALSE, FALSE, NULL, TRUE, FALSE, FALSE, FALSE ) as $album )
|
||||
{
|
||||
$album = $album->asNode();
|
||||
|
||||
/* Are we moving albums? */
|
||||
if ( isset( $data['moveToAlbums'] ) )
|
||||
{
|
||||
$album->moveTo( $data['moveToClassAlbums']::load( $data['moveToAlbums'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Store the task for deleting */
|
||||
\IPS\Task::queue( 'core', 'DeleteOrMoveContent', array( 'class' => 'IPS\gallery\Category', 'id' => $album->_id, 'deleteWhenDone' => FALSE ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $data['moveToAlbums'] ) )
|
||||
{
|
||||
$newNode = $data['moveToClassAlbums']::load( $data['moveToAlbums'] );
|
||||
\IPS\Session::i()->log( 'acplog__catalbum_mass_move', array( $this->title => TRUE, $node->titleForLog() => FALSE, $newNode->titleForLog() => FALSE ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__catalbum_mass_delete', array( $this->title => TRUE, $node->titleForLog() => FALSE ) );
|
||||
}
|
||||
|
||||
/* Then let the parent take over */
|
||||
return parent::_performMassMove( $data, $node, $contentItemClass );
|
||||
}
|
||||
/* Otherwise show a slightly more useful confirmation message */
|
||||
else
|
||||
{
|
||||
$albumCount = \IPS\gallery\Album\Item::getItemsWithPermission( array( array( 'album_category_id=?', $node->_id ) ), NULL, 1000, NULL, TRUE, 0, NULL, FALSE, FALSE, FALSE, TRUE, NULL, TRUE, FALSE, FALSE, FALSE );
|
||||
|
||||
$itemDeletionWhere = $node->massMoveorDeleteWhere( $data );
|
||||
$itemDeletionWhere[] = array( 'image_album_id=?', 0 );
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'global', 'gallery' )->nodeMoveDeleteContent( $this->url->setQueryString( array( 'do' => 'massManageContent', 'id' => $node->_id ) ), \IPS\Member::loggedIn()->language()->addToStack( $contentItemClass::$title . '_pl_lc' ), $node->getContentItems( NULL, NULL, $itemDeletionWhere, TRUE ), isset( $data['moveTo'] ) ? $data['moveToClass']::load( $data['moveTo'] ) : NULL, $albumCount, isset( $data['moveToAlbums'] ) ? $data['moveToClassAlbums']::load( $data['moveToAlbums'] ) : NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\admin\gallery;
|
||||
|
||||
/* 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;
|
||||
@@ -23,6 +23,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _settings extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
@@ -76,6 +81,11 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
$form->addHeader( 'gallery_options' );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'gallery_rss_enabled', \IPS\Settings::i()->gallery_rss_enabled ) );
|
||||
|
||||
if( \IPS\GeoLocation::enabled() )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'gallery_maps_default', \IPS\Settings::i()->gallery_maps_default ) );
|
||||
}
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$form->saveAsSettings( array(
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\admin\stats;
|
||||
|
||||
/* 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;
|
||||
@@ -23,6 +23,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _bandwidth extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
@@ -50,7 +55,7 @@ class _bandwidth extends \IPS\Dispatcher\Controller
|
||||
'chartArea' => array( 'left' => 120, 'width' => '75%' ),
|
||||
'vAxis' => array(
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'filesize_raw_k' )
|
||||
)
|
||||
)
|
||||
), 'AreaChart', 'daily', array( 'start' => 0, 'end' => 0 ), array( 'member_id', 'image_id', 'bdate', 'bsize' ) );
|
||||
|
||||
$chart->addSeries( \IPS\Member::loggedIn()->language()->addToStack('bandwidth'), 'number', 'ROUND((SUM(bsize)/1024),2)', FALSE );
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\admin\stats;
|
||||
|
||||
/* 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;
|
||||
@@ -24,6 +24,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
class _diskspace extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
const PER_PAGE = 25;
|
||||
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
@@ -43,69 +48,97 @@ class _diskspace extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$values = NULL;
|
||||
$where = array();
|
||||
|
||||
|
||||
if ( isset( \IPS\Request::i()->form ) )
|
||||
{
|
||||
$form = new \IPS\Helpers\Form( 'form', 'go' );
|
||||
$form->add( new \IPS\Helpers\Form\DateRange( 'stats_date_range', NULL, FALSE, array( 'start' => array( 'max' => new \IPS\DateTime() ), 'end' => array( 'max' => new \IPS\DateTime() ) ) ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
if ( $values['stats_date_range']['start'] )
|
||||
{
|
||||
$where[] = array( 'image_date>?', $values['stats_date_range']['start']->getTimestamp() );
|
||||
}
|
||||
if ( $values['stats_date_range']['end'] )
|
||||
{
|
||||
$where[] = array( 'image_date<?', $values['stats_date_range']['end']->getTimestamp() );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
$default = array(
|
||||
'start' => \IPS\Request::i()->start ? \IPS\DateTime::ts( \IPS\Request::i()->start ) : NULL,
|
||||
'end' => \IPS\Request::i()->end ? \IPS\DateTime::ts( \IPS\Request::i()->end ) : NULL
|
||||
);
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\DateRange( 'stats_date_range', $default, FALSE, array( 'start' => array( 'max' => \IPS\DateTime::ts( time() )->setTime( 0, 0, 0 ), 'time' => FALSE ), 'end' => array( 'max' => \IPS\DateTime::ts( time() )->setTime( 23, 59, 59 ), 'time' => FALSE ) ) ) );
|
||||
|
||||
if ( !$values = $form->values() )
|
||||
{
|
||||
\IPS\Output::i()->output = $form;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$page = isset( \IPS\Request::i()->page ) ? intval( \IPS\Request::i()->page ) : 1;
|
||||
|
||||
/* Figure out start and end parameters for links */
|
||||
$params = array(
|
||||
'start' => !empty( $values['stats_date_range']['start'] ) ? $values['stats_date_range']['start']->getTimestamp() : \IPS\Request::i()->start,
|
||||
'end' => !empty( $values['stats_date_range']['end'] ) ? $values['stats_date_range']['end']->getTimestamp() : \IPS\Request::i()->end
|
||||
);
|
||||
|
||||
if( $params['start'] )
|
||||
{
|
||||
$where[] = array( 'image_date>?', $params['start'] );
|
||||
}
|
||||
|
||||
if( $params['end'] )
|
||||
{
|
||||
$where[] = array( 'image_date<?', $params['end'] );
|
||||
}
|
||||
|
||||
$page = isset( \IPS\Request::i()->page ) ? \intval( \IPS\Request::i()->page ) : 1;
|
||||
|
||||
if( $page < 1 )
|
||||
{
|
||||
$page = 1;
|
||||
}
|
||||
try
|
||||
{
|
||||
$total = \IPS\Db::i()->select( 'COUNT(DISTINCT(image_member_id))', 'gallery_images', $where )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
$total = 0;
|
||||
}
|
||||
|
||||
$select = \IPS\Db::i()->select( 'image_member_id, COUNT(*) as images', 'gallery_images', $where, 'images DESC', array( ( $page - 1 ) * static::PER_PAGE, static::PER_PAGE ), 'image_member_id', NULL, \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS )->join( 'core_members', 'core_members.member_id=gallery_images.image_member_id' );
|
||||
$mids = array();
|
||||
|
||||
foreach( $select as $row )
|
||||
if( $total > 0 )
|
||||
{
|
||||
$mids[] = $row['image_member_id'];
|
||||
$select = \IPS\Db::i()->select( 'image_member_id, count(*) as images', 'gallery_images', $where, 'images DESC', array( ( $page - 1 ) * static::PER_PAGE, static::PER_PAGE ), 'image_member_id' )->join( 'core_members', 'core_members.member_id=gallery_images.image_member_id' );
|
||||
$mids = array();
|
||||
|
||||
foreach( $select as $row )
|
||||
{
|
||||
$mids[] = $row['image_member_id'];
|
||||
}
|
||||
|
||||
$members = array();
|
||||
if ( \count( $mids ) )
|
||||
{
|
||||
$members = iterator_to_array( \IPS\Db::i()->select( '*', 'core_members', array( \IPS\Db::i()->in( 'member_id', $mids ) ) )->setKeyField('member_id') );
|
||||
}
|
||||
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination(
|
||||
\IPS\Http\Url::internal( 'app=gallery&module=stats&controller=diskspace' )->setQueryString( $params ),
|
||||
ceil( $total / static::PER_PAGE ),
|
||||
$page,
|
||||
static::PER_PAGE,
|
||||
FALSE
|
||||
);
|
||||
|
||||
\IPS\Output::i()->sidebar['actions'] = array(
|
||||
'settings' => array(
|
||||
'title' => 'stats_date_range',
|
||||
'icon' => 'calendar',
|
||||
'link' => \IPS\Http\Url::internal( 'app=gallery&module=stats&controller=diskspace&form=1' )->setQueryString( $params ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('stats_date_range') )
|
||||
)
|
||||
);
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core' )->message( \IPS\Member::loggedIn()->language()->addToStack( 'stats_include_hidden_content' ), 'info' );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate('stats')->uploadersTable( $select, $pagination, $members );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__gallery_stats_diskspace');
|
||||
}
|
||||
|
||||
if ( count( $mids ) )
|
||||
else
|
||||
{
|
||||
$members = iterator_to_array( \IPS\Db::i()->select( '*', 'core_members', array( \IPS\Db::i()->in( 'member_id', $mids ) ) )->setKeyField('member_id') );
|
||||
/* Return the no results message */
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( \IPS\Member::loggedIn()->language()->addToStack('menu__gallery_stats_diskspace'), \IPS\Member::loggedIn()->language()->addToStack('no_results'), FALSE , 'ipsPad', NULL, TRUE );
|
||||
}
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination(
|
||||
\IPS\Http\Url::internal( 'app=gallery&module=stats&controller=diskspace' )->setQueryString( $values ),
|
||||
ceil( $select->count( TRUE ) / static::PER_PAGE ),
|
||||
$page,
|
||||
static::PER_PAGE,
|
||||
FALSE
|
||||
);
|
||||
|
||||
\IPS\Output::i()->sidebar['actions'] = array(
|
||||
'settings' => array(
|
||||
'title' => 'stats_date_range',
|
||||
'icon' => 'calendar',
|
||||
'link' => \IPS\Http\Url::internal( 'app=gallery&module=stats&controller=diskspace&form=1' )->setQueryString( $values ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('stats_date_range') )
|
||||
)
|
||||
);
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core' )->message( \IPS\Member::loggedIn()->language()->addToStack( 'stats_include_hidden_content' ), 'info' );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate('stats')->uploadersTable( $select, $pagination, $members );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__gallery_stats_diskspace');
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\admin\stats;
|
||||
|
||||
/* 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;
|
||||
@@ -23,6 +23,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _member extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Images
|
||||
*
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\front\gallery;
|
||||
|
||||
/* 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;
|
||||
@@ -45,6 +45,7 @@ class _browse extends \IPS\Content\Controller
|
||||
\IPS\Member::loggedIn()->language()->words[ "sort_title" ] = \IPS\Member::loggedIn()->language()->addToStack( "album_sort_caption", FALSE );
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_browse.js', 'gallery' ) );
|
||||
\IPS\gallery\Application::outputCss();
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
@@ -72,6 +73,13 @@ class _browse extends \IPS\Content\Controller
|
||||
if ( \IPS\Settings::i()->gallery_rss_enabled )
|
||||
{
|
||||
\IPS\Output::i()->rssFeeds['gallery_rss_title'] = \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=rss', 'front', 'gallery_rss' );
|
||||
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$key = md5( ( \IPS\Member::loggedIn()->members_pass_hash ?: \IPS\Member::loggedIn()->email ) . \IPS\Member::loggedIn()->members_pass_salt );
|
||||
|
||||
\IPS\Output::i()->rssFeeds['gallery_rss_title'] = \IPS\Output::i()->rssFeeds['gallery_rss_title']->setQueryString( array( 'member' => \IPS\Member::loggedIn()->member_id , 'key' => $key ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* And load data and display */
|
||||
@@ -79,18 +87,29 @@ class _browse extends \IPS\Content\Controller
|
||||
{
|
||||
try
|
||||
{
|
||||
$category = \IPS\gallery\Category::loadAndCheckPerms( \IPS\Request::i()->category, 'view' );
|
||||
$category = \IPS\gallery\Category::loadAndCheckPerms( \IPS\Request::i()->category, 'view' );
|
||||
|
||||
$category->clubCheckRules();
|
||||
|
||||
/* If we cannot view images and there's a custom error, show it now */
|
||||
if( !$category->can( 'read' ) AND \IPS\Member::loggedIn()->language()->checkKeyExists( "gallery_category_{$category->id}_permerror" ) )
|
||||
{
|
||||
\IPS\Output::i()->error( "gallery_category_{$category->id}_permerror", '1G189/B', 403, '' );
|
||||
\IPS\Output::i()->error( $category->errorMessage(), '1G189/B', 403, '' );
|
||||
}
|
||||
|
||||
/* Add RSS feed */
|
||||
if ( \IPS\Settings::i()->gallery_rss_enabled )
|
||||
{
|
||||
\IPS\Output::i()->rssFeeds[ \IPS\Member::loggedIn()->language()->addToStack( 'gallery_rss_title_container', FALSE, array( 'sprintf' => array( $category->_title ) ) ) ] = \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=rss&category=' . $category->id, 'front', 'gallery_rss' );
|
||||
$rssUrl = \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=rss&category=' . $category->id, 'front', 'gallery_rss' );
|
||||
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$key = md5( ( \IPS\Member::loggedIn()->members_pass_hash ?: \IPS\Member::loggedIn()->email ) . \IPS\Member::loggedIn()->members_pass_salt );
|
||||
|
||||
$rssUrl = $rssUrl->setQueryString( array( 'member' => \IPS\Member::loggedIn()->member_id , 'key' => $key ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->rssFeeds[ \IPS\Member::loggedIn()->language()->addToStack( 'gallery_rss_title_container', FALSE, array( 'sprintf' => array( $category->_title ) ) ) ] = $rssUrl;
|
||||
}
|
||||
|
||||
$this->_category( $category );
|
||||
@@ -105,11 +124,22 @@ class _browse extends \IPS\Content\Controller
|
||||
try
|
||||
{
|
||||
$album = \IPS\gallery\Album::loadAndCheckPerms( \IPS\Request::i()->album, 'view' );
|
||||
|
||||
$album->category()->clubCheckRules();
|
||||
|
||||
/* Add RSS feed */
|
||||
if ( \IPS\Settings::i()->gallery_rss_enabled )
|
||||
{
|
||||
\IPS\Output::i()->rssFeeds[\IPS\Member::loggedIn()->language()->addToStack('gallery_rss_title_container', FALSE, array('sprintf' => array($album->_title)))] = \IPS\Http\Url::internal('app=gallery&module=gallery&controller=browse&do=rss&album=' . $album->id, 'front', 'gallery_rss');
|
||||
$rssUrl = \IPS\Http\Url::internal('app=gallery&module=gallery&controller=browse&do=rss&album=' . $album->id, 'front', 'gallery_rss');
|
||||
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$key = md5( ( \IPS\Member::loggedIn()->members_pass_hash ?: \IPS\Member::loggedIn()->email ) . \IPS\Member::loggedIn()->members_pass_salt );
|
||||
|
||||
$rssUrl = $rssUrl->setQueryString( array( 'member' => \IPS\Member::loggedIn()->member_id , 'key' => $key ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->rssFeeds[ \IPS\Member::loggedIn()->language()->addToStack( 'gallery_rss_title_container', FALSE, array( 'sprintf' => array( $album->_title ) ) ) ] = $rssUrl;
|
||||
}
|
||||
$this->_album( $album );
|
||||
}
|
||||
@@ -186,12 +216,12 @@ class _browse extends \IPS\Content\Controller
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ), \IPS\Dispatcher::i()->module->_title );
|
||||
|
||||
if( !count( \IPS\gallery\Image::getItemsWithPermission( array( array( 'image_category_id=? AND image_album_id=?', $category->_id, 0 ) ) ) ) )
|
||||
if( !\count( \IPS\gallery\Image::getItemsWithPermission( array( array( 'image_category_id=? AND image_album_id=?', $category->_id, 0 ) ) ) ) )
|
||||
{
|
||||
$table = ( $category->childrenCount() or $albums ) ? '' : \IPS\Theme::i()->getTemplate( 'browse' )->noImages( $category );
|
||||
|
||||
$parents = iterator_to_array( $category->parents() );
|
||||
if ( count( $parents ) )
|
||||
if ( \count( $parents ) )
|
||||
{
|
||||
foreach( $parents AS $parent )
|
||||
{
|
||||
@@ -229,18 +259,10 @@ class _browse extends \IPS\Content\Controller
|
||||
}
|
||||
}
|
||||
|
||||
/* If we're viewing a club, set the breadcrumbs appropriately */
|
||||
if ( $club = $category->club() )
|
||||
{
|
||||
\IPS\core\FrontNavigation::$clubTabActive = TRUE;
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=core&module=clubs&controller=directory', 'front', 'clubs_list' ), \IPS\Member::loggedIn()->language()->addToStack('module__core_clubs') );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $club->url(), $club->name );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $category->url(), $category->_title );
|
||||
|
||||
if ( \IPS\Settings::i()->clubs_header == 'sidebar' )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate( 'clubs', 'core' )->header( $club, $category, 'sidebar' );
|
||||
}
|
||||
$club->setBreadcrumbs( $category );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item_categories' ) ] = array( 'type' => 'gallery_image', 'nodes' => $category->_id );
|
||||
@@ -255,7 +277,7 @@ class _browse extends \IPS\Content\Controller
|
||||
*/
|
||||
protected function _album( $album )
|
||||
{
|
||||
if( !count( \IPS\gallery\Image::getItemsWithPermission( array( array( 'image_album_id=?', $album->id ) ) ) ) )
|
||||
if( !\count( \IPS\gallery\Image::getItemsWithPermission( array( array( 'image_album_id=?', $album->id ) ) ) ) )
|
||||
{
|
||||
/* Show a 'no images' template if there's nothing to display */
|
||||
$table = \IPS\Theme::i()->getTemplate( 'browse' )->noImages( $album );
|
||||
@@ -303,9 +325,9 @@ class _browse extends \IPS\Content\Controller
|
||||
$tab = isset( \IPS\Request::i()->tab ) ? \IPS\Request::i()->tab : array_shift( $_tabs );
|
||||
$activeTabContents = $asItem->commentReviews( $tab );
|
||||
|
||||
if ( count( $tabs ) > 1 )
|
||||
if ( \count( $tabs ) > 1 )
|
||||
{
|
||||
$commentsAndReviews = count( $tabs ) ? \IPS\Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $tab, $activeTabContents, $album->url(), 'tab', FALSE, TRUE ) : NULL;
|
||||
$commentsAndReviews = \count( $tabs ) ? \IPS\Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $tab, $activeTabContents, $album->url(), 'tab', FALSE, TRUE ) : NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -344,7 +366,7 @@ class _browse extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ), \IPS\Dispatcher::i()->module->_title );
|
||||
$parents = iterator_to_array( $album->category()->parents() );
|
||||
if ( count( $parents ) )
|
||||
if ( \count( $parents ) )
|
||||
{
|
||||
foreach( $parents AS $parent )
|
||||
{
|
||||
@@ -394,57 +416,6 @@ class _browse extends \IPS\Content\Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest images RSS
|
||||
*
|
||||
* @return void
|
||||
* @note We use a template so that we can embed image directly into feed while still allowing it to be customized
|
||||
*/
|
||||
protected function rss()
|
||||
{
|
||||
if( !\IPS\Settings::i()->gallery_rss_enabled )
|
||||
{
|
||||
\IPS\Output::i()->error( 'gallery_rss_offline', '2G189/3', 403, 'gallery_rss_offline_admin' );
|
||||
}
|
||||
|
||||
$where = array();
|
||||
|
||||
if( isset( \IPS\Request::i()->category ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$category = \IPS\gallery\Category::loadAndCheckPerms( \IPS\Request::i()->category, 'read' );
|
||||
$where[] = array( 'image_category_id=?', $category->id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/8', 404, '' );
|
||||
}
|
||||
}
|
||||
else if ( isset( \IPS\Request::i()->album ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$album = \IPS\gallery\Album::loadAndCheckPerms( \IPS\Request::i()->album, 'read' );
|
||||
$where[] = array( 'image_album_id=?', $album->id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/9', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
$document = \IPS\Xml\Rss::newDocument( isset( $category ) ? $category->url() : ( isset( $album ) ? $album->url() : \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ) ), \IPS\Member::loggedIn()->language()->addToStack('gallery_rss_title'), \IPS\Member::loggedIn()->language()->addToStack('gallery_rss_title') );
|
||||
|
||||
foreach ( \IPS\gallery\Image::getItemsWithPermission( $where ) as $image )
|
||||
{
|
||||
$document->addItem( $image->caption, $image->url(), \IPS\Theme::i()->getTemplate( 'view' )->rssContent( $image ), \IPS\DateTime::ts( $image->updated ), $image->id );
|
||||
}
|
||||
|
||||
/* @note application/rss+xml is not a registered IANA mime-type so we need to stick with text/xml for RSS */
|
||||
\IPS\Output::i()->sendOutput( $document->asXML(), 200, 'text/xml' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit album
|
||||
*
|
||||
@@ -490,7 +461,7 @@ class _browse extends \IPS\Content\Controller
|
||||
$form->elements['']['album_category']->error = \IPS\Member::loggedIn()->language()->addToStack('form_required');
|
||||
}
|
||||
|
||||
\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' ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -501,7 +472,7 @@ class _browse extends \IPS\Content\Controller
|
||||
|
||||
/* Display form */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'edit_album' );
|
||||
\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' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -536,7 +507,22 @@ class _browse extends \IPS\Content\Controller
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'move_image_category', NULL, FALSE, array(
|
||||
'class' => 'IPS\gallery\Category',
|
||||
'permissionCheck' => 'add',
|
||||
'permissionCheck' => function( $node ) {
|
||||
|
||||
/* Do we have permission to add? */
|
||||
if( !$node->can( 'add' ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Otherwise, if the node *requires* albums, also return FALSE
|
||||
if( $node->allow_albums == 2 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
), NULL, NULL, NULL, 'move_image_category' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'move_image_album', NULL, FALSE, array(
|
||||
@@ -555,7 +541,7 @@ class _browse extends \IPS\Content\Controller
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
), NULL, NULL, NULL, 'move_image_album' ) );
|
||||
|
||||
@@ -587,7 +573,7 @@ class _browse extends \IPS\Content\Controller
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack('gallery_cat_or_album');
|
||||
|
||||
\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' ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -623,7 +609,7 @@ class _browse extends \IPS\Content\Controller
|
||||
}
|
||||
|
||||
/* Display form */
|
||||
\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' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
namespace IPS\gallery\modules\front\gallery;
|
||||
|
||||
/* 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;
|
||||
@@ -127,7 +127,7 @@ class _notes extends \IPS\Dispatcher\Controller
|
||||
$notes = $this->image->_notes;
|
||||
$position = explode( ',', $position );
|
||||
|
||||
if( count( $position ) != 4 )
|
||||
if( \count( $position ) != 4 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ class _notes extends \IPS\Dispatcher\Controller
|
||||
$notes[ $key ]['NOTE'] = trim( str_replace( "\n", ' ', str_replace( ' ', ' ', $noteText ) ) );
|
||||
}
|
||||
|
||||
if( count( $position ) == 4 )
|
||||
if( \count( $position ) == 4 )
|
||||
{
|
||||
$notes[ $key ]['LEFT'] = round( $position[0], 5 );
|
||||
$notes[ $key ]['TOP'] = round( $position[1], 5 );
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\front\gallery;
|
||||
|
||||
/* 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;
|
||||
@@ -33,13 +33,18 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
/* Init */
|
||||
$url = \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=submit', 'front', 'gallery_submit' );
|
||||
|
||||
if( isset( \IPS\Request::i()->_pi ) )
|
||||
{
|
||||
$url = $url->setQueryString( '_pi', \IPS\Request::i()->_pi );
|
||||
}
|
||||
|
||||
/* Init our form variables and check container */
|
||||
$container = $this->chooseContainerForm( $url );
|
||||
$images = NULL;
|
||||
$errors = array();
|
||||
|
||||
/* If we've submitted that and have our values we need, it's time to show the upload form */
|
||||
if( is_array( $container ) )
|
||||
if( \is_array( $container ) )
|
||||
{
|
||||
$url = $url->setQueryString( 'category', $container['category']->_id );
|
||||
|
||||
@@ -51,6 +56,11 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$url = $url->setQueryString( 'noAlbum', 1 );
|
||||
}
|
||||
|
||||
if ( isset( $container['guest_email'] ) )
|
||||
{
|
||||
$url = $url->setQueryString( 'guest_email', $container['guest_email'] );
|
||||
}
|
||||
|
||||
$images = $this->chooseImagesForm( $url, $container );
|
||||
|
||||
@@ -65,7 +75,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
/* Are we in da club? */
|
||||
$club = NULL;
|
||||
|
||||
if ( is_array( $container ) AND isset( $container['category'] ) AND $container['category'] )
|
||||
if ( \is_array( $container ) AND isset( $container['category'] ) AND $container['category'] )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -90,10 +100,11 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=submit', 'front', 'gallery_submit' ), array(), 'loc_gallery_adding_image' );
|
||||
|
||||
/* Output */
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'submit.css' ), \IPS\Theme::i()->css( 'gallery.css' ) );
|
||||
\IPS\gallery\Application::outputCss();
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'submit.css' ) );
|
||||
if ( \IPS\Theme::i()->settings['responsive'] )
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'submit_responsive.css', 'gallery', 'front' ), \IPS\Theme::i()->css( 'gallery_responsive.css', 'gallery', 'front' ) );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'submit_responsive.css', 'gallery', 'front' ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'jquery/jquery-ui.js', 'core', 'interface' ) );
|
||||
@@ -108,7 +119,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$imageTagsField = $tagsField;
|
||||
|
||||
/* Tags */
|
||||
if ( is_array( $container ) AND isset( $container['category'] ) AND $container['category'] AND \IPS\gallery\Image::canTag( NULL, $container['category'] ) )
|
||||
if ( \is_array( $container ) AND isset( $container['category'] ) AND $container['category'] AND \IPS\gallery\Image::canTag( NULL, $container['category'] ) )
|
||||
{
|
||||
$tagsField = \IPS\gallery\Image::tagsFormField( NULL, $container['category'] );
|
||||
$imageTagsField = $tagsField;
|
||||
@@ -125,8 +136,8 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
\IPS\Output::i()->json( array(
|
||||
'container' => is_string( $container ) ? $container : NULL,
|
||||
'containerInfo' => is_string( $container ) ? '' : \IPS\Theme::i()->getTemplate( 'submit' )->container( $container ),
|
||||
'container' => \is_string( $container ) ? $container : NULL,
|
||||
'containerInfo' => \is_string( $container ) ? '' : \IPS\Theme::i()->getTemplate( 'submit' )->container( $container ),
|
||||
'images' => $images,
|
||||
'imageTags' => preg_replace( '/data-ipsAutocomplete(?!\-)/', '', $imageTagsField ),
|
||||
'tagsField' => $tagsField,
|
||||
@@ -139,10 +150,14 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$allImagesForm = new \IPS\Helpers\Form( 'all_images_form', 'submit' );
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\TextArea( 'image_credit_info', NULL, FALSE ) );
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\Text( 'image_copyright', NULL, FALSE, array( 'maxLength' => 255 ) ) );
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\YesNo( 'image_auto_follow', (bool) \IPS\Member::loggedIn()->auto_follow['content'], FALSE, array(), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack( 'image_auto_follow_suffix' ) ) );
|
||||
|
||||
if( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\YesNo( 'image_auto_follow', (bool) \IPS\Member::loggedIn()->auto_follow['content'], FALSE, array(), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack( 'image_auto_follow_suffix' ) ) );
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
if ( is_array( $container ) AND isset( $container['category'] ) AND $container['category'] AND \IPS\gallery\Image::canTag( NULL, $container['category'] ) )
|
||||
if ( \is_array( $container ) AND isset( $container['category'] ) AND $container['category'] AND \IPS\gallery\Image::canTag( NULL, $container['category'] ) )
|
||||
{
|
||||
if( $tagsField = \IPS\gallery\Image::tagsFormField( NULL, $container['category'] ) )
|
||||
{
|
||||
@@ -156,7 +171,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if( $element->name == 'image_tags' )
|
||||
{
|
||||
if ( !is_array( $container ) OR !isset( $container['category'] ) OR !$container['category'] OR !\IPS\gallery\Image::canTag( NULL, $container['category'] ) )
|
||||
if ( !\is_array( $container ) OR !isset( $container['category'] ) OR !$container['category'] OR !\IPS\gallery\Image::canTag( NULL, $container['category'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -169,7 +184,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\TextArea( 'image_textarea_DEFAULT', NULL, FALSE ) );
|
||||
|
||||
/* These fields are conditional and will not always show for each image */
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\YesNo( "image_gps_show_DEFAULT", TRUE, FALSE ) );
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\YesNo( "image_gps_show_DEFAULT", \IPS\Settings::i()->gallery_maps_default, FALSE ) );
|
||||
$allImagesForm->add( new \IPS\Helpers\Form\Upload( "image_thumbnail_DEFAULT", NULL, FALSE, array(
|
||||
'storageExtension' => 'gallery_Images',
|
||||
'image' => TRUE,
|
||||
@@ -177,7 +192,8 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
) ) );
|
||||
|
||||
/* And output */
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->wrapper( $container, $images, $club, \IPS\gallery\Image::moderateNewItems( \IPS\Member::loggedIn() ), $allImagesForm );
|
||||
$category = ( \is_array( $container ) AND isset( $container['category'] ) AND $container['category'] ) ? $container['category'] : NULL;
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->wrapper( $container, $images, $club, $allImagesForm );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,20 +225,27 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
try
|
||||
{
|
||||
$album = \IPS\gallery\Album::loadAndCheckPerms( \IPS\Request::i()->album, 'add' );
|
||||
|
||||
/* If it's an album, make sure we grab the current category */
|
||||
try
|
||||
{
|
||||
$category = \IPS\gallery\Category::load( $album->category_id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
}
|
||||
|
||||
|
||||
/* If we have chosen an album we can return now */
|
||||
if( $category AND $album )
|
||||
{
|
||||
return array( 'category' => $category, 'album' => $album );
|
||||
return array( 'category' => $category, 'album' => $album, 'guest_email' => isset( \IPS\Request::i()->guest_email ) ? \IPS\Request::i()->guest_email : NULL );
|
||||
}
|
||||
|
||||
/* If we have chosen no album specifically, we can just return now */
|
||||
if ( isset( \IPS\Request::i()->noAlbum ) AND \IPS\Request::i()->noAlbum AND $category AND $category->allow_albums != 2 )
|
||||
{
|
||||
return array( 'category' => $category, 'album' => NULL );
|
||||
return array( 'category' => $category, 'album' => NULL, 'guest_email' => isset( \IPS\Request::i()->guest_email ) ? \IPS\Request::i()->guest_email : NULL );
|
||||
}
|
||||
|
||||
/* If we haven't selected a category yet... */
|
||||
@@ -265,6 +288,37 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Do we have any posting information to show? */
|
||||
$guestEmailError = NULL;
|
||||
if ( isset( \IPS\Request::i()->guest_email_submit ) )
|
||||
{
|
||||
if ( !\IPS\Request::i()->guest_email )
|
||||
{
|
||||
$guestEmailError = 'form_required';
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Helpers\Form\Email::validateEmail( \IPS\Request::i()->guest_email, TRUE );
|
||||
\IPS\Request::i()->_pi = TRUE;
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$guestEmailError = $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !isset( \IPS\Request::i()->_pi ) )
|
||||
{
|
||||
$guestPostBeforeRegister = ( !\IPS\Member::loggedIn()->member_id ) ? ( $category and !$category->can( 'add', \IPS\Member::loggedIn(), FALSE ) ) : NULL;
|
||||
$modQueued = \IPS\gallery\Image::moderateNewItems( \IPS\Member::loggedIn(), $category, $guestPostBeforeRegister );
|
||||
if ( $guestPostBeforeRegister or $modQueued )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate('submit')->postingInformation( $guestPostBeforeRegister, $modQueued, $url->setQueryString( array( 'category' => $category->_id ) ), $guestEmailError );
|
||||
}
|
||||
}
|
||||
|
||||
/* Can we create an album in this category? */
|
||||
$canCreateAlbum = ( $category->allow_albums and \IPS\Member::loggedIn()->group['g_create_albums'] );
|
||||
@@ -279,6 +333,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$createAlbumForm = new \IPS\Helpers\Form( 'new_album', 'create_new_album' );
|
||||
$createAlbumForm->class .= 'ipsForm_vertical';
|
||||
$createAlbumForm->hiddenValues['category'] = $category->_id;
|
||||
$createAlbumForm->hiddenValues['_pi'] = \IPS\Request::i()->_pi;
|
||||
|
||||
$album = new \IPS\gallery\Album;
|
||||
$album->form( $createAlbumForm );
|
||||
@@ -287,11 +342,13 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
/* And when we submit it, create an album... */
|
||||
if ( $createAlbumFormValues = $createAlbumForm->values() )
|
||||
{
|
||||
unset( $createAlbumFormValues['category'] );
|
||||
unset( $createAlbumFormValues['category'], $createAlbumFormValues['_pi'] );
|
||||
$createAlbumFormValues['album_category'] = $category;
|
||||
$album->saveForm( $album->formatFormValues( $createAlbumFormValues ) );
|
||||
|
||||
\IPS\Api\Webhook::fire( 'galleryAlbum_create', $album, $album->webhookFilters() );
|
||||
|
||||
return array( 'category' => $category, 'album' => $album );
|
||||
return array( 'category' => $category, 'album' => $album, 'guest_email' => isset( \IPS\Request::i()->guest_email ) ? \IPS\Request::i()->guest_email : NULL );
|
||||
}
|
||||
|
||||
/* Otherwise, display it*/
|
||||
@@ -302,12 +359,13 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$existingAlbumForm = NULL;
|
||||
$albumsInCategory = \IPS\Member::loggedIn()->member_id ? \IPS\gallery\Album::loadForSubmit( $category ) : array();
|
||||
|
||||
if ( count( $albumsInCategory ) )
|
||||
if ( \count( $albumsInCategory ) )
|
||||
{
|
||||
/* Build the existing album form... */
|
||||
$existingAlbumForm = new \IPS\Helpers\Form( 'choose_album', 'choose_selected_album' );
|
||||
$existingAlbumForm->class .= 'ipsForm_vertical';
|
||||
$existingAlbumForm->hiddenValues['category'] = $category->_id;
|
||||
$existingAlbumForm->hiddenValues['_pi'] = \IPS\Request::i()->_pi;
|
||||
$albums = array();
|
||||
foreach( $albumsInCategory as $id => $album )
|
||||
{
|
||||
@@ -318,7 +376,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
/* When we submit it, we can continue... */
|
||||
if ( $existingAlbumFormValues = $existingAlbumForm->values() )
|
||||
{
|
||||
return array( 'category' => $category, 'album' => \IPS\gallery\Album::loadAndCheckPerms( $existingAlbumFormValues['existing_album'], 'add' ) );
|
||||
return array( 'category' => $category, 'album' => \IPS\gallery\Album::loadAndCheckPerms( $existingAlbumFormValues['existing_album'], 'add' ), 'guest_email' => isset( \IPS\Request::i()->guest_email ) ? \IPS\Request::i()->guest_email : NULL );
|
||||
}
|
||||
|
||||
/* Otherwise, display it */
|
||||
@@ -328,7 +386,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
/* If there's nothing we can do, we can just continue */
|
||||
if ( !$canCreateAlbum )
|
||||
{
|
||||
return array( 'category' => $category, 'album' => NULL );
|
||||
return array( 'category' => $category, 'album' => NULL, 'guest_email' => isset( \IPS\Request::i()->guest_email ) ? \IPS\Request::i()->guest_email : NULL );
|
||||
}
|
||||
/* Otherwise, ask the user what they want to do */
|
||||
else
|
||||
@@ -345,7 +403,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
* @return string|array
|
||||
*/
|
||||
public function chooseImagesForm( $url, $data )
|
||||
{
|
||||
{
|
||||
$album = $data['album'];
|
||||
$category = $data['category'];
|
||||
|
||||
@@ -367,7 +425,11 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$form->add( new \IPS\Helpers\Form\TextArea( 'prefix_all', NULL, FALSE ) );
|
||||
$form->add( new \IPS\Helpers\Form\TextArea( 'images_order', NULL, FALSE ) );
|
||||
$form->add( new \IPS\Helpers\Form\TextArea( 'images_info', NULL, FALSE ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'images_autofollow_all', 1, FALSE ) );
|
||||
|
||||
if( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'images_autofollow_all', 1, FALSE ) );
|
||||
}
|
||||
|
||||
/* Add upload field */
|
||||
$maxFileSizes = array();
|
||||
@@ -398,13 +460,13 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$maxFileSizes['movie'] = \IPS\Member::loggedIn()->group['g_movie_size'] / 1024;
|
||||
}
|
||||
}
|
||||
if ( count( $maxFileSizes ) )
|
||||
if ( \count( $maxFileSizes ) )
|
||||
{
|
||||
$options['maxFileSize'] = max( $maxFileSizes );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'images', array(), TRUE, $options, function( $val ) use ( $maxNumberOfImages, $maxFileSizes ) {
|
||||
if ( $maxNumberOfImages !== NULL and count( $val ) > $maxNumberOfImages )
|
||||
if ( $maxNumberOfImages !== NULL and \count( $val ) > $maxNumberOfImages )
|
||||
{
|
||||
if ( $maxNumberOfImages < 1 )
|
||||
{
|
||||
@@ -419,16 +481,16 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
foreach ( $val as $file )
|
||||
{
|
||||
$ext = mb_substr( $file->filename, ( mb_strrpos( $file->filename, '.' ) + 1 ) );
|
||||
if ( in_array( $ext, \IPS\Image::$imageExtensions ) )
|
||||
if ( \in_array( mb_strtolower( $ext ), \IPS\Image::$imageExtensions ) )
|
||||
{
|
||||
/* The size was saved as kb, then divided by 1024 above to figure out how many MB to allow. So now we have '2' for 2MB for instance, so we need
|
||||
to multiply that by 1024*1024 in order to get the byte size again */
|
||||
if ( count( $maxFileSizes ) == 2 and $file->filesize() > ( $maxFileSizes['image'] * 1048576 ) )
|
||||
if ( \count( $maxFileSizes ) == 2 and $file->filesize() > ( $maxFileSizes['image'] * 1048576 ) )
|
||||
{
|
||||
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack( 'upload_image_too_big', FALSE, array( 'sprintf' => array( \IPS\Output\Plugin\Filesize::humanReadableFilesize( $maxFileSizes['image'] * 1048576 ) ) ) ) );
|
||||
}
|
||||
}
|
||||
elseif ( count( $maxFileSizes ) == 2 and $file->filesize() > ( $maxFileSizes['movie'] * 1048576 ) )
|
||||
elseif ( \count( $maxFileSizes ) == 2 and $file->filesize() > ( $maxFileSizes['movie'] * 1048576 ) )
|
||||
{
|
||||
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack( 'upload_movie_too_big', FALSE, array( 'sprintf' => array( \IPS\Output\Plugin\Filesize::humanReadableFilesize( $maxFileSizes['movie'] * 1048576 ) ) ) ) );
|
||||
}
|
||||
@@ -471,7 +533,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$checkboxInput = $tagsFieldName . '_freechoice_prefix';
|
||||
$prefixinput = $tagsFieldName . '_prefix';
|
||||
|
||||
\IPS\Request::i()->$tagsFieldName = ( is_array( $tagsValue ) ) ? implode( "\n", $tagsValue ) : $tagsValue;
|
||||
\IPS\Request::i()->$tagsFieldName = ( \is_array( $tagsValue ) ) ? implode( "\n", $tagsValue ) : $tagsValue;
|
||||
\IPS\Request::i()->$checkboxInput = 1;
|
||||
\IPS\Request::i()->$prefixinput = $tagsPrefix;
|
||||
|
||||
@@ -544,7 +606,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* Get any records we had before in case we need to delete them */
|
||||
$existing = iterator_to_array( \IPS\Db::i()->select( '*', 'gallery_images_uploads', array( 'upload_session=?', session_id() ) )->setKeyField( 'upload_location' ) );
|
||||
|
||||
|
||||
/* Get our image order first, as that's the order we want to loop through in */
|
||||
$imageOrder = json_decode( $values['images_order'], true );
|
||||
|
||||
@@ -562,13 +624,13 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
|
||||
$imageData = array();
|
||||
|
||||
if( is_array( $imagesData ) )
|
||||
if( \is_array( $imagesData ) )
|
||||
{
|
||||
foreach( $imagesData as $dataEntry )
|
||||
{
|
||||
if( mb_strpos( $dataEntry['name'], '_' . $image->tempId ) !== FALSE )
|
||||
{
|
||||
$imageData[ str_replace( '_' . $image->tempId, '', $dataEntry['name'] ) ] = $dataEntry['value'];
|
||||
$imageData[ str_replace( '_' . $image->tempId, '', str_replace( 'filedata__', '', $dataEntry['name'] ) ) ] = $dataEntry['value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -579,7 +641,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$imageData['image_copyright'] = $values['copyright_all'];
|
||||
}
|
||||
|
||||
if( !isset( $imageData['image_credit'] ) OR !$imageData['image_credit'] )
|
||||
if( !isset( $imageData['image_credit_info'] ) OR !$imageData['image_credit_info'] )
|
||||
{
|
||||
$imageData['image_credit_info'] = $values['credit_all'];
|
||||
}
|
||||
@@ -590,7 +652,10 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$imageData['image_tags_prefix'] = $values['prefix_all'];
|
||||
}
|
||||
|
||||
$imageData['image_auto_follow'] = $values['images_autofollow_all'];
|
||||
if( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$imageData['image_auto_follow'] = $values['images_autofollow_all'];
|
||||
}
|
||||
|
||||
/* Fix descriptions */
|
||||
$imageData['image_description'] = ( isset( $imageData['image_textarea'] ) AND $imageData['image_textarea'] ) ? $imageData['image_textarea'] : ( ( isset( $imageData['image_description'] ) ) ? $imageData['image_description'] : '' );
|
||||
@@ -603,8 +668,9 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
'upload_location' => (string) $image,
|
||||
'upload_file_name' => $image->originalFilename,
|
||||
'upload_date' => time(),
|
||||
'upload_order' => ( is_array( $imageOrder ) ) ? array_search( $image->tempId, $imageOrder ) : $i,
|
||||
'upload_data' => json_encode( $imageData )
|
||||
'upload_order' => ( \is_array( $imageOrder ) ) ? array_search( $image->tempId, $imageOrder ) : $i,
|
||||
'upload_data' => json_encode( $imageData ),
|
||||
'upload_exif' => $image->exifData ? json_encode( $image->exifData ) : NULL
|
||||
);
|
||||
}
|
||||
|
||||
@@ -612,7 +678,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Insert them into the database */
|
||||
if( count( $inserts ) )
|
||||
if( \count( $inserts ) )
|
||||
{
|
||||
\IPS\Db::i()->insert( 'gallery_images_uploads', $inserts );
|
||||
}
|
||||
@@ -633,6 +699,10 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$totalImages = \IPS\Db::i()->select( 'count(*)', 'gallery_images_uploads', array( 'upload_session=?', session_id() ) )->first();
|
||||
|
||||
$url = $url->setQueryString( 'totalImages', $totalImages );
|
||||
if ( isset( $data['guest_email'] ) )
|
||||
{
|
||||
$url = $url->setQueryString( 'guest_email', $data['guest_email'] );
|
||||
}
|
||||
|
||||
/* Now return the multiredirector */
|
||||
return $this->saveImages( $url );
|
||||
@@ -648,13 +718,13 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* Process */
|
||||
$url = $url ? $url->setQueryString( 'do', 'saveImages' ) : \IPS\Request::i()->url()->stripQueryString( array( 'mr' ) );
|
||||
|
||||
|
||||
/* Return the multiredirector */
|
||||
$multiRedirect = (string) new \IPS\Helpers\MultipleRedirect( $url,
|
||||
/* Function to process each image */
|
||||
function( $offset ) use ( $url )
|
||||
{
|
||||
$offset = intval( $offset );
|
||||
$offset = \intval( $offset );
|
||||
|
||||
$existing = \IPS\Db::i()->select( '*', 'gallery_images_uploads', array( 'upload_session=?', session_id() ), 'upload_order ASC', array( 0, 1 ) )->setKeyField( 'upload_location' );
|
||||
|
||||
@@ -667,20 +737,22 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
$values = array(
|
||||
'category' => $data['category']->_id,
|
||||
'imageLocation' => $location,
|
||||
'album' => $data['album'] ? $data['album']->_id : NULL
|
||||
'album' => $data['album'] ? $data['album']->_id : NULL,
|
||||
'guest_email' => isset( $data['guest_email'] ) ? $data['guest_email'] : NULL
|
||||
);
|
||||
|
||||
|
||||
/* Get the data from the row and set */
|
||||
$fileData = json_decode( $file['upload_data'], TRUE );
|
||||
|
||||
if( count( $fileData ) )
|
||||
if( \count( $fileData ) )
|
||||
{
|
||||
foreach( $fileData as $k => $v )
|
||||
{
|
||||
$values[ preg_replace("/^filedata_[0-9]+_/i", '', $k ) ] = $v;
|
||||
$values[ preg_replace("/^filedata_[0-9]*_/i", '', $k ) ] = $v;
|
||||
}
|
||||
}
|
||||
if( isset( $values['image_tags'] ) AND $values['image_tags'] AND !is_array( $values['image_tags'] ) )
|
||||
|
||||
if( isset( $values['image_tags'] ) AND $values['image_tags'] AND !\is_array( $values['image_tags'] ) )
|
||||
{
|
||||
$values['image_tags'] = explode( "\n", $values['image_tags'] );
|
||||
}
|
||||
@@ -722,16 +794,14 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
/* If GPS is supported but the admin did not specify whether to show the map or not, then default to showing it */
|
||||
$image = \IPS\File::get( 'gallery_Images', $location );
|
||||
|
||||
if( \IPS\GeoLocation::enabled() and \IPS\Image::exifSupported() and $image->isImage() )
|
||||
{
|
||||
$exif = \IPS\Image::create( $image->contents() )->parseExif();
|
||||
$exif = $file['upload_exif'] ? json_decode( $file['upload_exif'], true ) : NULL;
|
||||
$values['_exif'] = $exif;
|
||||
|
||||
if( count( $exif ) )
|
||||
if( \IPS\GeoLocation::enabled() and $exif )
|
||||
{
|
||||
if( isset( $exif['GPS.GPSLatitudeRef'] ) && isset( $exif['GPS.GPSLatitude'] ) && isset( $exif['GPS.GPSLongitudeRef'] ) && isset( $exif['GPS.GPSLongitude'] ) )
|
||||
{
|
||||
if( isset( $exif['GPS.GPSLatitudeRef'] ) && isset( $exif['GPS.GPSLatitude'] ) && isset( $exif['GPS.GPSLongitudeRef'] ) && isset( $exif['GPS.GPSLongitude'] ) )
|
||||
{
|
||||
$values['image_gps_show'] = ( isset( $values['image_gps_show'] ) ) ? (int) ( isset( $values['image_gps_show_checkbox'] ) ) : 1;
|
||||
}
|
||||
$values['image_gps_show'] = ( isset( $values['image_gps_show'] ) ) ? (int) ( isset( $values['image_gps_show_checkbox'] ) ) : \IPS\Settings::i()->gallery_maps_default;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,13 +811,26 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
|
||||
foreach( $formElements as $key => $element )
|
||||
{
|
||||
/* If this is a guest posting before registration, we can't check the CAPTCHA as none is added to the form */
|
||||
if( $key == 'captcha' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$testValuesForm->add( $element );
|
||||
|
||||
$name = 'image_' . $key;
|
||||
|
||||
if( isset( $values[ $name ] ) )
|
||||
{
|
||||
\IPS\Request::i()->$name = ( is_array( $values[ $name ] ) ) ? implode( "\n", $values[ $name ] ) : $values[ $name ];
|
||||
if( $name == 'image_description' )
|
||||
{
|
||||
\IPS\Request::i()->filedata__image_description = $values[ $name ];
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Request::i()->$name = ( \is_array( $values[ $name ] ) ) ? implode( "\n", $values[ $name ] ) : $values[ $name ];
|
||||
}
|
||||
|
||||
if( $name == 'image_tags' )
|
||||
{
|
||||
@@ -759,7 +842,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
|
||||
unset( $values[ $name . '_prefix' ] );
|
||||
}
|
||||
elseif( $name == 'image_auto_follow' )
|
||||
elseif( $name == 'image_auto_follow' AND \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$checkboxInput = $name . '_checkbox';
|
||||
|
||||
@@ -779,7 +862,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
foreach( $cleaned as $k => $v )
|
||||
{
|
||||
$values[ $k ] = $v;
|
||||
$values[ str_replace( 'filedata__', '', $k ) ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -800,7 +883,11 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
/* Function to call when done */
|
||||
function() use( $url )
|
||||
{
|
||||
if ( \IPS\Request::i()->totalImages === 1 )
|
||||
if ( isset( \IPS\Request::i()->guest_email ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register' ) );
|
||||
}
|
||||
elseif ( \IPS\Request::i()->totalImages === 1 )
|
||||
{
|
||||
/* If we are only sending one image, send a normal notification */
|
||||
$image = \IPS\gallery\Image::constructFromData( \IPS\Db::i()->select( '*', 'gallery_images', NULL, 'image_id DESC', 1 )->first() );
|
||||
@@ -808,7 +895,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$image->sendNotifications();
|
||||
}
|
||||
else if( $image->hidden() !== -1 )
|
||||
else if( !\in_array( $image->hidden(), array( -1, -3 ) ) )
|
||||
{
|
||||
$image->sendUnapprovedNotification();
|
||||
}
|
||||
@@ -864,7 +951,7 @@ class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$exif = \IPS\Image::create( \IPS\File::get( $temporaryImage['storage_extension'], $temporaryImage['contents'] )->contents() )->parseExif();
|
||||
|
||||
if( count( $exif ) )
|
||||
if( \count( $exif ) )
|
||||
{
|
||||
if( isset( $exif['GPS.GPSLatitudeRef'] ) && isset( $exif['GPS.GPSLatitude'] ) && isset( $exif['GPS.GPSLongitudeRef'] ) && isset( $exif['GPS.GPSLongitude'] ) )
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\modules\front\gallery;
|
||||
|
||||
/* 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;
|
||||
@@ -27,12 +27,6 @@ class _view extends \IPS\Content\Controller
|
||||
* [Content\Controller] Class
|
||||
*/
|
||||
protected static $contentModel = 'IPS\gallery\Image';
|
||||
|
||||
/**
|
||||
* @brief Should views and item markers be updated by AJAX requests?
|
||||
* @note For Gallery images, AJAX requests handle the next/previous links and using those needs to mark as read, etc.
|
||||
*/
|
||||
protected $updateViewsAndMarkersOnAjax = TRUE;
|
||||
|
||||
/**
|
||||
* Init
|
||||
@@ -47,6 +41,8 @@ class _view extends \IPS\Content\Controller
|
||||
{
|
||||
$this->image = \IPS\gallery\Image::load( \IPS\Request::i()->id );
|
||||
|
||||
$this->image->container()->clubCheckRules();
|
||||
|
||||
if ( !$this->image->canView( \IPS\Member::loggedIn() ) )
|
||||
{
|
||||
\IPS\Output::i()->error( $this->image->container()->errorMessage(), '2G188/1', 403, '' );
|
||||
@@ -58,6 +54,14 @@ class _view extends \IPS\Content\Controller
|
||||
}
|
||||
}
|
||||
|
||||
/* When preloading we don't want to update stuff */
|
||||
if( isset( \IPS\Request::i()->preload ) AND \IPS\Request::i()->preload )
|
||||
{
|
||||
$this->updateViewsAndMarkersOnAjax = FALSE;
|
||||
}
|
||||
|
||||
\IPS\gallery\Application::outputCss();
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
@@ -104,7 +108,7 @@ class _view extends \IPS\Content\Controller
|
||||
\IPS\Output::i()->metaTags['og:video:type'] = $this->image->file_type;
|
||||
\IPS\Output::i()->metaTags['og:type'] = 'video';
|
||||
|
||||
if( count( $this->image->tags() ) )
|
||||
if( \count( $this->image->tags() ) )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['og:video:tag'] = $this->image->tags();
|
||||
}
|
||||
@@ -119,7 +123,7 @@ class _view extends \IPS\Content\Controller
|
||||
\IPS\Output::i()->metaTags['og:image'] = \IPS\File::get( 'gallery_Images', $this->image->masked_file_name )->url;
|
||||
\IPS\Output::i()->metaTags['og:image:type'] = $this->image->file_type;
|
||||
|
||||
if( count( $this->image->tags() ) )
|
||||
if( \count( $this->image->tags() ) )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['og:object:tag'] = $this->image->tags();
|
||||
}
|
||||
@@ -138,9 +142,9 @@ class _view extends \IPS\Content\Controller
|
||||
$tab = isset( \IPS\Request::i()->tab ) ? \IPS\Request::i()->tab : array_shift( $_tabs );
|
||||
$activeTabContents = $this->image->commentReviews( $tab, \IPS\Request::i()->lightbox );
|
||||
|
||||
if ( count( $tabs ) > 1 )
|
||||
if ( \count( $tabs ) > 1 )
|
||||
{
|
||||
$commentsAndReviews = count( $tabs ) ? \IPS\Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $tab, $activeTabContents, \IPS\Request::i()->lightbox ? $this->image->url()->setQueryString( 'lightbox', 1 ) : $this->image->url(), 'tab', FALSE, TRUE, \IPS\Request::i()->lightbox ? 'ipsTabs_small ipsTabs_stretch' : '' ) : NULL;
|
||||
$commentsAndReviews = \count( $tabs ) ? \IPS\Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $tab, $activeTabContents, \IPS\Request::i()->lightbox ? $this->image->url()->setQueryString( 'lightbox', 1 ) : $this->image->url(), 'tab', FALSE, TRUE, \IPS\Request::i()->lightbox ? 'ipsTabs_small ipsTabs_stretch' : '' ) : NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -156,7 +160,7 @@ class _view extends \IPS\Content\Controller
|
||||
/* Media items should get the file size of the original file instead of a thumbnail */
|
||||
if( $this->image->media )
|
||||
{
|
||||
$displayedImage = \IPS\File::get( 'gallery_Images', $this->image->original_file_name );
|
||||
$displayedImage = \IPS\File::get( 'gallery_Images', $this->image->original_file_name, $this->image->file_size );
|
||||
}
|
||||
/* Otherwise, fetch the thumbnails */
|
||||
else
|
||||
@@ -189,7 +193,7 @@ class _view extends \IPS\Content\Controller
|
||||
'@id' => (string) $this->image->url(),
|
||||
'url' => (string) $this->image->url(),
|
||||
'name' => $this->image->mapped('title'),
|
||||
'description' => strip_tags( $this->image->truncated() ),
|
||||
'description' => $this->image->truncated( TRUE, NULL ),
|
||||
'dateCreated' => \IPS\DateTime::ts( $this->image->date )->format( \IPS\DateTime::ISO8601 ),
|
||||
'fileFormat' => $this->image->file_type,
|
||||
'keywords' => $this->image->tags(),
|
||||
@@ -272,7 +276,7 @@ class _view extends \IPS\Content\Controller
|
||||
'height' => $dimensions['large'][1],
|
||||
);
|
||||
|
||||
if( count( $this->image->metadata ) )
|
||||
if( \count( $this->image->metadata ) )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['gallery']['image']['exifData'] = array();
|
||||
|
||||
@@ -338,10 +342,42 @@ class _view extends \IPS\Content\Controller
|
||||
*/
|
||||
protected function download()
|
||||
{
|
||||
if( $this->image->canDownloadOriginal() == \IPS\gallery\Image::DOWNLOAD_ORIGINAL_NONE )
|
||||
{
|
||||
\IPS\Output::i()->error( 'cannot_download_original_image', '2G188/E', 403, '' );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
/* Get file and data */
|
||||
$file = \IPS\File::get( 'gallery_Images', $this->image->original_file_name ?: $this->image->masked_file_name );
|
||||
$image = NULL;
|
||||
|
||||
try
|
||||
{
|
||||
switch( $this->image->canDownloadOriginal() )
|
||||
{
|
||||
case \IPS\gallery\Image::DOWNLOAD_ORIGINAL_WATERMARKED:
|
||||
/* We need to watermark the original image on the fly in this case */
|
||||
$file = \IPS\File::get( 'gallery_Images', $this->image->original_file_name );
|
||||
$image = $this->image->createImageFile( $file, NULL );
|
||||
break;
|
||||
|
||||
case \IPS\gallery\Image::DOWNLOAD_ORIGINAL_RAW:
|
||||
$file = \IPS\File::get( 'gallery_Images', $this->image->original_file_name );
|
||||
break;
|
||||
}
|
||||
|
||||
if( $file->filesize() === false )
|
||||
{
|
||||
throw new \RuntimeException( 'DOES_NOT_EXIST' );
|
||||
}
|
||||
}
|
||||
catch( \RuntimeException $e )
|
||||
{
|
||||
\IPS\Log::log( "Original image for {$this->image->id} is missing, falling back to masked image", 'gallery_image_missing' );
|
||||
$file = \IPS\File::get( 'gallery_Images', $this->image->masked_file_name );
|
||||
}
|
||||
|
||||
$headers = array_merge( \IPS\Output::getCacheHeaders( time(), 360 ), array( "Content-Disposition" => \IPS\Output::getContentDisposition( 'attachment', $file->originalFilename ), "X-Content-Type-Options" => "nosniff" ) );
|
||||
|
||||
/* Send headers and print file */
|
||||
@@ -352,10 +388,20 @@ class _view extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Output::i()->sendHeader( $key . ': ' . $header );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->sendHeader( "Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
\IPS\Output::i()->sendHeader( "X-Content-Security-Policy: default-src 'none'; sandbox" );
|
||||
|
||||
\IPS\Output::i()->sendHeader( "Content-Length: " . $file->filesize() );
|
||||
|
||||
$file->printFile();
|
||||
if( $image !== NULL )
|
||||
{
|
||||
\IPS\Output::i()->sendHeader( "Content-Length: " . \strlen( (string) $image ) );
|
||||
print (string) $image;
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->sendHeader( "Content-Length: " . $file->filesize() );
|
||||
$file->printFile();
|
||||
}
|
||||
exit;
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
@@ -364,6 +410,44 @@ class _view extends \IPS\Content\Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark the image as read
|
||||
*
|
||||
* @note We preload the next/prev image in the lightbox and do not want those images marked as read when doing so. While this speeds up the loading to the end user, we still need to separately mark the image as read when it's pulled into view.
|
||||
* @return void
|
||||
*/
|
||||
public function markread()
|
||||
{
|
||||
/* Run CSRF check */
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Mark image as read */
|
||||
$this->image->markRead();
|
||||
|
||||
/* We also want to update the views */
|
||||
$countUpdated = false;
|
||||
if ( \IPS\REDIS_ENABLED and \IPS\CACHE_METHOD == 'Redis' and \IPS\CACHE_CONFIG )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Redis::i()->zIncrBy( 'topic_views', 1, static::$contentModel .'__' . $this->image->id );
|
||||
$countUpdated = true;
|
||||
}
|
||||
catch( \Exception $e ) {}
|
||||
}
|
||||
|
||||
if ( ! $countUpdated )
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_view_updates', array(
|
||||
'classname' => static::$contentModel,
|
||||
'id' => $this->image->id
|
||||
) );
|
||||
}
|
||||
|
||||
/* And return an AJAX response */
|
||||
\IPS\Output::i()->json('OK');
|
||||
}
|
||||
|
||||
/**
|
||||
* View all of the metadata for this image
|
||||
*
|
||||
@@ -520,7 +604,7 @@ class _view extends \IPS\Content\Controller
|
||||
}
|
||||
|
||||
/* Display form */
|
||||
\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' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -584,7 +668,7 @@ class _view extends \IPS\Content\Controller
|
||||
throw new \DomainException;
|
||||
}
|
||||
|
||||
$form = \IPS\gallery\Image\Table::buildMoveForm( $item->container(), 'IPS\\gallery\\Image', array( 'forceOwner' => $item->author() ) );
|
||||
$form = \IPS\gallery\Image\Table::buildMoveForm( $item->container(), 'IPS\\gallery\\Image', array( 'where' => array( "album_owner_id=? OR " . \IPS\Db::i()->in( 'album_submit_type', array( \IPS\gallery\Album::AUTH_SUBMIT_PUBLIC, \IPS\gallery\Album::AUTH_SUBMIT_GROUPS, \IPS\gallery\Album::AUTH_SUBMIT_MEMBERS, \IPS\gallery\Album::AUTH_SUBMIT_CLUB ) ), $item->author()->member_id ) ), $item->author() );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -614,7 +698,7 @@ class _view extends \IPS\Content\Controller
|
||||
$item->move( $target, FALSE );
|
||||
\IPS\Output::i()->redirect( $item->url() );
|
||||
}
|
||||
\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' ) );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
@@ -667,7 +751,7 @@ class _view extends \IPS\Content\Controller
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( $link ? $this->image->url() : NULL, $this->image->mapped('title') );
|
||||
|
||||
$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');
|
||||
$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;
|
||||
}
|
||||
}
|
||||
@@ -150,6 +150,21 @@
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "g_download_original",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Can this group download the original image?",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"13": {
|
||||
"method": "insert",
|
||||
"params": [
|
||||
"core_permission_index",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100002;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100015;
|
||||
|
||||
/* 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;
|
||||
@@ -79,7 +79,7 @@ class _Upgrade
|
||||
$update['album_sort_options'] = $_new;
|
||||
}
|
||||
|
||||
if( count( $update ) )
|
||||
if( \count( $update ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'gallery_albums', $update, 'album_id=' . $album['album_id'] );
|
||||
}
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100018;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100025;
|
||||
|
||||
/* 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;
|
||||
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100028;
|
||||
|
||||
/* 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;
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100030;
|
||||
|
||||
/* 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;
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100035;
|
||||
|
||||
/* 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;
|
||||
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_100042;
|
||||
|
||||
/* 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;
|
||||
@@ -56,7 +56,7 @@ class _Upgrade
|
||||
$imageData = json_decode( $row['image_data'], TRUE );
|
||||
$rebuild = false;
|
||||
|
||||
if ( is_array( $imageData ) )
|
||||
if ( \is_array( $imageData ) )
|
||||
{
|
||||
foreach( $imageData as $size => $dimensions )
|
||||
{
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_101000;
|
||||
|
||||
/* 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;
|
||||
@@ -55,7 +55,7 @@ class _Upgrade
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 'extra' => array( '_upgradeStep' => 2 ) ) );
|
||||
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_101006;
|
||||
|
||||
/* 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;
|
||||
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\gallery\setup\upg_101071;
|
||||
|
||||
/* 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;
|
||||
@@ -112,7 +112,7 @@ class _Upgrade
|
||||
$columns[] = 'upload_thumbnail';
|
||||
}
|
||||
|
||||
if( count( $columns ) )
|
||||
if( \count( $columns ) )
|
||||
{
|
||||
\IPS\Db::i()->dropColumn( 'gallery_images_uploads', $columns );
|
||||
}
|
||||
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Loaded 100 of 3791 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user