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
|
|
|
use XoopsModules\Adslight\Tree; |
24
|
|
|
|
25
|
|
|
/** @var Helper $helper */ |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @return array|false |
29
|
|
|
*/ |
30
|
|
|
function b_adslight_add() |
31
|
|
|
{ |
32
|
|
|
if (!class_exists(Helper::class)) { |
33
|
|
|
return []; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
$helper = Helper::getInstance(); |
|
|
|
|
37
|
|
|
global $xoopsDB; |
38
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
39
|
|
|
xoops_loadLanguage('main', $moduleDirName); |
40
|
|
|
$myTree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid'); |
41
|
|
|
$jump = XOOPS_URL . '/modules/adslight/addlisting.php?cid='; |
42
|
|
|
ob_start(); |
43
|
|
|
$myTree->makeMySelBox('title', 'title', 0, 1, 'pid', "location=\"{$jump}\"+this.options[this.selectedIndex].value"); |
44
|
|
|
$block['selectbox'] = ob_get_clean(); |
|
|
|
|
45
|
|
|
|
46
|
|
|
return $block; |
47
|
|
|
} |
48
|
|
|
|