1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace XoopsModules\Adslight; |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
You may not change or alter any portion of this comment or credits |
7
|
|
|
of supporting developers from this source code or any supporting source code |
8
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
9
|
|
|
|
10
|
|
|
This program is distributed in the hope that it will be useful, |
11
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Module: Adslight |
17
|
|
|
* |
18
|
|
|
* @category Module |
19
|
|
|
* @author XOOPS Development Team <https://xoops.org> |
20
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
21
|
|
|
* @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
use XoopsModules\Adslight\{ |
25
|
|
|
Form |
26
|
|
|
}; |
27
|
|
|
|
28
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Class Price |
32
|
|
|
*/ |
33
|
|
|
class Price extends \XoopsObject |
34
|
|
|
{ |
35
|
|
|
private $id_price; |
|
|
|
|
36
|
|
|
private $nom_price; |
|
|
|
|
37
|
|
|
public $helper; |
38
|
|
|
public $permHelper; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Constructor |
42
|
|
|
* |
43
|
|
|
* @param null |
44
|
|
|
*/ |
45
|
|
|
public function __construct() |
46
|
|
|
{ |
47
|
|
|
parent::__construct(); |
48
|
|
|
// /** @var Adslight\Helper $helper */ |
49
|
|
|
// $this->helper = Adslight\Helper::getInstance(); |
50
|
|
|
$this->permHelper = new \Xmf\Module\Helper\Permission(); |
51
|
|
|
|
52
|
|
|
$this->initVar('id_price', \XOBJ_DTYPE_INT); |
53
|
|
|
$this->initVar('nom_price', \XOBJ_DTYPE_TXTBOX); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Get form |
58
|
|
|
* |
59
|
|
|
* @param null |
60
|
|
|
* @return Form\PriceForm |
61
|
|
|
*/ |
62
|
|
|
public function getForm(): Form\PriceForm |
63
|
|
|
{ |
64
|
|
|
$form = new Form\PriceForm($this); |
65
|
|
|
|
66
|
|
|
return $form; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @return array|null |
71
|
|
|
*/ |
72
|
|
|
public function getGroupsRead(): ?array |
73
|
|
|
{ |
74
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
75
|
|
|
return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('id_price')); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return array|null |
80
|
|
|
*/ |
81
|
|
|
public function getGroupsSubmit(): ?array |
82
|
|
|
{ |
83
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
84
|
|
|
return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('id_price')); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return array|null |
89
|
|
|
*/ |
90
|
|
|
public function getGroupsModeration(): ?array |
91
|
|
|
{ |
92
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
93
|
|
|
return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('id_price')); |
94
|
|
|
} |
95
|
|
|
} |
96
|
|
|
|