2 achillis Nov 22, 2017 11:58

 

in inc/plugins/_plugin.funcs.php 
replace
	// "Layout" settings:
	if( isset($parmeta['layout']) )
	{
		switch( $parmeta['layout'] )
		{
			case 'begin_fieldset':
				$fieldset_title = $set_label;
				$Form->begin_fieldset( $fieldset_title.$help_icon );
				break;
//....
with
	// "Layout" settings:
	if( isset($parmeta['layout']) )
	{
		switch( $parmeta['layout'] )
		{
			case 'begin_fieldset':
				$fieldset_title = $set_label;
				$Form->begin_fieldset( $fieldset_title.$help_icon, isset($parmeta['fold']) ? array( 'fold'  => $parmeta['fold'], 'deny_fold'  => isset( $parmeta['deny_fold'] ) ? $parmeta['deny_fold'] : false, 'id'  => isset( $parmeta['id'] ) ? $parmeta['id'] : $parname ) : array() );
				break;
//....
and
	case 'array':
		case 'array:integer':
		case 'array:array:integer':
		case 'array:string':
		case 'array:array:string':
		case 'array:regexp':
			$has_array_type = true;
			$has_color_field = false;
			// Always use 'fieldset' layout to display it the same way from normal and ajax calls
			$Form->switch_layout( 'fieldset' );
			if( substr_count( $parname, '[' ) % 2 )
			{ // this refers to a specific array type set (with index pos at the end), e.g. when adding a field through AJAX:
				$pos_last_bracket = strrpos($parname, '[');
				$k_nb = substr( $parname, $pos_last_bracket+1, -1 );
				$disp_arrays = array( '' => $set_value ); // empty key..
				$parname = substr($parname, 0, $pos_last_bracket);
			}
			else
			{ // display all values hold in this set:
				$disp_whole_set = true;
				$disp_arrays = $set_value;
				$fieldset_title = $set_label;
				if( $debug )
				{
					$fieldset_title .= ' [debug: '.$parname.']';
				}
				$Form->begin_fieldset( $fieldset_title );
with
	case 'array':
		case 'array:integer':
		case 'array:array:integer':
		case 'array:string':
		case 'array:array:string':
		case 'array:regexp':
			$has_array_type = true;
			$has_color_field = false;
			// Always use 'fieldset' layout to display it the same way from normal and ajax calls
			$Form->switch_layout( 'fieldset' );
			if( substr_count( $parname, '[' ) % 2 )
			{ // this refers to a specific array type set (with index pos at the end), e.g. when adding a field through AJAX:
				$pos_last_bracket = strrpos($parname, '[');
				$k_nb = substr( $parname, $pos_last_bracket+1, -1 );
				$disp_arrays = array( '' => $set_value ); // empty key..
				$parname = substr($parname, 0, $pos_last_bracket);
			}
			else
			{ // display all values hold in this set:
				$disp_whole_set = true;
				$disp_arrays = $set_value;
				$fieldset_title = $set_label;
				if( $debug )
				{
					$fieldset_title .= ' [debug: '.$parname.']';
				}
				$Form->begin_fieldset( $fieldset_title, isset($parmeta['fold']) ? array( 'fold'  => $parmeta['fold'], 'deny_fold'  => isset( $parmeta['deny_fold'] ) ? $parmeta['deny_fold'] : false, 'id'  => isset( $parmeta['id'] ) ? $parmeta['id'] : $parname ) : array() );
completes the implementation
https://github.com/b2evolution/b2evolution/pull/54/files#diff-6a349809c4639c2880536ebbd9cfe12d

will check

will be in next version
This post has 1 feedback awaiting moderation...
Supported for:
and