Categories   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
dl 0
loc 60
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getGroupsModeration() 0 5 1
A __construct() 0 9 1
A getGroupsRead() 0 5 1
A getForm() 0 6 1
A getGroupsSubmit() 0 5 1
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
use XoopsObject;
30
31
32
33
34
35
36
37
require_once \dirname(__DIR__) . '/include/common.php';
38
39
$moduleDirName = \basename(\dirname(__DIR__));
40
41
$permHelper = new \Xmf\Module\Helper\Permission($moduleDirName);
42
43
/**
44
 * Class Categories
45
 */
46
class Categories extends XoopsObject
47
{
48
    /**
49
     * Constructor
50
     *
51
     * @param null
52
     */
53
    public function __construct()
54
    {
55
        parent::__construct();
56
        $this->initVar('categoryID', \XOBJ_DTYPE_INT);
57
        $this->initVar('name', \XOBJ_DTYPE_TXTBOX);
58
        $this->initVar('description', \XOBJ_DTYPE_OTHER);
59
        $this->initVar('total', \XOBJ_DTYPE_INT);
60
        $this->initVar('weight', \XOBJ_DTYPE_INT);
61
        $this->initVar('logourl', \XOBJ_DTYPE_TXTBOX);
62
    }
63
64
    /**
65
     * Get form
66
     *
67
     * @param null
68
     * @return Lexikon\Form\CategoriesForm
69
     */
70
    public function getForm()
71
    {
72
73
        $form = new Form\CategoriesForm($this);
74
75
        return $form;
76
    }
77
78
    /**
79
     * @return array|null
80
     */
81
    public function getGroupsRead()
82
    {
83
        global $permHelper;
84
        //return $this->publisher->getHandler('permission')->getGrantedGroupsById('categories_read', categoryID);
85
        return $permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('categoryID'));
86
    }
87
88
    /**
89
     * @return array|null
90
     */
91
    public function getGroupsSubmit()
92
    {
93
        global $permHelper;
94
        //        return $this->publisher->getHandler('permission')->getGrantedGroupsById('categories_submit', categoryID);
95
        return $permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('categoryID'));
96
    }
97
98
    /**
99
     * @return array|null
100
     */
101
    public function getGroupsModeration()
102
    {
103
        global $permHelper;
104
        //        return $this->publisher->getHandler('permission')->getGrantedGroupsById('categories_moderation', categoryID);
105
        return $permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('categoryID'));
106
    }
107
}
108