Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -83,6 +83,7 @@ class _Stack extends FormAbstract
|
||||
foreach( $this->value as $k => $v )
|
||||
{
|
||||
$class = ( new $classType( $this->name . '[' . count($fields) . ']', $v, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix, $this->htmlId . '_' . count($fields) ) );
|
||||
$class->setValue( TRUE );
|
||||
$html = $class->html();
|
||||
|
||||
if( !\IPS\Login::compareHashes( $remove, md5( $html ) ) )
|
||||
@@ -94,6 +95,7 @@ class _Stack extends FormAbstract
|
||||
else
|
||||
{
|
||||
$class = ( new $classType( $this->name . '[0]', NULL, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix, $this->htmlId . '_' . count($fields) ) );
|
||||
$class->setValue( TRUE );
|
||||
$html = $class->html();
|
||||
|
||||
if( !\IPS\Login::compareHashes( $remove, md5( $html ) ) )
|
||||
@@ -106,6 +108,7 @@ class _Stack extends FormAbstract
|
||||
if ( $this->reloadForm === TRUE AND $remove === NULL )
|
||||
{
|
||||
$class = ( new $classType( $this->name . '[]', NULL, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix, $this->htmlId . '_' . count($fields) ) );
|
||||
$class->setValue( TRUE );
|
||||
$html = $class->html();
|
||||
$fields[] = $html;
|
||||
}
|
||||
@@ -113,6 +116,27 @@ class _Stack extends FormAbstract
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->stack( $this->name, $fields, $this->options );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Temporarily store if this is the intitial setValue call
|
||||
*/
|
||||
protected $_setValueInitial = NULL;
|
||||
|
||||
/**
|
||||
* Set the value of the element
|
||||
*
|
||||
* @param bool $initial Whether this is the initial call or not. Do not reset default values on subsequent calls.
|
||||
* @param bool $force Set the value even if one was not submitted (done on the final validation when getting values)?
|
||||
* @return void
|
||||
*/
|
||||
public function setValue( $initial=FALSE, $force=FALSE )
|
||||
{
|
||||
$this->_setValueInitial = $initial;
|
||||
|
||||
parent::setValue( $initial, $force );
|
||||
|
||||
$this->_setValueInitial = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format Value
|
||||
*
|
||||
@@ -130,7 +154,8 @@ class _Stack extends FormAbstract
|
||||
{
|
||||
foreach( \IPS\Request::i()->$name as $k => $v )
|
||||
{
|
||||
$class = ( new $classType( $this->name . '[]', $v, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix, $this->htmlId ) );
|
||||
$class = ( new $classType( $this->name . '[' . $k . ']', $v, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix, $this->htmlId ) );
|
||||
$class->setValue( $this->_setValueInitial, $this->_setValueInitial ? FALSE : TRUE );
|
||||
$values[] = $class->value;
|
||||
}
|
||||
}
|
||||
@@ -141,7 +166,8 @@ class _Stack extends FormAbstract
|
||||
{
|
||||
foreach( $this->value as $k => $v )
|
||||
{
|
||||
$class = ( new $classType( $this->name . '[]', $v, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix, $this->htmlId ) );
|
||||
$class = ( new $classType( $this->name . '[' . $k . ']', $v, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix, $this->htmlId ) );
|
||||
$class->setValue( $this->_setValueInitial, $this->_setValueInitial ? FALSE : TRUE );
|
||||
$values[] = $class->value;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user