1
|
|
|
<?php namespace XoopsModules\Newbb; |
2
|
|
|
|
3
|
|
|
use XoopsModules\Newbb; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class GroupPermForm |
7
|
|
|
* @package XoopsModules\Newbb |
8
|
|
|
*/ |
9
|
|
|
class GroupPermForm extends \XoopsGroupPermForm |
|
|
|
|
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* @param $title |
13
|
|
|
* @param $modid |
14
|
|
|
* @param $permname |
15
|
|
|
* @param $permdesc |
16
|
|
|
* @param string $url |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
public function __construct($title, $modid, $permname, $permdesc, $url = '') |
20
|
|
|
{ |
21
|
|
|
parent::__construct($title, $modid, $permname, $permdesc, $url); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @param $title |
26
|
|
|
* @param $modid |
27
|
|
|
* @param $permname |
28
|
|
|
* @param $permdesc |
29
|
|
|
* @param string $url |
30
|
|
|
*/ |
31
|
|
|
|
32
|
|
|
/* |
|
|
|
|
33
|
|
|
public function newbb_XoopsGroupPermForm($title, $modid, $permname, $permdesc, $url = "") |
34
|
|
|
{ |
35
|
|
|
// $this->XoopsGroupPermForm($title, $modid, $permname, $permdesc, $url); |
36
|
|
|
self::__construct($title, $modid, $permname, $permdesc, $url); |
37
|
|
|
} |
38
|
|
|
*/ |
39
|
|
|
/** |
40
|
|
|
* @return string |
41
|
|
|
*/ |
42
|
|
|
public function render() |
43
|
|
|
{ |
44
|
|
|
// load all child ids for javascript codes |
45
|
|
|
foreach (array_keys($this->_itemTree) as $item_id) { |
46
|
|
|
$this->_itemTree[$item_id]['allchild'] = []; |
|
|
|
|
47
|
|
|
$this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']); |
48
|
|
|
} |
49
|
|
|
/** @var \XoopsGroupPermHandler $gpermHandler */ |
50
|
|
|
$gpermHandler = xoops_getHandler('groupperm'); |
|
|
|
|
51
|
|
|
/** @var \XoopsMemberHandler $memberHandler */ |
52
|
|
|
$memberHandler = xoops_getHandler('member'); |
53
|
|
|
$glist = $memberHandler->getGroupList(); |
54
|
|
|
foreach (array_keys($glist) as $i) { |
55
|
|
|
// get selected item id(s) for each group |
56
|
|
|
$selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid); |
57
|
|
|
$ele = new Newbb\GroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
58
|
|
|
$ele->setOptionTree($this->_itemTree); |
59
|
|
|
$this->addElement($ele); |
60
|
|
|
unset($ele); |
61
|
|
|
} |
62
|
|
|
$tray = new \XoopsFormElementTray(''); |
|
|
|
|
63
|
|
|
$tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
|
|
|
|
64
|
|
|
$tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset')); |
|
|
|
|
65
|
|
|
$this->addElement($tray); |
66
|
|
|
$ret = '<br><strong>' . $this->getTitle() . '</strong><br>' . $this->_permDesc . '<br>'; |
67
|
|
|
$ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1' valign='top'>\n"; |
68
|
|
|
$elements = $this->getElements(); |
69
|
|
|
$hidden = ''; |
70
|
|
|
foreach (array_keys($elements) as $i) { |
71
|
|
|
if (!is_object($elements[$i])) { |
72
|
|
|
$ret .= $elements[$i]; |
73
|
|
|
} elseif (!$elements[$i]->isHidden()) { |
74
|
|
|
$ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption(); |
75
|
|
|
if ('' !== $elements[$i]->getDescription()) { |
76
|
|
|
$ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; |
77
|
|
|
} |
78
|
|
|
$ret .= "</td>\n<td class='even' style='text-align:center;'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; |
79
|
|
|
} else { |
80
|
|
|
$hidden .= $elements[$i]->render(); |
81
|
|
|
} |
82
|
|
|
} |
83
|
|
|
$ret .= "</table>$hidden</form>"; |
84
|
|
|
$ret .= $this->renderValidationJS(true); |
85
|
|
|
|
86
|
|
|
return $ret; |
87
|
|
|
} |
88
|
|
|
} |
89
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths