Completed
Push — master ( 266444...2ebe1b )
by Michael
01:31
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
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     http://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
require __DIR__ . '/../../mainfile.php';
24
require_once  __DIR__ . '/header.php';
25
$GLOBALS['xoopsOption']['template_main'] = 'contact_index.tpl';
26
//unset($_SESSION);
27
include XOOPS_ROOT_PATH . '/header.php';
28
global $xoopsModuleConfig, $xoopsModule;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
29
/*Modules Options*/
30
if ($xoopsModuleConfig['form_dept'] == 1) {
31
    // show a drop down with the correct departments listed
32
    $departmentlist = [];
33
    $departments    = xoops_getModuleOption('contact_dept', 'contact');
34
    foreach ($departments as $val) {
35
        list($name, $email) = explode(',', $val, 2); //split the name and email
36
        $departmentlist[] = $name;
37
    }
38
    $GLOBALS['xoopsTpl']->assign('depart', $xoopsModuleConfig['form_dept']);
39
    $GLOBALS['xoopsTpl']->assign('departments', $departmentlist);
40
}
41
$GLOBALS['xoopsTpl']->assign('recaptcha', $xoopsModuleConfig['recaptchause']);
42
$GLOBALS['xoopsTpl']->assign('recaptchakey', $xoopsModuleConfig['recaptchakey']);
43
$GLOBALS['xoopsTpl']->assign('url', $xoopsModuleConfig['form_url']);
44
$GLOBALS['xoopsTpl']->assign('icq', $xoopsModuleConfig['form_icq']);
45
$GLOBALS['xoopsTpl']->assign('skype', $xoopsModuleConfig['form_skype']);
46
$GLOBALS['xoopsTpl']->assign('company', $xoopsModuleConfig['form_company']);
47
$GLOBALS['xoopsTpl']->assign('location', $xoopsModuleConfig['form_location']);
48
$GLOBALS['xoopsTpl']->assign('phone', $xoopsModuleConfig['form_phone']);
49
$GLOBALS['xoopsTpl']->assign('address', $xoopsModuleConfig['form_address']);
50
51
$GLOBALS['xoopsTpl']->assign('map', $xoopsModuleConfig['embed_maps']);
52
/*end Modules options*/
53
54
$GLOBALS['xoopsTpl']->assign('breadcrumb', '<li><a href="' . XOOPS_URL . '">' . _YOURHOME . '</a></li> <li class="active">' . $xoopsModule->name().'</li>');
55
$GLOBALS['xoopsTpl']->assign('info', xoops_getModuleOption('contact_info', 'contact'));
56
$GLOBALS['xoopsTpl']->assign('contact_default', xoops_getModuleOption('contact_default', 'contact'));
57
58
/* lang vars, added by goffy */
59
$GLOBALS['xoopsTpl']->assign('lng_username', _MD_CONTACT_NAME);
60
$GLOBALS['xoopsTpl']->assign('lng_email', _MD_CONTACT_MAIL);
61
$GLOBALS['xoopsTpl']->assign('lng_url', _MD_CONTACT_URL);
62
$GLOBALS['xoopsTpl']->assign('lng_company', _MD_CONTACT_COMPANY);
63
$GLOBALS['xoopsTpl']->assign('lng_icq', _MD_CONTACT_ICQ_NAME);
64
$GLOBALS['xoopsTpl']->assign('lng_address', _MD_CONTACT_ADDRESS);
65
$GLOBALS['xoopsTpl']->assign('lng_location', _MD_CONTACT_LOCATION);
66
$GLOBALS['xoopsTpl']->assign('lng_phone', _MD_CONTACT_PHONE);
67
$GLOBALS['xoopsTpl']->assign('lng_skypename', _MD_CONTACT_SKYPE_NAME);
68
$GLOBALS['xoopsTpl']->assign('lng_department', _MD_CONTACT_DEPARTMENT);
69
$GLOBALS['xoopsTpl']->assign('lng_subject', _MD_CONTACT_SUBJECT);
70
$GLOBALS['xoopsTpl']->assign('lng_message', _MD_CONTACT_MESSAGE);
71
$GLOBALS['xoopsTpl']->assign('lng_submit', _MD_CONTACT_SUBMIT);
72
73
$GLOBALS['xoopsTpl']->assign('lng_username_info', _MD_CONTACT_NAME_INFO);
74
$GLOBALS['xoopsTpl']->assign('lng_email_info', _MD_CONTACT_MAIL_INFO);
75
$GLOBALS['xoopsTpl']->assign('lng_url_info', _MD_CONTACT_URL_INFO);
76
$GLOBALS['xoopsTpl']->assign('lng_company_info', _MD_CONTACT_COMPANY_INFO);
77
$GLOBALS['xoopsTpl']->assign('lng_address_info', _MD_CONTACT_ADDRESS_INFO);
78
$GLOBALS['xoopsTpl']->assign('lng_location_info', _MD_CONTACT_LOCATION_INFO);
79
$GLOBALS['xoopsTpl']->assign('lng_phone_info', _MD_CONTACT_PHONE_INFO);
80
$GLOBALS['xoopsTpl']->assign('lng_icq_info', _MD_CONTACT_ICQ_INFO);
81
$GLOBALS['xoopsTpl']->assign('lng_skypename_info', _MD_CONTACT_SKYPE_NAME_INFO);
82
$GLOBALS['xoopsTpl']->assign('lng_subject_info', _MD_CONTACT_SUBJECT_INFO);
83
$GLOBALS['xoopsTpl']->assign('lng_message_info', _MD_CONTACT_MESSAGE_INFO);
84
               
85
include XOOPS_ROOT_PATH . '/footer.php';
86