| @@ 158-172 (lines=15) @@ | ||
| 155 | * @param string $sitecode Unique site code |
|
| 156 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
|
| 157 | */ |
|
| 158 | protected function createClient( $sitecode, $resource ) |
|
| 159 | { |
|
| 160 | $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 161 | ||
| 162 | $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 163 | $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 164 | ||
| 165 | $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 166 | $context = $this->setLocale( $context, $sitecode, $lang ); |
|
| 167 | ||
| 168 | $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 169 | $context->setView( $view ); |
|
| 170 | ||
| 171 | return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 172 | } |
|
| 173 | } |
|
| 174 | ||
| @@ 186-200 (lines=15) @@ | ||
| 183 | * @param string $sitecode Unique site code |
|
| 184 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
|
| 185 | */ |
|
| 186 | protected function createController( $sitecode, $resource ) |
|
| 187 | { |
|
| 188 | $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 189 | ||
| 190 | $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 191 | $templatePaths = $aimeos->getCustomPaths( 'controller/jsonadm/templates' ); |
|
| 192 | ||
| 193 | $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 194 | $context = $this->setLocale( $context, $sitecode, $lang ); |
|
| 195 | ||
| 196 | $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 197 | $context->setView( $view ); |
|
| 198 | ||
| 199 | return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource ); |
|
| 200 | } |
|
| 201 | ||
| 202 | ||
| 203 | /** |
|