@@ -29,8 +29,8 @@ |
||
29 | 29 | * and a list of relative paths inside the core or the extension as values |
30 | 30 | * @param \Aimeos\Admin\JQAdm\Iface $client Admin object |
31 | 31 | */ |
32 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths ) |
|
32 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths) |
|
33 | 33 | { |
34 | - parent::__construct( $context, $templatePaths ); |
|
34 | + parent::__construct($context, $templatePaths); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -28,5 +28,5 @@ |
||
28 | 28 | * and a list of relative paths inside the core or the extension as values |
29 | 29 | * @return void |
30 | 30 | */ |
31 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths ); |
|
31 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths); |
|
32 | 32 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param string $classname Full name of the class for which the object should be returned |
31 | 31 | * @param \Aimeos\Admin\JQAdm\Iface|null $client ExtJS client object |
32 | 32 | */ |
33 | - public static function injectClient( $classname, \Aimeos\Admin\JQAdm\Iface $client = null ) |
|
33 | + public static function injectClient($classname, \Aimeos\Admin\JQAdm\Iface $client = null) |
|
34 | 34 | { |
35 | 35 | self::$objects[$classname] = $client; |
36 | 36 | } |
@@ -46,29 +46,29 @@ discard block |
||
46 | 46 | * @param string $classprefix Decorator class prefix, e.g. "\Aimeos\Admin\JQAdm\Catalog\Decorator\" |
47 | 47 | * @return \Aimeos\Admin\JQAdm\Iface Admin object |
48 | 48 | */ |
49 | - protected static function addDecorators( \Aimeos\MShop\Context\Item\Iface $context, |
|
50 | - \Aimeos\Admin\JQAdm\Iface $client, array $templatePaths, array $decorators, $classprefix ) |
|
49 | + protected static function addDecorators(\Aimeos\MShop\Context\Item\Iface $context, |
|
50 | + \Aimeos\Admin\JQAdm\Iface $client, array $templatePaths, array $decorators, $classprefix) |
|
51 | 51 | { |
52 | 52 | $iface = '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\Iface'; |
53 | 53 | |
54 | - foreach( $decorators as $name ) |
|
54 | + foreach ($decorators as $name) |
|
55 | 55 | { |
56 | - if( ctype_alnum( $name ) === false ) |
|
56 | + if (ctype_alnum($name) === false) |
|
57 | 57 | { |
58 | - $classname = is_string( $name ) ? $classprefix . $name : '<not a string>'; |
|
59 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid class name "%1$s"', $classname ) ); |
|
58 | + $classname = is_string($name) ? $classprefix . $name : '<not a string>'; |
|
59 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid class name "%1$s"', $classname)); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $classname = $classprefix . $name; |
63 | 63 | |
64 | - if( class_exists( $classname ) === false ) { |
|
65 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Class "%1$s" not found', $classname ) ); |
|
64 | + if (class_exists($classname) === false) { |
|
65 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Class "%1$s" not found', $classname)); |
|
66 | 66 | } |
67 | 67 | |
68 | - $client = new $classname( $client, $context, $templatePaths ); |
|
68 | + $client = new $classname($client, $context, $templatePaths); |
|
69 | 69 | |
70 | - if( !( $client instanceof $iface ) ) { |
|
71 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Class "%1$s" does not implement "%2$s"', $classname, $iface ) ); |
|
70 | + if (!($client instanceof $iface)) { |
|
71 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Class "%1$s" does not implement "%2$s"', $classname, $iface)); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | * @param string $path Path of the client in lower case, e.g. "catalog/detail" |
86 | 86 | * @return \Aimeos\Admin\JQAdm\Iface Admin object |
87 | 87 | */ |
88 | - protected static function addClientDecorators( \Aimeos\MShop\Context\Item\Iface $context, |
|
89 | - \Aimeos\Admin\JQAdm\Iface $client, array $templatePaths, $path ) |
|
88 | + protected static function addClientDecorators(\Aimeos\MShop\Context\Item\Iface $context, |
|
89 | + \Aimeos\Admin\JQAdm\Iface $client, array $templatePaths, $path) |
|
90 | 90 | { |
91 | - if( !is_string( $path ) || $path === '' ) { |
|
92 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid domain "%1$s"', $path ) ); |
|
91 | + if (!is_string($path) || $path === '') { |
|
92 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid domain "%1$s"', $path)); |
|
93 | 93 | } |
94 | 94 | |
95 | - $localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $path ) ) ); |
|
95 | + $localClass = str_replace(' ', '\\', ucwords(str_replace('/', ' ', $path))); |
|
96 | 96 | $config = $context->getConfig(); |
97 | 97 | |
98 | 98 | /** admin/jqadm/common/decorators/default |
@@ -117,26 +117,26 @@ discard block |
||
117 | 117 | * @since 2014.03 |
118 | 118 | * @category Developer |
119 | 119 | */ |
120 | - $decorators = $config->get( 'admin/jqadm/common/decorators/default', array() ); |
|
121 | - $excludes = $config->get( 'admin/jqadm/' . $path . '/decorators/excludes', array() ); |
|
120 | + $decorators = $config->get('admin/jqadm/common/decorators/default', array()); |
|
121 | + $excludes = $config->get('admin/jqadm/' . $path . '/decorators/excludes', array()); |
|
122 | 122 | |
123 | - foreach( $decorators as $key => $name ) |
|
123 | + foreach ($decorators as $key => $name) |
|
124 | 124 | { |
125 | - if( in_array( $name, $excludes ) ) { |
|
126 | - unset( $decorators[$key] ); |
|
125 | + if (in_array($name, $excludes)) { |
|
126 | + unset($decorators[$key]); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | 130 | $classprefix = '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'; |
131 | - $client = self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix ); |
|
131 | + $client = self::addDecorators($context, $client, $templatePaths, $decorators, $classprefix); |
|
132 | 132 | |
133 | 133 | $classprefix = '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'; |
134 | - $decorators = $config->get( 'admin/jqadm/' . $path . '/decorators/global', array() ); |
|
135 | - $client = self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix ); |
|
134 | + $decorators = $config->get('admin/jqadm/' . $path . '/decorators/global', array()); |
|
135 | + $client = self::addDecorators($context, $client, $templatePaths, $decorators, $classprefix); |
|
136 | 136 | |
137 | 137 | $classprefix = '\\Aimeos\\Admin\\JQAdm\\' . $localClass . '\\Decorator\\'; |
138 | - $decorators = $config->get( 'admin/jqadm/' . $path . '/decorators/local', array() ); |
|
139 | - $client = self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix ); |
|
138 | + $decorators = $config->get('admin/jqadm/' . $path . '/decorators/local', array()); |
|
139 | + $client = self::addDecorators($context, $client, $templatePaths, $decorators, $classprefix); |
|
140 | 140 | |
141 | 141 | return $client; |
142 | 142 | } |
@@ -152,20 +152,20 @@ discard block |
||
152 | 152 | * @return \Aimeos\Admin\JQAdm\\Iface Admin object |
153 | 153 | * @throws \Aimeos\Admin\JQAdm\Exception If client couldn't be found or doesn't implement the interface |
154 | 154 | */ |
155 | - protected static function createClientBase( \Aimeos\MShop\Context\Item\Iface $context, $classname, $interface, $templatePaths ) |
|
155 | + protected static function createClientBase(\Aimeos\MShop\Context\Item\Iface $context, $classname, $interface, $templatePaths) |
|
156 | 156 | { |
157 | - if( isset( self::$objects[$classname] ) ) { |
|
157 | + if (isset(self::$objects[$classname])) { |
|
158 | 158 | return self::$objects[$classname]; |
159 | 159 | } |
160 | 160 | |
161 | - if( class_exists( $classname ) === false ) { |
|
162 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
|
161 | + if (class_exists($classname) === false) { |
|
162 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Class "%1$s" not available', $classname)); |
|
163 | 163 | } |
164 | 164 | |
165 | - $client = new $classname( $context, $templatePaths ); |
|
165 | + $client = new $classname($context, $templatePaths); |
|
166 | 166 | |
167 | - if( !( $client instanceof $interface ) ) { |
|
168 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $interface ) ); |
|
167 | + if (!($client instanceof $interface)) { |
|
168 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Class "%1$s" does not implement interface "%2$s"', $classname, $interface)); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | return $client; |
@@ -27,5 +27,5 @@ |
||
27 | 27 | * @param string $name Admin name (from configuration or "Standard" if null) |
28 | 28 | * @return \Aimeos\Admin\JQAdm\Iface New client object |
29 | 29 | */ |
30 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null ); |
|
30 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null); |
|
31 | 31 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * Creates a new resource |
75 | 75 | * |
76 | 76 | * @return string|null admin output to display or null for redirecting to the list |
77 | - */ |
|
77 | + */ |
|
78 | 78 | public function create() |
79 | 79 | { |
80 | 80 | return $this->client->create(); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * Deletes a resource |
86 | 86 | * |
87 | 87 | * @return string|null admin output to display or null for redirecting to the list |
88 | - */ |
|
88 | + */ |
|
89 | 89 | public function delete() |
90 | 90 | { |
91 | 91 | return $this->client->delete(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * Returns a single resource |
97 | 97 | * |
98 | 98 | * @return string|null admin output to display or null for redirecting to the list |
99 | - */ |
|
99 | + */ |
|
100 | 100 | public function get() |
101 | 101 | { |
102 | 102 | return $this->client->get(); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * Saves the data |
108 | 108 | * |
109 | 109 | * @return string|null admin output to display or null for redirecting to the list |
110 | - */ |
|
110 | + */ |
|
111 | 111 | public function save() |
112 | 112 | { |
113 | 113 | return $this->client->save(); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * Returns a list of resource according to the conditions |
119 | 119 | * |
120 | 120 | * @return string admin output to display |
121 | - */ |
|
121 | + */ |
|
122 | 122 | public function search() |
123 | 123 | { |
124 | 124 | return $this->client->search(); |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | * @param array $templatePaths Associative list of the file system paths to the core or the extensions as key |
33 | 33 | * and a list of relative paths inside the core or the extension as values |
34 | 34 | */ |
35 | - public function __construct( \Aimeos\Admin\JQAdm\Iface $client, |
|
36 | - \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths ) |
|
35 | + public function __construct(\Aimeos\Admin\JQAdm\Iface $client, |
|
36 | + \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths) |
|
37 | 37 | { |
38 | - parent::__construct( $context, $templatePaths ); |
|
38 | + parent::__construct($context, $templatePaths); |
|
39 | 39 | |
40 | 40 | $this->client = $client; |
41 | 41 | } |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | * @return mixed Returns the value of the called method |
50 | 50 | * @throws \Aimeos\Admin\JQAdm\Exception If method call failed |
51 | 51 | */ |
52 | - public function __call( $name, array $param ) |
|
52 | + public function __call($name, array $param) |
|
53 | 53 | { |
54 | - if( ( $result = @call_user_func_array( array( $this->client, $name ), $param ) ) === false ) { |
|
55 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Unable to call method "%1$s"', $name ) ); |
|
54 | + if (($result = @call_user_func_array(array($this->client, $name), $param)) === false) { |
|
55 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Unable to call method "%1$s"', $name)); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return $result; |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | * @param string|null $name Name of the sub-client (Default if null) |
133 | 133 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
134 | 134 | */ |
135 | - public function getSubClient( $type, $name = null ) |
|
135 | + public function getSubClient($type, $name = null) |
|
136 | 136 | { |
137 | - return $this->client->getSubClient( $type, $name ); |
|
137 | + return $this->client->getSubClient($type, $name); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
156 | 156 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
157 | 157 | */ |
158 | - public function setView( \Aimeos\MW\View\Iface $view ) |
|
158 | + public function setView(\Aimeos\MW\View\Iface $view) |
|
159 | 159 | { |
160 | - $this->client->setView( $view ); |
|
160 | + $this->client->setView($view); |
|
161 | 161 | return $this; |
162 | 162 | } |
163 | 163 |
@@ -29,10 +29,10 @@ |
||
29 | 29 | $result = $this->getClient()->save(); |
30 | 30 | $item = $this->getView()->item; |
31 | 31 | |
32 | - if( $item->getId() !== null ) |
|
32 | + if ($item->getId() !== null) |
|
33 | 33 | { |
34 | 34 | $idtag = $item->getResourceType() . '-' . $item->getId(); |
35 | - $this->getContext()->getCache()->deleteByTags( array( $item->getResourceType(), $idtag ) ); |
|
35 | + $this->getContext()->getCache()->deleteByTags(array($item->getResourceType(), $idtag)); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return $result; |
@@ -29,8 +29,8 @@ |
||
29 | 29 | $result = $this->getClient()->save(); |
30 | 30 | $item = $this->getView()->item; |
31 | 31 | |
32 | - if( $item->getId() !== null ) { |
|
33 | - \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->saveItem( $item ); |
|
32 | + if ($item->getId() !== null) { |
|
33 | + \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->saveItem($item); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | return $result; |
@@ -25,24 +25,24 @@ |
||
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 | $sites = array(); |
31 | 31 | $aimeos = new \Aimeos\Bootstrap(); |
32 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/site' ); |
|
32 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/site'); |
|
33 | 33 | |
34 | 34 | $search = $manager->createSearch(); |
35 | - $search->setSortations( array( $search->sort( '+', 'locale.site.label' ) ) ); |
|
35 | + $search->setSortations(array($search->sort('+', 'locale.site.label'))); |
|
36 | 36 | |
37 | - foreach( $manager->searchItems( $search ) as $siteItem ) { |
|
37 | + foreach ($manager->searchItems($search) as $siteItem) { |
|
38 | 38 | $sites[$siteItem->getCode()] = $siteItem->getLabel(); |
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | $view->pageSites = $sites; |
43 | - $view->pageLanguages = $aimeos->getI18nList( 'admin' ); |
|
43 | + $view->pageLanguages = $aimeos->getI18nList('admin'); |
|
44 | 44 | |
45 | - $this->getClient()->setView( $view ); |
|
45 | + $this->getClient()->setView($view); |
|
46 | 46 | return $this; |
47 | 47 | } |
48 | 48 | } |
@@ -28,6 +28,6 @@ |
||
28 | 28 | * @param array $templatePaths Associative list of the file system paths to the core or the extensions as key |
29 | 29 | * and a list of relative paths inside the core or the extension as values |
30 | 30 | */ |
31 | - public function __construct( \Aimeos\Admin\JQAdm\Iface $client, |
|
32 | - \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths ); |
|
31 | + public function __construct(\Aimeos\Admin\JQAdm\Iface $client, |
|
32 | + \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths); |
|
33 | 33 | } |
34 | 34 | \ No newline at end of file |