Code Duplication    Length = 27-27 lines in 2 locations

classes/class-lsx-wetu-importer-accommodation.php 1 location

@@ 388-414 (lines=27) @@
385
	 * @param boolean $row the current row to format.
386
	 * @return void
387
	 */
388
	public function format_row( $row = false ) {
389
		if ( false !== $row ) {
390
391
			$status = 'import';
392
			if ( 0 !== $row['post_id'] ) {
393
				$status = '<a href="' . admin_url( '/post.php?post=' . $row['post_id'] . '&action=edit' ) . '" target="_blank">' . get_post_status( $row['post_id'] ) . '</a>';
394
			}
395
396
			$row_html = '
397
			<tr class="post-' . $row['post_id'] . ' type-tour" id="post-' . $row['post_id'] . '">
398
				<th class="check-column" scope="row">
399
					<label for="cb-select-' . $row['id'] . '" class="screen-reader-text">' . $row['name'] . '</label>
400
					<input type="checkbox" data-identifier="' . $row['id'] . '" value="' . $row['post_id'] . '" name="post[]" id="cb-select-' . $row['id'] . '">
401
				</th>
402
				<td class="post-title page-title column-title">
403
					<strong>' . $row['name'] . '</strong> - ' . $status . '
404
				</td>
405
				<td class="date column-date">
406
					<abbr title="' . date( 'Y/m/d',strtotime( $row['last_modified'] ) ) . '">' . date( 'Y/m/d',strtotime( $row['last_modified'] ) ) . '</abbr><br>Last Modified
407
				</td>
408
				<td class="ssid column-ssid">
409
					' . $row['id'] . '
410
				</td>
411
			</tr>';
412
			return $row_html;
413
		}
414
	}
415
416
	/**
417
	 * Saves the queue to the option.

classes/class-lsx-wetu-importer-destination.php 1 location

@@ 445-471 (lines=27) @@
442
	/**
443
	 * Formats the row for output on the screen.
444
	 */
445
	public function format_row( $row = false ) {
446
		if ( false !== $row ) {
447
448
			$status = 'import';
449
			if ( 0 !== $row['post_id'] ) {
450
				$status = '<a href="' . admin_url( '/post.php?post=' . $row['post_id'] . '&action=edit' ) . '" target="_blank">' . get_post_status( $row['post_id'] ) . '</a>';
451
			}
452
453
			$row_html = '
454
			<tr class="post-' . $row['post_id'] . ' type-tour" id="post-' . $row['post_id'] . '">
455
				<th class="check-column" scope="row">
456
					<label for="cb-select-' . $row['id'] . '" class="screen-reader-text">' . $row['name'] . '</label>
457
					<input type="checkbox" data-identifier="' . $row['id'] . '" value="' . $row['post_id'] . '" name="post[]" id="cb-select-' . $row['id'] . '">
458
				</th>
459
				<td class="post-title page-title column-title">
460
					<strong>' . $row['name'] . '</strong> - ' . $status . '
461
				</td>
462
				<td class="date column-date">
463
					<abbr title="' . date( 'Y/m/d',strtotime( $row['last_modified'] ) ) . '">' . date( 'Y/m/d',strtotime( $row['last_modified'] ) ) . '</abbr><br>Last Modified
464
				</td>
465
				<td class="ssid column-ssid">
466
					' . $row['id'] . '
467
				</td>
468
			</tr>';
469
			return $row_html;
470
		}
471
	}
472
473
	/**
474
	 * Connect to wetu