Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Checkbox Set 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 19 Jul 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\Helpers\Form;
|
||||
@@ -82,7 +81,7 @@ class _CheckboxSet extends Select
|
||||
|
||||
/* If the value is NULL or an empty string, i.e. from a custom field, then we should not convert it into an array because the
|
||||
value will evaluate to 0 with an == check and the first option in the checkbox set will always be selected erroneously */
|
||||
if ( ! is_array( $value ) AND $value !== NULL AND $value !== '' )
|
||||
if ( $this->options['unlimited'] === NULL and !is_array( $value ) AND $value !== NULL AND $value !== '' )
|
||||
{
|
||||
$value = array( $value );
|
||||
}
|
||||
@@ -97,9 +96,16 @@ class _CheckboxSet extends Select
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
$value = parent::getValue();
|
||||
|
||||
if ( $this->options['unlimited'] !== NULL and $value === $this->options['unlimited'] )
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
/* We need the array keys. For custom fields we will have 0 => 1, 1 => 1 if checkboxes 0 and 1 are checked, while for Content we will have
|
||||
customKey => 1, customOtherKey => 1 - we always need the array keys */
|
||||
$value = is_array( parent::getValue() ) ? array_keys( parent::getValue() ) : array();
|
||||
$value = is_array( $value ) ? array_keys( $value ) : array();
|
||||
if ( $this->options['returnLabels'] )
|
||||
{
|
||||
if ( is_array( $value ) )
|
||||
|
||||
Reference in new issue
Block a user