mirror of
https://github.com/humhub/humhub.git
synced 2025-03-04 15:19:06 +01:00
Added Group Admin Menu Widget
This commit is contained in:
parent
5b5a171405
commit
5d70df3081
@ -7,15 +7,12 @@ use humhub\widgets\GridView;
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><?php echo Yii::t('AdminModule.views_group_index', '<strong>Manage</strong> groups'); ?></div>
|
||||
<div class="panel-body">
|
||||
|
||||
<?= \humhub\modules\admin\widgets\GroupMenu::widget(); ?>
|
||||
<p />
|
||||
<p>
|
||||
<?php echo Yii::t('AdminModule.views_groups_index', 'You can split users into different groups (for teams, departments etc.) and define standard spaces and admins for them.'); ?>
|
||||
</p>
|
||||
|
||||
<?php echo Html::a(Yii::t('AdminModule.views_groups_index', "Create new group"), Url::toRoute('edit'), array('class' => 'btn btn-primary')); ?>
|
||||
<br>
|
||||
|
||||
|
||||
<?php
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
|
44
protected/humhub/modules/admin/widgets/GroupMenu.php
Normal file
44
protected/humhub/modules/admin/widgets/GroupMenu.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\modules\admin\widgets;
|
||||
|
||||
use Yii;
|
||||
use yii\helpers\Url;
|
||||
use humhub\models\Setting;
|
||||
|
||||
/**
|
||||
* Group Administration Menu
|
||||
*/
|
||||
class GroupMenu extends \humhub\widgets\BaseMenu
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $template = "@humhub/widgets/views/tabMenu";
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->addItem(array(
|
||||
'label' => Yii::t('AdminModule.views_user_index', 'Overview'),
|
||||
'url' => Url::toRoute(['/admin/group/index']),
|
||||
'sortOrder' => 100,
|
||||
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'group' && Yii::$app->controller->action->id == 'index'),
|
||||
));
|
||||
$this->addItem(array(
|
||||
'label' => Yii::t('AdminModule.views_groups_index', "Create new group"),
|
||||
'url' => Url::toRoute(['/admin/group/edit']),
|
||||
'sortOrder' => 200,
|
||||
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'group' && Yii::$app->controller->action->id == 'edit'),
|
||||
));
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
}
|
@ -31,25 +31,25 @@ class MemberMenu extends \humhub\widgets\BaseMenu
|
||||
|
||||
$this->addItem(array(
|
||||
'label' => 'Members',
|
||||
'url' => $this->space->createUrl('index'),
|
||||
'url' => $this->space->createUrl('/space/manage/member/index'),
|
||||
'sortOrder' => 100,
|
||||
'isActive' => (Yii::$app->controller->action->id == 'index'),
|
||||
'isActive' => (Yii::$app->controller->action->id == 'index' && Yii::$app->controller->id === 'member'),
|
||||
));
|
||||
$this->addItem(array(
|
||||
'label' => 'Pending Invites',
|
||||
'url' => $this->space->createUrl('pending-invitations'),
|
||||
'url' => $this->space->createUrl('/space/manage/member/pending-invitations'),
|
||||
'sortOrder' => 200,
|
||||
'isActive' => (Yii::$app->controller->action->id == 'pending-invitations'),
|
||||
));
|
||||
$this->addItem(array(
|
||||
'label' => 'Pending Approvals',
|
||||
'url' => $this->space->createUrl('pending-approvals'),
|
||||
'url' => $this->space->createUrl('/space/manage/member/pending-approvals'),
|
||||
'sortOrder' => 300,
|
||||
'isActive' => (Yii::$app->controller->action->id == 'pending-approvals'),
|
||||
));
|
||||
$this->addItem(array(
|
||||
'label' => 'Permissions',
|
||||
'url' => $this->space->createUrl('permissions'),
|
||||
'url' => $this->space->createUrl('/space/manage/member/permissions'),
|
||||
'sortOrder' => 400,
|
||||
'isActive' => (Yii::$app->controller->action->id == 'permissions'),
|
||||
));
|
||||
@ -57,7 +57,7 @@ class MemberMenu extends \humhub\widgets\BaseMenu
|
||||
if ($this->space->isSpaceOwner()) {
|
||||
$this->addItem(array(
|
||||
'label' => 'Owner',
|
||||
'url' => $this->space->createUrl('change-owner'),
|
||||
'url' => $this->space->createUrl('/space/manage/member/change-owner'),
|
||||
'sortOrder' => 500,
|
||||
'isActive' => (Yii::$app->controller->action->id == 'change-owner'),
|
||||
));
|
||||
|
Loading…
x
Reference in New Issue
Block a user