Submit
Path:
~
/
home
/
getwphos
/
public_html
/
giulianos
/
wp-content
/
plugins
/
gravityforms
/
includes
/
File Content:
class-gf-service-provider.php
<?php namespace Gravity_Forms\Gravity_Forms; use Gravity_Forms\Gravity_Forms\Config\GF_App_Config; use Gravity_Forms\Gravity_Forms\Config\GF_Config_Service_Provider; /** * Class GF_Service_Provider * * An abstraction which provides a contract for defining Service Providers. Service Providers facilitate * organizing Services into discreet modules, as opposed to having to register each service in a single location. * * @since 2.5 * * @package Gravity_Forms\Gravity_Forms */ abstract class GF_Service_Provider { /** * @var GF_Service_Container $container */ protected $container; public function set_container( GF_Service_Container $container ) { $this->container = $container; } /** * Register new services to the Service Container. * * @param GF_Service_Container $container * * @return void */ abstract public function register( GF_Service_Container $container ); /** * Noop by default - used to initialize hooks and filters for the given module. */ public function init( GF_Service_Container $container ) {} //---------------------------------------- //---------- App Registration ------------ //---------------------------------------- /** * Register a JS app with the given arguments. * * @since 2.7.1 * * @param array $args */ public function register_app( $args ) { $config = new GF_App_Config( $this->container->get( GF_Config_Service_Provider::DATA_PARSER ) ); $config->set_data( $args ); $this->container->get( GF_Config_Service_Provider::CONFIG_COLLECTION )->add_config( $config ); $should_display = is_callable( $args['enqueue'] ) ? call_user_func( $args['enqueue'] ) : $args['enqueue']; if ( ! $should_display ) { return; } if ( ! empty( $args['css'] ) ) { $this->enqueue_app_css( $args ); } if ( ! empty( $args['root_element'] ) ) { $this->add_root_element( $args['root_element'] ); } } /** * Enqueue the CSS assets for the app. * * @since 2.7.1 * * @param $args */ protected function enqueue_app_css( $args ) { $css_asset = $args['css']; add_action( 'wp_enqueue_scripts', function () use ( $css_asset ) { call_user_func_array( 'wp_enqueue_style', $css_asset ); } ); add_action( 'admin_enqueue_scripts', function () use ( $css_asset ) { call_user_func_array( 'wp_enqueue_style', $css_asset ); } ); } /** * Add the root element to the footer output for bootstrapping. * * @since 2.7.1 * * @param string $root */ protected function add_root_element( $root ) { add_action( 'admin_footer', function() use ( $root ) { echo '<div data-js="' . esc_attr( $root ) . '"></div>'; }, 10, 0 ); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
addon
---
0755
ajax
---
0755
assets
---
0755
async
---
0755
author-select
---
0755
blocks
---
0755
config
---
0755
duplicate-submissions
---
0755
editor-button
---
0755
embed-form
---
0755
environment-config
---
0755
external-api
---
0755
fields
---
0755
form-display
---
0755
form-editor
---
0755
form-switcher
---
0755
honeypot
---
0755
legacy
---
0755
libraries
---
0755
license
---
0755
locking
---
0755
logging
---
0755
merge-tags
---
0755
messages
---
0755
notification
---
0755
orders
---
0755
phpqrcode
---
0755
post-custom-field-select
---
0755
query
---
0755
save-form
---
0755
settings
---
0755
setup-wizard
---
0755
splash-page
---
0755
system-status
---
0755
telemetry
---
0755
template-library
---
0755
templates
---
0755
theme-layers
---
0755
transients
---
0755
updates
---
0755
util
---
0755
webapi
---
0755
wizard
---
0755
api.php
101499 bytes
0644
class-confirmation.php
34714 bytes
0644
class-gf-background-upgrader.php
2408 bytes
0644
class-gf-download.php
7669 bytes
0644
class-gf-osdxp.php
10153 bytes
0644
class-gf-service-container.php
1908 bytes
0644
class-gf-service-provider.php
2659 bytes
0644
class-gf-upgrade.php
74277 bytes
0644
class-gravity-api.php
16408 bytes
0644
class-personal-data.php
40638 bytes
0644
class-translationspress-updater.php
12652 bytes
0644
index.php
27 bytes
0644
trait-redirects-on-save.php
2230 bytes
0644
upload.php
18793 bytes
0644
N4ST4R_ID | Naxtarrr