Code Duplication    Length = 21-22 lines in 2 locations

modules/homes-com/widgets/class-homes-com-widgets.php 2 locations

@@ 177-198 (lines=22) @@
174
		 * @param bool   $rent (default: true) For Rent homes.
175
		 * @return void
176
		 */
177
		public function get_search( $iframe_id = '', $location, $color, $sale, $rent ) {
178
179
			if ( ( empty( $sale ) && empty( $rent ) ) || ( $sale && $rent ) ) {
180
				$searchTypes = 'FOR SALE,FOR RENT';
181
				$showTitle = '';
182
			} else if ( $sale ) {
183
				$searchTypes = 'FOR SALE';
184
				$showTitle = 'for Sale';
185
			} else if ( $rent ) {
186
				$searchTypes = 'FOR RENT';
187
				$showTitle = 'for Rent';
188
			}
189
190
			echo '<div class="medium-search-widget">';
191
			echo '	<h1 style="color:#' . $color . '">Search Homes <span class="listing-stat">' . $showTitle . '</span> </h1>';
192
			echo '	<iframe id="'. $this->homes_iframe_id( $iframe_id ) .'" class="medium-search-frame '. $this->homes_iframe_class( 'search-widget' ) .'" scrolling="no" title="'. __( 'Search on Homes', 're-pro' ) .'"src="http://www.homes.com/widget/medium-search/frame/?text_color=%23' . $color .'&listing_status=' . $searchTypes .'&cobrand=&location=' . $location .'" width="100%" seamless frameborder="0"></iframe>';
193
			echo '	<a href="http://www.homes.com/widgets/" title="Homes.com" class="logo">';
194
			echo '		Powered By Homes.com';
195
			echo '	</a>';
196
			echo '</div>';
197
198
		}
199
200
		/**
201
		 * Get Mortgage Calculator Widget.
@@ 231-251 (lines=21) @@
228
		 * @param bool   $rent (default: true) For Rent homes.
229
		 * @return void
230
		 */
231
		public function get_simple_search( $iframe_id = '', $location, $color, $sale, $rent ) {
232
233
			if ( ( empty( $sale ) && empty( $rent ) ) || ( $sale && $rent ) ) {
234
				$searchTypes = 'FOR SALE,FOR RENT';
235
				$showTitle = '';
236
			} else if ( $sale ) {
237
				$searchTypes = 'FOR SALE';
238
				$showTitle = 'for Sale';
239
			} else if ( $rent ) {
240
				$searchTypes = 'FOR RENT';
241
				$showTitle = 'for Rent';
242
			}
243
244
			echo '<div class="simple-search-widget">';
245
			echo '<h1 style="color:#' . $color . '">Search Homes <span class="listing-stat">' . $showTitle . '</span></h1>';
246
			echo '	<iframe id="'. $this->homes_iframe_id( $iframe_id ) .'" class="simple-search-frame '. $this->homes_iframe_class( 'simple-search-widget' ) .'" scrolling="no" title="'. __( 'Simple Search on Homes', 're-pro' ) .'"src="http://www.homes.com/widget/simple-search/frame/?text_color=%23' . $color .'&listing_status=' . $searchTypes .'&cobrand=&location=' . $location .'" width="100%" seamless frameborder="0"></iframe>';
247
			echo '	<a href="http://www.homes.com/widgets/" title="Homes.com" class="logo">';
248
			echo '		Powered By Homes.com';
249
			echo '	</a>';
250
			echo '</div>';
251
		}
252
253
		/**
254
		 * Get Real Estate (Tall) Search Widget.