Enqueues assets to load in the submissions list table view if conditions are met.
Description
See also
Parameters
- $submissions
-
(awsmug\Torro_Forms\DB_Objects\Submissions\Submission_Manager) (Required) Submission manager instance.
Source
File: src/modules/evaluators/module.php
protected function maybe_enqueue_submission_results_assets( $submissions ) { if ( empty( $_GET['form_id'] ) ) { return; } $form = $submissions->get_parent_manager( 'forms' )->get( (int) $_GET['form_id'] ); if ( ! $form ) { return; } $assets = $this->manager()->assets(); $has_enabled = false; foreach ( $this->submodules as $slug => $evaluator ) { if ( ! $evaluator->enabled( $form ) ) { continue; } $has_enabled = true; if ( ! is_a( $evaluator, Assets_Submodule_Interface::class ) ) { continue; } if ( ! is_callable( array( $evaluator, 'enqueue_submission_results_assets' ) ) ) { continue; } $evaluator->enqueue_submission_results_assets( $assets, $form ); } if ( $has_enabled ) { $assets->enqueue_script( 'clipboard' ); $assets->enqueue_style( 'clipboard' ); $assets->enqueue_script( 'admin-evaluations' ); $assets->enqueue_style( 'admin-evaluations' ); } }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |