1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
You may not change or alter any portion of this comment or credits |
4
|
|
|
of supporting developers from this source code or any supporting source code |
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
|
11
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
12
|
|
|
* @package alumni |
13
|
|
|
* @since 2.6.0 |
14
|
|
|
* @author John Mordo - jlm69 |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
use Xmf\Request; |
18
|
|
|
|
19
|
|
|
include __DIR__ . '/header.php'; |
20
|
|
|
|
21
|
|
|
$xoops = Xoops::getInstance(); |
22
|
|
|
$op = Request::getString('op', 'alumni_view'); |
23
|
|
|
$xoops->header(); |
24
|
|
|
$admin_page = new Xoops\Module\Admin(); |
25
|
|
|
$admin_page->displayNavigation('groupperm.php'); |
26
|
|
|
$moduleId = $xoops->module->getVar('mid'); |
27
|
|
|
$categoriesHandler = $xoops->getModuleHandler('category', 'alumni'); |
28
|
|
|
$cats = $categoriesHandler->getAll(); |
29
|
|
|
$cat_rows = $categoriesHandler->getCount(); |
30
|
|
|
|
31
|
|
|
include_once XOOPS_ROOT_PATH . "/modules/{$moduleDirName}/class/alumni_tree.php"; |
32
|
|
|
$cattree = new AlumniObjectTree($cats, 'cid', 'pid'); |
33
|
|
|
|
34
|
|
|
if ('0' == $cat_rows) { |
35
|
|
|
echo constant($modinfo_lang . '_MUST_ADD_CAT'); |
|
|
|
|
36
|
|
|
} else { |
37
|
|
|
$perm_desc = ''; |
38
|
|
|
switch ($op) { |
39
|
|
|
|
40
|
|
|
case 'alumni_view': |
41
|
|
View Code Duplication |
default: |
42
|
|
|
$title_of_form = constant($modinfo_lang . '_VIEWFORM'); |
43
|
|
|
$perm_name = 'alumni_view'; |
44
|
|
|
$restriction = ''; |
45
|
|
|
$anonymous = true; |
46
|
|
|
$form = new XoopsGroupPermForm($title_of_form, $moduleId, $perm_name, $perm_desc, 'admin/groupperm.php', $anonymous); |
47
|
|
|
break; |
48
|
|
|
|
49
|
|
|
case 'alumni_submit': |
50
|
|
View Code Duplication |
default: |
51
|
|
|
$title_of_form = constant($modinfo_lang . '_SUBMITFORM'); |
52
|
|
|
$perm_name = 'alumni_submit'; |
53
|
|
|
$restriction = ''; |
54
|
|
|
$anonymous = false; |
55
|
|
|
$form = new XoopsGroupPermForm($title_of_form, $moduleId, $perm_name, $perm_desc, 'admin/groupperm.php', $anonymous); |
56
|
|
|
break; |
57
|
|
|
|
58
|
|
View Code Duplication |
case 'alumni_premium': |
59
|
|
|
$title_of_form = constant($modinfo_lang . '_PREMIUM'); |
60
|
|
|
$perm_name = 'alumni_premium'; |
61
|
|
|
$restriction = ''; |
62
|
|
|
$anonymous = false; |
63
|
|
|
$form = new XoopsGroupPermForm($title_of_form, $moduleId, $perm_name, $perm_desc, 'admin/groupperm.php', $anonymous); |
64
|
|
|
break; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
$opform = new XoopsSimpleForm('', 'opform', 'groupperm.php', 'get'); |
68
|
|
|
$opSelect = new XoopsFormSelect('', 'op', $op); |
69
|
|
|
$opSelect->setExtra('onchange="document.forms.opform.submit()"'); |
70
|
|
|
$opSelect->addOption('alumni_view', constant($modinfo_lang . '_VIEWFORM')); |
|
|
|
|
71
|
|
|
$opSelect->addOption('alumni_submit', constant($modinfo_lang . '_SUBMITFORM')); |
|
|
|
|
72
|
|
|
$opSelect->addOption('alumni_premium', constant($modinfo_lang . '_PREMIUM')); |
|
|
|
|
73
|
|
|
$opform->addElement($opSelect); |
74
|
|
|
$opform->display(); |
75
|
|
|
|
76
|
|
View Code Duplication |
foreach (array_keys($cats) as $i) { |
77
|
|
|
$cid = $cats[$i]->getVar('cid'); |
78
|
|
|
$title = $cats[$i]->getVar('title'); |
79
|
|
|
$pid = $cats[$i]->getVar('pid'); |
80
|
|
|
$allcats = $cattree->alumni_makeArrayTree($cats[$i]->getVar('cid')); |
81
|
|
|
$form->addItem($cid, $title, $pid); |
82
|
|
|
} |
83
|
|
|
$form->display(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
$xoops->footer(); |
87
|
|
|
|
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.