Merge branch 'v1.2-dev' of https://github.com/humhub/humhub into v1.2-dev

This commit is contained in:
buddh4 2017-01-26 16:10:11 +01:00
commit 9c354fbde1
3 changed files with 8 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class DropDownGridColumn extends DataColumn
if ($readonly) {
if (isset($options[$model[$this->attribute]])) {
return $options[$model[$this->attribute]];
return Html::dropDownList($inputName, $model[$this->attribute], $options, array_merge($this->htmlOptions, ['readonly' => true, 'disabled' => true]));
}
return $model[$this->attribute];
}

View File

@ -4,6 +4,6 @@ use humhub\modules\user\widgets\PermissionGridEditor;
?>
<?php $this->beginContent('@admin/views/group/_manageLayout.php', ['group' => $group]) ?>
<div class="panel-body">
<?= PermissionGridEditor::widget(['permissionManager' => Yii::$app->user->permissionManager, 'groupId' => $group->id]); ?>
<?= PermissionGridEditor::widget(['permissionManager' => Yii::$app->user->permissionManager, 'groupId' => $group->id, 'hideFixedPermissions' => false]); ?>
</div>
<?php $this->endContent(); ?>

View File

@ -21,6 +21,11 @@ use humhub\libs\Html;
class PermissionGridEditor extends GridView
{
/**
* @var boolean hide not changeable permissions
*/
public $hideFixedPermissions = true;
/**
* @inheritdoc
*/
@ -104,7 +109,7 @@ class PermissionGridEditor extends GridView
protected function getDataProvider()
{
return new ArrayDataProvider([
'allModels' => $this->permissionManager->createPermissionArray($this->groupId, true),
'allModels' => $this->permissionManager->createPermissionArray($this->groupId, $this->hideFixedPermissions),
'sort' => [
'attributes' => ['title', 'description', 'moduleId'],
],