Code Duplication    Length = 18-20 lines in 2 locations

classes/PodsUI.php 2 locations

@@ 1482-1499 (lines=18) @@
1479
            <?php
1480
            echo $this->do_template( $duplicate ? $this->header[ 'duplicate' ] : $this->header[ 'edit' ] );
1481
1482
            if ( !in_array( 'add', $this->actions_disabled ) && !in_array( 'add', $this->actions_hidden ) ) {
1483
                $link = pods_query_arg( array( 'action' . $this->num => 'add', 'id' . $this->num => '', 'do' . $this->num = '' ), self::$allowed, $this->exclusion() );
1484
1485
                if ( !empty( $this->action_links[ 'add' ] ) )
1486
                    $link = $this->action_links[ 'add' ];
1487
                ?>
1488
                <a href="<?php echo esc_url( $link ); ?>" class="add-new-h2"><?php echo $this->heading[ 'add' ]; ?></a>
1489
                <?php
1490
            }
1491
            elseif ( !in_array( 'manage', $this->actions_disabled ) && !in_array( 'manage', $this->actions_hidden ) ) {
1492
                $link = pods_query_arg( array( 'action' . $this->num => 'manage', 'id' . $this->num => '' ), self::$allowed, $this->exclusion() );
1493
1494
                if ( !empty( $this->action_links[ 'manage' ] ) )
1495
                    $link = $this->action_links[ 'manage' ];
1496
                ?>
1497
                <a href="<?php echo esc_url( $link ); ?>" class="add-new-h2">&laquo; <?php echo sprintf( __( 'Back to %s', 'pods' ), $this->heading[ 'manage' ] ); ?></a>
1498
                <?php
1499
            }
1500
            ?>
1501
        </h2>
1502
@@ 1760-1779 (lines=20) @@
1757
				<?php
1758
					echo $this->do_template( $this->header[ 'view' ] );
1759
1760
					if ( !in_array( 'add', $this->actions_disabled ) && !in_array( 'add', $this->actions_hidden ) ) {
1761
						$link = pods_query_arg( array( 'action' . $this->num => 'add', 'id' . $this->num => '', 'do' . $this->num = '' ), self::$allowed, $this->exclusion() );
1762
1763
						if ( !empty( $this->action_links[ 'add' ] ) ) {
1764
							$link = $this->action_links[ 'add' ];
1765
						}
1766
				?>
1767
					<a href="<?php echo esc_url( $link ); ?>" class="add-new-h2"><?php echo $this->heading[ 'add' ]; ?></a>
1768
				<?php
1769
					}
1770
					elseif ( !in_array( 'manage', $this->actions_disabled ) && !in_array( 'manage', $this->actions_hidden ) ) {
1771
						$link = pods_query_arg( array( 'action' . $this->num => 'manage', 'id' . $this->num => '' ), self::$allowed, $this->exclusion() );
1772
1773
						if ( !empty( $this->action_links[ 'manage' ] ) ) {
1774
							$link = $this->action_links[ 'manage' ];
1775
						}
1776
				?>
1777
					<a href="<?php echo esc_url( $link ); ?>" class="add-new-h2">&laquo; <?php echo sprintf( __( 'Back to %s', 'pods' ), $this->heading[ 'manage' ] ); ?></a>
1778
				<?php
1779
					}
1780
1781
					pods_view( PODS_DIR . 'ui/admin/view.php', compact( array_keys( get_defined_vars() ) ) );
1782
				?>