1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
/* |
3
|
|
|
You may not change or alter any portion of this comment or credits |
4
|
|
|
of supporting developers from this source code or any supporting source code |
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Contact module |
14
|
|
|
* |
15
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
16
|
|
|
* @license https://www.fsf.org/copyleft/gpl.html GNU public license |
17
|
|
|
* @author Kazumi Ono (aka Onokazu) |
18
|
|
|
* @author Trabis <[email protected]> |
19
|
|
|
* @author Hossein Azizabadi (AKA Voltan) |
20
|
|
|
* @author Mirza (AKA Bleekk) |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
use XoopsModules\Contact\{ |
24
|
|
|
Helper |
25
|
|
|
}; |
26
|
|
|
|
27
|
|
|
require_once \dirname(__DIR__, 2) . '/mainfile.php'; |
28
|
|
|
require_once __DIR__ . '/header.php'; |
29
|
|
|
$GLOBALS['xoopsOption']['template_main'] = 'contact_index.tpl'; |
30
|
|
|
//unset($_SESSION); |
31
|
|
|
require XOOPS_ROOT_PATH . '/header.php'; |
32
|
|
|
$helper = Helper::getInstance(); |
33
|
|
|
global $xoopsModuleConfig, $xoopsModule, $xoopsUser; |
34
|
|
|
|
35
|
|
|
/*Modules Options*/ |
36
|
|
|
if (1 == $helper->getConfig('form_dept')) { |
37
|
|
|
// show a drop down with the correct departments listed |
38
|
|
|
$departmentlist = []; |
39
|
|
|
$departments = $helper->getConfig('contact_dept'); |
40
|
|
|
foreach ($departments as $val) { |
41
|
|
|
[$name, $email] = explode(',', $val, 2); //split the name and email |
42
|
|
|
$departmentlist[] = $name; |
43
|
|
|
} |
44
|
|
|
$GLOBALS['xoopsTpl']->assign('depart', $helper->getConfig('form_dept')); |
45
|
|
|
$GLOBALS['xoopsTpl']->assign('departments', $departmentlist); |
46
|
|
|
} |
47
|
|
|
$GLOBALS['xoopsTpl']->assign('recaptcha', $helper->getConfig('recaptchause')); |
48
|
|
|
$GLOBALS['xoopsTpl']->assign('recaptchakey', $helper->getConfig('recaptchakey')); |
49
|
|
|
$GLOBALS['xoopsTpl']->assign('url', $helper->getConfig('form_url')); |
50
|
|
|
$GLOBALS['xoopsTpl']->assign('icq', $helper->getConfig('form_icq')); |
51
|
|
|
$GLOBALS['xoopsTpl']->assign('skype', $helper->getConfig('form_skype')); |
52
|
|
|
$GLOBALS['xoopsTpl']->assign('company', $helper->getConfig('form_company')); |
53
|
|
|
$GLOBALS['xoopsTpl']->assign('location', $helper->getConfig('form_location')); |
54
|
|
|
$GLOBALS['xoopsTpl']->assign('phone', $helper->getConfig('form_phone')); |
55
|
|
|
$GLOBALS['xoopsTpl']->assign('address', $helper->getConfig('form_address')); |
56
|
|
|
$GLOBALS['xoopsTpl']->assign('map', $helper->getConfig('embed_maps')); |
57
|
|
|
$GLOBALS['xoopsTpl']->assign('info', xoops_getModuleOption('contact_info', 'contact')); |
|
|
|
|
58
|
|
|
$GLOBALS['xoopsTpl']->assign('contact_default', xoops_getModuleOption('contact_default', 'contact')); |
|
|
|
|
59
|
|
|
|
60
|
|
|
if ($helper->getConfig('show_breadcrumbs')) { |
61
|
|
|
$GLOBALS['xoopsTpl']->assign('show_breadcrumbs', true); |
62
|
|
|
$GLOBALS['xoopsTpl']->assign('breadcrumb', '<li><a href="' . XOOPS_URL . '">' . _YOURHOME . '</a></li> <li class="active">' . $xoopsModule->name() . '</li>'); |
63
|
|
|
} |
64
|
|
|
/*end Modules options*/ |
65
|
|
|
|
66
|
|
|
$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; |
67
|
|
|
$GLOBALS['xoopsTpl']->assign('contact_uid', $uid); |
68
|
|
|
|
69
|
|
|
/* lang vars, added by goffy */ |
70
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_username', _MD_CONTACT_NAME); |
71
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_email', _MD_CONTACT_MAIL); |
72
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_url', _MD_CONTACT_URL); |
73
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_company', _MD_CONTACT_COMPANY); |
74
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_icq', _MD_CONTACT_ICQ_NAME); |
75
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_address', _MD_CONTACT_ADDRESS); |
76
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_location', _MD_CONTACT_LOCATION); |
77
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_phone', _MD_CONTACT_PHONE); |
78
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_skypename', _MD_CONTACT_SKYPE_NAME); |
79
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_department', _MD_CONTACT_DEPARTMENT); |
80
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_subject', _MD_CONTACT_SUBJECT); |
81
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_message', _MD_CONTACT_MESSAGE); |
82
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_submit', _MD_CONTACT_SUBMIT); |
83
|
|
|
|
84
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_username_info', _MD_CONTACT_NAME_INFO); |
85
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_email_info', _MD_CONTACT_MAIL_INFO); |
86
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_url_info', _MD_CONTACT_URL_INFO); |
87
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_company_info', _MD_CONTACT_COMPANY_INFO); |
88
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_address_info', _MD_CONTACT_ADDRESS_INFO); |
89
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_location_info', _MD_CONTACT_LOCATION_INFO); |
90
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_phone_info', _MD_CONTACT_PHONE_INFO); |
91
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_icq_info', _MD_CONTACT_ICQ_INFO); |
92
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_skypename_info', _MD_CONTACT_SKYPE_NAME_INFO); |
93
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_subject_info', _MD_CONTACT_SUBJECT_INFO); |
94
|
|
|
$GLOBALS['xoopsTpl']->assign('lng_message_info', _MD_CONTACT_MESSAGE_INFO); |
95
|
|
|
|
96
|
|
|
require XOOPS_ROOT_PATH . '/footer.php'; |
97
|
|
|
|