@@ -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 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @param string|null $name Name of the sub-client (Default if null) |
27 | 27 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
28 | 28 | */ |
29 | - public function getSubClient( $type, $name = null ); |
|
29 | + public function getSubClient($type, $name = null); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Returns the view object that will generate the admin output. |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
42 | 42 | * @return \Aimeos\Admin\Html\Iface Reference to this object for fluent calls |
43 | 43 | */ |
44 | - public function setView( \Aimeos\MW\View\Iface $view ); |
|
44 | + public function setView(\Aimeos\MW\View\Iface $view); |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Copies a resource |
@@ -29,29 +29,29 @@ |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface admin client implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $type, $name = null ) |
|
32 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $type, $name = null) |
|
33 | 33 | { |
34 | - if( empty( $type ) ) { |
|
35 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Admin JQAdm type is empty' ) ); |
|
34 | + if (empty($type)) { |
|
35 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Admin JQAdm type is empty')); |
|
36 | 36 | } |
37 | 37 | |
38 | - if( ctype_alnum( $type ) === false ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in client name "%1$s"', $type ) ); |
|
38 | + if (ctype_alnum($type) === false) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in client name "%1$s"', $type)); |
|
40 | 40 | } |
41 | 41 | |
42 | - $factory = '\\Aimeos\\Admin\\JQAdm\\' . ucwords( $type ) . '\\Factory'; |
|
42 | + $factory = '\\Aimeos\\Admin\\JQAdm\\' . ucwords($type) . '\\Factory'; |
|
43 | 43 | |
44 | - if( class_exists( $factory ) === false ) { |
|
45 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Class "%1$s" not available', $factory ) ); |
|
44 | + if (class_exists($factory) === false) { |
|
45 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Class "%1$s" not available', $factory)); |
|
46 | 46 | } |
47 | 47 | |
48 | - $client = @call_user_func_array( array( $factory, 'createClient' ), array( $context, $templatePaths, $name ) ); |
|
48 | + $client = @call_user_func_array(array($factory, 'createClient'), array($context, $templatePaths, $name)); |
|
49 | 49 | |
50 | - if( $client === false ) { |
|
51 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) ); |
|
50 | + if ($client === false) { |
|
51 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid factory "%1$s"', $factory)); |
|
52 | 52 | } |
53 | 53 | |
54 | - $client->setView( $context->getView() ); |
|
54 | + $client->setView($context->getView()); |
|
55 | 55 | |
56 | 56 | return $client; |
57 | 57 | } |