-
Notifications
You must be signed in to change notification settings - Fork 3
/
admin.php
54 lines (48 loc) · 2.01 KB
/
admin.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
use Xhshop\BackEndController;
$temp = xhshop_pluginMenu();
if (function_exists('XH_wantsPluginAdministration') && XH_wantsPluginAdministration('xhshop') || isset($xhshop)) {
setcookie('xhsMode', 'edit');
$o .= print_plugin_admin('off');
pluginmenu('ROW');
foreach ($temp as $i => $j) {
pluginmenu('TAB', XH_hsc($j), '', $i);
}
$o .= pluginmenu('SHOW');
if (in_array($admin, array('plugin_stylesheet', 'plugin_config', 'plugin_language'), true)) {
if (isset($_GET['xh_success']) && in_array($_GET['xh_success'], array('config', 'language'))) {
header('Location: ' . CMSIMPLE_URL . '?xhshop&xhsTask=syscheck&normal');
exit;
}
$o .= plugin_admin_common($action, $admin, $plugin);
} else {
$xhsController = new BackEndController();
$o .= $xhsController->handleRequest();
}
}
/** @return array */
function xhshop_pluginMenu()
{
global $su, $plugin_cf, $plugin_tx;
$baseurl = substr($plugin_tx['xhshop']['config_shop_page'], 1);
$baseurl = $su === $baseurl ? $baseurl : 'xhshop';
$items = array();
$items[$plugin_tx['xhshop']['labels_products_list']] = "?{$baseurl}&xhsTask=productList&normal";
$items[$plugin_tx['xhshop']['labels_new_product']] = "?{$baseurl}&xhsTask=editProduct&normal";
if ($plugin_cf['xhshop']['categories_use_categories']) {
$items[$plugin_tx['xhshop']['labels_product_categories']] = "?{$baseurl}&xhsTask=productCategories&normal";
}
foreach ($items as $label => $url) {
XH_registerPluginMenuItem('xhshop', $label, $url);
}
XH_registerStandardPluginMenuItems(false);
$label = $plugin_tx['xhshop']['labels_syscheck'];
$url = "?{$baseurl}&xhsTask=syscheck&normal";
XH_registerPluginMenuItem('xhshop', $label, $url);
$items[$label] = $url;
$label = $plugin_tx['xhshop']['labels_about'];
$url = "?{$baseurl}&xhsTask=helpAbout&normal";
XH_registerPluginMenuItem('xhshop', $label, $url);
$items[$label] = $url;
return $items;
}