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 Member input 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 11 Mar 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\Helpers\Form;
|
||||
@@ -40,7 +39,7 @@ class _Member extends Text
|
||||
* Constructor
|
||||
* Adds 'confirm' to the available options
|
||||
*
|
||||
* @see \IPS\Helpers\Form\Abstract::__construct
|
||||
* @see \IPS\Helpers\Form\FormAbstract::__construct
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
@@ -90,14 +89,14 @@ 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/ */
|
||||
/* This value is decoded by the JS widget before use. */
|
||||
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'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Format Value
|
||||
*
|
||||
* @return \IPS\Member|NULL|FALSE
|
||||
* @return \IPS\Member|array|NULL|FALSE
|
||||
*/
|
||||
public function formatValue()
|
||||
{
|
||||
@@ -150,6 +149,16 @@ class _Member extends Text
|
||||
{
|
||||
throw new \InvalidArgumentException('form_member_bad');
|
||||
}
|
||||
else if ( is_array( $this->value ) )
|
||||
{
|
||||
foreach( $this->value AS $value )
|
||||
{
|
||||
if ( $value !== '' AND !( $value instanceof \IPS\Member ) )
|
||||
{
|
||||
throw new \InvalidArgumentException( \IPS\Member::loggedIn()->language()->addToStack( 'form_member_bad_multiple', FALSE, array( 'sprintf' => array( $value ) ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,12 +166,17 @@ class _Member extends Text
|
||||
* String Value
|
||||
*
|
||||
* @param mixed $value The value
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public static function stringValue( $value )
|
||||
{
|
||||
if ( is_array( $value ) )
|
||||
{
|
||||
if ( !count( $value ) )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return implode( "\n", array_map( function( $v )
|
||||
{
|
||||
return $v->member_id;
|
||||
|
||||
Reference in new issue
Block a user