| @@ 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 | /** |
|
| @@ 146-160 (lines=15) @@ | ||
| 143 | * @param string $sitecode Unique site code |
|
| 144 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
|
| 145 | */ |
|
| 146 | protected function createClient( $sitecode, $resource ) |
|
| 147 | { |
|
| 148 | $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 149 | ||
| 150 | $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 151 | $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 152 | ||
| 153 | $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 154 | $context = $this->setLocale( $context, $sitecode, $lang ); |
|
| 155 | ||
| 156 | $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 157 | $context->setView( $view ); |
|
| 158 | ||
| 159 | return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 160 | } |
|
| 161 | ||
| 162 | ||
| 163 | /** |
|