Code Duplication    Length = 18-20 lines in 2 locations

classes/PodsUI.php 2 locations

@@ 1677-1694 (lines=18) @@
1674
				<?php
1675
				echo wp_kses_post( $this->do_template( $duplicate ? $this->header['duplicate'] : $this->header['edit'] ) );
1676
1677
				if ( ! in_array( 'add', $this->actions_disabled ) && ! in_array( 'add', $this->actions_hidden ) && ! $this->restricted( 'add' ) ) {
1678
					$link = pods_query_arg(
1679
						array(
1680
							'action' . $this->num => 'add',
1681
							'id' . $this->num     => '',
1682
							'do' . $this->num = '',
1683
						), self::$allowed, $this->exclusion()
1684
					);
1685
1686
					if ( ! empty( $this->action_links['add'] ) ) {
1687
						$link = $this->action_links['add'];
1688
					}
1689
					?>
1690
					<a href="<?php echo esc_url( $link ); ?>" class="add-new-h2"><?php echo wp_kses_post( $this->heading['add'] ); ?></a>
1691
					<?php
1692
				} elseif ( ! in_array( 'manage', $this->actions_disabled ) && ! in_array( 'manage', $this->actions_hidden ) && ! $this->restricted( 'manage' ) ) {
1693
					$link = pods_query_arg(
1694
						array(
1695
							'action' . $this->num => 'manage',
1696
							'id' . $this->num     => '',
1697
						), self::$allowed, $this->exclusion()
@@ 1991-2010 (lines=20) @@
1988
				<?php
1989
				echo wp_kses_post( $this->do_template( $this->header['view'] ) );
1990
1991
				if ( ! in_array( 'add', $this->actions_disabled ) && ! in_array( 'add', $this->actions_hidden ) && ! $this->restricted( 'add' ) ) {
1992
					$link = pods_query_arg(
1993
						array(
1994
							'action' . $this->num => 'add',
1995
							'id' . $this->num     => '',
1996
							'do' . $this->num = '',
1997
						), self::$allowed, $this->exclusion()
1998
					);
1999
2000
					if ( ! empty( $this->action_links['add'] ) ) {
2001
						$link = $this->action_links['add'];
2002
					}
2003
					?>
2004
					<a href="<?php echo esc_url( $link ); ?>" class="add-new-h2"><?php echo wp_kses_post( $this->heading['add'] ); ?></a>
2005
					<?php
2006
				} elseif ( ! in_array( 'manage', $this->actions_disabled ) && ! in_array( 'manage', $this->actions_hidden ) && ! $this->restricted( 'manage' ) ) {
2007
					$link = pods_query_arg(
2008
						array(
2009
							'action' . $this->num => 'manage',
2010
							'id' . $this->num     => '',
2011
						), self::$allowed, $this->exclusion()
2012
					);
2013