public function fileAction()
{
if (config('shop.authorize', true)) {
$this->authorize('admin', [['admin', 'editor']]);
}
$contents = '';
$files = array();
$aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get();
$type = Route::input('type', Input::get('type', 'js'));
foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths) {
foreach ($paths as $path) {
$jsbAbsPath = $base . '/' . $path;
$jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath));
$files = array_merge($files, $jsb2->getFiles($type));
}
}
foreach ($files as $file) {
if (($content = file_get_contents($file)) !== false) {
$contents .= $content;
}
}
$response = response($contents);
if ($type === 'js') {
$response->header('Content-Type', 'application/javascript');
} elseif ($type === 'css') {
$response->header('Content-Type', 'text/css');
}
return $response;
}