refine description
This commit is contained in:
parent
b4590187a6
commit
7fe4bb16a4
41
CHANGELOG.md
41
CHANGELOG.md
@ -1,46 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 1.4.0.0 (2021-11-11)
|
|
||||||
|
|
||||||
#### Added
|
|
||||||
- add JSON export renderer
|
|
||||||
- add tpl block for easier extension
|
|
||||||
- enable controller based exception handling
|
|
||||||
|
|
||||||
#### Changed
|
|
||||||
- change deprecated CSV export code
|
|
||||||
- show registered export renderers in admin submit without required tpl block extension
|
|
||||||
- force get translations from admin
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 1.3.1.0 (2021-09-10)
|
## 1.0.0.0 (2021-12-11)
|
||||||
|
|
||||||
- installable in OXID 6.3.1
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1.3.0.0 (2021-07-29)
|
|
||||||
|
|
||||||
- can handle long task description text
|
|
||||||
- has more generic admin controller templates
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1.2.0.0 (2021-07-27)
|
|
||||||
|
|
||||||
- adjustments for CLI extension
|
|
||||||
- fix OXID 6.1 incompatibilities
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1.1.0.0 (2021-06-25)
|
|
||||||
|
|
||||||
- implement form builder
|
|
||||||
- fix key figures export
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1.0.0.0 (2021-06-22)
|
|
||||||
|
|
||||||
- initial implementation
|
- initial implementation
|
@ -1,5 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*
|
||||||
|
* https://www.d3data.de
|
||||||
|
*
|
||||||
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||||
|
* @link https://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\SortedMenus\Modules\Controller\Admin {
|
namespace D3\SortedMenus\Modules\Controller\Admin {
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Controller\Admin\NavigationTree;
|
use OxidEsales\Eshop\Application\Controller\Admin\NavigationTree;
|
||||||
|
@ -1,5 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*
|
||||||
|
* https://www.d3data.de
|
||||||
|
*
|
||||||
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||||
|
* @link https://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace D3\SortedMenus\Modules\Controller\Admin;
|
namespace D3\SortedMenus\Modules\Controller\Admin;
|
||||||
|
|
||||||
use DOMElement;
|
use DOMElement;
|
||||||
@ -44,6 +57,7 @@ class NavigationTreeSortedMenus extends NavigationTreeSortedMenus_parent
|
|||||||
$remainingUnsortedElements = [];
|
$remainingUnsortedElements = [];
|
||||||
$sortedElements = [];
|
$sortedElements = [];
|
||||||
|
|
||||||
|
// split current elements to "contained in sorted" and all others
|
||||||
foreach ($unsortedElements as $element) {
|
foreach ($unsortedElements as $element) {
|
||||||
if (in_array($element->getAttribute('id'), $newOrder)) {
|
if (in_array($element->getAttribute('id'), $newOrder)) {
|
||||||
$sortedElements[$element->getAttribute('id')] = $element;
|
$sortedElements[$element->getAttribute('id')] = $element;
|
||||||
@ -61,11 +75,11 @@ class NavigationTreeSortedMenus extends NavigationTreeSortedMenus_parent
|
|||||||
}
|
}
|
||||||
$allSortedElements = array_merge($sortedElements, $remainingUnsortedElements);
|
$allSortedElements = array_merge($sortedElements, $remainingUnsortedElements);
|
||||||
|
|
||||||
|
// apply sorted elements
|
||||||
for ($i = 0; $i < count($allSortedElements); $i++) {
|
for ($i = 0; $i < count($allSortedElements); $i++) {
|
||||||
$keys = array_keys($allSortedElements);
|
$keys = array_keys($allSortedElements);
|
||||||
$elem = $unsortedElements->item($i);
|
$elem = $unsortedElements->item($i);
|
||||||
$searchElem = $elem->parentNode;
|
$searchElem = $elem->parentNode;
|
||||||
//$searchElem->removeChild($elem);
|
|
||||||
$searchElem->appendChild($allSortedElements[$keys[$i]]);
|
$searchElem->appendChild($allSortedElements[$keys[$i]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
121
README.en.md
121
README.en.md
@ -1,50 +1,63 @@
|
|||||||
[![deutsche Version](https://logos.oxidmodule.com/de2_xs.svg)](README.md)
|
[![deutsche Version](https://logos.oxidmodule.com/de2_xs.svg)](README.md)
|
||||||
[![english version](https://logos.oxidmodule.com/en2_xs.svg)](README.en.md)
|
[![english version](https://logos.oxidmodule.com/en2_xs.svg)](README.en.md)
|
||||||
|
|
||||||
# D³ Data Wizard for OXID eShop
|
# D³ Sortable Menus für OXID eShop
|
||||||
|
|
||||||
The module `DataWizard` offers a framework for the simple integration of exports via the admin area of the OXID shop.
|
The module offers the possibility to sort the admin menus into a desired order.
|
||||||
|
|
||||||
The exports are defined via database queries or ready-made data lists. Various export formats are available. The generation is possible at any time and always recurring (within the system limits). These are offered as downloads in the browser.
|
The side menu on the left and the tabs in each individual area can be sorted.
|
||||||
|
The action links of the areas are also configured via the menu.xml, but are loaded in the template in a fixed order.
|
||||||
|
|
||||||
All exports and tasks are grouped together for better clarity.
|
The entries can only be moved in the currently selected level.
|
||||||
|
|
||||||
Sample exports are included in the package d3/datawizardtasks. These are intended to serve as an implementation reference for individual exports.
|
|
||||||
|
|
||||||
![administration area](assets/administration_exports.jpg "administration area")
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
In the console in the shop root (above source and vendor), execute the following command:
|
In the console in the shop root (above source and vendor), execute the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
php composer require d3/datawizard
|
php composer require d3/sortedmenus
|
||||||
```
|
```
|
||||||
|
|
||||||
Activate the module in the admin area of the shop in "Extensions -> Modules".
|
Activate the module in the admin area of the shop in "Extensions -> Modules".
|
||||||
|
|
||||||
## Extensibility
|
## Configuration
|
||||||
|
|
||||||
The module represents the technical basic framework of the exports and does not claim to be complete. In order to adapt the scope to individual requirements, the following extensions are prepared:
|
For the sake of simplicity, the configuration is done directly in the configuration file of the shop (`config.inc.php`).
|
||||||
|
|
||||||
- Add exports or tasks
|
Insert the following configuration as an example:
|
||||||
- Use existing and new groups
|
|
||||||
- Add export formats
|
|
||||||
|
|
||||||
Independently of this, all extension options are available that the OXID Shop provides for modules.
|
```php
|
||||||
|
$this->d3MenuSorting = [
|
||||||
|
// mainmenu
|
||||||
|
'move articles and order panels in front' => [
|
||||||
|
'xpath' => "//OX/*[@id='NAVIGATION_ESHOPADMIN']/MAINMENU",
|
||||||
|
'order' => ['mxmanageprod', 'mxorders']
|
||||||
|
],
|
||||||
|
// submenu
|
||||||
|
'move vouchers in shop settings to front' => [
|
||||||
|
'xpath' => "//OX/*[@id='NAVIGATION_ESHOPADMIN']/*[@id='mxshopsett']/SUBMENU",
|
||||||
|
'order' => ['mxvouchers']
|
||||||
|
],
|
||||||
|
// tabs
|
||||||
|
'show category picture tab as first' => [
|
||||||
|
'xpath' => "//OX/*[@id='NAVIGATION_ESHOPADMIN']/*[@id='mxmanageprod']/*[@id='mxcategories']/TAB",
|
||||||
|
'order' => ['tbclcategory_pictures']
|
||||||
|
]
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
## Extension packages
|
Each entry defines a menu level with the xPath specification in which sorting can take place. The xPath can be determined in the respective menu.xml. Describe the xPath as precisely as possible (ideally using the unique ELement IDs), otherwise the elements to be moved could end up in the wrong area.
|
||||||
|
|
||||||
- `d3/datawizardtasks` - provides sample exports and their implementation reference
|
In the order entry, the IDs of the contained entries are in the correct order. Entries that are not contained are automatically appended to the end of the sorted list in the previous sort order.
|
||||||
- `d3/datawizardcli` - provides the execution of exports or tasks via the command prompt (e.g. as cronjobs)
|
|
||||||
- `d3/datawizardlink` - provides URLs to generate exports from third party systems
|
After changing the sorting entries, the tmp folder must be emptied.
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
See [CHANGELOG](CHANGELOG.md) for further informations.
|
See [CHANGELOG](CHANGELOG.md) for further informations.
|
||||||
|
|
||||||
## Licence of this software (d3/datawizard)
|
## Licence of this software (d3/sortedmenus)
|
||||||
(status: 2021-05-06)
|
(status: 2021-12-11)
|
||||||
|
|
||||||
```
|
```
|
||||||
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
@ -53,69 +66,3 @@ This software is distributed under the GNU GENERAL PUBLIC LICENSE version 3.
|
|||||||
```
|
```
|
||||||
|
|
||||||
For full copyright and licensing information, please see the [LICENSE](LICENSE.md) file distributed with this source code.
|
For full copyright and licensing information, please see the [LICENSE](LICENSE.md) file distributed with this source code.
|
||||||
|
|
||||||
## Further licences and terms of use
|
|
||||||
|
|
||||||
### background gradients on src/Application/views/admin/tpl/ templates
|
|
||||||
(https://www.gradientmagic.com/licensing - status: 07.05.2021)
|
|
||||||
|
|
||||||
```
|
|
||||||
Image courtesy of gradientmagic.com
|
|
||||||
|
|
||||||
Free Gradients
|
|
||||||
|
|
||||||
Gradients available on the site are free to use on personal and commercial projects, with attribution.
|
|
||||||
```
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
The following software packages are not part of this module. However, they are required for use. The linked packages are under the following licences:
|
|
||||||
|
|
||||||
### league/csv [MIT]
|
|
||||||
(https://github.com/thephpleague/csv - status: 2021-05-06)
|
|
||||||
|
|
||||||
```
|
|
||||||
Copyright (c) 2013-2017 ignace nyamagana butera
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
```
|
|
||||||
|
|
||||||
### mathieuviossat/arraytotexttable [MIT]
|
|
||||||
(https://github.com/viossat/arraytotexttable - status: 2021-05-06)
|
|
||||||
|
|
||||||
```
|
|
||||||
Copyright (c) 2015 Mathieu Viossat
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
```
|
|
||||||
|
81
README.md
81
README.md
@ -1,53 +1,16 @@
|
|||||||
[![deutsche Version](https://logos.oxidmodule.com/de2_xs.svg)](README.md)
|
[![deutsche Version](https://logos.oxidmodule.com/de2_xs.svg)](README.md)
|
||||||
[![english version](https://logos.oxidmodule.com/en2_xs.svg)](README.en.md)
|
[![english version](https://logos.oxidmodule.com/en2_xs.svg)](README.en.md)
|
||||||
|
|
||||||
# D³ Sortable Menus für OXID eShop
|
# D³ Sortierbare Menüs für OXID eShop
|
||||||
|
|
||||||
Das Modul bietet die Möglichkeit, die Adminmenüs in eine gewünschte Reihenfolge zubringen.
|
Das Modul bietet die Möglichkeit, die Adminmenüs in eine gewünschte Reihenfolge zu bringen.
|
||||||
|
|
||||||
Sortiert werden kann das Seitenmenü auf der linken Seite sowie die Tabs in jedem einzelnen Bereich.
|
Sortiert werden kann das Seitenmenü auf der linken Seite sowie die Tabs in jedem einzelnen Bereich.
|
||||||
|
Die Aktionslinks der Bereiche werden zwar ebenfalls über die menu.xml konfiguriert, werden aber im Template in fester Reihenfolge geladen.
|
||||||
|
|
||||||
Die Einträge können ausschließlich in der aktuell ausgewählten Ebene verschoben werden.
|
Die Einträge können ausschließlich in der aktuell ausgewählten Ebene verschoben werden.
|
||||||
|
|
||||||
## Konfiguration
|
## Installation
|
||||||
|
|
||||||
Die Konfiguration erfolgt der Einfachheit halber direkt in der Konfiguration des Shops (`config.inc.php`).
|
|
||||||
|
|
||||||
Fügen Sie beispielhaft folgende Konfiguration ein:
|
|
||||||
|
|
||||||
```php
|
|
||||||
$this->d3MenuSorting = [
|
|
||||||
// Tabs
|
|
||||||
[
|
|
||||||
'xpath' => "//OX/*[@id='d3mxd3modules']/*[@id='d3mximporter']/*[@id='d3mxarticleimport']/TAB",
|
|
||||||
'order' => ['d3tbclimporter_category', 'd3tbclimporter_selectlist', 'd3tbclimporter_main']
|
|
||||||
],
|
|
||||||
// mainmenu
|
|
||||||
[
|
|
||||||
'xpath' => "//OX/*[@id='d3mxd3modules']/MAINMENU",
|
|
||||||
'order' => ['d3konfigurator', 'abcdef', 'd3mxordermanager']
|
|
||||||
],
|
|
||||||
// mainmenu with unvalid item
|
|
||||||
[
|
|
||||||
'xpath' => "//OX/*[@id='d3mxd4modules']/MAINMENU",
|
|
||||||
'order' => ['d3konfigurator', 'abcdef', 'd3mxordermanager']
|
|
||||||
],
|
|
||||||
// Tabs
|
|
||||||
[
|
|
||||||
'xpath' => "//OX/*[@id='NAVIGATION_ESHOPADMIN']/*[@id='mxmanageprod']/*[@id='mxcategories']/TAB",
|
|
||||||
'order' => ['tbclcategory_pictures']
|
|
||||||
]
|
|
||||||
// can't sort buttons
|
|
||||||
];
|
|
||||||
```
|
|
||||||
|
|
||||||
Jeder Eintrage definiert mit der xPath-Angabe eine Menüebene, in der sortiert werden kann. Der xPath kann in der jeweiligen menu.xml ermittelt werden.
|
|
||||||
|
|
||||||
Im order-Eintrag stehen die IDs der enthaltenen Einträge in der richtigen Reihenfolge. Nicht enthaltene Einträge werden in der bisherigen Sortierung automatisch an das Ende der sortierten Liste angehängt.
|
|
||||||
|
|
||||||
Nach dem Ändern der Sortiereinträage muss der tmp-Ordner geleert werden.
|
|
||||||
|
|
||||||
## Schnellinstallation
|
|
||||||
|
|
||||||
Auf der Konsole im Shoproot (oberhalb von source und vendor) folgenden Befehl ausführen:
|
Auf der Konsole im Shoproot (oberhalb von source und vendor) folgenden Befehl ausführen:
|
||||||
|
|
||||||
@ -57,11 +20,43 @@ php composer require d3/sortedmenus
|
|||||||
|
|
||||||
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
||||||
|
|
||||||
|
## Konfiguration
|
||||||
|
|
||||||
|
Die Konfiguration erfolgt der Einfachheit halber direkt in der Konfigurationsdatei des Shops (`config.inc.php`).
|
||||||
|
|
||||||
|
Fügen Sie beispielhaft folgende Konfiguration ein:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$this->d3MenuSorting = [
|
||||||
|
// mainmenu
|
||||||
|
'move articles and order panels in front' => [
|
||||||
|
'xpath' => "//OX/*[@id='NAVIGATION_ESHOPADMIN']/MAINMENU",
|
||||||
|
'order' => ['mxmanageprod', 'mxorders']
|
||||||
|
],
|
||||||
|
// submenu
|
||||||
|
'move vouchers in shop settings to front' => [
|
||||||
|
'xpath' => "//OX/*[@id='NAVIGATION_ESHOPADMIN']/*[@id='mxshopsett']/SUBMENU",
|
||||||
|
'order' => ['mxvouchers']
|
||||||
|
],
|
||||||
|
// tabs
|
||||||
|
'show category picture tab as first' => [
|
||||||
|
'xpath' => "//OX/*[@id='NAVIGATION_ESHOPADMIN']/*[@id='mxmanageprod']/*[@id='mxcategories']/TAB",
|
||||||
|
'order' => ['tbclcategory_pictures']
|
||||||
|
]
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
Jeder Eintrage definiert mit der xPath-Angabe eine Menüebene, in der sortiert werden kann. Der xPath kann in der jeweiligen menu.xml ermittelt werden. Beschreiben Sie den xPath möglichst genau (idealerweise anhand der eindeutigen Element-IDs), da sonst die zu verschiebenden Elemente im falschen Bereich landen könnten.
|
||||||
|
|
||||||
|
Im order-Eintrag stehen die IDs der enthaltenen Einträge in der richtigen Reihenfolge. Nicht enthaltene Einträge werden in der bisherigen Sortierung automatisch an das Ende der sortierten Liste angehängt.
|
||||||
|
|
||||||
|
Nach dem Ändern der Sortiereinträge muss der tmp-Ordner geleert werden.
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
Siehe [CHANGELOG](CHANGELOG.md) für weitere Informationen.
|
Siehe [CHANGELOG](CHANGELOG.md) für weitere Informationen.
|
||||||
|
|
||||||
## Lizenz dieser Software (d3/datawizard)
|
## Lizenz dieser Software (d3/sortedmenus)
|
||||||
(Stand: 11.12.2021)
|
(Stand: 11.12.2021)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -13,10 +13,6 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
/**
|
|
||||||
* Metadata version
|
|
||||||
*/
|
|
||||||
|
|
||||||
use D3\SortedMenus\Modules\Controller\Admin\NavigationTreeSortedMenus;
|
use D3\SortedMenus\Modules\Controller\Admin\NavigationTreeSortedMenus;
|
||||||
use OxidEsales\Eshop\Application\Controller\Admin\NavigationTree;
|
use OxidEsales\Eshop\Application\Controller\Admin\NavigationTree;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user