36 lines
1.3 KiB
PHTML
36 lines
1.3 KiB
PHTML
|
|
<?php
|
||
|
|
/**
|
||
|
|
* Reusable export dropdown for list pages.
|
||
|
|
*
|
||
|
|
* Renders a zero-config <details class="dropdown"> with two triggers:
|
||
|
|
* [data-list-export="csv"] — plain CSV
|
||
|
|
* [data-list-export="excel"] — UTF-8 BOM + semicolon (opens in Excel)
|
||
|
|
*
|
||
|
|
* The URL is NOT set here. The JS module `/js/core/app-list-export.js`
|
||
|
|
* picks up the trigger clicks, reads the grid filter/sort state, and
|
||
|
|
* navigates to the configured export endpoint.
|
||
|
|
*
|
||
|
|
* Consumer contract:
|
||
|
|
* - Pass the export endpoint to the JS module via page config
|
||
|
|
* (initListExport({ gridConfig, exportUrl })).
|
||
|
|
* - Place this partial inside $listTitleActionsHtml.
|
||
|
|
*/
|
||
|
|
?>
|
||
|
|
<details class="dropdown app-list-export-dropdown" data-list-export-menu>
|
||
|
|
<summary role="button" class="secondary outline">
|
||
|
|
<i class="bi bi-download" aria-hidden="true"></i> <?php e(t('Export')); ?>
|
||
|
|
</summary>
|
||
|
|
<ul dir="rtl">
|
||
|
|
<li dir="ltr">
|
||
|
|
<button class="transparent" type="button" data-list-export="csv">
|
||
|
|
<i class="bi bi-filetype-csv" aria-hidden="true"></i> <?php e(t('Export as CSV')); ?>
|
||
|
|
</button>
|
||
|
|
</li>
|
||
|
|
<li dir="ltr">
|
||
|
|
<button class="transparent" type="button" data-list-export="excel">
|
||
|
|
<i class="bi bi-file-earmark-spreadsheet" aria-hidden="true"></i> <?php e(t('Export for Excel')); ?>
|
||
|
|
</button>
|
||
|
|
</li>
|
||
|
|
</ul>
|
||
|
|
</details>
|