forked from drajathasan/slims-excel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslims-excel.plugin.php
36 lines (33 loc) · 1.24 KB
/
slims-excel.plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Plugin Name: SLiMS Excel
* Plugin URI: -
* Description: Import Excel
* Version: 1.0.0
* Author: Drajat Hasan
* Author URI: https://t.me/drajathasan
*/
use SLiMS\Url;
use SLiMS\Plugins;
if (!function_exists('pluginUrl'))
{
/**
* Generate URL with plugin_container.php?id=<id>&mod=<mod> + custom query
*
* @param array $data
* @param boolean $reset
* @return string
*/
function pluginUrl(array $data = [], bool $reset = false): string
{
// back to base uri
if ($reset) return Url::getSelf(fn($self) => $self . '?mod=' . $_GET['mod'] . '&id=' . $_GET['id']);
return Url::getSelf(function($self) use($data) {
return $self . '?' . http_build_query(array_merge($_GET,$data));
});
}
}
Plugins::getInstance()->registerMenu('bibliography', 'Biblio Export Excel', __DIR__ . '/pages/export_biblio_excel.php');
Plugins::getInstance()->registerMenu('bibliography', 'Item Export Excel', __DIR__ . '/pages/export_item_excel.php');
Plugins::getInstance()->registerMenu('bibliography', 'Biblio Import Excel', __DIR__ . '/pages/import_biblio_excel.php');
Plugins::getInstance()->registerMenu('bibliography', 'Item Import Excel', __DIR__ . '/pages/import_item_excel.php');