forked from rainlab/user-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.1.1: Users can now be added to groups.
- Loading branch information
Showing
20 changed files
with
449 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php namespace RainLab\User\Controllers; | ||
|
||
use Flash; | ||
use BackendMenu; | ||
use Backend\Classes\Controller; | ||
use RainLab\User\Models\UserGroup; | ||
|
||
/** | ||
* User Groups Back-end Controller | ||
*/ | ||
class UserGroups extends Controller | ||
{ | ||
public $implement = [ | ||
'Backend.Behaviors.FormController', | ||
'Backend.Behaviors.ListController' | ||
]; | ||
|
||
public $formConfig = 'config_form.yaml'; | ||
public $listConfig = 'config_list.yaml'; | ||
|
||
public $requiredPermissions = ['rainlab.users.access_groups']; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
BackendMenu::setContext('RainLab.User', 'user', 'usergroups'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div data-control="toolbar"> | ||
<a | ||
href="<?= Backend::url('rainlab/user/usergroups/create') ?>" | ||
class="btn btn-primary oc-icon-plus"> | ||
New User Group | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# =================================== | ||
# Form Behavior Config | ||
# =================================== | ||
|
||
# Record name | ||
name: User Group | ||
|
||
# Model Form Field configuration | ||
form: $/rainlab/user/models/usergroup/fields.yaml | ||
|
||
# Model Class name | ||
modelClass: RainLab\User\Models\UserGroup | ||
|
||
# Default redirect location | ||
defaultRedirect: rainlab/user/usergroups | ||
|
||
# Create page | ||
create: | ||
title: Create User Group | ||
redirect: rainlab/user/usergroups/update/:id | ||
redirectClose: rainlab/user/usergroups | ||
|
||
# Update page | ||
update: | ||
title: Edit User Group | ||
redirect: rainlab/user/usergroups | ||
redirectClose: rainlab/user/usergroups | ||
|
||
# Preview page | ||
preview: | ||
title: Preview User Group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# =================================== | ||
# List Behavior Config | ||
# =================================== | ||
|
||
# Model List Column configuration | ||
list: $/rainlab/user/models/usergroup/columns.yaml | ||
|
||
# Model Class name | ||
modelClass: RainLab\User\Models\UserGroup | ||
|
||
# List Title | ||
title: Manage User Groups | ||
|
||
# Link URL for each record | ||
recordUrl: rainlab/user/usergroups/update/:id | ||
|
||
# Message to display if the list is empty | ||
noRecordsMessage: backend::lang.list.no_records | ||
|
||
# Records to display per page | ||
recordsPerPage: 20 | ||
|
||
# Displays the list column set up button | ||
showSetup: true | ||
|
||
# Displays the sorting link on each column | ||
showSorting: true | ||
|
||
# Default sorting column | ||
# defaultSort: | ||
# column: created_at | ||
# direction: desc | ||
|
||
# Display checkboxes next to each record | ||
# showCheckboxes: true | ||
|
||
# Toolbar widget configuration | ||
toolbar: | ||
# Partial for toolbar buttons | ||
buttons: list_toolbar | ||
|
||
# Search widget configuration | ||
search: | ||
prompt: backend::lang.list.search_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('rainlab/user/usergroups') ?>">User Groups</a></li> | ||
<li><?= e($this->pageTitle) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<?= Form::open(['class' => 'layout']) ?> | ||
|
||
<div class="layout-row"> | ||
<?= $this->formRender() ?> | ||
</div> | ||
|
||
<div class="form-buttons"> | ||
<div class="loading-indicator-container"> | ||
<button | ||
type="submit" | ||
data-request="onSave" | ||
data-hotkey="ctrl+s, cmd+s" | ||
data-load-indicator="Creating UserGroup..." | ||
class="btn btn-primary"> | ||
Create | ||
</button> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-request-data="close:1" | ||
data-hotkey="ctrl+enter, cmd+enter" | ||
data-load-indicator="Creating UserGroup..." | ||
class="btn btn-default"> | ||
Create and Close | ||
</button> | ||
<span class="btn-text"> | ||
or <a href="<?= Backend::url('rainlab/user/usergroups') ?>">Cancel</a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<?= Form::close() ?> | ||
|
||
<?php else: ?> | ||
|
||
<p class="flash-message static error"><?= e($this->fatalError) ?></p> | ||
<p><a href="<?= Backend::url('rainlab/user/usergroups') ?>" class="btn btn-default">Return to user groups list</a></p> | ||
|
||
<?php endif ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
<?= $this->listRender() ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('rainlab/user/usergroups') ?>">User Groups</a></li> | ||
<li><?= e($this->pageTitle) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<div class="form-preview"> | ||
<?= $this->formRenderPreview() ?> | ||
</div> | ||
|
||
<?php else: ?> | ||
|
||
<p class="flash-message static error"><?= e($this->fatalError) ?></p> | ||
<p><a href="<?= Backend::url('rainlab/user/usergroups') ?>" class="btn btn-default">Return to user groups list</a></p> | ||
|
||
<?php endif ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('rainlab/user/usergroups') ?>">User Groups</a></li> | ||
<li><?= e($this->pageTitle) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<?= Form::open(['class' => 'layout']) ?> | ||
|
||
<div class="layout-row"> | ||
<?= $this->formRender() ?> | ||
</div> | ||
|
||
<div class="form-buttons"> | ||
<div class="loading-indicator-container"> | ||
<button | ||
type="submit" | ||
data-request="onSave" | ||
data-request-data="redirect:0" | ||
data-hotkey="ctrl+s, cmd+s" | ||
data-load-indicator="Saving UserGroup..." | ||
class="btn btn-primary"> | ||
<u>S</u>ave | ||
</button> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-request-data="close:1" | ||
data-hotkey="ctrl+enter, cmd+enter" | ||
data-load-indicator="Saving UserGroup..." | ||
class="btn btn-default"> | ||
Save and Close | ||
</button> | ||
<button | ||
type="button" | ||
class="oc-icon-trash-o btn-icon danger pull-right" | ||
data-request="onDelete" | ||
data-load-indicator="Deleting UserGroup..." | ||
data-request-confirm="Do you really want to delete this usergroup?"> | ||
</button> | ||
<span class="btn-text"> | ||
or <a href="<?= Backend::url('rainlab/user/usergroups') ?>">Cancel</a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<?= Form::close() ?> | ||
|
||
<?php else: ?> | ||
|
||
<p class="flash-message static error"><?= e($this->fatalError) ?></p> | ||
<p><a href="<?= Backend::url('rainlab/user/usergroups') ?>" class="btn btn-default">Return to user groups list</a></p> | ||
|
||
<?php endif ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.