Completed
Push — develop ( 1d2391...a94b56 )
by David
02:55 queued 11s
created

Sync_Page::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 29
rs 9.456
c 0
b 0
f 0
1
<?php
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
51
        </div>
52
		<?php
53
	}
54
55
}