Completed
Pull Request — develop (#1588)
by
unknown
01:22
created
src/modules/food-kg/includes/admin/Full_Page_Delegate.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 
5 5
 class Full_Page_Delegate implements Page_Delegate {
6 6
 
7
-	public function render() {
8
-		include WL_FOOD_KG_DIR_PATH . '/includes/admin/partials/main_ingredient.php';
9
-	}
7
+    public function render() {
8
+        include WL_FOOD_KG_DIR_PATH . '/includes/admin/partials/main_ingredient.php';
9
+    }
10 10
 
11
-	public function admin_enqueue_scripts() {
12
-		wp_enqueue_style( 'thickbox' );
13
-		wp_enqueue_script( 'plugin-install' );
14
-	}
11
+    public function admin_enqueue_scripts() {
12
+        wp_enqueue_style( 'thickbox' );
13
+        wp_enqueue_script( 'plugin-install' );
14
+    }
15 15
 
16 16
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
 class Full_Page_Delegate implements Page_Delegate {
6 6
 
7 7
 	public function render() {
8
-		include WL_FOOD_KG_DIR_PATH . '/includes/admin/partials/main_ingredient.php';
8
+		include WL_FOOD_KG_DIR_PATH.'/includes/admin/partials/main_ingredient.php';
9 9
 	}
10 10
 
11 11
 	public function admin_enqueue_scripts() {
12
-		wp_enqueue_style( 'thickbox' );
13
-		wp_enqueue_script( 'plugin-install' );
12
+		wp_enqueue_style('thickbox');
13
+		wp_enqueue_script('plugin-install');
14 14
 	}
15 15
 
16 16
 }
Please login to merge, or discard this patch.
src/modules/food-kg/includes/admin/Page.php 2 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -4,55 +4,55 @@
 block discarded – undo
4 4
 
5 5
 class Page {
6 6
 
7
-	/**
8
-	 * @var Page_Delegate
9
-	 */
10
-	private $delegate;
11
-
12
-	/**
13
-	 * @param Page_Delegate $full_page_delegate
14
-	 * @param Page_Delegate $modal_page_delegate
15
-	 */
16
-	public function __construct( $full_page_delegate, $modal_page_delegate ) {
17
-		$this->delegate = isset( $_GET['modal_window'] ) ? $modal_page_delegate : $full_page_delegate; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
18
-	}
19
-
20
-	public function register_hooks() {
21
-		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
22
-		add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
23
-		if ( isset( $_GET['modal_window'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
24
-			add_action( 'in_admin_header', array( $this, 'remove_notices' ), 99 );
25
-		}
26
-	}
27
-
28
-	/**
29
-	 * Remove notices from ingredients modal.
30
-	 */
31
-	public function remove_notices() {
32
-		remove_all_actions( 'admin_notices' );
33
-		remove_all_actions( 'all_admin_notices' );
34
-	}
35
-
36
-	public function admin_menu() {
37
-		add_submenu_page(
38
-			'wl_admin_menu',
39
-			__( 'Ingredients', 'wordlift' ),
40
-			__( 'Ingredients', 'wordlift' ),
41
-			'manage_options',
42
-			'wl_ingredients',
43
-			array( $this, 'render' )
44
-		);
45
-	}
46
-
47
-	public function render() {
48
-		$this->delegate->render();
49
-	}
50
-
51
-	public function admin_enqueue_scripts() {
52
-		// Check that we are on the right screen
53
-		if ( get_current_screen()->id === 'wordlift_page_wl_ingredients' ) {
54
-			$this->delegate->admin_enqueue_scripts();
55
-		}
56
-	}
7
+    /**
8
+     * @var Page_Delegate
9
+     */
10
+    private $delegate;
11
+
12
+    /**
13
+     * @param Page_Delegate $full_page_delegate
14
+     * @param Page_Delegate $modal_page_delegate
15
+     */
16
+    public function __construct( $full_page_delegate, $modal_page_delegate ) {
17
+        $this->delegate = isset( $_GET['modal_window'] ) ? $modal_page_delegate : $full_page_delegate; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
18
+    }
19
+
20
+    public function register_hooks() {
21
+        add_action( 'admin_menu', array( $this, 'admin_menu' ) );
22
+        add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
23
+        if ( isset( $_GET['modal_window'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
24
+            add_action( 'in_admin_header', array( $this, 'remove_notices' ), 99 );
25
+        }
26
+    }
27
+
28
+    /**
29
+     * Remove notices from ingredients modal.
30
+     */
31
+    public function remove_notices() {
32
+        remove_all_actions( 'admin_notices' );
33
+        remove_all_actions( 'all_admin_notices' );
34
+    }
35
+
36
+    public function admin_menu() {
37
+        add_submenu_page(
38
+            'wl_admin_menu',
39
+            __( 'Ingredients', 'wordlift' ),
40
+            __( 'Ingredients', 'wordlift' ),
41
+            'manage_options',
42
+            'wl_ingredients',
43
+            array( $this, 'render' )
44
+        );
45
+    }
46
+
47
+    public function render() {
48
+        $this->delegate->render();
49
+    }
50
+
51
+    public function admin_enqueue_scripts() {
52
+        // Check that we are on the right screen
53
+        if ( get_current_screen()->id === 'wordlift_page_wl_ingredients' ) {
54
+            $this->delegate->admin_enqueue_scripts();
55
+        }
56
+    }
57 57
 
58 58
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@  discard block
 block discarded – undo
13 13
 	 * @param Page_Delegate $full_page_delegate
14 14
 	 * @param Page_Delegate $modal_page_delegate
15 15
 	 */
16
-	public function __construct( $full_page_delegate, $modal_page_delegate ) {
17
-		$this->delegate = isset( $_GET['modal_window'] ) ? $modal_page_delegate : $full_page_delegate; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
16
+	public function __construct($full_page_delegate, $modal_page_delegate) {
17
+		$this->delegate = isset($_GET['modal_window']) ? $modal_page_delegate : $full_page_delegate; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
18 18
 	}
19 19
 
20 20
 	public function register_hooks() {
21
-		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
22
-		add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
23
-		if ( isset( $_GET['modal_window'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
24
-			add_action( 'in_admin_header', array( $this, 'remove_notices' ), 99 );
21
+		add_action('admin_menu', array($this, 'admin_menu'));
22
+		add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
23
+		if (isset($_GET['modal_window'])) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
24
+			add_action('in_admin_header', array($this, 'remove_notices'), 99);
25 25
 		}
26 26
 	}
27 27
 
@@ -29,18 +29,18 @@  discard block
 block discarded – undo
29 29
 	 * Remove notices from ingredients modal.
30 30
 	 */
31 31
 	public function remove_notices() {
32
-		remove_all_actions( 'admin_notices' );
33
-		remove_all_actions( 'all_admin_notices' );
32
+		remove_all_actions('admin_notices');
33
+		remove_all_actions('all_admin_notices');
34 34
 	}
35 35
 
36 36
 	public function admin_menu() {
37 37
 		add_submenu_page(
38 38
 			'wl_admin_menu',
39
-			__( 'Ingredients', 'wordlift' ),
40
-			__( 'Ingredients', 'wordlift' ),
39
+			__('Ingredients', 'wordlift'),
40
+			__('Ingredients', 'wordlift'),
41 41
 			'manage_options',
42 42
 			'wl_ingredients',
43
-			array( $this, 'render' )
43
+			array($this, 'render')
44 44
 		);
45 45
 	}
46 46
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 	public function admin_enqueue_scripts() {
52 52
 		// Check that we are on the right screen
53
-		if ( get_current_screen()->id === 'wordlift_page_wl_ingredients' ) {
53
+		if (get_current_screen()->id === 'wordlift_page_wl_ingredients') {
54 54
 			$this->delegate->admin_enqueue_scripts();
55 55
 		}
56 56
 	}
Please login to merge, or discard this patch.
src/modules/food-kg/includes/admin/partials/main_ingredient.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 	<hr class="wp-header-end">
12 12
 	<?php
13 13
 
14
-	// Prepare Table of elements
15
-	$main_ingredient_list_table = new Main_Ingredient_List_Table();
16
-	$main_ingredient_list_table->prepare_items();
17
-	$main_ingredient_list_table->display();
18
-	?>
14
+    // Prepare Table of elements
15
+    $main_ingredient_list_table = new Main_Ingredient_List_Table();
16
+    $main_ingredient_list_table->prepare_items();
17
+    $main_ingredient_list_table->display();
18
+    ?>
19 19
 </div>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@
 block discarded – undo
6 6
 
7 7
 
8 8
 <div class="wrap">
9
-	<h1 class="wp-heading-inline"><?php esc_html_e( 'Main Ingredients', 'wordlift' ); ?></h1>
10
-	<a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=wl_download_ingredients_data&_wpnonce=' . wp_create_nonce( 'wl-dl-ingredients-data-nonce' ) ) ); ?>" class="page-title-action"><?php esc_html_e( 'Download Ingredients Data', 'wordlift' ); ?></a>
9
+	<h1 class="wp-heading-inline"><?php esc_html_e('Main Ingredients', 'wordlift'); ?></h1>
10
+	<a href="<?php echo esc_url(admin_url('admin-ajax.php?action=wl_download_ingredients_data&_wpnonce='.wp_create_nonce('wl-dl-ingredients-data-nonce'))); ?>" class="page-title-action"><?php esc_html_e('Download Ingredients Data', 'wordlift'); ?></a>
11 11
 	<hr class="wp-header-end">
12 12
 	<?php
13 13
 
Please login to merge, or discard this patch.