Added list functions
This commit is contained in:
parent
e3775e1045
commit
2226e91faf
11 changed files with 116 additions and 9 deletions
62
modules/admin/controllers/users.php
Normal file
62
modules/admin/controllers/users.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
//include('modules/admin/libraries/tplcontroller.php');
|
||||
|
||||
class GenerateAdminClass {
|
||||
|
||||
public $fields_edit;
|
||||
public $fields_list;
|
||||
public $model;
|
||||
public $url;
|
||||
public $tpl;
|
||||
|
||||
public function __construct($model, $fields_edit, $fields_list, $url, $tpl) {
|
||||
|
||||
$this->model=$model;
|
||||
$this->fields_edit=$fields_edit;
|
||||
$this->fields_list=$fields_list;
|
||||
$this->url=$url;
|
||||
$this->tpl=$tpl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function show() {
|
||||
|
||||
$op=$_GET['op'] ?? '';
|
||||
|
||||
switch($op) {
|
||||
|
||||
default:
|
||||
|
||||
echo $this->list();
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function list() {
|
||||
|
||||
echo $this->tpl->load_template('list', []);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class AppController extends Admin\AdminController\AdminController {
|
||||
|
||||
public function app($op='') {
|
||||
|
||||
$admin=new GenerateAdminClass($this->db->tables['useradmin'], ['username', 'password', 'email', 'double_auth', 'theme'], ['username', 'email'], \PhangoApp\PhaRouter\Url::make_url('admin', 'users'), $this->tpl);
|
||||
|
||||
echo $this->tpl->load_template('users', ['title' => _('Edit users'), 'path_module' => 'admin.users', 'content' => $admin->show()]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue