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 Member input 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 11 Mar 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -50,6 +50,7 @@ class _Member extends Text
|
||||
$this->defaultOptions['autocomplete'] = array(
|
||||
'source' => 'app=core&module=system&controller=ajax&do=findMember',
|
||||
'resultItemTemplate' => 'core.autocomplete.memberItem',
|
||||
'commaTrigger' => false,
|
||||
'unique' => true,
|
||||
'minAjaxLength' => 3,
|
||||
'disallowedCharacters' => array()
|
||||
@@ -81,7 +82,7 @@ class _Member extends Text
|
||||
{
|
||||
$value[] = ( $v instanceof \IPS\Member ) ? $v->name : $v;
|
||||
}
|
||||
$value = implode( ',', $value );
|
||||
$value = implode( "\n", $value );
|
||||
}
|
||||
elseif ( $value instanceof \IPS\Member )
|
||||
{
|
||||
@@ -90,7 +91,7 @@ class _Member extends Text
|
||||
|
||||
/* 10/19/15 - adding htmlspecialchars around value if autocomplete is enabled so that html tag characters can be used (e.g. for members) */
|
||||
/* This value is decoded by the JS widget before use. See https://community.invisionpower.com/4bugtrack/active-reports/cannot-pm-certain-members-r6181/ */
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->text( $this->name, 'text', ( $this->options['autocomplete'] ? htmlspecialchars( $value, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ) : $value ), $this->required, $this->options['maxLength'], $this->options['size'], $this->options['disabled'], $this->options['autocomplete'], $this->options['placeholder'], NULL, NULL );
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->text( $this->name, 'text', ( $this->options['autocomplete'] AND !is_null( $value ) ) ? htmlspecialchars( $value, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ) : $value, $this->required, $this->options['maxLength'], $this->options['size'], $this->options['disabled'], $this->options['autocomplete'], $this->options['placeholder'], NULL, $this->options['nullLang'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,18 +101,20 @@ class _Member extends Text
|
||||
*/
|
||||
public function formatValue()
|
||||
{
|
||||
if ( $this->value and !( $this->value instanceof \IPS\Member ) )
|
||||
if ( $this->value !== '' and !( $this->value instanceof \IPS\Member ) )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
foreach ( is_array( $this->value ) ? $this->value : explode( ',', $this->value ) as $v )
|
||||
foreach ( is_array( $this->value ) ? $this->value : explode( "\n", $this->value ) as $v )
|
||||
{
|
||||
if ( $v instanceof \IPS\Member )
|
||||
{
|
||||
$return[ $v->member_id ] = $v;
|
||||
}
|
||||
elseif( $v )
|
||||
elseif( $v !== '' )
|
||||
{
|
||||
$v = html_entity_decode( $v, ENT_QUOTES, 'UTF-8' );
|
||||
|
||||
$member = \IPS\Member::load( $v, 'name' );
|
||||
if ( $member->member_id )
|
||||
{
|
||||
@@ -160,7 +163,7 @@ class _Member extends Text
|
||||
{
|
||||
if ( is_array( $value ) )
|
||||
{
|
||||
return implode( ',', array_map( function( $v )
|
||||
return implode( "\n", array_map( function( $v )
|
||||
{
|
||||
return $v->member_id;
|
||||
}, $value ) );
|
||||
|
||||
Reference in new issue
Block a user