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 Radio Switch 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
|
||||
*/
|
||||
@@ -35,6 +35,10 @@ class _Radio extends Select
|
||||
{
|
||||
$this->options['descriptions'] = array();
|
||||
}
|
||||
if ( !isset( $this->options['warnings'] ) )
|
||||
{
|
||||
$this->options['warnings'] = array();
|
||||
}
|
||||
|
||||
/* If you haven't selected any radio options, then there is no input and the required flag is never checked (validate() is never called) */
|
||||
$_key = "radio_" . $this->name . "__empty";
|
||||
@@ -62,7 +66,8 @@ class _Radio extends Select
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
$descriptions = $this->options['descriptions'];
|
||||
$descriptions = $this->options['descriptions'];
|
||||
$warnings = $this->options['warnings'];
|
||||
if ( $this->options['parse'] === 'lang' )
|
||||
{
|
||||
foreach ( $this->options['options'] as $k => $v )
|
||||
@@ -72,6 +77,12 @@ class _Radio extends Select
|
||||
{
|
||||
$descriptions[ $k ] = \IPS\Member::loggedIn()->language()->addToStack( $key );
|
||||
}
|
||||
|
||||
$key = "{$v}_warning";
|
||||
if ( \IPS\Member::loggedIn()->language()->checkKeyExists( $key ) )
|
||||
{
|
||||
$warnings[ $k ] = \IPS\Member::loggedIn()->language()->addToStack( $key );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,19 +90,23 @@ class _Radio extends Select
|
||||
if ( $this->options['returnLabels'] )
|
||||
{
|
||||
$value = array_search( $this->value, $this->options['options'] );
|
||||
if ( $value === FALSE )
|
||||
{
|
||||
$value = $this->defaultValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $this->value;
|
||||
}
|
||||
|
||||
|
||||
if ( $this->options['parse'] === 'image' )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->radioImages( $this->name, $value, $this->required, $this->options['options'], $this->options['disabled'], $this->options['toggles'], $descriptions, $this->options['userSuppliedInput'], $this->options['unlimited'], $this->options['unlimitedLang'], $this->htmlId );
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->radioImages( $this->name, $value, $this->required, $this->options['options'], $this->options['disabled'], $this->options['toggles'], $descriptions, $warnings, $this->options['userSuppliedInput'], $this->options['unlimited'], $this->options['unlimitedLang'], $this->htmlId );
|
||||
}
|
||||
else
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->radio( $this->name, $value, $this->required, $this->parseOptions(), $this->options['disabled'], $this->options['toggles'], $descriptions, $this->options['userSuppliedInput'], $this->options['unlimited'], $this->options['unlimitedLang'], $this->htmlId );
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->radio( $this->name, $value, $this->required, $this->parseOptions(), $this->options['disabled'], $this->options['toggles'], $descriptions, $warnings, $this->options['userSuppliedInput'], $this->options['unlimited'], $this->options['unlimitedLang'], $this->htmlId );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user