Code Duplication    Length = 12-12 lines in 3 locations

modules/widgets/gallery.php 3 locations

@@ 178-189 (lines=12) @@
175
	 * @param array $instance The Widget instance to generate HTML for
176
	 * @return string String of HTML representing a rectangular gallery
177
	 */
178
	public function rectangular_widget( $args, $instance ) {
179
		if ( ! class_exists( 'Jetpack_Tiled_Gallery' )
180
			&& ! class_exists( 'Jetpack_Tiled_Gallery_Layout_Rectangular') ) {
181
			return;
182
		}
183
184
		$widget_tiled_gallery = new Jetpack_Tiled_Gallery();
185
		$widget_tiled_gallery->default_scripts_and_styles();
186
187
		$layout = new Jetpack_Tiled_Gallery_Layout_Rectangular( $instance['attachments'], $instance['link'], false, 3 );
188
		return $layout->HTML();
189
	}
190
191
	/**
192
	 * Generate HTML for a square (grid style) Widget
@@ 198-209 (lines=12) @@
195
	 * @param array $instance The Widget instance to generate HTML for
196
	 * @return string String of HTML representing a square gallery
197
	 */
198
	public function square_widget( $args, $instance ) {
199
		if ( ! class_exists( 'Jetpack_Tiled_Gallery' )
200
			&& ! class_exists( 'Jetpack_Tiled_Gallery_Layout_Square') ) {
201
			return;
202
		}
203
204
		$widget_tiled_gallery = new Jetpack_Tiled_Gallery();
205
		$widget_tiled_gallery->default_scripts_and_styles();
206
207
		$layout = new Jetpack_Tiled_Gallery_Layout_Square( $instance['attachments'], $instance['link'], false, 3 );
208
		return $layout->HTML();
209
	}
210
211
	/**
212
	 * Generate HTML for a circular (grid style) Widget
@@ 218-229 (lines=12) @@
215
	 * @param array $instance The Widget instance to generate HTML for
216
	 * @return string String of HTML representing a circular gallery
217
	 */
218
	public function circle_widget( $args, $instance ) {
219
		if ( ! class_exists( 'Jetpack_Tiled_Gallery' )
220
			&& ! class_exists( 'Jetpack_Tiled_Gallery_Layout_Circle') ) {
221
			return;
222
		}
223
224
		$widget_tiled_gallery = new Jetpack_Tiled_Gallery();
225
		$widget_tiled_gallery->default_scripts_and_styles();
226
227
		$layout = new Jetpack_Tiled_Gallery_Layout_Circle( $instance['attachments'], $instance['link'], false, 3 );
228
		return $layout->HTML();
229
	}
230
231
	/**
232
	 * Generate HTML for a slideshow Widget