@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create( $this->context, '%type/attribute' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create($this->context, '%type/attribute'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Attribute\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create( $this->context, '%type/attribute/lists' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create($this->context, '%type/attribute/lists'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create( $this->context, '%type/attribute/property' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create($this->context, '%type/attribute/property'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Attribute\Property\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Text\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Text\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Text\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Text\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Text\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Text\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Text\Factory::create( $this->context, '%type/text' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Text\Factory::create($this->context, '%type/text'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Text\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Text\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create( $this->context, '%type/text/lists' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create($this->context, '%type/text/lists'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Text\Lists\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Price\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Price\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Price\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Price\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Price\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Price\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Price\Factory::create( $this->context, '%type/price' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Price\Factory::create($this->context, '%type/price'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Price\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Price\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create( $this->context ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create($this->context); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create( $this->context, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create($this->context, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create( $this->context, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create($this->context, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create( $this->context, '%type/price/lists' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create($this->context, '%type/price/lists'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create( $this->context, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Type\Price\Lists\Factory::create($this->context, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Catalog\Media\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->mediaData = $this->toArray( $view->item, $view->get( 'mediaData', [] ), true ); |
|
47 | + $view->mediaData = $this->toArray($view->item, $view->get('mediaData', []), true); |
|
48 | 48 | $view->propertyBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->propertyBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->get( 'mediaData', [] ); |
|
67 | + $data = $view->get('mediaData', []); |
|
68 | 68 | |
69 | - foreach( $data as $index => $entry ) |
|
69 | + foreach ($data as $index => $entry) |
|
70 | 70 | { |
71 | - foreach( $view->value( $entry, 'property', [] ) as $idx => $y ) { |
|
71 | + foreach ($view->value($entry, 'property', []) as $idx => $y) { |
|
72 | 72 | $data[$index]['property'][$idx]['catalog.lists.siteid'] = $siteid; |
73 | 73 | } |
74 | 74 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | $view->propertyData = $data; |
77 | 77 | $view->propertyBody = ''; |
78 | 78 | |
79 | - foreach( $this->getSubClients() as $client ) { |
|
79 | + foreach ($this->getSubClients() as $client) { |
|
80 | 80 | $view->propertyBody .= $client->create(); |
81 | 81 | } |
82 | 82 | |
83 | - return $this->render( $view ); |
|
83 | + return $this->render($view); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function get() |
93 | 93 | { |
94 | - $view = $this->addViewData( $this->getView() ); |
|
94 | + $view = $this->addViewData($this->getView()); |
|
95 | 95 | |
96 | - $view->mediaData = $this->toArray( $view->item, $view->get( 'mediaData', [] ) ); |
|
96 | + $view->mediaData = $this->toArray($view->item, $view->get('mediaData', [])); |
|
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | { |
112 | 112 | $view = $this->getView(); |
113 | 113 | |
114 | - $view->item = $this->fromArray( $view->item, $view->param( 'media', [] ) ); |
|
114 | + $view->item = $this->fromArray($view->item, $view->param('media', [])); |
|
115 | 115 | $view->propertyBody = ''; |
116 | 116 | |
117 | - foreach( $this->getSubClients() as $client ) { |
|
117 | + foreach ($this->getSubClients() as $client) { |
|
118 | 118 | $view->propertyBody .= $client->save(); |
119 | 119 | } |
120 | 120 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @param string|null $name Name of the sub-client (Default if null) |
128 | 128 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
129 | 129 | */ |
130 | - public function getSubClient( $type, $name = null ) |
|
130 | + public function getSubClient($type, $name = null) |
|
131 | 131 | { |
132 | 132 | /** admin/jqadm/catalog/media/property/decorators/excludes |
133 | 133 | * Excludes decorators added by the "common" option from the catalog JQAdm client |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @see admin/jqadm/catalog/media/property/decorators/excludes |
203 | 203 | * @see admin/jqadm/catalog/media/property/decorators/global |
204 | 204 | */ |
205 | - return $this->createSubClient( 'catalog/media/property/' . $type, $name ); |
|
205 | + return $this->createSubClient('catalog/media/property/' . $type, $name); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -212,15 +212,15 @@ discard block |
||
212 | 212 | * @param \Aimeos\MW\View\Iface $view View object |
213 | 213 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
214 | 214 | */ |
215 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
215 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
216 | 216 | { |
217 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'media/property/type' ); |
|
217 | + $manager = \Aimeos\MShop::create($this->getContext(), 'media/property/type'); |
|
218 | 218 | |
219 | 219 | $search = $manager->createSearch(); |
220 | - $search->setConditions( $search->compare( '==', 'media.property.type.domain', 'catalog' ) ); |
|
221 | - $search->setSlice( 0, 0x7fffffff ); |
|
220 | + $search->setConditions($search->compare('==', 'media.property.type.domain', 'catalog')); |
|
221 | + $search->setSlice(0, 0x7fffffff); |
|
222 | 222 | |
223 | - $view->propertyTypes = $manager->searchItems( $search ); |
|
223 | + $view->propertyTypes = $manager->searchItems($search); |
|
224 | 224 | |
225 | 225 | return $view; |
226 | 226 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @since 2018.01 |
267 | 267 | * @category Developer |
268 | 268 | */ |
269 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/media/property/standard/subparts', [] ); |
|
269 | + return $this->getContext()->getConfig()->get('admin/jqadm/catalog/media/property/standard/subparts', []); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | |
@@ -276,32 +276,32 @@ discard block |
||
276 | 276 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item object without referenced domain items |
277 | 277 | * @param string[] $data Data array |
278 | 278 | */ |
279 | - protected function fromArray( \Aimeos\MShop\Catalog\Item\Iface $item, array $data ) |
|
279 | + protected function fromArray(\Aimeos\MShop\Catalog\Item\Iface $item, array $data) |
|
280 | 280 | { |
281 | - $propManager = \Aimeos\MShop::create( $this->getContext(), 'media/property' ); |
|
281 | + $propManager = \Aimeos\MShop::create($this->getContext(), 'media/property'); |
|
282 | 282 | $index = 0; |
283 | 283 | |
284 | - foreach( $item->getRefItems( 'media', null, null, false ) as $refItem ) |
|
284 | + foreach ($item->getRefItems('media', null, null, false) as $refItem) |
|
285 | 285 | { |
286 | - $propItems = $refItem->getPropertyItems( null, false ); |
|
286 | + $propItems = $refItem->getPropertyItems(null, false); |
|
287 | 287 | |
288 | - foreach( (array) $this->getValue( $data, $index . '/property', [] ) as $entry ) |
|
288 | + foreach ((array) $this->getValue($data, $index . '/property', []) as $entry) |
|
289 | 289 | { |
290 | - if( isset( $propItems[$entry['media.property.id']] ) ) |
|
290 | + if (isset($propItems[$entry['media.property.id']])) |
|
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | - unset( $propItems[$entry['media.property.id']] ); |
|
293 | + unset($propItems[$entry['media.property.id']]); |
|
294 | 294 | } |
295 | 295 | else |
296 | 296 | { |
297 | 297 | $propItem = $propManager->createItem(); |
298 | 298 | } |
299 | 299 | |
300 | - $propItem->fromArray( $entry ); |
|
301 | - $refItem->addPropertyItem( $propItem ); |
|
300 | + $propItem->fromArray($entry); |
|
301 | + $refItem->addPropertyItem($propItem); |
|
302 | 302 | } |
303 | 303 | |
304 | - $refItem->deletePropertyItems( $propItems ); |
|
304 | + $refItem->deletePropertyItems($propItems); |
|
305 | 305 | $index++; |
306 | 306 | } |
307 | 307 | |
@@ -317,18 +317,18 @@ discard block |
||
317 | 317 | * @param boolean $copy True if items should be copied, false if not |
318 | 318 | * @return string[] Multi-dimensional associative list of item data |
319 | 319 | */ |
320 | - protected function toArray( \Aimeos\MShop\Catalog\Item\Iface $item, array $data, $copy = false ) |
|
320 | + protected function toArray(\Aimeos\MShop\Catalog\Item\Iface $item, array $data, $copy = false) |
|
321 | 321 | { |
322 | 322 | $idx = 0; |
323 | 323 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
324 | 324 | |
325 | - foreach( $item->getRefItems( 'media', null, null, false ) as $mediaItem ) |
|
325 | + foreach ($item->getRefItems('media', null, null, false) as $mediaItem) |
|
326 | 326 | { |
327 | - foreach( $mediaItem->getPropertyItems( null, false ) as $propItem ) |
|
327 | + foreach ($mediaItem->getPropertyItems(null, false) as $propItem) |
|
328 | 328 | { |
329 | - $list = $propItem->toArray( true ); |
|
329 | + $list = $propItem->toArray(true); |
|
330 | 330 | |
331 | - if( $copy === true ) |
|
331 | + if ($copy === true) |
|
332 | 332 | { |
333 | 333 | $list['media.property.siteid'] = $siteId; |
334 | 334 | $list['media.property.id'] = ''; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
351 | 351 | * @return string HTML output |
352 | 352 | */ |
353 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
353 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
354 | 354 | { |
355 | 355 | /** admin/jqadm/catalog/media/property/template-item |
356 | 356 | * Relative path to the HTML body template of the media subpart for catalogs. |
@@ -374,6 +374,6 @@ discard block |
||
374 | 374 | $tplconf = 'admin/jqadm/catalog/media/property/template-item'; |
375 | 375 | $default = 'catalog/item-media-property-standard'; |
376 | 376 | |
377 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
377 | + return $view->render($view->config($tplconf, $default)); |
|
378 | 378 | } |
379 | 379 | } |
380 | 380 | \ No newline at end of file |
@@ -291,8 +291,7 @@ |
||
291 | 291 | { |
292 | 292 | $propItem = $propItems[$entry['media.property.id']]; |
293 | 293 | unset( $propItems[$entry['media.property.id']] ); |
294 | - } |
|
295 | - else |
|
294 | + } else |
|
296 | 295 | { |
297 | 296 | $propItem = $propManager->createItem(); |
298 | 297 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Catalog\Media; |
12 | 12 | |
13 | -sprintf( 'media' ); // for translation |
|
13 | +sprintf('media'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->mediaData = $this->toArray( $view->item, true ); |
|
47 | + $view->mediaData = $this->toArray($view->item, true); |
|
48 | 48 | $view->mediaBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->mediaBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | 67 | |
68 | - $itemData = $this->toArray( $view->item ); |
|
69 | - $data = array_replace_recursive( $itemData, $view->param( 'media', [] ) ); |
|
68 | + $itemData = $this->toArray($view->item); |
|
69 | + $data = array_replace_recursive($itemData, $view->param('media', [])); |
|
70 | 70 | |
71 | - foreach( $data as $idx => $entry ) |
|
71 | + foreach ($data as $idx => $entry) |
|
72 | 72 | { |
73 | 73 | $data[$idx]['media.siteid'] = $siteid; |
74 | 74 | $data[$idx]['media.url'] = $itemData[$idx]['media.url']; |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | $view->mediaData = $data; |
80 | 80 | $view->mediaBody = ''; |
81 | 81 | |
82 | - foreach( $this->getSubClients() as $client ) { |
|
82 | + foreach ($this->getSubClients() as $client) { |
|
83 | 83 | $view->mediaBody .= $client->create(); |
84 | 84 | } |
85 | 85 | |
86 | - return $this->render( $view ); |
|
86 | + return $this->render($view); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -95,15 +95,15 @@ discard block |
||
95 | 95 | parent::delete(); |
96 | 96 | |
97 | 97 | $item = $this->getView()->item; |
98 | - $cntl = \Aimeos\Controller\Common\Media\Factory::create( $this->getContext() ); |
|
98 | + $cntl = \Aimeos\Controller\Common\Media\Factory::create($this->getContext()); |
|
99 | 99 | |
100 | - foreach( $item->getListItems( 'media', null, null, false ) as $listItem ) |
|
100 | + foreach ($item->getListItems('media', null, null, false) as $listItem) |
|
101 | 101 | { |
102 | - if( ( $refItem = $listItem->getRefItem() ) !== null ) { |
|
103 | - $cntl->delete( $refItem ); |
|
102 | + if (($refItem = $listItem->getRefItem()) !== null) { |
|
103 | + $cntl->delete($refItem); |
|
104 | 104 | } |
105 | 105 | |
106 | - $item->deleteListItem( 'media', $listItem, $refItem ); |
|
106 | + $item->deleteListItem('media', $listItem, $refItem); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -115,16 +115,16 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function get() |
117 | 117 | { |
118 | - $view = $this->addViewData( $this->getView() ); |
|
118 | + $view = $this->addViewData($this->getView()); |
|
119 | 119 | |
120 | - $view->mediaData = $this->toArray( $view->item ); |
|
120 | + $view->mediaData = $this->toArray($view->item); |
|
121 | 121 | $view->mediaBody = ''; |
122 | 122 | |
123 | - foreach( $this->getSubClients() as $client ) { |
|
123 | + foreach ($this->getSubClients() as $client) { |
|
124 | 124 | $view->mediaBody .= $client->get(); |
125 | 125 | } |
126 | 126 | |
127 | - return $this->render( $view ); |
|
127 | + return $this->render($view); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -137,26 +137,26 @@ discard block |
||
137 | 137 | |
138 | 138 | try |
139 | 139 | { |
140 | - $view->item = $this->fromArray( $view->item, $view->param( 'media', [] ) ); |
|
140 | + $view->item = $this->fromArray($view->item, $view->param('media', [])); |
|
141 | 141 | $view->mediaBody = ''; |
142 | 142 | |
143 | - foreach( $this->getSubClients() as $client ) { |
|
143 | + foreach ($this->getSubClients() as $client) { |
|
144 | 144 | $view->mediaBody .= $client->save(); |
145 | 145 | } |
146 | 146 | |
147 | 147 | return; |
148 | 148 | } |
149 | - catch( \Aimeos\MShop\Exception $e ) |
|
149 | + catch (\Aimeos\MShop\Exception $e) |
|
150 | 150 | { |
151 | - $error = array( 'catalog-item-media' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
152 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
153 | - $this->logException( $e ); |
|
151 | + $error = array('catalog-item-media' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
152 | + $view->errors = $view->get('errors', []) + $error; |
|
153 | + $this->logException($e); |
|
154 | 154 | } |
155 | - catch( \Exception $e ) |
|
155 | + catch (\Exception $e) |
|
156 | 156 | { |
157 | - $error = array( 'catalog-item-media' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
158 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
159 | - $this->logException( $e ); |
|
157 | + $error = array('catalog-item-media' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
158 | + $view->errors = $view->get('errors', []) + $error; |
|
159 | + $this->logException($e); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @param string|null $name Name of the sub-client (Default if null) |
171 | 171 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
172 | 172 | */ |
173 | - public function getSubClient( $type, $name = null ) |
|
173 | + public function getSubClient($type, $name = null) |
|
174 | 174 | { |
175 | 175 | /** admin/jqadm/catalog/media/decorators/excludes |
176 | 176 | * Excludes decorators added by the "common" option from the catalog JQAdm client |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @see admin/jqadm/catalog/media/decorators/excludes |
246 | 246 | * @see admin/jqadm/catalog/media/decorators/global |
247 | 247 | */ |
248 | - return $this->createSubClient( 'catalog/media/' . $type, $name ); |
|
248 | + return $this->createSubClient('catalog/media/' . $type, $name); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -255,23 +255,23 @@ discard block |
||
255 | 255 | * @param \Aimeos\MW\View\Iface $view View object |
256 | 256 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
257 | 257 | */ |
258 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
258 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
259 | 259 | { |
260 | 260 | $context = $this->getContext(); |
261 | 261 | |
262 | - $typeManager = \Aimeos\MShop::create( $this->getContext(), 'media/type' ); |
|
263 | - $listTypeManager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists/type' ); |
|
262 | + $typeManager = \Aimeos\MShop::create($this->getContext(), 'media/type'); |
|
263 | + $listTypeManager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists/type'); |
|
264 | 264 | |
265 | - $search = $typeManager->createSearch()->setSlice( 0, 0x7fffffff ); |
|
266 | - $search->setConditions( $search->compare( '==', 'media.type.domain', 'catalog' ) ); |
|
267 | - $search->setSortations( array( $search->sort( '+', 'media.type.label' ) ) ); |
|
265 | + $search = $typeManager->createSearch()->setSlice(0, 0x7fffffff); |
|
266 | + $search->setConditions($search->compare('==', 'media.type.domain', 'catalog')); |
|
267 | + $search->setSortations(array($search->sort('+', 'media.type.label'))); |
|
268 | 268 | |
269 | - $listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
270 | - $listSearch->setConditions( $listSearch->compare( '==', 'catalog.lists.type.domain', 'media' ) ); |
|
271 | - $listSearch->setSortations( array( $listSearch->sort( '+', 'catalog.lists.type.label' ) ) ); |
|
269 | + $listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
270 | + $listSearch->setConditions($listSearch->compare('==', 'catalog.lists.type.domain', 'media')); |
|
271 | + $listSearch->setSortations(array($listSearch->sort('+', 'catalog.lists.type.label'))); |
|
272 | 272 | |
273 | - $view->mediaListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) ); |
|
274 | - $view->mediaTypes = $typeManager->searchItems( $search ); |
|
273 | + $view->mediaListTypes = $this->sortType($listTypeManager->searchItems($listSearch)); |
|
274 | + $view->mediaTypes = $typeManager->searchItems($search); |
|
275 | 275 | |
276 | 276 | return $view; |
277 | 277 | } |
@@ -284,29 +284,29 @@ discard block |
||
284 | 284 | * @param array $listItems Media list items to be removed |
285 | 285 | * @return \Aimeos\MShop\Catalog\Item\Iface Modified catalog item |
286 | 286 | */ |
287 | - protected function deleteMediaItems( \Aimeos\MShop\Catalog\Item\Iface $item, array $listItems ) |
|
287 | + protected function deleteMediaItems(\Aimeos\MShop\Catalog\Item\Iface $item, array $listItems) |
|
288 | 288 | { |
289 | 289 | $context = $this->getContext(); |
290 | - $cntl = \Aimeos\Controller\Common\Media\Factory::create( $context ); |
|
291 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
290 | + $cntl = \Aimeos\Controller\Common\Media\Factory::create($context); |
|
291 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
292 | 292 | $search = $manager->createSearch(); |
293 | 293 | |
294 | - foreach( $listItems as $listItem ) |
|
294 | + foreach ($listItems as $listItem) |
|
295 | 295 | { |
296 | 296 | $expr = [ |
297 | - $search->compare( '==', 'catalog.lists.domain', 'media' ), |
|
298 | - $search->compare( '==', 'catalog.lists.type', $listItem->getType() ), |
|
299 | - $search->compare( '==', 'catalog.lists.refid', $listItem->getRefId() ), |
|
297 | + $search->compare('==', 'catalog.lists.domain', 'media'), |
|
298 | + $search->compare('==', 'catalog.lists.type', $listItem->getType()), |
|
299 | + $search->compare('==', 'catalog.lists.refid', $listItem->getRefId()), |
|
300 | 300 | ]; |
301 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
302 | - $items = $manager->searchItems( $search ); |
|
301 | + $search->setConditions($search->combine('&&', $expr)); |
|
302 | + $items = $manager->searchItems($search); |
|
303 | 303 | $refItem = null; |
304 | 304 | |
305 | - if( count( $items ) === 1 && ( $refItem = $listItem->getRefItem() ) !== null ) { |
|
306 | - $cntl->delete( $refItem ); |
|
305 | + if (count($items) === 1 && ($refItem = $listItem->getRefItem()) !== null) { |
|
306 | + $cntl->delete($refItem); |
|
307 | 307 | } |
308 | 308 | |
309 | - $item->deleteListItem( 'media', $listItem, $refItem ); |
|
309 | + $item->deleteListItem('media', $listItem, $refItem); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | return $item; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * @since 2017.07 |
354 | 354 | * @category Developer |
355 | 355 | */ |
356 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/media/standard/subparts', [] ); |
|
356 | + return $this->getContext()->getConfig()->get('admin/jqadm/catalog/media/standard/subparts', []); |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | |
@@ -363,54 +363,54 @@ discard block |
||
363 | 363 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item object without referenced domain items |
364 | 364 | * @param string[] $data Data array |
365 | 365 | */ |
366 | - protected function fromArray( \Aimeos\MShop\Catalog\Item\Iface $item, array $data ) |
|
366 | + protected function fromArray(\Aimeos\MShop\Catalog\Item\Iface $item, array $data) |
|
367 | 367 | { |
368 | 368 | $context = $this->getContext(); |
369 | 369 | |
370 | - $mediaManager = \Aimeos\MShop::create( $context, 'media' ); |
|
371 | - $listManager = \Aimeos\MShop::create( $context, 'catalog/lists' ); |
|
372 | - $cntl = \Aimeos\Controller\Common\Media\Factory::create( $context ); |
|
370 | + $mediaManager = \Aimeos\MShop::create($context, 'media'); |
|
371 | + $listManager = \Aimeos\MShop::create($context, 'catalog/lists'); |
|
372 | + $cntl = \Aimeos\Controller\Common\Media\Factory::create($context); |
|
373 | 373 | |
374 | - $listItems = $item->getListItems( 'media', null, null, false ); |
|
374 | + $listItems = $item->getListItems('media', null, null, false); |
|
375 | 375 | $files = (array) $this->getView()->request()->getUploadedFiles(); |
376 | 376 | |
377 | - foreach( $data as $idx => $entry ) |
|
377 | + foreach ($data as $idx => $entry) |
|
378 | 378 | { |
379 | - if( ( $listItem = $item->getListItem( 'media', $entry['catalog.lists.type'], $entry['media.id'], false ) ) === null ) { |
|
379 | + if (($listItem = $item->getListItem('media', $entry['catalog.lists.type'], $entry['media.id'], false)) === null) { |
|
380 | 380 | $listItem = $listManager->createItem(); |
381 | 381 | } |
382 | 382 | |
383 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
383 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
384 | 384 | $refItem = $mediaManager->createItem(); |
385 | 385 | } |
386 | 386 | |
387 | - $refItem->fromArray( $entry ); |
|
387 | + $refItem->fromArray($entry); |
|
388 | 388 | |
389 | - if( ( $file = $this->getValue( $files, 'media/' . $idx . '/file' ) ) !== null && $file->getError() !== UPLOAD_ERR_NO_FILE ) |
|
389 | + if (($file = $this->getValue($files, 'media/' . $idx . '/file')) !== null && $file->getError() !== UPLOAD_ERR_NO_FILE) |
|
390 | 390 | { |
391 | - $refItem->getId() ?: $refItem->setUrl( '' )->setPreview( '' ); // keep copied media |
|
392 | - $cntl->add( $refItem, $file ); |
|
391 | + $refItem->getId() ?: $refItem->setUrl('')->setPreview(''); // keep copied media |
|
392 | + $cntl->add($refItem, $file); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | $conf = []; |
396 | 396 | |
397 | - foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key ) |
|
397 | + foreach ((array) $this->getValue($entry, 'config/key') as $num => $key) |
|
398 | 398 | { |
399 | - if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) { |
|
400 | - $conf[$key] = trim( $val ); |
|
399 | + if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) { |
|
400 | + $conf[$key] = trim($val); |
|
401 | 401 | } |
402 | 402 | } |
403 | 403 | |
404 | - $listItem->fromArray( $entry ); |
|
405 | - $listItem->setPosition( $idx ); |
|
406 | - $listItem->setConfig( $conf ); |
|
404 | + $listItem->fromArray($entry); |
|
405 | + $listItem->setPosition($idx); |
|
406 | + $listItem->setConfig($conf); |
|
407 | 407 | |
408 | - $item->addListItem( 'media', $listItem, $refItem ); |
|
408 | + $item->addListItem('media', $listItem, $refItem); |
|
409 | 409 | |
410 | - unset( $listItems[$listItem->getId()] ); |
|
410 | + unset($listItems[$listItem->getId()]); |
|
411 | 411 | } |
412 | 412 | |
413 | - return $this->deleteMediaItems( $item, $listItems ); |
|
413 | + return $this->deleteMediaItems($item, $listItems); |
|
414 | 414 | } |
415 | 415 | |
416 | 416 | |
@@ -421,20 +421,20 @@ discard block |
||
421 | 421 | * @param boolean $copy True if items should be copied, false if not |
422 | 422 | * @return string[] Multi-dimensional associative list of item data |
423 | 423 | */ |
424 | - protected function toArray( \Aimeos\MShop\Catalog\Item\Iface $item, $copy = false ) |
|
424 | + protected function toArray(\Aimeos\MShop\Catalog\Item\Iface $item, $copy = false) |
|
425 | 425 | { |
426 | 426 | $data = []; |
427 | 427 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
428 | 428 | |
429 | - foreach( $item->getListItems( 'media', null, null, false ) as $listItem ) |
|
429 | + foreach ($item->getListItems('media', null, null, false) as $listItem) |
|
430 | 430 | { |
431 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
431 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
432 | 432 | continue; |
433 | 433 | } |
434 | 434 | |
435 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
435 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
436 | 436 | |
437 | - if( $copy === true ) |
|
437 | + if ($copy === true) |
|
438 | 438 | { |
439 | 439 | $list['catalog.lists.siteid'] = $siteId; |
440 | 440 | $list['catalog.lists.id'] = ''; |
@@ -442,10 +442,10 @@ discard block |
||
442 | 442 | $list['media.id'] = null; |
443 | 443 | } |
444 | 444 | |
445 | - $list['catalog.lists.datestart'] = str_replace( ' ', 'T', $list['catalog.lists.datestart'] ); |
|
446 | - $list['catalog.lists.dateend'] = str_replace( ' ', 'T', $list['catalog.lists.dateend'] ); |
|
445 | + $list['catalog.lists.datestart'] = str_replace(' ', 'T', $list['catalog.lists.datestart']); |
|
446 | + $list['catalog.lists.dateend'] = str_replace(' ', 'T', $list['catalog.lists.dateend']); |
|
447 | 447 | |
448 | - foreach( $list['catalog.lists.config'] as $key => $val ) |
|
448 | + foreach ($list['catalog.lists.config'] as $key => $val) |
|
449 | 449 | { |
450 | 450 | $list['config']['key'][] = $key; |
451 | 451 | $list['config']['val'][] = $val; |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
465 | 465 | * @return string HTML output |
466 | 466 | */ |
467 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
467 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
468 | 468 | { |
469 | 469 | /** admin/jqadm/catalog/media/template-item |
470 | 470 | * Relative path to the HTML body template of the media subpart for catalogs. |
@@ -488,6 +488,6 @@ discard block |
||
488 | 488 | $tplconf = 'admin/jqadm/catalog/media/template-item'; |
489 | 489 | $default = 'catalog/item-media-standard'; |
490 | 490 | |
491 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
491 | + return $view->render($view->config($tplconf, $default)); |
|
492 | 492 | } |
493 | 493 | } |
494 | 494 | \ No newline at end of file |
@@ -145,14 +145,12 @@ |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | return; |
148 | - } |
|
149 | - catch( \Aimeos\MShop\Exception $e ) |
|
148 | + } catch( \Aimeos\MShop\Exception $e ) |
|
150 | 149 | { |
151 | 150 | $error = array( 'catalog-item-media' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
152 | 151 | $view->errors = $view->get( 'errors', [] ) + $error; |
153 | 152 | $this->logException( $e ); |
154 | - } |
|
155 | - catch( \Exception $e ) |
|
153 | + } catch( \Exception $e ) |
|
156 | 154 | { |
157 | 155 | $error = array( 'catalog-item-media' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
158 | 156 | $view->errors = $view->get( 'errors', [] ) + $error; |