feat: image processing improve
This commit is contained in:
@@ -5,9 +5,6 @@ use Cart\User;
|
||||
use Monolog\Handler\RotatingFileHandler;
|
||||
use Monolog\Logger;
|
||||
use Openguru\OpenCartFramework\Application;
|
||||
use Openguru\OpenCartFramework\Http\Response as HttpResponse;
|
||||
use Openguru\OpenCartFramework\ImageTool\ImageTool;
|
||||
use Openguru\OpenCartFramework\ImageTool\ImageToolInterface;
|
||||
use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator;
|
||||
use Openguru\OpenCartFramework\Support\Arr;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@@ -114,6 +111,7 @@ class ControllerExtensionModuleTgshop extends Controller
|
||||
$data['customer_groups'] = $this->getCustomerGroups();
|
||||
$data['themes'] = self::$themes;
|
||||
$data['telecart_module_version'] = module_version();
|
||||
$data['shop_base_url'] = HTTPS_CATALOG;
|
||||
|
||||
$data['action'] = $this->url->link(
|
||||
'extension/module/tgshop',
|
||||
@@ -128,21 +126,9 @@ class ControllerExtensionModuleTgshop extends Controller
|
||||
{
|
||||
$logger = $this->createLogger();
|
||||
|
||||
try {
|
||||
$this
|
||||
->createApplication($logger)
|
||||
->bootAndHandleRequest();
|
||||
} catch (Throwable $e) {
|
||||
$logger->error($e->getMessage(), ['exception' => $e]);
|
||||
http_response_code(HttpResponse::HTTP_INTERNAL_SERVER_ERROR);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode([
|
||||
'error' => $e->getMessage(),
|
||||
'code' => $e->getCode(),
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
], JSON_THROW_ON_ERROR);
|
||||
}
|
||||
$this
|
||||
->createApplication($logger)
|
||||
->bootAndHandleRequest();
|
||||
}
|
||||
|
||||
protected function validate(): bool
|
||||
@@ -170,31 +156,6 @@ class ControllerExtensionModuleTgshop extends Controller
|
||||
|
||||
$data = array_merge($data, $this->error);
|
||||
|
||||
$data['breadcrumbs'] = array();
|
||||
|
||||
$data['breadcrumbs'][] = array(
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
|
||||
);
|
||||
|
||||
$data['breadcrumbs'][] = array(
|
||||
'text' => $this->language->get('text_module'),
|
||||
'href' => $this->url->link(
|
||||
'marketplace/extension',
|
||||
'user_token=' . $this->session->data['user_token'] . '&type=module',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$data['breadcrumbs'][] = array(
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link(
|
||||
'extension/module/tgshop',
|
||||
'user_token=' . $this->session->data['user_token'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($this->session->data['success'])) {
|
||||
$data['success'] = $this->session->data['success'];
|
||||
|
||||
@@ -255,6 +216,9 @@ class ControllerExtensionModuleTgshop extends Controller
|
||||
'shop_base_url' => HTTPS_CATALOG, // for catalog: HTTPS_SERVER, for admin: HTTPS_CATALOG
|
||||
'language_id' => (int) $this->config->get('config_language_id'),
|
||||
],
|
||||
'paths' => [
|
||||
'images' => DIR_IMAGE,
|
||||
],
|
||||
'logs' => [
|
||||
'path' => DIR_LOGS,
|
||||
],
|
||||
@@ -281,7 +245,6 @@ class ControllerExtensionModuleTgshop extends Controller
|
||||
|
||||
$app = ApplicationFactory::create($items);
|
||||
$app->bind(OcRegistryDecorator::class, fn() => new OcRegistryDecorator($this->registry));
|
||||
$app->bind(ImageToolInterface::class, fn() => new ImageTool(DIR_IMAGE, HTTPS_SERVER));
|
||||
$app->setLogger($logger);
|
||||
|
||||
return $app;
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
<script>
|
||||
window.TeleCart = {
|
||||
user_token: '{{ user_token }}',
|
||||
mainpage_slider: '{{ mainpage_slider }}',
|
||||
themes: '{{ themes | json_encode }}',
|
||||
order_statuses: '{{ order_statuses | json_encode }}',
|
||||
shop_base_url: '{{ shop_base_url }}',
|
||||
};
|
||||
</script>
|
||||
<div id="app" class="telecart-admin-app">App Loading...</div>
|
||||
|
||||
Reference in New Issue
Block a user