Skip to content

Commit

Permalink
Add help permission
Browse files Browse the repository at this point in the history
  • Loading branch information
aerograf committed Sep 15, 2017
1 parent a616f4d commit 0b8025b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 7 additions & 7 deletions admin/admin_permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function render()
if ('' !== $elements[$i]->getDescription()) {
$ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
}
$ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
$ret .= "</td>\n<td class='even' style='text-align:center;'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
} else {
$hidden .= $elements[$i]->render();
}
Expand Down Expand Up @@ -214,7 +214,7 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
xoops_cp_header();
$adminObject->displayNavigation(basename(__FILE__));
echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', 'get');
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_TEMPLAT, 'actionform', 'admin_permissions.php', 'get');
$op_select = new XoopsFormSelect('', 'action');
$op_select->setExtra('onchange="document.forms.actionform.submit()"');
$op_select->addOptionArray([
Expand Down Expand Up @@ -260,16 +260,16 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
$ret = '<h4>' . _AM_NEWBB_PERM_TEMPLATE . '</h4>' . _AM_NEWBB_PERM_TEMPLATE_DESC . '<br><br><br>';
$ret .= "<form name='template' id='template' method='post'>\n<table width='100%' class='outer' cellspacing='1'>\n";
$ret .= implode("\n", $elements);
$ret .= '<tr align="left" valign="top"><td class="head"></td><td class="even">';
$ret .= '<tr align="left" valign="top"><td class="head"></td><td class="even" style="text-align:center;">';
$ret .= $tray->render();
$ret .= '</td></tr>';
$ret .= '</table></form>';
echo $ret;
include_once __DIR__ . '/admin_footer.php';
break;

case 'template_save':
// $res = $newbbpermHandler->setTemplate($_POST['perms'], $groupid = 0);
// $res = $newbbpermHandler->setTemplate($_POST['perms'], $groupid = 0);
$res = $newbbpermHandler->setTemplate(Request::getArray('perms', '', 'POST'), $groupid = 0);
if ($res) {
redirect_header('admin_permissions.php', 2, _AM_NEWBB_PERM_TEMPLATE_CREATED);
Expand All @@ -287,7 +287,7 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
xoops_cp_header();
$adminObject->displayNavigation(basename(__FILE__));
echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', 'get');
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_APPLY, 'actionform', 'admin_permissions.php', 'get');
$op_select = new XoopsFormSelect('', 'action');
$op_select->setExtra('onchange="document.forms.actionform.submit()"');
$op_select->addOptionArray([
Expand Down Expand Up @@ -365,7 +365,7 @@ public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])

$adminObject->displayNavigation(basename(__FILE__));
echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', 'get');
$opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP, 'actionform', 'admin_permissions.php', 'get');
$op_select = new XoopsFormSelect('', 'action');
$op_select->setExtra('onchange="document.forms.actionform.submit()"');
$op_select->addOptionArray([
Expand Down
3 changes: 3 additions & 0 deletions language/english/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@
define('_AM_NEWBB_PERM_TEMPLATEAPP', 'Apply default permission');
define('_AM_NEWBB_PERM_TEMPLATE_APPLIED', 'Default permissions have been applied to forums');
define('_AM_NEWBB_PERM_ACTION', 'Permission management tools');
define('_AM_NEWBB_PERM_ACTION_HELP', 'Allows you to set the access rights for each function and group');
define('_AM_NEWBB_PERM_ACTION_HELP_TEMPLAT', 'Allows you to create an access rights template for automatic installation when creating a forum.');
define('_AM_NEWBB_PERM_ACTION_HELP_APPLY', 'Allows you to apply a permission template to already created forums.');
define('_AM_NEWBB_PERM_SETBYGROUP', 'Set permissions directly by group');
// admin_forum_prune.php
define('_AM_NEWBB_PRUNE_RESULTS_TITLE', 'Prune Results');
Expand Down

0 comments on commit 0b8025b

Please sign in to comment.