From bd69b07c11493bd325b054d4d2e2663023266332 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Sat, 10 Feb 2018 12:14:35 +0100 Subject: [PATCH] Added elasticsearch support --- Adminer/index.php | 3 + Controllers/Backend/Adminer.php | 2 + README.md | 9 ++- Resources/menu.xml | 13 ++++- Resources/services.xml | 13 +++++ Resources/views/backend/adminer/app.js | 4 +- Resources/views/backend/adminer/form.tpl | 14 +++-- .../views/backend/adminer/view/window.js | 4 +- Subscriber/MenuSubscriber.php | 57 +++++++++++++++++++ 9 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 Resources/services.xml create mode 100644 Subscriber/MenuSubscriber.php diff --git a/Adminer/index.php b/Adminer/index.php index 0a489cd..dca1a7b 100644 --- a/Adminer/index.php +++ b/Adminer/index.php @@ -12,4 +12,7 @@ function adminer_object() { ]); } +error_reporting(0); +@ini_set('display_errors', 0); + include './Adminer.php'; \ No newline at end of file diff --git a/Controllers/Backend/Adminer.php b/Controllers/Backend/Adminer.php index 2254abe..55ae5b2 100644 --- a/Controllers/Backend/Adminer.php +++ b/Controllers/Backend/Adminer.php @@ -28,7 +28,9 @@ public function formAction() $this->Front()->Plugins()->ViewRenderer()->setNoRender(); $this->View()->dbData = Shopware()->Container()->getParameter('shopware.db'); + $this->View()->esData = Shopware()->Container()->getParameter('shopware.es'); $this->View()->postUri = $baseUrl . $pathToPluginFolder . '/Adminer/index.php'; + $this->View()->driver = $this->Request()->getParam('adminerAction') === 'index' ? 'server' : 'elastic'; echo $this->View()->fetch('backend/adminer/form.tpl'); die(); diff --git a/README.md b/README.md index 94fd77d..7023f98 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,18 @@ manage the database in backend -![Adminer in Shopware](http://i.imgur.com/eWSl5K3.png) +## MySQL +![Adminer in Shopware](https://ipfs.io/ipfs/QmdUVhnuzidwqQgyAi7bd4hJAM26GEw7afR7Abx2ep1Kj9) + + +## ElasticSearch +![Adminer in Shopware](https://ipfs.io/ipfs/QmUpjMBEHM7To2h9WUtE2dFHMDxNA778VS3FM2pEtYWGJ4) # Installation ## Zip Installation package for the Shopware Plugin Manager -* Download the [latest plugin version](https://github.com/shyim/adminer-for-shopware/releases/latest/) (e.g. `AdminerForShopware-1.1.1.zip`) +* Download the [latest plugin version](https://github.com/shyim/adminer-for-shopware/releases/latest/) (e.g. `AdminerForShopware-1.3.0.zip`) * Upload and install plugin using Plugin Manager ## Install with composer diff --git a/Resources/menu.xml b/Resources/menu.xml index ea67ac8..713df12 100644 --- a/Resources/menu.xml +++ b/Resources/menu.xml @@ -4,12 +4,21 @@ AdminerMySQL - - + + Adminer index sprite-gear ConfigurationMenu + + AdminerElastic + + + Adminer + elasticSearch + sprite-gear + ConfigurationMenu + \ No newline at end of file diff --git a/Resources/services.xml b/Resources/services.xml new file mode 100644 index 0000000..2e8582e --- /dev/null +++ b/Resources/services.xml @@ -0,0 +1,13 @@ + + + + + + + %shopware.es.enabled% + + + + diff --git a/Resources/views/backend/adminer/app.js b/Resources/views/backend/adminer/app.js index ba4161b..82b718c 100644 --- a/Resources/views/backend/adminer/app.js +++ b/Resources/views/backend/adminer/app.js @@ -12,6 +12,8 @@ Ext.define('Shopware.apps.Adminer', { ], launch: function() { - return Ext.create('Shopware.apps.Adminer.view.Window'); + return Ext.create('Shopware.apps.Adminer.view.Window', { + action: this.action + }); } }); diff --git a/Resources/views/backend/adminer/form.tpl b/Resources/views/backend/adminer/form.tpl index 74ae9af..150ca05 100644 --- a/Resources/views/backend/adminer/form.tpl +++ b/Resources/views/backend/adminer/form.tpl @@ -1,9 +1,13 @@
- - - - - + + {if $driver === "server"} + + + + + {else} + + {/if}