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 | * wgSitenotice module for xoops |
||
13 | * |
||
14 | * @copyright XOOPS Project (https://xoops.org) |
||
15 | * @license GPL 2.0 or later |
||
16 | * @package wgsitenotice |
||
17 | * @since 1.0 |
||
18 | * @min_xoops 2.5.7 |
||
19 | * @author Goffy (wedega.com) - Email:<[email protected]> - Website:<http://wedega.com> |
||
20 | * @param $options |
||
21 | * @return array |
||
22 | */ |
||
23 | |||
24 | // Function show block form only |
||
25 | function block_contact_form_show($options) |
||
0 ignored issues
–
show
|
|||
26 | { |
||
27 | $block = []; |
||
28 | contactGetElements($block); |
||
29 | |||
30 | return $block; |
||
31 | } |
||
32 | |||
33 | // Function show block map |
||
34 | /** |
||
35 | * @param $options |
||
36 | * @return array |
||
37 | */ |
||
38 | function block_contact_map_show($options) |
||
0 ignored issues
–
show
|
|||
39 | { |
||
40 | $block = []; |
||
41 | contactGetElements($block); |
||
42 | |||
43 | return $block; |
||
44 | } |
||
45 | |||
46 | // Function show block form and map |
||
47 | /** |
||
48 | * @param $options |
||
49 | * @return array |
||
50 | */ |
||
51 | function block_contact_form_map_show($options) |
||
0 ignored issues
–
show
|
|||
52 | { |
||
53 | $block = []; |
||
54 | contactGetElements($block); |
||
55 | |||
56 | return $block; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param $block |
||
61 | */ |
||
62 | function contactGetElements(&$block) |
||
63 | { |
||
64 | /** @var XoopsModuleHandler $moduleHandler */ |
||
65 | $moduleHandler = xoops_getHandler('module'); |
||
66 | $xoopsModule = $moduleHandler->getByDirname('contact'); |
||
67 | /** @var XoopsConfigHandler $configHandler */ |
||
68 | $configHandler = xoops_getHandler('config'); |
||
69 | $xoopsModuleConfig = $configHandler->getConfigsByCat(0, $xoopsModule->mid()); |
||
70 | |||
71 | xoops_loadLanguage('main', 'contact'); |
||
72 | |||
73 | require_once XOOPS_ROOT_PATH . '/modules/contact/class/contact.php'; |
||
74 | |||
75 | $block['lng_username'] = 'name'; |
||
76 | |||
77 | /*Modules Options*/ |
||
78 | if ($xoopsModuleConfig['form_dept'] == 1) { |
||
79 | // show a drop down with the correct departments listed |
||
80 | $departmentlist = []; |
||
81 | $departments = xoops_getModuleOption('contact_dept', 'contact'); |
||
82 | foreach ($departments as $val) { |
||
83 | list($name, $email) = explode(',', $val, 2); //split the name and email |
||
0 ignored issues
–
show
The assignment to
$email is unused. Consider omitting it like so list($first,,$third) .
This checks looks for assignemnts to variables using the Consider the following code example. <?php
function returnThreeValues() {
return array('a', 'b', 'c');
}
list($a, $b, $c) = returnThreeValues();
print $a . " - " . $c;
Only the variables Instead, the list call could have been. list($a,, $c) = returnThreeValues();
Loading history...
|
|||
84 | array_push($departmentlist, $name); |
||
85 | } |
||
86 | $block['depart'] = $xoopsModuleConfig['form_dept']; |
||
87 | $block['departments'] = $departmentlist; |
||
88 | } |
||
89 | $block['recaptcha'] = $xoopsModuleConfig['recaptchause']; |
||
90 | $block['recaptchakey'] = $xoopsModuleConfig['recaptchakey']; |
||
91 | $block['url'] = $xoopsModuleConfig['form_url']; |
||
92 | $block['icq'] = $xoopsModuleConfig['form_icq']; |
||
93 | $block['skype'] = $xoopsModuleConfig['form_skype']; |
||
94 | $block['company'] = $xoopsModuleConfig['form_company']; |
||
95 | $block['location'] = $xoopsModuleConfig['form_location']; |
||
96 | $block['phone'] = $xoopsModuleConfig['form_phone']; |
||
97 | $block['address'] = $xoopsModuleConfig['form_address']; |
||
98 | $block['info'] = $xoopsModuleConfig['contact_info']; |
||
99 | $block['contact_default'] = $xoopsModuleConfig['contact_default']; |
||
100 | $block['map'] = $xoopsModuleConfig['embed_maps']; |
||
101 | /*end Modules options*/ |
||
102 | |||
103 | /* get language vars*/ |
||
104 | $block['lng_username'] = _MD_CONTACT_NAME; |
||
105 | $block['lng_email'] = _MD_CONTACT_MAIL; |
||
106 | $block['lng_url'] = _MD_CONTACT_URL; |
||
107 | $block['lng_company'] = _MD_CONTACT_COMPANY; |
||
108 | $block['lng_icq'] = _MD_CONTACT_ICQ_NAME; |
||
109 | $block['lng_address'] = _MD_CONTACT_ADDRESS; |
||
110 | $block['lng_location'] = _MD_CONTACT_LOCATION; |
||
111 | $block['lng_phone'] = _MD_CONTACT_PHONE; |
||
112 | $block['lng_skypename'] = _MD_CONTACT_SKYPE_NAME; |
||
113 | $block['lng_department'] = _MD_CONTACT_DEPARTMENT; |
||
114 | $block['lng_subject'] = _MD_CONTACT_SUBJECT; |
||
115 | $block['lng_message'] = _MD_CONTACT_MESSAGE; |
||
116 | $block['lng_submit'] = _MD_CONTACT_SUBMIT; |
||
117 | |||
118 | $block['lng_username_info'] = _MD_CONTACT_NAME_INFO; |
||
119 | $block['lng_email_info'] = _MD_CONTACT_MAIL_INFO; |
||
120 | $block['lng_url_info'] = _MD_CONTACT_URL_INFO; |
||
121 | $block['lng_company_info'] = _MD_CONTACT_COMPANY_INFO; |
||
122 | $block['lng_address_info'] = _MD_CONTACT_ADDRESS_INFO; |
||
123 | $block['lng_location_info'] = _MD_CONTACT_LOCATION_INFO; |
||
124 | $block['lng_phone_info'] = _MD_CONTACT_PHONE_INFO; |
||
125 | $block['lng_icq_info'] = _MD_CONTACT_ICQ_INFO; |
||
126 | $block['lng_skypename_info'] = _MD_CONTACT_SKYPE_NAME_INFO; |
||
127 | $block['lng_subject_info'] = _MD_CONTACT_SUBJECT_INFO; |
||
128 | $block['lng_message_info'] = _MD_CONTACT_MESSAGE_INFO; |
||
129 | } |
||
130 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.