Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -52,9 +52,7 @@ class _StateSelect extends \IPS\Helpers\Form\FormAbstract
|
||||
* @return mixed
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
$value = array();
|
||||
|
||||
{
|
||||
if ( $this->options['unlimitedLang'] )
|
||||
{
|
||||
$unlimitedName = "{$this->name}_unlimited";
|
||||
@@ -64,21 +62,46 @@ class _StateSelect extends \IPS\Helpers\Form\FormAbstract
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( parent::getValue() as $v )
|
||||
return parent::getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function formatValue()
|
||||
{
|
||||
if ( is_array( $this->value ) )
|
||||
{
|
||||
if ( preg_match( '/^([A-Z]{2})-(.*)$/', $v, $matches ) )
|
||||
$value = array();
|
||||
foreach ( $this->value as $k => $v )
|
||||
{
|
||||
if ( !isset( $value[ $matches[1] ] ) )
|
||||
if ( in_array( (string) $k, \IPS\GeoLocation::$countries ) )
|
||||
{
|
||||
$value[ $matches[1] ] = array();
|
||||
$value[ $k ] = $v;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( preg_match( '/^([A-Z]{2})-(.*)$/', $v, $matches ) )
|
||||
{
|
||||
if ( !isset( $value[ $matches[1] ] ) )
|
||||
{
|
||||
$value[ $matches[1] ] = array();
|
||||
}
|
||||
$value[ $matches[1] ][] = $matches[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
$value[ $v ] = '*';
|
||||
}
|
||||
}
|
||||
$value[ $matches[1] ][] = $matches[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
$value[ $v ] = '*';
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user