@@ -17,103 +17,103 @@ discard block |
||
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 | $config = $this->context->getConfig(); |
23 | - $config->set( 'admin/jqadm/common/decorators/default', array() ); |
|
24 | - $config->set( 'admin/jqadm/product/decorators/global', array() ); |
|
25 | - $config->set( 'admin/jqadm/product/decorators/local', array() ); |
|
23 | + $config->set('admin/jqadm/common/decorators/default', array()); |
|
24 | + $config->set('admin/jqadm/product/decorators/global', array()); |
|
25 | + $config->set('admin/jqadm/product/decorators/local', array()); |
|
26 | 26 | |
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testInjectClient() |
31 | 31 | { |
32 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
33 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
32 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
33 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
34 | 34 | |
35 | - $iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
35 | + $iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
36 | 36 | |
37 | - $this->assertSame( $client, $iClient ); |
|
37 | + $this->assertSame($client, $iClient); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testInjectClientReset() |
42 | 42 | { |
43 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
44 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
45 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null ); |
|
43 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
44 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
45 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null); |
|
46 | 46 | |
47 | - $new = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
47 | + $new = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
48 | 48 | |
49 | - $this->assertNotSame( $client, $new ); |
|
49 | + $this->assertNotSame($client, $new); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | public function testAddDecorators() |
54 | 54 | { |
55 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
55 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
56 | 56 | |
57 | - $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
58 | - array(), array( 'Cache' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
57 | + $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
58 | + array(), array('Cache'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
59 | 59 | |
60 | - $this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result ); |
|
60 | + $this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testAddDecoratorsInvalidName() |
65 | 65 | { |
66 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
66 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
67 | 67 | |
68 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
69 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(), |
|
70 | - array( '$' ), 'Test' ); |
|
68 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
69 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(), |
|
70 | + array('$'), 'Test'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | 74 | public function testAddDecoratorsInvalidClass() |
75 | 75 | { |
76 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
76 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
77 | 77 | |
78 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
79 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(), |
|
80 | - array( 'Test' ), 'TestDecorator' ); |
|
78 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
79 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(), |
|
80 | + array('Test'), 'TestDecorator'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testAddDecoratorsInvalidInterface() |
85 | 85 | { |
86 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
86 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
87 | 87 | |
88 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
89 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(), |
|
90 | - array( 'Test' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
88 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
89 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(), |
|
90 | + array('Test'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
94 | 94 | public function testAddClientDecoratorsExcludes() |
95 | 95 | { |
96 | - $this->context->getConfig()->set( 'admin/jqadm/decorators/excludes', array( 'TestDecorator' ) ); |
|
97 | - $this->context->getConfig()->set( 'admin/jqadm/common/decorators/default', array( 'TestDecorator' ) ); |
|
96 | + $this->context->getConfig()->set('admin/jqadm/decorators/excludes', array('TestDecorator')); |
|
97 | + $this->context->getConfig()->set('admin/jqadm/common/decorators/default', array('TestDecorator')); |
|
98 | 98 | |
99 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
100 | - \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
99 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
100 | + \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
104 | 104 | public function testAddClientDecoratorsEmptyPath() |
105 | 105 | { |
106 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
106 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
107 | 107 | |
108 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
109 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic( $this->context, $client, array(), '' ); |
|
108 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
109 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic($this->context, $client, array(), ''); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
113 | 113 | public function testCreateClientBase() |
114 | 114 | { |
115 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
116 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic( $this->context, 'Test', 'Test', array() ); |
|
115 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
116 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic($this->context, 'Test', 'Test', array()); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
@@ -121,22 +121,22 @@ discard block |
||
121 | 121 | class TestAbstract |
122 | 122 | extends \Aimeos\Admin\JQAdm\Common\Factory\Base |
123 | 123 | { |
124 | - public static function addDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
125 | - \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix ) |
|
124 | + public static function addDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
125 | + \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix) |
|
126 | 126 | { |
127 | - return self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix ); |
|
127 | + return self::addDecorators($context, $client, $templatePaths, $decorators, $classprefix); |
|
128 | 128 | } |
129 | 129 | |
130 | - public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
131 | - \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path ) |
|
130 | + public static function addClientDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
131 | + \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path) |
|
132 | 132 | { |
133 | - return self::addClientDecorators( $context, $client, $templatePaths, $path ); |
|
133 | + return self::addClientDecorators($context, $client, $templatePaths, $path); |
|
134 | 134 | } |
135 | 135 | |
136 | - public static function createClientBasePublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
137 | - $classname, $interface, $templatePath ) |
|
136 | + public static function createClientBasePublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
137 | + $classname, $interface, $templatePath) |
|
138 | 138 | { |
139 | - return self::createClientBase( $context, $classname, $interface, $templatePath ); |
|
139 | + return self::createClientBase($context, $classname, $interface, $templatePath); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | $this->context = \TestHelperJqadm::getContext(); |
21 | 21 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
22 | 22 | |
23 | - $client = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, $templatePaths ); |
|
24 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Languages( $client, $this->context, $templatePaths ); |
|
23 | + $client = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Languages($client, $this->context, $templatePaths); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset( $this->object, $this->context ); |
|
30 | + unset($this->object, $this->context); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | $view = \TestHelperJqadm::getView(); |
37 | 37 | |
38 | - $this->object->setView( $view ); |
|
38 | + $this->object->setView($view); |
|
39 | 39 | |
40 | - $this->assertInternalType( 'array', $view->languagesList ); |
|
40 | + $this->assertInternalType('array', $view->languagesList); |
|
41 | 41 | } |
42 | 42 | } |
@@ -17,83 +17,83 @@ |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
21 | - ->setMethods( array( 'copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient' ) ) |
|
20 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
21 | + ->setMethods(array('copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient')) |
|
22 | 22 | ->disableOriginalConstructor() |
23 | 23 | ->getMock(); |
24 | 24 | |
25 | 25 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
26 | 26 | $context = \TestHelperJqadm::getContext(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites( $this->mock, $context, $templatePaths ); |
|
28 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites($this->mock, $context, $templatePaths); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | protected function tearDown() |
33 | 33 | { |
34 | - unset( $this->object, $this->mock ); |
|
34 | + unset($this->object, $this->mock); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCallInvalid() |
39 | 39 | { |
40 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
40 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
41 | 41 | $this->object->invalidMethod(); |
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCopy() |
46 | 46 | { |
47 | - $this->mock->expects( $this->once() )->method( 'copy' )->will( $this->returnValue( 'test' ) ); |
|
47 | + $this->mock->expects($this->once())->method('copy')->will($this->returnValue('test')); |
|
48 | 48 | |
49 | - $this->assertEquals( 'test', $this->object->copy() ); |
|
49 | + $this->assertEquals('test', $this->object->copy()); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | public function testCreate() |
54 | 54 | { |
55 | - $this->mock->expects( $this->once() )->method( 'create' )->will( $this->returnValue( 'test' ) ); |
|
55 | + $this->mock->expects($this->once())->method('create')->will($this->returnValue('test')); |
|
56 | 56 | |
57 | - $this->assertEquals( 'test', $this->object->create() ); |
|
57 | + $this->assertEquals('test', $this->object->create()); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | public function testDelete() |
62 | 62 | { |
63 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
63 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
64 | 64 | |
65 | - $this->assertEquals( 'test', $this->object->delete() ); |
|
65 | + $this->assertEquals('test', $this->object->delete()); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
69 | 69 | public function testGet() |
70 | 70 | { |
71 | - $this->mock->expects( $this->once() )->method( 'get' )->will( $this->returnValue( 'test' ) ); |
|
71 | + $this->mock->expects($this->once())->method('get')->will($this->returnValue('test')); |
|
72 | 72 | |
73 | - $this->assertEquals( 'test', $this->object->get() ); |
|
73 | + $this->assertEquals('test', $this->object->get()); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
77 | 77 | public function testSave() |
78 | 78 | { |
79 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
79 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
80 | 80 | |
81 | - $this->assertEquals( 'test', $this->object->save() ); |
|
81 | + $this->assertEquals('test', $this->object->save()); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testSearch() |
86 | 86 | { |
87 | - $this->mock->expects( $this->once() )->method( 'search' )->will( $this->returnValue( 'test' ) ); |
|
87 | + $this->mock->expects($this->once())->method('search')->will($this->returnValue('test')); |
|
88 | 88 | |
89 | - $this->assertEquals( 'test', $this->object->search() ); |
|
89 | + $this->assertEquals('test', $this->object->search()); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
93 | 93 | public function testGetSubClient() |
94 | 94 | { |
95 | - $this->mock->expects( $this->once() )->method( 'getSubClient' )->will( $this->returnValue( 'test' ) ); |
|
95 | + $this->mock->expects($this->once())->method('getSubClient')->will($this->returnValue('test')); |
|
96 | 96 | |
97 | - $this->assertEquals( 'test', $this->object->getSubClient( 'invalid' ) ); |
|
97 | + $this->assertEquals('test', $this->object->getSubClient('invalid')); |
|
98 | 98 | } |
99 | 99 | } |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | $this->context = \TestHelperJqadm::getContext(); |
21 | 21 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
22 | 22 | |
23 | - $client = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, $templatePaths ); |
|
24 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites( $client, $this->context, $templatePaths ); |
|
23 | + $client = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites($client, $this->context, $templatePaths); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset( $this->object, $this->context ); |
|
30 | + unset($this->object, $this->context); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | $view = \TestHelperJqadm::getView(); |
37 | 37 | |
38 | - $this->object->setView( $view ); |
|
38 | + $this->object->setView($view); |
|
39 | 39 | |
40 | - $this->assertInternalType( 'array', $view->sitesList ); |
|
40 | + $this->assertInternalType('array', $view->sitesList); |
|
41 | 41 | } |
42 | 42 | } |
@@ -4,17 +4,17 @@ |
||
4 | 4 | 'jqadm' => array( |
5 | 5 | 'common' => array( |
6 | 6 | 'decorators' => array( |
7 | - 'default' => array( 'Languages', 'Sites' ), |
|
7 | + 'default' => array('Languages', 'Sites'), |
|
8 | 8 | ), |
9 | 9 | ), |
10 | 10 | 'product' => array( |
11 | 11 | 'decorators' => array( |
12 | - 'global' => array( 'Index', 'Cache' ), |
|
12 | + 'global' => array('Index', 'Cache'), |
|
13 | 13 | ), |
14 | 14 | ), |
15 | 15 | 'product/category' => array( |
16 | 16 | 'decorators' => array( |
17 | - 'local' => array( 'Cache' ), |
|
17 | + 'local' => array('Cache'), |
|
18 | 18 | ), |
19 | 19 | ), |
20 | 20 | ), |
@@ -8,28 +8,28 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | $target = $this->request()->getTarget(); |
11 | -$cntl = $this->config( 'admin/jqadm/url/search/controller', 'Jqadm' ); |
|
12 | -$action = $this->config( 'admin/jqadm/url/search/action', 'search' ); |
|
13 | -$config = $this->config( 'admin/jqadm/url/search/config', array() ); |
|
11 | +$cntl = $this->config('admin/jqadm/url/search/controller', 'Jqadm'); |
|
12 | +$action = $this->config('admin/jqadm/url/search/action', 'search'); |
|
13 | +$config = $this->config('admin/jqadm/url/search/config', array()); |
|
14 | 14 | |
15 | -$jsonTarget = $this->config( 'admin/jsonadm/url/options/target' ); |
|
16 | -$jsonCntl = $this->config( 'admin/jsonadm/url/options/controller', 'Jsonadm' ); |
|
17 | -$jsonAction = $this->config( 'admin/jsonadm/url/options/action', 'options' ); |
|
18 | -$jsonConfig = $this->config( 'admin/jsonadm/url/options/config', array() ); |
|
15 | +$jsonTarget = $this->config('admin/jsonadm/url/options/target'); |
|
16 | +$jsonCntl = $this->config('admin/jsonadm/url/options/controller', 'Jsonadm'); |
|
17 | +$jsonAction = $this->config('admin/jsonadm/url/options/action', 'options'); |
|
18 | +$jsonConfig = $this->config('admin/jsonadm/url/options/config', array()); |
|
19 | 19 | |
20 | -$extTarget = $this->config( 'admin/extjs/url/target' ); |
|
21 | -$extCntl = $this->config( 'admin/extjs/url/controller', 'Extadm' ); |
|
22 | -$extAction = $this->config( 'admin/extjs/url/action', 'index' ); |
|
23 | -$extConfig = $this->config( 'admin/extjs/url/config', array() ); |
|
20 | +$extTarget = $this->config('admin/extjs/url/target'); |
|
21 | +$extCntl = $this->config('admin/extjs/url/controller', 'Extadm'); |
|
22 | +$extAction = $this->config('admin/extjs/url/action', 'index'); |
|
23 | +$extConfig = $this->config('admin/extjs/url/config', array()); |
|
24 | 24 | |
25 | -$site = $this->param( 'site' ); |
|
26 | -$extParams = array( 'site' => $site, 'lang' => $this->param( 'lang' ) ); |
|
25 | +$site = $this->param('site'); |
|
26 | +$extParams = array('site' => $site, 'lang' => $this->param('lang')); |
|
27 | 27 | |
28 | -$params = $this->get( 'pageParams', array() ); |
|
29 | -$params['id'] = $this->param( 'id', '' ); |
|
28 | +$params = $this->get('pageParams', array()); |
|
29 | +$params['id'] = $this->param('id', ''); |
|
30 | 30 | |
31 | 31 | ?> |
32 | -<div class="aimeos" data-url="<?php echo $enc->attr( $this->url( $jsonTarget, $jsonCntl, $jsonAction, array( 'site' => $site, 'resource' => '', 'id' => '' ), array(), $jsonConfig ) ); ?>"> |
|
32 | +<div class="aimeos" data-url="<?php echo $enc->attr($this->url($jsonTarget, $jsonCntl, $jsonAction, array('site' => $site, 'resource' => '', 'id' => ''), array(), $jsonConfig)); ?>"> |
|
33 | 33 | |
34 | 34 | <nav class="navbar navbar-full"> |
35 | 35 | <a class="navbar-brand" href="https://aimeos.org/update/?type={type}&version={version}"> |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | |
41 | 41 | <div class="collapse navbar-toggleable-xs" id="collapse-navbar"> |
42 | 42 | <ul class="nav navbar-nav"> |
43 | -<?php if( $this->access( 'admin' ) ) : ?> |
|
43 | +<?php if ($this->access('admin')) : ?> |
|
44 | 44 | <li class="nav-item mode active"> |
45 | - <a class="nav-link" href="<?php echo $enc->attr( $this->url( $extTarget, $extCntl, $extAction, $extParams, array(), $extConfig ) ); ?>"> |
|
46 | - <?php echo $enc->html( $this->translate( 'admin', 'Expert mode' ) ); ?> |
|
45 | + <a class="nav-link" href="<?php echo $enc->attr($this->url($extTarget, $extCntl, $extAction, $extParams, array(), $extConfig)); ?>"> |
|
46 | + <?php echo $enc->html($this->translate('admin', 'Expert mode')); ?> |
|
47 | 47 | </a> |
48 | 48 | </li> |
49 | 49 | <?php endif; ?> |
@@ -51,31 +51,31 @@ discard block |
||
51 | 51 | |
52 | 52 | <div class="btn-group"> |
53 | 53 | <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
54 | - <?php echo $enc->attr( $this->param( 'lang', $this->translate( 'admin', 'Language' ) ) ); ?> |
|
54 | + <?php echo $enc->attr($this->param('lang', $this->translate('admin', 'Language'))); ?> |
|
55 | 55 | </button> |
56 | 56 | <div class="dropdown-menu"> |
57 | -<?php foreach( $this->get( 'languagesList', array() ) as $langid ) : ?> |
|
57 | +<?php foreach ($this->get('languagesList', array()) as $langid) : ?> |
|
58 | 58 | <a class="dropdown-item" |
59 | - href="<?php echo $enc->attr( $this->url( $target, $cntl, $action, array( 'lang' => $langid ) + $params, array(), $config ) ); ?>"> |
|
60 | - <?php echo $enc->html( $langid ); ?> |
|
59 | + href="<?php echo $enc->attr($this->url($target, $cntl, $action, array('lang' => $langid) + $params, array(), $config)); ?>"> |
|
60 | + <?php echo $enc->html($langid); ?> |
|
61 | 61 | </a> |
62 | 62 | <?php endforeach; ?> |
63 | 63 | </div> |
64 | 64 | </div> |
65 | 65 | |
66 | 66 | </li> |
67 | -<?php if( $this->access( 'admin' ) ) : ?> |
|
68 | -<?php $sites = $this->get( 'sitesList', array() ); ?> |
|
67 | +<?php if ($this->access('admin')) : ?> |
|
68 | +<?php $sites = $this->get('sitesList', array()); ?> |
|
69 | 69 | <li class="nav-item site"> |
70 | 70 | <div class="btn-group"> |
71 | 71 | <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
72 | - <?php echo $enc->attr( $this->value( $sites, $site, $this->translate( 'admin', 'Site' ) ) ); ?> |
|
72 | + <?php echo $enc->attr($this->value($sites, $site, $this->translate('admin', 'Site'))); ?> |
|
73 | 73 | </button> |
74 | 74 | <div class="dropdown-menu"> |
75 | -<?php foreach( $sites as $code => $label ) : ?> |
|
75 | +<?php foreach ($sites as $code => $label) : ?> |
|
76 | 76 | <a class="dropdown-item" |
77 | - href="<?php echo $enc->attr( $this->url( $target, $cntl, $action, array( 'site' => $code ) + $params, array(), $config ) ); ?>"> |
|
78 | - <?php echo $enc->html( $label ); ?> |
|
77 | + href="<?php echo $enc->attr($this->url($target, $cntl, $action, array('site' => $code) + $params, array(), $config)); ?>"> |
|
78 | + <?php echo $enc->html($label); ?> |
|
79 | 79 | </a> |
80 | 80 | <?php endforeach; ?> |
81 | 81 | </div> |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | |
90 | 90 | <div class="container"> |
91 | 91 | |
92 | -<?php echo $this->partial( $this->config( 'admin/jqadm/partial/error', 'common/partials/error-default.php' ), array( 'errors' => $this->get( 'errors', array() ) ) ); ?> |
|
92 | +<?php echo $this->partial($this->config('admin/jqadm/partial/error', 'common/partials/error-default.php'), array('errors' => $this->get('errors', array()))); ?> |
|
93 | 93 | |
94 | -<?php echo $this->block()->get( 'jqadm_content' ); ?> |
|
94 | +<?php echo $this->block()->get('jqadm_content'); ?> |
|
95 | 95 | |
96 | 96 | </div> |
97 | 97 | |
98 | -<?php echo $this->partial( $this->config( 'admin/jqadm/partial/confirm', 'common/partials/confirm-default.php' ) ); ?> |
|
98 | +<?php echo $this->partial($this->config('admin/jqadm/partial/confirm', 'common/partials/confirm-default.php')); ?> |
|
99 | 99 | |
100 | 100 | </div> |
101 | 101 | \ No newline at end of file |
@@ -25,14 +25,14 @@ |
||
25 | 25 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
26 | 26 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
27 | 27 | */ |
28 | - public function setView( \Aimeos\MW\View\Iface $view ) |
|
28 | + public function setView(\Aimeos\MW\View\Iface $view) |
|
29 | 29 | { |
30 | - $extdir = dirname( dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) ); |
|
31 | - $aimeos = new \Aimeos\Bootstrap( array( $extdir ) ); |
|
30 | + $extdir = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))))); |
|
31 | + $aimeos = new \Aimeos\Bootstrap(array($extdir)); |
|
32 | 32 | |
33 | - $view->languagesList = $aimeos->getI18nList( 'admin' ); |
|
33 | + $view->languagesList = $aimeos->getI18nList('admin'); |
|
34 | 34 | |
35 | - $this->getClient()->setView( $view ); |
|
35 | + $this->getClient()->setView($view); |
|
36 | 36 | return $this; |
37 | 37 | } |
38 | 38 | } |
@@ -25,21 +25,21 @@ |
||
25 | 25 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
26 | 26 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
27 | 27 | */ |
28 | - public function setView( \Aimeos\MW\View\Iface $view ) |
|
28 | + public function setView(\Aimeos\MW\View\Iface $view) |
|
29 | 29 | { |
30 | 30 | $list = array(); |
31 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/site' ); |
|
31 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/site'); |
|
32 | 32 | |
33 | 33 | $search = $manager->createSearch(); |
34 | - $search->setSortations( array( $search->sort( '+', 'locale.site.label' ) ) ); |
|
34 | + $search->setSortations(array($search->sort('+', 'locale.site.label'))); |
|
35 | 35 | |
36 | - foreach( $manager->searchItems( $search ) as $item ) { |
|
36 | + foreach ($manager->searchItems($search) as $item) { |
|
37 | 37 | $list[$item->getCode()] = $item->getLabel(); |
38 | 38 | } |
39 | 39 | |
40 | 40 | $view->sitesList = $list; |
41 | 41 | |
42 | - $this->getClient()->setView( $view ); |
|
42 | + $this->getClient()->setView($view); |
|
43 | 43 | return $this; |
44 | 44 | } |
45 | 45 | } |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | { |
29 | 29 | $result = $this->getClient()->delete(); |
30 | 30 | |
31 | - $ids = (array) $this->getView()->param( 'id' ); |
|
32 | - \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->deleteItems( $ids ); |
|
31 | + $ids = (array) $this->getView()->param('id'); |
|
32 | + \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->deleteItems($ids); |
|
33 | 33 | |
34 | 34 | return $result; |
35 | 35 | } |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | $result = $this->getClient()->save(); |
46 | 46 | $item = $this->getView()->item; |
47 | 47 | |
48 | - if( $item->getId() !== null ) { |
|
49 | - \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->saveItem( $item ); |
|
48 | + if ($item->getId() !== null) { |
|
49 | + \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->saveItem($item); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $result; |