Commit 9205427c authored by Franco Fichtner's avatar Franco Fichtner

system: simplify ACL translation for #1037

parent 7526194b
......@@ -100,10 +100,6 @@ class ACL
if (isset($ACLnode->name)) {
$aclPayload = array();
$aclPayload['name'] = (string)$ACLnode->name;
if (isset($ACLnode->description)) {
// rename internal tag for backward compat.
$aclPayload['descr'] = (string)$ACLnode->description;
}
if (isset($ACLnode->patterns->pattern)) {
// rename pattern to match for internal usage, old code did use match and
// to avoid duplicate conversion let's do this only on input.
......@@ -254,8 +250,8 @@ class ACL
foreach ($this->ACLtags as $aclKey => $aclItem) {
$priv_list[$aclKey] = array();
foreach ($aclItem as $propName => $propValue) {
if ($propName == 'name' || $propName == 'descr') {
// translate name and description tags
if ($propName == 'name') {
// translate name tag
$priv_list[$aclKey][$propName] = gettext($propValue);
} else {
$priv_list[$aclKey][$propName] = $propValue;
......
......@@ -666,16 +666,29 @@ $( document ).ready(function() {
<td>
<table class="table table-hover table-condensed">
<tr>
<td><b><?=gettext("Inherited From");?></b></td>
<td><b><?=gettext("Inherited from");?></b></td>
<td><b><?=gettext("Type");?></b></td>
<td><b><?=gettext("Name");?></b></td>
<td><b><?=gettext("Description");?></b></td>
</tr>
<?php
foreach (get_user_privdesc($a_user[$id]) as $priv) :?>
<tr>
<td><?=!empty($priv['group']) ? $priv['group'] : ""?></td>
<td><?=!empty($priv['group']) ? $priv['group'] : ''?></td>
<td>
<?php
switch (substr($id, 0, 5)) {
case 'page-':
echo gettext('GUI');
break;
case 'user-':
echo gettext('System');
break;
default:
echo gettext('Unknown');
break;
} ?>
</td>
<td><?=$priv['name']?></td>
<td><?=!empty($priv['descr']) ? $priv['descr'] : ""?></td>
</tr>
<?php
endforeach;?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment