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