Version 5.0.0 beta 4

This commit is contained in:
Neo committed 2025-12-19 16:57:00 -08:00
1 parent e86153356a
commit 2f24f9de48
276 files changed
+8614 -6044

No files matched your search

@@ -463,6 +463,26 @@ class Categories extends Model implements Permissions
return parent::roots( $permissionCheck, $member, $where, $limit );
}
/**
* Fetch All Root Nodes
*
* @param string|null $permissionCheck The permission key to check for or NULl to not check permissions
* @param Member|null $member The member to check permissions for or NULL for the currently logged in member
* @param mixed $where Additional WHERE clause
* @param string|null $order ORDER BY clause
* @param array|null $limit Limit/offset to use, or NULL for no limit (default)
* @return array
*/
protected static function nodesWithPermission( ?string $permissionCheck, ?Member $member, mixed $where=array(), string $order=NULL, array $limit=NULL ): array
{
if( static::$customDatabaseId !== null )
{
$where[] = array( 'category_database_id=?', static::$customDatabaseId );
}
return parent::nodesWithPermission( $permissionCheck, $member, $where, $order, $limit );
}
/**
* [Node] Fetch Child Nodes
@@ -186,12 +186,16 @@ class Dispatcher extends SystemDispatcher
Output::i()->error( 'page_doesnt_exist', '2T251/2', 404 );
}
$path = trim( preg_replace( '#' . Page::$currentPage->full_path . '#', '', Request::i()->path, 1 ), '/' );
/* If we visited the default page in a folder, the full_path will be like folder/page but the request path will just be folder */
if( Request::i()->path . '/' . Page::$currentPage->seo_name == Page::$currentPage->full_path )
$path = '';
if( isset( Request::i()->path ) )
{
$path = '';
$path = trim( preg_replace( '#' . Page::$currentPage->full_path . '#', '', Request::i()->path, 1 ), '/' );
/* If we visited the default page in a folder, the full_path will be like folder/page but the request path will just be folder */
if( Request::i()->path . '/' . Page::$currentPage->seo_name == Page::$currentPage->full_path )
{
$path = '';
}
}
list( $path, $pageNumber ) = Page::getStrippedPagePath( $path );
+28 -6
View File
@@ -969,16 +969,38 @@ class Fields extends CustomField implements Permissions
{
foreach( $value as $idx => $val )
{
if ( $val instanceof FileSystem )
if ( $val instanceof File )
{
$value[ $idx ] = (string) $val->url;
$fileKey = Encrypt::fromPlaintext( (string) $val )->tag();
$downloadUrl = Url::internal( 'applications/core/interface/file/cfield.php', 'none' )->setqueryString( array(
'storage' => $val->storageExtension,
'path' => $val->originalFilename,
'fileKey' => $fileKey
) );
$value[ $idx ] = Theme::i()->getTemplate( 'global', 'cms', 'front' )->uploadDisplay( File::get( static::$uploadStorageExtension, $val ), $record, $downloadUrl, $fileKey );
}
}
}
else if ( $value instanceof FileSystem )
else if ( $value instanceof File )
{
$value = (string) $value->url;
$fileKey = Encrypt::fromPlaintext( (string) $value )->tag();
$downloadUrl = Url::internal( 'applications/core/interface/file/cfield.php', 'none' )->setqueryString( array(
'storage' => $value->storageExtension,
'path' => $value->originalFilename,
'fileKey' => $fileKey
) );
$value = Theme::i()->getTemplate( 'global', 'cms', 'front' )->uploadDisplay( File::get( static::$uploadStorageExtension, $value ), $record, $downloadUrl, $fileKey );
}
/* Restructure formValue so that it has the full URL */
$updatedFormValue = [];
foreach( explode( ",", $formValue ) as $val )
{
$updatedFormValue[] = File::get( static::$uploadStorageExtension, $val )->url;
}
$formValue = implode( ",", $updatedFormValue );
}
if ( ! isset( Store::i()->$functionName ) )
{
@@ -2235,7 +2257,7 @@ class Fields extends CustomField implements Permissions
if ( ! $isTitleOrContent )
{
$form->add( new YesNo( 'field_display_listing', $this->id ? $this->display_listing : 1, FALSE, array(
'togglesOn' => array('field_truncate', 'field_display_listing_json_badge', 'field_show_map_listing' )
'togglesOn' => array('field_display_listing_json_badge', 'field_show_map_listing', 'media_display_listing_method' )
), NULL, NULL, NULL, 'field_display_listing' ) );
}
@@ -2277,7 +2299,7 @@ class Fields extends CustomField implements Permissions
if ( ! $isTitleOrContent )
{
$form->add( new YesNo( 'field_display_display', $this->id ? $this->display_display : 1, FALSE, array(
'togglesOn' => array( 'field_display_display_json_badge', 'field_show_map_display', 'field_display_display_json_where' )
'togglesOn' => array( 'field_display_display_json_badge', 'field_show_map_display', 'field_display_display_json_where', 'media_display_display_method' )
), NULL, NULL, NULL, 'field_display_display' ) );
}
@@ -182,13 +182,14 @@ class CommentTopicSync extends Comment
/**
* Report
*
* @param string $reportContent Report content message from member
* @param int $reportType Report type (see constants in \IPS\core\Reports\Report
* @param Member|null $member Member making the report (or NULL for loggedIn())
* @return Report
* @throws UnexpectedValueException If there is a permission error - you should only call this method after checking canReport
* @param string $reportContent Report content message from member
* @param int $reportType Report type (see constants in \IPS\core\Reports\Report)
* @param \IPS\Member|NULL $member Member making the report (or NULL for loggedIn())
* @param array $guestDetails Details for a guest report
* @return \IPS\core\Reports\Report
* @throws UnexpectedValueException If there is a permission error - you should only call this method after checking canReport
*/
public function report( string $reportContent, int $reportType=1, Member|null $member=null ): Report
public function report( string $reportContent, int $reportType=1, Member|null $member=null, array $guestDetails=array() ): Report
{
$comment = Post::load( $this->pid );
return $comment->report( $reportContent, $reportType, $member );