-
Notifications
You must be signed in to change notification settings - Fork 0
/
e_menu.php
86 lines (75 loc) · 2.13 KB
/
e_menu.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2025 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* #######################################
* # e107 contact plugin #
* # by Jimako #
* # https://www.e107sk.com #
* #######################################
*/
if (!defined('e107_INIT'))
{
exit;
}
class econtact_menu
{
public function __construct()
{
// Load the language file for the contact plugin
e107::lan('econtact', 'lan_contact');
}
/**
* Returns the configuration fields for the menu.
* @param string $menu Menu name (e.g., 'econtact')
* @return array Configuration fields for the selected menu
*/
public function config($menu = '')
{
// Get the database object and initialize the fields array
$sql = e107::getDb();
$fields = [];
// Fetch available templates for the contact menu
$templates = e107::getLayouts('econtact', 'contact_menu', 'front', null, true, false);
// Set a default caption if LAN_CONTACT_00 is defined
$default_caption = defset('LAN_CONTACT_PAGE_TITLE', 'Contact Us');
// Switch case to handle different menu types
switch ($menu)
{
case 'contact':
// Define the configuration fields for the 'econtact' menu
$fields['caption'] = [
'title' => LAN_CAPTION,
'type' => 'text',
'multilan' => true,
'writeParms' => ['size' => 'xxlarge', 'default' => $default_caption]
];
$fields['subtitle'] = [
'title' => LAN_TITLE,
'type' => 'text',
'multilan' => true,
'writeParms' => ['size' => 'xxlarge']
];
$fields['template'] = [
'title' => LAN_TEMPLATE,
'type' => 'dropdown',
'writeParms' => ['optArray' => $templates],
'help' => ''
];
$fields['tablestyle'] = [
'title' => 'Tablestyle key',
'type' => 'text',
'writeParms' => ['size' => 'xxlarge']
];
// Return the fields configuration
return $fields;
default:
// Return an empty array if no menu is matched
return [];
}
}
}