upport 44dfccc - make group permission name split into parts

to be styleable as in 1.7, but here still unchanged by tags, since this may need to change some styles.
This commit is contained in:
Ian 2014-02-27 12:04:21 +01:00
parent ac22fec171
commit ce56d05d5d
2 changed files with 5 additions and 7 deletions

View File

@ -1,4 +1,4 @@
<?php # $Id:$
<?php #
if (IN_serendipity !== true) {
die ('Don\'t hack!');
@ -28,7 +28,6 @@ if (isset($_POST['SAVE_NEW']) && serendipity_checkFormToken()) {
$data['group'] = $group;
}
/* Edit a group */
if (isset($_POST['SAVE_EDIT']) && serendipity_checkFormToken()) {
$perms = serendipity_getAllPermissionNames();
@ -54,9 +53,6 @@ if ( $serendipity['GET']['adminAction'] != 'delete' ) {
$data['deleteFormToken'] = serendipity_setFormToken('url');
}
if ($serendipity['GET']['adminAction'] == 'edit' || isset($_POST['NEW']) || $serendipity['GET']['adminAction'] == 'new') {
if (isset($_POST['NEW']) || $serendipity['GET']['adminAction'] == 'new') {
$data['new'] = true;
@ -88,7 +84,9 @@ if ($serendipity['GET']['adminAction'] == 'edit' || isset($_POST['NEW']) || $ser
$data['perms'] = $perms;
foreach($perms AS $perm => $userlevels) {
if (defined('PERMISSION_' . strtoupper($perm))) {
$data['perms'][$perm]['permission_name'] = constant('PERMISSION_' . strtoupper($perm));
list($name, $note) = explode(":", constant('PERMISSION_' . strtoupper($perm)));
$data['perms'][$perm]['permission_name'] = $name;
$data['perms'][$perm]['permission_note'] = $note;
} else {
$data['perms'][$perm]['permission_name'] = $perm;
}

View File

@ -81,7 +81,7 @@
{else}
<div class="form_check">
<input id="{{$perm@key}|escape:"html"}" name="serendipity[{{$perm@key}|escape:"html"}]" type="checkbox" value="true"{if isset({$from.{$perm@key}}) && {$from.{$perm@key}} == "true"} checked="checked"{/if}>
<label for="{{$perm@key}|escape:"html"}">{$perm.permission_name|escape:"html"}</label>
<label for="{{$perm@key}|escape:"html"}">{$perm.permission_name|escape:"html"}: {$perm.permission_note|escape:"html"}</label>
</div>
{/if}
{/foreach}