Version 5.0.14

This commit is contained in:
Neo committed 2025-12-19 19:17:57 -08:00
1 parent 5efe744c5f
commit dbd774b30c
364 files changed
+7048 -1377

No files matched your search

+2 -2
View File
@@ -319,7 +319,7 @@ abstract class Dynamic extends Chart
}
elseif ( is_numeric( Request::i()->start[ $this->identifier ] ) )
{
$this->start = DateTime::ts( Request::i()->start[ $this->identifier ] );
$this->start = DateTime::ts( (int) Request::i()->start[ $this->identifier ] );
}
else
{
@@ -354,7 +354,7 @@ abstract class Dynamic extends Chart
}
elseif ( is_numeric( Request::i()->end[ $this->identifier ] ) )
{
$this->end = DateTime::ts( Request::i()->end[ $this->identifier ] );
$this->end = DateTime::ts( (int) Request::i()->end[ $this->identifier ] );
}
else
{
+11 -1
View File
@@ -10,6 +10,8 @@
namespace IPS\Helpers\Form\Captcha;
use ErrorException;
use InvalidArgumentException;
use IPS\Http\Request\Exception;
use IPS\Http\Url;
use IPS\Log;
@@ -50,7 +52,15 @@ class Turnstile implements CaptchaInterface
*/
public function getHtml(): string
{
return Theme::i()->getTemplate( 'forms', 'core', 'global' )->captchaTurnstile( Bridge::i()->getTurnstileCredentials()['site_key'], preg_replace( '/^(.+?)\..*$/', '$1', Member::loggedIn()->language()->short ) );
try
{
return Theme::i()->getTemplate( 'forms', 'core', 'global' )->captchaTurnstile( Bridge::i()->getTurnstileCredentials()['site_key'], preg_replace( '/^(.+?)\..*$/', '$1', Member::loggedIn()->language()->short ) );
}
catch( ErrorException $e )
{
Log::log( $e->getMessage(), 'turnstile' );
return '';
}
}
/**
+3 -2
View File
@@ -680,9 +680,10 @@ class Form
{
foreach ( $elements as $_name => $element )
{
/* @var FormAbstract $element */
if ( isset( $element->options['togglesOn'] ) )
{
if ( !$element->value )
if ( !$element->value or in_array( $element->htmlId, $htmlIdsToIgnoreBecauseTheyAreHiddenByToggles ) )
{
$htmlIdsToIgnoreBecauseTheyAreHiddenByToggles = array_merge( $htmlIdsToIgnoreBecauseTheyAreHiddenByToggles, $element->options['togglesOn'] );
}
@@ -726,7 +727,7 @@ class Form
$match = is_array( $element->value ) ? in_array( $toggleValue, $element->value ) : $toggleValue == $element->value;
}
if ( !$match )
if ( !$match or in_array( $element->htmlId, $htmlIdsToIgnoreBecauseTheyAreHiddenByToggles ) )
{
$htmlIdsToIgnoreBecauseTheyAreHiddenByToggles = array_merge( $htmlIdsToIgnoreBecauseTheyAreHiddenByToggles, $toggleHtmlIds );
}
+17 -5
View File
@@ -67,7 +67,7 @@ class Node extends FormAbstract
'where' => array(), // where clause to control which results to display
'disabledIds' => array(), // Array of disabled IDs
'noParentNodes' => 'Custom' // If a value is provided, subnodes of this class which have no parent node will be added into a pseudo-group with the title provided. e.g. custom packages in Nexus do not belong to any package group
'autoPopulate' => FALSE // Whether or not to autopopulate children of root nodes (defaults to TRUE which means the children are loaded, use FALSE to only show the parent nodes by default until they are clicked on)
'autoPopulate' => FALSE // Whether to autopopulate children of root nodes (defaults to TRUE which means the children are loaded, use FALSE to only show the parent nodes by default until they are clicked on)
'clubs' => TRUE, // If TRUE, will also show nodes inside clubs that the user can access. Defaults to FALSE.
'nodeGroups' => FALSE, // If TRUE, will show node groups for easier selection. Defaults to FALSE.
'maxResults' => 200, // Maximum number of nodes to load. NULL to load all nodes or FALSE to respect node class definition. Defaults to FALSE.
@@ -120,9 +120,21 @@ class Node extends FormAbstract
}
$this->options['url'] = $this->options['url']->setQueryString( '_nodeSelectName', $this->name );
if ( $this->options['clubs'] and ( !Settings::i()->clubs or !IPS::classUsesTrait( $this->options['class'], 'IPS\Content\ClubContainer' ) ) )
if ( $this->options['clubs'] )
{
$this->options['clubs'] = FALSE;
if( ( !Settings::i()->clubs or !IPS::classUsesTrait( $this->options['class'], 'IPS\Content\ClubContainer' ) ) )
{
$this->options['clubs'] = FALSE;
}
else
{
/* Make sure we have clubs to show */
$totalClubNodes = (int) Db::i()->select( 'count(*)', 'core_clubs_node_map', [ 'node_class=?', $this->options['class'] ] )->first();
if( !$totalClubNodes )
{
$this->options['clubs'] = false;
}
}
}
if( $this->options['nodeGroups'] and ! ( IPS::classUsesTrait( $this->options['class'], Grouping::class ) and Member::loggedIn()->isModerator() ) )
@@ -143,7 +155,7 @@ class Node extends FormAbstract
*
* @return string
* @note $selectable controls whether the node is selectable, not whether it is provided as an option or not.
* @note $showable controls whether or not the node should be displayed at all. On the front end this is based on view permissions, and on the backend we display all nodes regardless of view permissions.
* @note $showable controls whether the node should be displayed at all. On the front end this is based on view permissions, and on the backend we display all nodes regardless of view permissions.
*/
public function html(): string
{
@@ -258,7 +270,7 @@ class Node extends FormAbstract
$nodes = array();
$children = array();
$noParentNodes = array();
if( isset( $nodeClass::$ownerTypes ) and $nodeClass::$ownerTypes !== NULL and $this->options['forceOwner'] !== FALSE )
if( !empty( $nodeClass::$ownerTypes ) and $this->options['forceOwner'] !== FALSE )
{
$nodes = $nodeClass::loadByOwner( $this->options['forceOwner'] ?: Member::loggedIn(), $this->options['where'] );
if ( $this->options['clubs'] )
+11
View File
@@ -19,6 +19,7 @@ use IPS\Content\Comment;
use IPS\Content\Filter;
use IPS\Content\Item;
use IPS\Content\Reaction;
use IPS\Content\Search\Index;
use IPS\Content\Taggable;
use IPS\DateTime;
use IPS\Db;
@@ -1053,6 +1054,16 @@ class Content extends Table
if( $modified )
{
$object->setTags( $currentTags );
/* And make sure we index it! */
if( $object instanceof Item and $object::$firstCommentRequired )
{
Index::i()->index( $object->firstComment() );
}
else
{
Index::i()->index( $object );
}
}
}
catch( OutOfRangeException ){}