Code Duplication    Length = 53-56 lines in 2 locations

src/wordlift/dataset/class-sync-page.php 1 location

@@ 5-57 (lines=53) @@
2
3
namespace Wordlift\Dataset;
4
5
class Sync_Page {
6
7
	/**
8
	 * Sync_Page constructor.
9
	 */
10
	public function __construct() {
11
12
		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
13
14
	}
15
16
	public function admin_menu() {
17
18
		add_submenu_page( 'wl_admin_menu', __( 'Synchronize Dataset', 'wordlift' ), __( 'Synchronize Dataset', 'wordlift' ), 'manage_options', 'wl_dataset_sync', array(
19
			$this,
20
			'render'
21
		) );
22
23
	}
24
25
	public function render() {
26
27
		wp_enqueue_style(
28
			'wl-tasks-page',
29
			plugin_dir_url( dirname( __FILE__ ) ) . 'tasks/admin/assets/tasks-page.css',
30
			array(),
31
			\Wordlift::get_instance()->get_version(),
32
			'all' );
33
		wp_enqueue_script(
34
			'wl-dataset-sync-page',
35
			plugin_dir_url( __FILE__ ) . 'assets/sync-page.js',
36
			array( 'wp-api' ),
37
			\Wordlift::get_instance()->get_version() );
38
39
		?>
40
        <div class="wrap">
41
            <h2><?php esc_html_e( 'Synchronize Dataset', 'wordlift' ); ?></h2>
42
43
            <div class="wl-task__progress" style="border: 1px solid #23282D; height: 20px; margin: 8px 0;">
44
                <div class="wl-task__progress__bar"
45
                     style="width:0;background: #0073AA; text-align: center; height: 100%; color: #fff;"></div>
46
            </div>
47
48
            <button id="wl-start-btn" type="button" class="button button-large button-primary"><?php
49
				esc_html_e( 'Start', 'wordlift-framework' ); ?></button>
50
            <button id="wl-stop-btn" type="button" class="button button-large button-primary hidden"><?php
51
				esc_html_e( 'Stop', 'wordlift-framework' ); ?></button>
52
53
        </div>
54
		<?php
55
	}
56
57
}

src/wordlift/videoobject/pages/class-import-videos-page.php 1 location

@@ 5-60 (lines=56) @@
2
3
namespace Wordlift\Videoobject\Pages;
4
5
class Import_Videos_Page {
6
7
	/**
8
	 * Sync_Page constructor.
9
	 */
10
	public function __construct() {
11
12
		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
13
14
	}
15
16
	public function admin_menu() {
17
18
		add_submenu_page( 'wl_admin_menu',
19
            __( 'Import all videos', 'wordlift' ),
20
            __( 'Import all videos', 'wordlift' ),
21
            'manage_options', 'wl_videos_import', array(
22
			$this,
23
			'render'
24
		) );
25
26
	}
27
28
	public function render() {
29
30
		wp_enqueue_style(
31
			'wl-tasks-page',
32
			plugin_dir_url( dirname( __FILE__ ) ) . 'tasks/admin/assets/tasks-page.css',
33
			array(),
34
			\Wordlift::get_instance()->get_version(),
35
			'all' );
36
		wp_enqueue_script(
37
			'wl-dataset-sync-page',
38
			plugin_dir_url( __FILE__ ) . 'assets/videoobject-import-page.js',
39
			array( 'wp-api' ),
40
			\Wordlift::get_instance()->get_version() );
41
42
		?>
43
        <div class="wrap">
44
            <h2><?php esc_html_e( 'Import all videos', 'wordlift' ); ?></h2>
45
46
            <div class="wl-task__progress" style="border: 1px solid #23282D; height: 20px; margin: 8px 0;">
47
                <div class="wl-task__progress__bar"
48
                     style="width:0;background: #0073AA; text-align: center; height: 100%; color: #fff;"></div>
49
            </div>
50
51
            <button id="wl-start-btn" type="button" class="button button-large button-primary"><?php
52
				esc_html_e( 'Start', 'wordlift' ); ?></button>
53
            <button id="wl-stop-btn" type="button" class="button button-large button-primary hidden"><?php
54
				esc_html_e( 'Stop', 'wordlift' ); ?></button>
55
56
        </div>
57
		<?php
58
	}
59
60
}