';
foreach ( $list as $list_key => $list_value ) {
$output .= '| ';
//Save field data-- collections can be of any field type
$field_name = $name . '[' . $current_key . '][' . $list_key . ']';
$field_type = isset( $list_value['type'] ) ? $list_value['type'] : 'text';
$field_args = isset( $list_value['args'] ) ? $list_value['args'] : null;
$field_options = isset( $list_value['option'] ) ? $list_value['option'] : null;
$field_value = isset( $current_value[ $list_key ] ) ? $current_value[ $list_key ] : '';
//Display corresponding type of field
if ( $field_type == 'readonly' ) {
$output .= antreas_form_readonly( $field_name, $field_value, $field_args );
} elseif ( $field_type == 'text' ) {
$output .= antreas_form_text( $field_name, $field_value, $field_args );
} elseif ( $field_type == 'textarea' ) {
$output .= antreas_form_textarea( $field_name, $field_value, $field_args );
} elseif ( $field_type == 'select' ) {
$output .= antreas_form_select( $field_name, $field_value, $field_options, $field_args );
} elseif ( $field_type == 'checkbox' ) {
$output .= antreas_form_checkbox( $field_name, $field_value, $field_args );
} elseif ( $field_type == 'yesno' ) {
$output .= antreas_form_yesno( $field_name, $field_value, $field_args );
} elseif ( $field_type == 'color' ) {
$output .= antreas_form_color( $field_name, $field_value );
} elseif ( $field_type == 'upload' ) {
$output .= antreas_form_upload( $field_name, $field_value, null, $post );
} elseif ( $field_type == 'date' ) {
$output .= antreas_form_date( $field_name, $field_value, null );
}
$output .= ' | ';
}
$output .= '';
$output .= '' . __( 'Remove', 'antreas' ) . '';
$output .= ' | ';
$output .= '
';
}
$output .= '