|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Lexikon; |
|
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: lexikon |
|
17
|
|
|
* |
|
18
|
|
|
* @category Module |
|
19
|
|
|
* @package lexikon |
|
20
|
|
|
* @author XOOPS Development Team <[email protected]> - <https://xoops.org> |
|
21
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
|
22
|
|
|
* @license GPL 2.0 or later |
|
23
|
|
|
* @link https://xoops.org/ |
|
24
|
|
|
* @since 1.0.0 |
|
25
|
|
|
*/ |
|
26
|
|
|
|
|
27
|
|
|
use Xmf\Module\Helper\Permission; |
|
28
|
|
|
use XoopsModules\Lexikon; |
|
29
|
|
|
|
|
30
|
|
|
require_once \dirname(__DIR__) . '/include/common.php'; |
|
31
|
|
|
|
|
32
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
|
33
|
|
|
|
|
34
|
|
|
$permHelper = new \Xmf\Module\Helper\Permission($moduleDirName); |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Class LexikonEntries |
|
38
|
|
|
*/ |
|
39
|
|
|
class Entries extends \XoopsObject |
|
40
|
|
|
{ |
|
41
|
|
|
/** |
|
42
|
|
|
* Constructor |
|
43
|
|
|
* |
|
44
|
|
|
* @param null |
|
45
|
|
|
*/ |
|
46
|
|
|
public function __construct() |
|
47
|
|
|
{ |
|
48
|
|
|
parent::__construct(); |
|
49
|
|
|
$this->initVar('entryID', \XOBJ_DTYPE_INT); |
|
50
|
|
|
$this->initVar('categoryID', \XOBJ_DTYPE_INT); |
|
51
|
|
|
$this->initVar('term', \XOBJ_DTYPE_TXTBOX); |
|
52
|
|
|
$this->initVar('init', \XOBJ_DTYPE_TXTBOX); |
|
53
|
|
|
$this->initVar('definition', \XOBJ_DTYPE_OTHER); |
|
54
|
|
|
$this->initVar('ref', \XOBJ_DTYPE_OTHER); |
|
55
|
|
|
$this->initVar('url', \XOBJ_DTYPE_TXTBOX); |
|
56
|
|
|
$this->initVar('uid', \XOBJ_DTYPE_INT); |
|
57
|
|
|
$this->initVar('submit', \XOBJ_DTYPE_INT); |
|
58
|
|
|
$this->initVar('datesub', \XOBJ_DTYPE_INT, time(), false); |
|
59
|
|
|
$this->initVar('counter', \XOBJ_DTYPE_INT); |
|
60
|
|
|
$this->initVar('html', \XOBJ_DTYPE_INT); |
|
61
|
|
|
$this->initVar('smiley', \XOBJ_DTYPE_INT); |
|
62
|
|
|
$this->initVar('xcodes', \XOBJ_DTYPE_INT); |
|
63
|
|
|
$this->initVar('breaks', \XOBJ_DTYPE_INT); |
|
64
|
|
|
$this->initVar('block', \XOBJ_DTYPE_INT); |
|
65
|
|
|
$this->initVar('offline', \XOBJ_DTYPE_INT); |
|
66
|
|
|
$this->initVar('notifypub', \XOBJ_DTYPE_INT); |
|
67
|
|
|
$this->initVar('request', \XOBJ_DTYPE_INT); |
|
68
|
|
|
$this->initVar('comments', \XOBJ_DTYPE_INT); |
|
69
|
|
|
// $this->initVar('item_tag', XOBJ_DTYPE_OTHER); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* Get form |
|
74
|
|
|
* |
|
75
|
|
|
* @param null |
|
76
|
|
|
* @return Form\EntriesForm |
|
77
|
|
|
*/ |
|
78
|
|
|
public function getForm() |
|
79
|
|
|
{ |
|
80
|
|
|
// require_once XOOPS_ROOT_PATH . '/modules/lexikon/class/form/entries.php'; |
|
81
|
|
|
|
|
82
|
|
|
$form = new Form\EntriesForm($this); |
|
83
|
|
|
|
|
84
|
|
|
return $form; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @return array|null |
|
89
|
|
|
*/ |
|
90
|
|
|
public function getGroupsRead() |
|
91
|
|
|
{ |
|
92
|
|
|
global $permHelper; |
|
93
|
|
|
//return $this->publisher->getHandler('permission')->getGrantedGroupsById('entries_read', entryID); |
|
94
|
|
|
return $permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('entryID')); |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* @return array|null |
|
99
|
|
|
*/ |
|
100
|
|
|
public function getGroupsSubmit() |
|
101
|
|
|
{ |
|
102
|
|
|
global $permHelper; |
|
103
|
|
|
// return $this->publisher->getHandler('permission')->getGrantedGroupsById('entries_submit', entryID); |
|
104
|
|
|
return $permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('entryID')); |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* @return array|null |
|
109
|
|
|
*/ |
|
110
|
|
|
public function getGroupsModeration() |
|
111
|
|
|
{ |
|
112
|
|
|
global $permHelper; |
|
113
|
|
|
// return $this->publisher->getHandler('permission')->getGrantedGroupsById('entries_moderation', entryID); |
|
114
|
|
|
return $permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('entryID')); |
|
115
|
|
|
} |
|
116
|
|
|
} |
|
117
|
|
|
|