Version 5.0.0 beta 10

This commit is contained in:
Neo committed 2025-12-19 17:53:48 -08:00
1 parent 56979f8ee8
commit 264eeb97e0
325 files changed
+6442 -1849

No files matched your search

+27 -14
View File
@@ -2032,6 +2032,11 @@ class Event extends Item implements Embeddable,
$this->coverPhotoFile()?->delete();
}
/**
* @var string|null
*/
protected ?string $_map = null;
/**
* Return the map for the event, if location is specified
*
@@ -2042,30 +2047,39 @@ class Event extends Item implements Embeddable,
*/
public function map( int $width, int $height ): string
{
/* Show venue map */
if ( Settings::i()->calendar_venues_enabled )
if( $this->_map === null )
{
if ( $this->venue )
/* Show venue map */
if ( Settings::i()->calendar_venues_enabled )
{
if ( $this->venue )
{
try
{
$this->location = Venue::load( $this->venue )->address;
}
catch( OutOfRangeException $e ){}
}
}
/* No venue? Do we have a specific event location? */
if ( $this->location )
{
try
{
$this->location = Venue::load( $this->venue )->address;
$this->_map = GeoLocation::buildFromJson( $this->location )->map()->render( $width, $height );
}
catch( OutOfRangeException $e ){}
catch( BadMethodCallException $e ){}
}
}
/* No venue? Do we have a specific event location? */
if ( $this->location )
{
try
/* Set to an empty string so we don't run through this multiple times */
if( $this->_map === null )
{
return GeoLocation::buildFromJson( $this->location )->map()->render( $width, $height );
$this->_map = '';
}
catch( BadMethodCallException $e ){}
}
return '';
return $this->_map;
}
/**
@@ -2725,6 +2739,5 @@ class Event extends Item implements Embeddable,
return $this->author()->member_id == $member->member_id and $this->container()->can( 'add', $member );
}
public static string $itemMenuKey = 'manage_event';
public static string $itemMenuCss = '';
}