Code Duplication    Length = 11-11 lines in 6 locations

src/Aimeos/Shop/Controller/JqadmController.php 6 locations

@@ 37-47 (lines=11) @@
34
	 * @param integer $id Unique resource ID
35
	 * @return string Generated output
36
	 */
37
	public function copyAction( $site = 'default', $resource, $id )
38
	{
39
		if( config( 'shop.authorize', true ) ) {
40
			$this->authorize( 'admin' );
41
		}
42
43
		$cntl = $this->createClient( $site, $resource );
44
		$content = $cntl->copy( $id );
45
46
		return View::make('shop::admin.jqadm', array( 'content' => $content, 'site' => $site ) );
47
	}
48
49
50
	/**
@@ 57-67 (lines=11) @@
54
	 * @param string $sitecode Unique site code
55
	 * @return string Generated output
56
	 */
57
	public function createAction( $site = 'default', $resource )
58
	{
59
		if( config( 'shop.authorize', true ) ) {
60
			$this->authorize( 'admin' );
61
		}
62
63
		$cntl = $this->createClient( $site, $resource );
64
		$content = $cntl->create();
65
66
		return View::make('shop::admin.jqadm', array( 'content' => $content, 'site' => $site ) );
67
	}
68
69
70
	/**
@@ 78-88 (lines=11) @@
75
	 * @param integer $id Unique resource ID
76
	 * @return string Generated output
77
	 */
78
	public function deleteAction( $site = 'default', $resource, $id )
79
	{
80
		if( config( 'shop.authorize', true ) ) {
81
			$this->authorize( 'admin' );
82
		}
83
84
		$cntl = $this->createClient( $site, $resource );
85
		$content = $cntl->delete( $id ) . $cntl->search();
86
87
		return View::make('shop::admin.jqadm', array( 'content' => $content, 'site' => $site ) );
88
	}
89
90
91
	/**
@@ 99-109 (lines=11) @@
96
	 * @param integer $id Unique resource ID
97
	 * @return string Generated output
98
	 */
99
	public function getAction( $site = 'default', $resource, $id )
100
	{
101
		if( config( 'shop.authorize', true ) ) {
102
			$this->authorize( 'admin' );
103
		}
104
105
		$cntl = $this->createClient( $site, $resource );
106
		$content = $cntl->get( $id );
107
108
		return View::make('shop::admin.jqadm', array( 'content' => $content, 'site' => $site ) );
109
	}
110
111
112
	/**
@@ 119-129 (lines=11) @@
116
	 * @param string $sitecode Unique site code
117
	 * @return string Generated output
118
	 */
119
	public function saveAction( $site = 'default', $resource )
120
	{
121
		if( config( 'shop.authorize', true ) ) {
122
			$this->authorize( 'admin' );
123
		}
124
125
		$cntl = $this->createClient( $site, $resource );
126
		$content = ( $cntl->save() ? : $cntl->search() );
127
128
		return View::make('shop::admin.jqadm', array( 'content' => $content, 'site' => $site ) );
129
	}
130
131
132
	/**
@@ 139-149 (lines=11) @@
136
	 * @param string $sitecode Unique site code
137
	 * @return string Generated output
138
	 */
139
	public function searchAction( $site = 'default', $resource )
140
	{
141
		if( config( 'shop.authorize', true ) ) {
142
			$this->authorize( 'admin' );
143
		}
144
145
		$cntl = $this->createClient( $site, $resource );
146
		$content = $cntl->search();
147
148
		return View::make('shop::admin.jqadm', array( 'content' => $content, 'site' => $site ) );
149
	}
150
151
152
	/**