Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Select-box class for Form Builder
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @since 18 Feb 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -223,12 +223,12 @@ class _Select extends FormAbstract
|
||||
$value = mb_strpos( $name, '[' ) ? \IPS\Request::i()->valueFromArray( $name ) : \IPS\Request::i()->$name;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $value ) AND is_array( $value ) AND $this->options['multiple'] )
|
||||
|
||||
if ( isset( $value ) AND is_array( $value ) AND $this->options['multiple'] AND array_search( '__EMPTY', $value ) !== FALSE )
|
||||
{
|
||||
unset( $value[ array_search( '__EMPTY', $value ) ] );
|
||||
}
|
||||
|
||||
|
||||
if ( $this->options['returnLabels'] )
|
||||
{
|
||||
if ( is_array( $value ) )
|
||||
@@ -286,10 +286,19 @@ class _Select extends FormAbstract
|
||||
$acceptableValues[] = $this->options['returnLabels'] ? $v : $k;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$disabledValues = ( is_array( $this->options['disabled'] ) ) ? $this->options['disabled'] : array( $this->options['disabled'] );
|
||||
$acceptableValues = array_diff( $acceptableValues, $disabledValues );
|
||||
|
||||
$diff = array_diff( ( is_array( $this->value ) ? $this->value : array( $this->value ) ), $acceptableValues );
|
||||
if ( !empty( $diff ) )
|
||||
{
|
||||
/* Is the entire thing disabled? If so, just return any default value set (if one has been set)*/
|
||||
if ( $this->options['disabled'] === TRUE and $this->defaultValue )
|
||||
{
|
||||
return $this->defaultValue;
|
||||
}
|
||||
|
||||
throw new \OutOfRangeException( 'form_bad_value' );
|
||||
}
|
||||
|
||||
@@ -300,15 +309,4 @@ class _Select extends FormAbstract
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* String Value
|
||||
*
|
||||
* @param mixed $value The value
|
||||
* @return string
|
||||
*/
|
||||
public static function stringValue( $value )
|
||||
{
|
||||
return parent::stringValue( $value );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user