Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -12,33 +12,24 @@
|
||||
namespace IPS\gallery\extensions\core\Profile;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Application;
|
||||
use IPS\Content\Filter;
|
||||
use IPS\Extensions\ProfileAbstract;
|
||||
use IPS\gallery\Image;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Profile extension: galleryImages
|
||||
*/
|
||||
class _galleryImages
|
||||
class galleryImages extends ProfileAbstract
|
||||
{
|
||||
/**
|
||||
* Member
|
||||
*/
|
||||
protected \IPS\Member $member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\Member $member Member whose profile we are viewing
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Member $member )
|
||||
{
|
||||
$this->member = $member;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is there content to display?
|
||||
*
|
||||
@@ -46,7 +37,12 @@ class _galleryImages
|
||||
*/
|
||||
public function showTab(): bool
|
||||
{
|
||||
return TRUE;
|
||||
$where = [
|
||||
[ 'image_member_id=?', $this->member->member_id ],
|
||||
[ 'image_album_id=?', 0 ]
|
||||
];
|
||||
$items = Image::getItemsWithPermission( $where, null, 1, 'read', Filter::FILTER_AUTOMATIC, 0, null, false, false,false,true );
|
||||
return $items > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +53,7 @@ class _galleryImages
|
||||
public function render(): string
|
||||
{
|
||||
$table ="";
|
||||
foreach ( \IPS\Application::load( 'gallery' )->extensions( 'core', 'ContentRouter' ) as $ext )
|
||||
foreach ( Application::load( 'gallery' )->extensions( 'core', 'ContentRouter' ) as $ext )
|
||||
{
|
||||
$table = $ext->customTableHelper( 'IPS\gallery\Image', $this->member->url()->setQueryString( 'tab', 'node_gallery_galleryImages'), array( array( 'image_member_id=? and image_album_id=0', $this->member->member_id ) ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user