1
|
|
|
<?php namespace Xoopsmodules\randomquote; |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
You may not change or alter any portion of this comment or credits |
5
|
|
|
of supporting developers from this source code or any supporting source code |
6
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
7
|
|
|
|
8
|
|
|
This program is distributed in the hope that it will be useful, |
9
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11
|
|
|
*/ |
12
|
|
|
/** |
13
|
|
|
* Module: randomquote |
14
|
|
|
* |
15
|
|
|
* @category Module |
16
|
|
|
* @package randomquote |
17
|
|
|
* @author XOOPS Development Team <[email protected]> - <https://xoops.org> |
18
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
19
|
|
|
* @license GPL 2.0 or later |
20
|
|
|
* @link https://xoops.org/ |
21
|
|
|
* @since 1.0.0 |
22
|
|
|
*/ |
23
|
|
|
use Xoopsmodules\randomquote; |
24
|
|
|
use Xoopsmodules\randomquote\form; |
25
|
|
|
|
26
|
|
|
$moduleDirName = basename(dirname(__DIR__)); |
27
|
|
|
|
28
|
|
|
$permHelper = new \Xmf\Module\Helper\Permission(); |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Class Category |
32
|
|
|
*/ |
33
|
|
|
class Category extends \XoopsObject |
34
|
|
|
{ |
35
|
|
|
/** |
36
|
|
|
* Constructor |
37
|
|
|
* |
38
|
|
|
* @param null |
39
|
|
|
*/ |
40
|
|
|
public function __construct() |
41
|
|
|
{ |
42
|
|
|
parent::__construct(); |
43
|
|
|
$this->initVar('id', XOBJ_DTYPE_INT); |
44
|
|
|
$this->initVar('pid', XOBJ_DTYPE_INT); |
45
|
|
|
$this->initVar('title', XOBJ_DTYPE_TXTBOX); |
46
|
|
|
$this->initVar('description', XOBJ_DTYPE_OTHER); |
47
|
|
|
$this->initVar('image', XOBJ_DTYPE_TXTBOX); |
48
|
|
|
$this->initVar('weight', XOBJ_DTYPE_INT); |
49
|
|
|
$this->initVar('color', XOBJ_DTYPE_TXTBOX); |
50
|
|
|
$this->initVar('online', XOBJ_DTYPE_INT); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Get form |
55
|
|
|
* |
56
|
|
|
* @return \Xoopsmodules\randomquote\form\CategoryForm |
57
|
|
|
*/ |
58
|
|
|
public function getForm() |
59
|
|
|
{ |
60
|
|
|
require_once XOOPS_ROOT_PATH . '/modules/randomquote/class/form/CategoryForm.php'; |
61
|
|
|
|
62
|
|
|
$form = new form\CategoryForm($this); |
63
|
|
|
return $form; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return array|null |
68
|
|
|
*/ |
69
|
|
|
public function getGroupsRead() |
70
|
|
|
{ |
71
|
|
|
global $permHelper; |
72
|
|
|
//return $this->publisher->getHandler('permission')->getGrantedGroupsById('category_read', id); |
73
|
|
|
return $permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('id')); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return array|null |
78
|
|
|
*/ |
79
|
|
|
public function getGroupsSubmit() |
80
|
|
|
{ |
81
|
|
|
global $permHelper; |
82
|
|
|
// return $this->publisher->getHandler('permission')->getGrantedGroupsById('category_submit', id); |
83
|
|
|
return $permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('id')); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return array|null |
88
|
|
|
*/ |
89
|
|
|
public function getGroupsModeration() |
90
|
|
|
{ |
91
|
|
|
global $permHelper; |
92
|
|
|
// return $this->publisher->getHandler('permission')->getGrantedGroupsById('category_moderation', id); |
93
|
|
|
return $permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('id')); |
94
|
|
|
} |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
|