|
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
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
14
|
|
|
* @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
|
15
|
|
|
* @author XOOPS Development Team |
|
16
|
|
|
* @author Pascal Le Boustouller: original author ([email protected]) |
|
17
|
|
|
* @author Luc Bizet (www.frxoops.org) |
|
18
|
|
|
* @author jlm69 (www.jlmzone.com) |
|
19
|
|
|
* @author mamba (www.xoops.org) |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
use XoopsModules\Adslight\Helper; |
|
23
|
|
|
|
|
24
|
|
|
/** @var Helper $helper */ |
|
25
|
|
|
|
|
26
|
|
|
// <{$xoops_url}>/modules/adslight/maps/<{$block.mapsname}>/assets/images/map.png |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @param array $options |
|
30
|
|
|
* |
|
31
|
|
|
* @return array|false |
|
32
|
|
|
*/ |
|
33
|
|
|
function adslight_maps_show($options) |
|
|
|
|
|
|
34
|
|
|
{ |
|
35
|
|
|
if (!class_exists(Helper::class)) { |
|
36
|
|
|
return []; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
$helper = Helper::getInstance(); |
|
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
global $xoopsConfig, $block_lang; |
|
42
|
|
|
$maps_name = $xoopsConfig['language']; |
|
|
|
|
|
|
43
|
|
|
$block = []; |
|
44
|
|
|
$myts = \MyTextSanitizer::getInstance(); |
|
|
|
|
|
|
45
|
|
|
|
|
46
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
|
47
|
|
|
$block_lang = '_MB_' . mb_strtoupper($moduleDirName); |
|
48
|
|
|
|
|
49
|
|
|
$block['title'] = constant("{$block_lang}_TITLE"); |
|
50
|
|
|
//@todo - move language string to language file |
|
51
|
|
|
$block['imgmapsurl'] = '<a title="Recherche dans votre region" href="' . XOOPS_URL . '/modules/adslight/maps.php"><img src="' . XOOPS_URL . '/modules/adslight/maps/' . $xoopsConfig['language'] . '/assets/images/map.png" alt="Recherche dans votre region" border="0"></a><br>'; |
|
52
|
|
|
|
|
53
|
|
|
$block['link'] = '<a href="' . XOOPS_URL . "/modules/{$moduleDirName}/\"><b>" . constant("{$block_lang}_ALL_LISTINGS") . '</b></a><br>'; |
|
54
|
|
|
$block['add'] = '<a href="' . XOOPS_URL . "/modules/{$moduleDirName}/\"><b>" . constant("{$block_lang}_ADDNOW") . '</b></a><br>'; |
|
55
|
|
|
|
|
56
|
|
|
return $block; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @param array $options |
|
61
|
|
|
* |
|
62
|
|
|
* @return string html form to display |
|
63
|
|
|
*/ |
|
64
|
|
|
function adslight_maps_edit($options): string |
|
65
|
|
|
{ |
|
66
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
|
67
|
|
|
$block_lang = '_MB_' . mb_strtoupper($moduleDirName); |
|
68
|
|
|
|
|
69
|
|
|
$form = constant("{$block_lang}_ORDER") . " <select name='options[]'>"; |
|
70
|
|
|
$form .= "<option value='date_created'"; |
|
71
|
|
|
if ('date_created' === $options[0]) { |
|
72
|
|
|
$form .= ' selected'; |
|
73
|
|
|
} |
|
74
|
|
|
$form .= '>' . constant($block_lang . '_DATE') . "</option>\n"; |
|
75
|
|
|
|
|
76
|
|
|
$form .= "<option value='hits'"; |
|
77
|
|
|
if ('hits' === $options[0]) { |
|
78
|
|
|
$form .= ' selected'; |
|
79
|
|
|
} |
|
80
|
|
|
$form .= '>' . constant("{$block_lang}_HITS") . '</option>'; |
|
81
|
|
|
$form .= "</select>\n"; |
|
82
|
|
|
|
|
83
|
|
|
$form .= ' ' . constant("{$block_lang}_DISP") . " <input type='text' name='options[]' value='{$options[1]}'> " . constant("{$block_lang}_LISTINGS"); |
|
84
|
|
|
$form .= ' <br><br>' . constant("{$block_lang}_CHARS") . " <input type='text' name='options[]' value='{$options[2]}'> " . constant("{$block_lang}_LENGTH") . '<br><br>'; |
|
85
|
|
|
|
|
86
|
|
|
return $form; |
|
87
|
|
|
} |
|
88
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.