Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

+24 -10
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Number input class for Form Builder
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 12 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\Helpers\Form;
@@ -42,6 +41,7 @@ class _Node extends FormAbstract
'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)
'clubs' => TRUE, // If TRUE, will also show nodes inside clubs that the user can access. Defaults to FALSE.
);
* @endcode
*/
@@ -60,7 +60,8 @@ class _Node extends FormAbstract
'where' => array(),
'disabledIds' => array(),
'noParentNodes' => NULL,
'autoPopulate' => TRUE
'autoPopulate' => TRUE,
'clubs' => FALSE
);
/**
@@ -77,6 +78,11 @@ class _Node extends FormAbstract
$this->options['url'] = \IPS\Request::i()->url();
}
$this->options['url'] = $this->options['url']->setQueryString( '_nodeSelectName', $this->name );
if ( $this->options['clubs'] and ( !\IPS\Settings::i()->clubs or !\IPS\IPS::classUsesTrait( $this->options['class'], 'IPS\Content\ClubContainer' ) ) )
{
$this->options['clubs'] = FALSE;
}
}
/**
@@ -94,7 +100,7 @@ class _Node extends FormAbstract
{
$permCheck = 'view';
}
/* Are we getting some AJAX stuff? */
if ( isset( \IPS\Request::i()->_nodeSelectName ) and \IPS\Request::i()->_nodeSelectName === $this->name )
{
@@ -166,8 +172,16 @@ class _Node extends FormAbstract
}
else
{
/* Recurse three levels in to allow for discoverability */
foreach( $nodeClass::roots( NULL, NULL, $this->options['where'] ) AS $node )
/* Recurse three levels in to allow for discoverability */
if ( $this->options['clubs'] )
{
$nodes = $nodeClass::rootsWithClubs( 'view', NULL, $this->options['where'] );
}
else
{
$nodes = $nodeClass::roots( 'view', NULL, $this->options['where'] );
}
foreach( $nodes AS $node )
{
$this->_populate( $nodes, $disabled, 0, $node, $children, 3 );
}
@@ -266,7 +280,7 @@ class _Node extends FormAbstract
}
/* Display */
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->node( $this->name, $selected, $this->options['multiple'], $this->options['url'], $nodeClass::$nodeTitle, $nodes, $this->options['zeroVal'], $noJS, $permCheck, $this->options['subnodes'], $this->options['togglePerm'], $this->options['toggleIds'], $disabledCallback, $this->options['zeroValTogglesOn'], $this->options['zeroValTogglesOff'], $this->options['autoPopulate'], $children, $this->options['class'], $this->options['where'], is_array( $this->options['disabledIds'] ) ? $this->options['disabledIds'] : array(), $this->options['noParentNodes'], $noParentNodes );
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->node( $this->name, $selected, $this->options['multiple'], $this->options['url'], $nodeClass::$nodeTitle, $nodes, $this->options['zeroVal'], $noJS, $permCheck, $this->options['subnodes'], $this->options['togglePerm'], $this->options['toggleIds'], $disabledCallback, $this->options['zeroValTogglesOn'], $this->options['zeroValTogglesOff'], $this->options['autoPopulate'], $children, $this->options['class'], $this->options['where'], is_array( $this->options['disabledIds'] ) ? $this->options['disabledIds'] : array(), $this->options['noParentNodes'], $noParentNodes, $this->options['clubs'] );
}
/**