Completed
Pull Request — master (#65)
by
unknown
02:55
created
modules/rentbits/widgets/class-rentbits-widgets.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 		 * @access public
49 49
 		 * @param mixed $loc1 First Location.
50 50
 		 * @param mixed $loc2 Second Location.
51
-	 	 * @param mixed $loc3 Third Location.
51
+		 * @param mixed $loc3 Third Location.
52 52
 		 * @param mixed $loc4 Fourth Location.
53 53
 		 * @return void
54 54
 		 */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 // Exit if accessed directly.
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11
-if ( ! class_exists( 'RentbitsWidgets' ) ) {
11
+if ( ! class_exists('RentbitsWidgets')) {
12 12
 	/**
13 13
 	 * HomeFinderWidgets class.
14 14
 	 */
@@ -28,15 +28,15 @@  discard block
 block discarded – undo
28 28
 		 * @return void
29 29
 		 */
30 30
 		public function __construct() {
31
-			add_action( 'wp_footer', array( $this, 'rb_enqueue' ) );
31
+			add_action('wp_footer', array($this, 'rb_enqueue'));
32 32
 		}
33 33
 
34 34
 		/**
35 35
 		 * Handle multiple rb widgets js enqueues.
36 36
 		 */
37 37
 		public function rb_enqueue() {
38
-			wp_enqueue_script( 'rb-widgets-js', plugins_url( 'rb-widgets.js', __FILE__ ), array( 'jquery' ), null, true );
39
-			wp_localize_script( 'rb-widgets-js', 'rb_data', static::$rb_data );
38
+			wp_enqueue_script('rb-widgets-js', plugins_url('rb-widgets.js', __FILE__), array('jquery'), null, true);
39
+			wp_localize_script('rb-widgets-js', 'rb_data', static::$rb_data);
40 40
 
41 41
 		}
42 42
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		 * @param mixed $loc4 Fourth Location.
53 53
 		 * @return void
54 54
 		 */
55
-		public function get_rental_comparison_widget( $loc1, $loc2, $loc3, $loc4 ) {
55
+		public function get_rental_comparison_widget($loc1, $loc2, $loc3, $loc4) {
56 56
 
57 57
 			$url = 'http://rentbits.com/rb/pageinc.do?p=widget-cmp-price&loc1=' . $loc1 . '&loc2=' . $loc2 . '&loc3=' . $loc3 . '&loc4=' . $loc4;
58 58
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			);
64 64
 			static::$rb_data[] = $rb_data;
65 65
 
66
-			$index = count( static::$rb_data ) - 1;
66
+			$index = count(static::$rb_data) - 1;
67 67
 			echo '<div id="rb-widget-' . $index . '"></div>';
68 68
 
69 69
 		}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		 * @param mixed $loc Location.
76 76
 		 * @return void
77 77
 		 */
78
-		public function get_average_rental_rates_widget( $loc ) {
78
+		public function get_average_rental_rates_widget($loc) {
79 79
 
80 80
 			$url = 'http://rentbits.com/rb/pageinc.do?p=widget-avg-price&loc=' . $loc;
81 81
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			);
87 87
 			static::$rb_data[] = $rb_data;
88 88
 
89
-			$index = count( static::$rb_data ) - 1;
89
+			$index = count(static::$rb_data) - 1;
90 90
 			echo '<div id="rb-widget-' . $index . '"></div>';
91 91
 
92 92
 		}
Please login to merge, or discard this patch.
modules/rentbits/widgets/class-rental-comparison-widget.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 	/* Exit if accessed directly. */
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11 11
 /**
12 12
  * RentbitsRentalComparisonWidget class.
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 		parent::__construct(
27 27
 			'rentbits_rental_comparison',
28
-			__( 'Rentbits Rental Comparison', 're-pro' ),
28
+			__('Rentbits Rental Comparison', 're-pro'),
29 29
 			array(
30
-				'description' => __( 'Display the current average rental price for up to any four locations.', 're-pro' ),
30
+				'description' => __('Display the current average rental price for up to any four locations.', 're-pro'),
31 31
 				'classname'   => 're-pro re-pro-widget rentbits-widget rentbits-rental-comparison',
32 32
 				'customize_selective_refresh' => true,
33 33
 			)
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
 	 * @param mixed $args Arguments.
42 42
 	 * @param mixed $instance Instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 
46
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
47
-		$location1 = ! empty( $instance['location1'] ) ? $instance['location1'] : '';
48
-		$location2 = ! empty( $instance['location2'] ) ? $instance['location2'] : '';
49
-		$location3 = ! empty( $instance['location3'] ) ? $instance['location3'] : '';
50
-		$location4 = ! empty( $instance['location4'] ) ? $instance['location4'] : '';
46
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
47
+		$location1 = ! empty($instance['location1']) ? $instance['location1'] : '';
48
+		$location2 = ! empty($instance['location2']) ? $instance['location2'] : '';
49
+		$location3 = ! empty($instance['location3']) ? $instance['location3'] : '';
50
+		$location4 = ! empty($instance['location4']) ? $instance['location4'] : '';
51 51
 
52 52
 		echo $args['before_widget'];
53 53
 
54
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
54
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
55 55
 
56 56
 		$rentbits_widgets = new RentbitsWidgets();
57 57
 
58
-		$rentbits_widgets->get_rental_comparison_widget( $location1, $location2, $location3, $location4 );
58
+		$rentbits_widgets->get_rental_comparison_widget($location1, $location2, $location3, $location4);
59 59
 
60 60
 		echo $args['after_widget'];
61 61
 	}
@@ -67,52 +67,52 @@  discard block
 block discarded – undo
67 67
 	 * @param mixed $instance Instance.
68 68
 	 * @return void
69 69
 	 */
70
-	public function form( $instance ) {
70
+	public function form($instance) {
71 71
 
72 72
 		// Set default values.
73
-		$instance = wp_parse_args( (array) $instance, array(
73
+		$instance = wp_parse_args((array) $instance, array(
74 74
 			'title' => '',
75 75
 			'location1' => '',
76 76
 			'location2' => '',
77 77
 			'location3' => '',
78 78
 			'location4' => '',
79
-		) );
79
+		));
80 80
 
81 81
 		// Retrieve an existing value from the database.
82
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
83
-		$location1 = ! empty( $instance['location1'] ) ? $instance['location1'] : '';
84
-		$location2 = ! empty( $instance['location2'] ) ? $instance['location2'] : '';
85
-		$location3 = ! empty( $instance['location3'] ) ? $instance['location3'] : '';
86
-		$location4 = ! empty( $instance['location4'] ) ? $instance['location4'] : '';
82
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
83
+		$location1 = ! empty($instance['location1']) ? $instance['location1'] : '';
84
+		$location2 = ! empty($instance['location2']) ? $instance['location2'] : '';
85
+		$location3 = ! empty($instance['location3']) ? $instance['location3'] : '';
86
+		$location4 = ! empty($instance['location4']) ? $instance['location4'] : '';
87 87
 
88 88
 		// Title.
89 89
 		echo '<p>';
90
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
91
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
90
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
91
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
92 92
 		echo '</p>';
93 93
 
94 94
 		// Location 1.
95 95
 		echo '<p>';
96
-		echo '	<label for="' . $this->get_field_id( 'location1' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
97
-		echo '	<input id="' . $this->get_field_id( 'location1' ) . '" name="' . $this->get_field_name( 'location1' ) . '" value="' . $location1 . '" class="widefat">';
96
+		echo '	<label for="' . $this->get_field_id('location1') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
97
+		echo '	<input id="' . $this->get_field_id('location1') . '" name="' . $this->get_field_name('location1') . '" value="' . $location1 . '" class="widefat">';
98 98
 		echo '</p>';
99 99
 
100 100
 		// Location 2.
101 101
 		echo '<p>';
102
-		echo '	<label for="' . $this->get_field_id( 'location2' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
103
-		echo '	<input id="' . $this->get_field_id( 'location2' ) . '" name="' . $this->get_field_name( 'location2' ) . '" value="' . $location2 . '" class="widefat">';
102
+		echo '	<label for="' . $this->get_field_id('location2') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
103
+		echo '	<input id="' . $this->get_field_id('location2') . '" name="' . $this->get_field_name('location2') . '" value="' . $location2 . '" class="widefat">';
104 104
 		echo '</p>';
105 105
 
106 106
 		// Location 3.
107 107
 		echo '<p>';
108
-		echo '	<label for="' . $this->get_field_id( 'location3' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
109
-		echo '	<input id="' . $this->get_field_id( 'location3' ) . '" name="' . $this->get_field_name( 'location3' ) . '" value="' . $location3 . '" class="widefat">';
108
+		echo '	<label for="' . $this->get_field_id('location3') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
109
+		echo '	<input id="' . $this->get_field_id('location3') . '" name="' . $this->get_field_name('location3') . '" value="' . $location3 . '" class="widefat">';
110 110
 		echo '</p>';
111 111
 
112 112
 		// Location 4.
113 113
 		echo '<p>';
114
-		echo '	<label for="' . $this->get_field_id( 'location4' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
115
-		echo '	<input id="' . $this->get_field_id( 'location4' ) . '" name="' . $this->get_field_name( 'location4' ) . '" value="' . $location4 . '" class="widefat">';
114
+		echo '	<label for="' . $this->get_field_id('location4') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
115
+		echo '	<input id="' . $this->get_field_id('location4') . '" name="' . $this->get_field_name('location4') . '" value="' . $location4 . '" class="widefat">';
116 116
 		echo '</p>';
117 117
 
118 118
 	}
@@ -125,15 +125,15 @@  discard block
 block discarded – undo
125 125
 	 * @param mixed $old_instance Old Instance.
126 126
 	 * @return $instance
127 127
 	 */
128
-	public function update( $new_instance, $old_instance ) {
128
+	public function update($new_instance, $old_instance) {
129 129
 
130 130
 		$instance = $old_instance;
131 131
 
132
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
133
-		$instance['location1'] = ! empty( $new_instance['location1'] ) ? strip_tags( $new_instance['location1'] ) : '';
134
-		$instance['location2'] = ! empty( $new_instance['location2'] ) ? strip_tags( $new_instance['location2'] ) : '';
135
-		$instance['location3'] = ! empty( $new_instance['location3'] ) ? strip_tags( $new_instance['location3'] ) : '';
136
-		$instance['location4'] = ! empty( $new_instance['location4'] ) ? strip_tags( $new_instance['location4'] ) : '';
132
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
133
+		$instance['location1'] = ! empty($new_instance['location1']) ? strip_tags($new_instance['location1']) : '';
134
+		$instance['location2'] = ! empty($new_instance['location2']) ? strip_tags($new_instance['location2']) : '';
135
+		$instance['location3'] = ! empty($new_instance['location3']) ? strip_tags($new_instance['location3']) : '';
136
+		$instance['location4'] = ! empty($new_instance['location4']) ? strip_tags($new_instance['location4']) : '';
137 137
 
138 138
 		return $instance;
139 139
 	}
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
  * @return void
147 147
  */
148 148
 function repro_rentbits_rental_comparison() {
149
-	if ( ! is_ssl() ) {
150
-		register_widget( 'RentbitsRentalComparisonWidget' );
149
+	if ( ! is_ssl()) {
150
+		register_widget('RentbitsRentalComparisonWidget');
151 151
 	}
152 152
 }
153
-add_action( 'widgets_init', 'repro_rentbits_rental_comparison' );
153
+add_action('widgets_init', 'repro_rentbits_rental_comparison');
Please login to merge, or discard this patch.
modules/modules.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Google maps.
4
-require_once( 'google-maps/gmaps.php' );
4
+require_once('google-maps/gmaps.php');
5 5
 
6 6
 // Equal Housing.
7
-require_once( 'equal-housing/equal-housing.php' );
7
+require_once('equal-housing/equal-housing.php');
8 8
 
9 9
 // Zillow.
10
-require_once( 'zillow/zillow.php' );
10
+require_once('zillow/zillow.php');
11 11
 
12
-require_once( 'trulia/trulia.php' );
12
+require_once('trulia/trulia.php');
13 13
 
14
-require_once( 'inman/inman.php' );
14
+require_once('inman/inman.php');
15 15
 
16
-require_once( 'homes-com/homes-com.php' );
16
+require_once('homes-com/homes-com.php');
17 17
 
18 18
 
19
-require_once( 'streetadvisor/streetadvisor.php' );
19
+require_once('streetadvisor/streetadvisor.php');
20 20
 
21
-require_once( 'greatschools/greatschools.php' );
21
+require_once('greatschools/greatschools.php');
22 22
 
23
-require_once( 'homefinder/homefinder.php' );
23
+require_once('homefinder/homefinder.php');
24 24
 
25
-require_once( 'rentbits/rentbits.php' );
25
+require_once('rentbits/rentbits.php');
Please login to merge, or discard this patch.