Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

@@ -698,6 +698,35 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
$property = $size . "_file_name";
/* If we have an explicit cover photo set, make sure it's valid and load/cache it */
if( $this->cover_img_id )
{
if( $this->coverPhoto === NULL )
{
$this->coverPhoto = $this->coverPhotoObject();
}
}
if( $this->coverPhoto !== NULL )
{
return (string) \IPS\File::get( 'gallery_Images', $this->coverPhoto->$property )->url;
}
if( $lastImage = $this->lastImage() )
{
return (string) \IPS\File::get( 'gallery_Images', $lastImage->$property )->url;
}
return NULL;
}
/**
* Retrieve a cover photo object
*
* @return \IPS\gallery\Image|null
*/
public function coverPhotoObject()
{
/* If we have an explicit cover photo set, make sure it's valid and load/cache it */
if( $this->cover_img_id )
{
@@ -706,6 +735,11 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
try
{
$this->coverPhoto = \IPS\gallery\Image::load( $this->cover_img_id );
if( $this->coverPhoto !== NULL )
{
return $this->coverPhoto;
}
}
catch( \OutOfRangeException $e )
{
@@ -714,16 +748,11 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
$this->save();
}
}
if( $this->coverPhoto !== NULL )
{
return (string) \IPS\File::get( 'gallery_Images', $this->coverPhoto->$property )->url;
}
}
if( $lastImage = $this->lastImage() )
{
return (string) \IPS\File::get( 'gallery_Images', $lastImage->$property )->url;
return $lastImage;
}
return NULL;
@@ -970,7 +999,7 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
if( $club->type == 'closed' )
{
$form->add( new \IPS\Helpers\Form\YesNo( 'club_node_public', $this->id ? $this->isPublic() : FALSE ) );
$form->add( new \IPS\Helpers\Form\Radio( 'club_node_public', $this->id ? $this->isPublic() : 0, TRUE, array( 'options' => array( '0' => 'club_node_public_no', '1' => 'club_node_public_view', '2' => 'club_node_public_participate' ) ) ) );
}
}