XOOPS  2.6.0
permissions.php
Go to the documentation of this file.
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 
22 
23 include_once __DIR__ . '/admin_header.php';
24 
25 $moduleAdmin = new \Xoops\Module\Admin();
26 $moduleAdmin->displayNavigation('permissions.php');
27 
28 $helper = Helper::getHelper('debugbar');
31  // this is the name and item we are going to work with
32  $gperm_name='use_debugbar';
33  $gperm_itemid=0;
34 
35  // if this is a post operation get our variables
36  if ('POST'==Request::getMethod()) {
37  $name=$permHelper->defaultFieldName($gperm_name, $gperm_itemid);
38  $groups=Request::getVar($name, array(), $hash = 'POST');
39  $permHelper->savePermissionForItem($gperm_name, $gperm_itemid, $groups);
41  }
42 
43  $form = new \Xoops\Form\ThemeForm(_MA_DEBUGBAR_PERMISSION_FORM, 'form', '', 'POST');
44  $permElement = $permHelper->getGroupSelectFormForItem(
45  $gperm_name,
46  $gperm_itemid,
48  null,
49  true
50  );
51 
52  $form->addElement($permElement);
53  $form->addElement(new \Xoops\Form\Button('', 'submit', _MA_DEBUGBAR_FORM_SUBMIT, 'submit'));
54 
55  echo $form->render();
56 }
57 
58 include_once __DIR__ . '/admin_footer.php';
const _MA_DEBUGBAR_PERMISSION_FORM
Definition: admin.php:19
$helper
Definition: permissions.php:28
const _MA_DEBUGBAR_FORM_SUBMIT
Definition: admin.php:21
$form
Definition: xoops_code.php:21
const _MA_DEBUGBAR_PERMISSION_GROUPS
Definition: admin.php:20
$xoops
Definition: admin.php:25
const _MA_DEBUGBAR_FORM_PROCESSED
Definition: admin.php:22
$groups
$moduleAdmin
Definition: permissions.php:25
$permHelper
Definition: permissions.php:29