15 changed files with 835 additions and 39 deletions
@ -0,0 +1,164 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* CodeIgniter-Aauth |
||||||
|
* |
||||||
|
* Aauth is a User Authorization Library for CodeIgniter 4.x, which aims to make |
||||||
|
* easy some essential jobs such as login, permissions and access operations. |
||||||
|
* Despite ease of use, it has also very advanced features like grouping, |
||||||
|
* access management, public access etc.. |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
* @author Emre Akay |
||||||
|
* @author Raphael "REJack" Jackstadt |
||||||
|
* @copyright 2014-2019 Emre Akay |
||||||
|
* @license https://opensource.org/licenses/MIT MIT License |
||||||
|
* @link https://github.com/emreakay/CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace App\Controllers\Admin; |
||||||
|
|
||||||
|
use CodeIgniter\Controller; |
||||||
|
use App\Libraries\Aauth; |
||||||
|
use Config\Services; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Admin/Groups Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Groups extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Constructor |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->aauth = new Aauth(); |
||||||
|
$this->request = Services::request(); |
||||||
|
helper('form'); |
||||||
|
helper('aauth'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
$data = $this->aauth->listGroupsPaginated(); |
||||||
|
|
||||||
|
$data['cssFiles'] = [ |
||||||
|
'/assets/css/admin/groups/index.css' |
||||||
|
]; |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin', $data); |
||||||
|
echo view('Admin/Groups/Home', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* New |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function new() |
||||||
|
{ |
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Groups/New'); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Create |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function create() |
||||||
|
{ |
||||||
|
$name = $this->request->getPost('name'); |
||||||
|
$definition = $this->request->getPost('definition'); |
||||||
|
|
||||||
|
if (! $this->aauth->createGroup($name, $definition)) |
||||||
|
{ |
||||||
|
return redirect()->back()->with('errors', $this->aauth->getErrorsArray()); |
||||||
|
} |
||||||
|
|
||||||
|
return redirect()->to('/admin/groups'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Edit |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function edit($groupId) |
||||||
|
{ |
||||||
|
$data['group'] = $this->aauth->getGroup($groupId); |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Groups/Edit', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Update |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function update($groupId) |
||||||
|
{ |
||||||
|
$name = $this->request->getPost('name'); |
||||||
|
$definition = $this->request->getPost('definition'); |
||||||
|
|
||||||
|
if (! $this->aauth->updateGroup($groupId, empty($name) ? null : $name, empty($definition) ? null : $definition)) |
||||||
|
{ |
||||||
|
return redirect()->back()->with('errors', $this->aauth->getErrorsArray()); |
||||||
|
} |
||||||
|
|
||||||
|
return redirect()->to('/admin/groups/edit/' . $groupId); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function show($groupId) |
||||||
|
{ |
||||||
|
$data['group'] = $this->aauth->getGroup($groupId); |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Groups/Show', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Delete |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function delete($groupId) |
||||||
|
{ |
||||||
|
if (! $this->aauth->getGroup($groupId)) |
||||||
|
{ |
||||||
|
return redirect()->to('/admin/groups'); |
||||||
|
} |
||||||
|
|
||||||
|
$id = $this->request->getPost('id'); |
||||||
|
if ($groupId === $id) |
||||||
|
{ |
||||||
|
if ($this->aauth->deleteGroup($groupId)) |
||||||
|
{ |
||||||
|
return redirect()->to('/admin/groups'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$data['group'] = $this->aauth->getGroup($groupId); |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Groups/Delete', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,164 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* CodeIgniter-Aauth |
||||||
|
* |
||||||
|
* Aauth is a User Authorization Library for CodeIgniter 4.x, which aims to make |
||||||
|
* easy some essential jobs such as login, permissions and access operations. |
||||||
|
* Despite ease of use, it has also very advanced features like grouping, |
||||||
|
* access management, public access etc.. |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
* @author Emre Akay |
||||||
|
* @author Raphael "REJack" Jackstadt |
||||||
|
* @copyright 2014-2019 Emre Akay |
||||||
|
* @license https://opensource.org/licenses/MIT MIT License |
||||||
|
* @link https://github.com/emreakay/CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace App\Controllers\Admin; |
||||||
|
|
||||||
|
use CodeIgniter\Controller; |
||||||
|
use App\Libraries\Aauth; |
||||||
|
use Config\Services; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Admin/Perms Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Perms extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Constructor |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->aauth = new Aauth(); |
||||||
|
$this->request = Services::request(); |
||||||
|
helper('form'); |
||||||
|
helper('aauth'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
$data = $this->aauth->listPermsPaginated(); |
||||||
|
|
||||||
|
$data['cssFiles'] = [ |
||||||
|
'/assets/css/admin/groups/index.css' |
||||||
|
]; |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin', $data); |
||||||
|
echo view('Admin/Perms/Home', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* New |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function new() |
||||||
|
{ |
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Perms/New'); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Create |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function create() |
||||||
|
{ |
||||||
|
$name = $this->request->getPost('name'); |
||||||
|
$definition = $this->request->getPost('definition'); |
||||||
|
|
||||||
|
if (! $this->aauth->createPerm($name, $definition)) |
||||||
|
{ |
||||||
|
return redirect()->back()->with('errors', $this->aauth->getErrorsArray()); |
||||||
|
} |
||||||
|
|
||||||
|
return redirect()->to('/admin/groups'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Edit |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function edit($permId) |
||||||
|
{ |
||||||
|
$data['group'] = $this->aauth->getPerm($permId); |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Perms/Edit', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Update |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function update($permId) |
||||||
|
{ |
||||||
|
$name = $this->request->getPost('name'); |
||||||
|
$definition = $this->request->getPost('definition'); |
||||||
|
|
||||||
|
if (! $this->aauth->updatePerm($permId, empty($name) ? null : $name, empty($definition) ? null : $definition)) |
||||||
|
{ |
||||||
|
return redirect()->back()->with('errors', $this->aauth->getErrorsArray()); |
||||||
|
} |
||||||
|
|
||||||
|
return redirect()->to('/admin/groups/edit/' . $permId); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function show($permId) |
||||||
|
{ |
||||||
|
$data['group'] = $this->aauth->getPerm($permId); |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Perms/Show', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Delete |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function delete($permId) |
||||||
|
{ |
||||||
|
if (! $this->aauth->getPerm($permId)) |
||||||
|
{ |
||||||
|
return redirect()->to('/admin/groups'); |
||||||
|
} |
||||||
|
|
||||||
|
$id = $this->request->getPost('id'); |
||||||
|
if ($permId === $id) |
||||||
|
{ |
||||||
|
if ($this->aauth->deletePerm($permId)) |
||||||
|
{ |
||||||
|
return redirect()->to('/admin/groups'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$data['group'] = $this->aauth->getPerm($permId); |
||||||
|
|
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Perms/Delete', $data); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/groups') ?>"><?= lang('Admin.groupsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonDelete') ?></li>
|
||||||
|
</ol> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.groupsDeleteHeader') ?> |
||||||
|
</div> |
||||||
|
<?= form_open('admin/groups/delete/' . $group['id'], [], ['id' => $group['id']]) ?> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelId') ?></label>
|
||||||
|
<p><?= $group['id'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelName') ?></label>
|
||||||
|
<p><?= $group['name'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelDefinition') ?></label>
|
||||||
|
<p><?= $group['definition'] ?></p>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<button type="submit" class="btn btn-primary float-right"><?= lang('Admin.groupsDeleteSubmit') ?></button>
|
||||||
|
<a href="<?= site_url('admin/groups') ?>" class="btn btn-warning"><?= lang('Admin.groupsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
<?= form_close() ?> |
||||||
|
</div> |
@ -0,0 +1,51 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/groups') ?>"><?= lang('Admin.groupsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonEdit') ?></li>
|
||||||
|
</ol> |
||||||
|
<?php if (session('errors')): ?> |
||||||
|
<div class="alert alert-danger"> |
||||||
|
<?php foreach (session('errors') as $error) : ?> |
||||||
|
<?= esc($error) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php elseif (session('infos')): ?> |
||||||
|
<div class="alert alert-info"> |
||||||
|
<?php foreach (session('infos') as $info) : ?> |
||||||
|
<?= esc($info) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.groupsEditHeader') ?> |
||||||
|
</div> |
||||||
|
<?= form_open('admin/groups/update/' . $group['id']) ?> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelNameCurrent') ?></label>
|
||||||
|
<p><?= $group['name'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputName"><?= lang('Admin.groupsLabelName') ?></label>
|
||||||
|
<input type="text" class="form-control" name="name" id="inputName" placeholder="<?= lang('Admin.groupsLabelName') ?>">
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelDefinitionCurrent') ?></label>
|
||||||
|
<p><?= $group['definition'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputDefinition"><?= lang('Admin.groupsLabelDefinition') ?></label>
|
||||||
|
<input type="text" class="form-control" name="definition" id="inputDefinition" placeholder="<?= lang('Admin.groupsLabelDefinition') ?>">
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<button type="submit" class="btn btn-primary float-right"><?= lang('Admin.groupsEditSubmit') ?></button>
|
||||||
|
<a href="<?= site_url('admin/groups') ?>" class="btn btn-warning"><?= lang('Admin.groupsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
<?= form_close() ?> |
||||||
|
</div> |
@ -0,0 +1,56 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.groupsBreadcrumbTitle') ?></li>
|
||||||
|
</ol> |
||||||
|
<?php if (session('infos')): ?> |
||||||
|
<div class="alert alert-info"> |
||||||
|
<?php foreach (session('infos') as $info) : ?> |
||||||
|
<?= esc($info) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<a href="<?= site_url('admin/groups/new') ?>" class="btn btn-sm btn-success float-right"><?= lang('Admin.groupsLinkNew') ?></a>
|
||||||
|
<div class="pt-1"><?= lang('Admin.groupsIndexHeader') ?></div>
|
||||||
|
</div> |
||||||
|
<div class="card-body p-0"> |
||||||
|
<div class="table-responsive"> |
||||||
|
<table class="table mb-0"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th scope="col"><?= lang('Admin.groupsLabelId') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.groupsLabelName') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.groupsLabelDefinition') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.groupsLabelCreatedAt') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.groupsLabelUpdatedAt') ?></th>
|
||||||
|
<th scope="col"></th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<?php foreach ($groups as $group): ?> |
||||||
|
<tr> |
||||||
|
<th scope="row"><?= $group['id'] ?></th>
|
||||||
|
<td><?= $group['name'] ?></td>
|
||||||
|
<td><?= $group['definition'] ?></td>
|
||||||
|
<td><?= $group['created_at'] ?></td>
|
||||||
|
<td><?= $group['updated_at'] ?></td>
|
||||||
|
<td class="text-right p-1"> |
||||||
|
<div class="btn-group"> |
||||||
|
<a href="<?= site_url('admin/groups/show/' . $group['id']) ?>" class="btn btn-info"><i class="fa fa-fw fa-info-circle"></i></a>
|
||||||
|
<a href="<?= site_url('admin/groups/edit/' . $group['id']) ?>" class="btn btn-warning"><i class="fa fa-fw fa-pencil-alt"></i></a>
|
||||||
|
<a href="<?= site_url('admin/groups/delete/' . $group['id']) ?>" class="btn btn-danger"><i class="fa fa-fw fa-times"></i></a>
|
||||||
|
</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<?php endforeach; ?> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<?= $pager->links() ?> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,37 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/groups') ?>"><?= lang('Admin.groupsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonNew') ?></li>
|
||||||
|
</ol> |
||||||
|
<?php if (session('errors')): ?> |
||||||
|
<div class="alert alert-danger"> |
||||||
|
<?php foreach (session('errors') as $error) : ?> |
||||||
|
<?= esc($error) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.groupsNewHeader') ?> |
||||||
|
</div> |
||||||
|
<?= form_open('admin/groups/create') ?> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputName"><?= lang('Admin.groupsLabelName') ?></label>
|
||||||
|
<input type="text" class="form-control" name="name" id="inputName" placeholder="<?= lang('Admin.groupsLabelName') ?>" required>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputDefinition"><?= lang('Admin.groupsLabelDefinition') ?></label>
|
||||||
|
<input type="text" class="form-control" name="definition" id="inputDefinition" placeholder="<?= lang('Admin.groupsLabelDefinition') ?>">
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<button type="submit" class="btn btn-primary float-right"><?= lang('Admin.groupsNewSubmit') ?></button>
|
||||||
|
<a href="<?= site_url('admin/groups') ?>" class="btn btn-warning"><?= lang('Admin.groupsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
<?= form_close() ?> |
||||||
|
</div> |
@ -0,0 +1,31 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/groups') ?>"><?= lang('Admin.groupsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonShow') ?></li>
|
||||||
|
</ol> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.groupsShowHeader') ?> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelId') ?></label>
|
||||||
|
<p><?= $group['id'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelName') ?></label>
|
||||||
|
<p><?= $group['name'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.groupsLabelDefinition') ?></label>
|
||||||
|
<p><?= $group['definition'] ?></p>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<a href="<?= site_url('admin/groups') ?>" class="btn btn-warning"><?= lang('Admin.groupsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,34 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/perms') ?>"><?= lang('Admin.permsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonDelete') ?></li>
|
||||||
|
</ol> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.permsDeleteHeader') ?> |
||||||
|
</div> |
||||||
|
<?= form_open('admin/perms/delete/' . $perm['id'], [], ['id' => $perm['id']]) ?> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelId') ?></label>
|
||||||
|
<p><?= $perm['id'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelName') ?></label>
|
||||||
|
<p><?= $perm['name'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelDefinition') ?></label>
|
||||||
|
<p><?= $perm['definition'] ?></p>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<button type="submit" class="btn btn-primary float-right"><?= lang('Admin.permsDeleteSubmit') ?></button>
|
||||||
|
<a href="<?= site_url('admin/perms') ?>" class="btn btn-warning"><?= lang('Admin.permsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
<?= form_close() ?> |
||||||
|
</div> |
@ -0,0 +1,51 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/perms') ?>"><?= lang('Admin.permsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonEdit') ?></li>
|
||||||
|
</ol> |
||||||
|
<?php if (session('errors')): ?> |
||||||
|
<div class="alert alert-danger"> |
||||||
|
<?php foreach (session('errors') as $error) : ?> |
||||||
|
<?= esc($error) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php elseif (session('infos')): ?> |
||||||
|
<div class="alert alert-info"> |
||||||
|
<?php foreach (session('infos') as $info) : ?> |
||||||
|
<?= esc($info) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.permsEditHeader') ?> |
||||||
|
</div> |
||||||
|
<?= form_open('admin/perms/update/' . $perm['id']) ?> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelNameCurrent') ?></label>
|
||||||
|
<p><?= $perm['name'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputName"><?= lang('Admin.permsLabelName') ?></label>
|
||||||
|
<input type="text" class="form-control" name="name" id="inputName" placeholder="<?= lang('Admin.permsLabelName') ?>">
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelDefinitionCurrent') ?></label>
|
||||||
|
<p><?= $perm['definition'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputDefinition"><?= lang('Admin.permsLabelDefinition') ?></label>
|
||||||
|
<input type="text" class="form-control" name="definition" id="inputDefinition" placeholder="<?= lang('Admin.permsLabelDefinition') ?>">
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<button type="submit" class="btn btn-primary float-right"><?= lang('Admin.permsEditSubmit') ?></button>
|
||||||
|
<a href="<?= site_url('admin/perms') ?>" class="btn btn-warning"><?= lang('Admin.permsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
<?= form_close() ?> |
||||||
|
</div> |
@ -0,0 +1,56 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.permsBreadcrumbTitle') ?></li>
|
||||||
|
</ol> |
||||||
|
<?php if (session('infos')): ?> |
||||||
|
<div class="alert alert-info"> |
||||||
|
<?php foreach (session('infos') as $info) : ?> |
||||||
|
<?= esc($info) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<a href="<?= site_url('admin/perms/new') ?>" class="btn btn-sm btn-success float-right"><?= lang('Admin.permsLinkNew') ?></a>
|
||||||
|
<div class="pt-1"><?= lang('Admin.permsIndexHeader') ?></div>
|
||||||
|
</div> |
||||||
|
<div class="card-body p-0"> |
||||||
|
<div class="table-responsive"> |
||||||
|
<table class="table mb-0"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th scope="col"><?= lang('Admin.permsLabelId') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.permsLabelName') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.permsLabelDefinition') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.permsLabelCreatedAt') ?></th>
|
||||||
|
<th scope="col"><?= lang('Admin.permsLabelUpdatedAt') ?></th>
|
||||||
|
<th scope="col"></th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<?php foreach ($perms as $perm): ?> |
||||||
|
<tr> |
||||||
|
<th scope="row"><?= $perm['id'] ?></th>
|
||||||
|
<td><?= $perm['name'] ?></td>
|
||||||
|
<td><?= $perm['definition'] ?></td>
|
||||||
|
<td><?= $perm['created_at'] ?></td>
|
||||||
|
<td><?= $perm['updated_at'] ?></td>
|
||||||
|
<td class="text-right p-1"> |
||||||
|
<div class="btn-group"> |
||||||
|
<a href="<?= site_url('admin/perms/show/' . $perm['id']) ?>" class="btn btn-info"><i class="fa fa-fw fa-info-circle"></i></a>
|
||||||
|
<a href="<?= site_url('admin/perms/edit/' . $perm['id']) ?>" class="btn btn-warning"><i class="fa fa-fw fa-pencil-alt"></i></a>
|
||||||
|
<a href="<?= site_url('admin/perms/delete/' . $perm['id']) ?>" class="btn btn-danger"><i class="fa fa-fw fa-times"></i></a>
|
||||||
|
</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<?php endforeach; ?> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<?= $pager->links() ?> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,37 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/perms') ?>"><?= lang('Admin.permsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonNew') ?></li>
|
||||||
|
</ol> |
||||||
|
<?php if (session('errors')): ?> |
||||||
|
<div class="alert alert-danger"> |
||||||
|
<?php foreach (session('errors') as $error) : ?> |
||||||
|
<?= esc($error) ?><br />
|
||||||
|
<?php endforeach ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.permsNewHeader') ?> |
||||||
|
</div> |
||||||
|
<?= form_open('admin/perms/create') ?> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputName"><?= lang('Admin.permsLabelName') ?></label>
|
||||||
|
<input type="text" class="form-control" name="name" id="inputName" placeholder="<?= lang('Admin.permsLabelName') ?>" required>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="inputDefinition"><?= lang('Admin.permsLabelDefinition') ?></label>
|
||||||
|
<input type="text" class="form-control" name="definition" id="inputDefinition" placeholder="<?= lang('Admin.permsLabelDefinition') ?>">
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<button type="submit" class="btn btn-primary float-right"><?= lang('Admin.permsNewSubmit') ?></button>
|
||||||
|
<a href="<?= site_url('admin/perms') ?>" class="btn btn-warning"><?= lang('Admin.permsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
<?= form_close() ?> |
||||||
|
</div> |
@ -0,0 +1,31 @@ |
|||||||
|
<ol class="breadcrumb"> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin') ?>"><?= lang('Admin.homeBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item"> |
||||||
|
<a href="<?= site_url('admin/perms') ?>"><?= lang('Admin.permsBreadcrumbTitle') ?></a>
|
||||||
|
</li> |
||||||
|
<li class="breadcrumb-item active"><?= lang('Admin.breadcrumbCommonShow') ?></li>
|
||||||
|
</ol> |
||||||
|
<div class="card mb-3"> |
||||||
|
<div class="card-header"> |
||||||
|
<?= lang('Admin.permsShowHeader') ?> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelId') ?></label>
|
||||||
|
<p><?= $perm['id'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelName') ?></label>
|
||||||
|
<p><?= $perm['name'] ?></p>
|
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label><?= lang('Admin.permsLabelDefinition') ?></label>
|
||||||
|
<p><?= $perm['definition'] ?></p>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<a href="<?= site_url('admin/perms') ?>" class="btn btn-warning"><?= lang('Admin.permsLinkBack') ?></a>
|
||||||
|
</div> |
||||||
|
</div> |
Loading…
Reference in new issue