diff --git a/build/generic/view/settings/admin/view/main.php b/build/generic/view/settings/admin/view/main.php index ae74d69..b728d72 100644 --- a/build/generic/view/settings/admin/view/main.php +++ b/build/generic/view/settings/admin/view/main.php @@ -3,10 +3,47 @@ namespace view\settings\admin\view; use \generic\core\i_view; + use \api\core\Request; + use \error\core\Err; class main extends i_view{ - public function __construct(){} + /* (1) Attributes + ---------------------------------------------------------*/ + public $icon; + public $theme; + public $self_id; + + public function __construct(){ + + /* (1) Setup attributes + ---------------------------------------------------------*/ + /* (1) Fill attributes */ + $this->icon = [ + 'remove' => file_get_contents( __PUBLIC__.'/src/static/sub-menu-side/remove.svg' ) + ]; + + $this->theme = $_SESSION['WAREHOUSE']['theme']; + + $this->self_id = $_SESSION['ADMIN']['id']; + } + + + + public function get_admins(){ + /* (1) On exécute la requête */ + $adminListRq = new Request('authenticationDefault/get_admins'); + + /* (2) On recupere la reponse */ + $adminListRs = $adminListRq->dispatch(); + + /* (3) si erreur vide */ + if( $adminListRs->error->get() != Err::Success ) + return []; + + /* (4) On récupère la liste des utilisateurs */ + return $adminListRs->get('admins'); + } } \ No newline at end of file diff --git a/build/generic/view/settings/admin/view/main.twig b/build/generic/view/settings/admin/view/main.twig index cfa9de2..d47e477 100644 --- a/build/generic/view/settings/admin/view/main.twig +++ b/build/generic/view/settings/admin/view/main.twig @@ -1 +1,17 @@ -In development.. This feature will soon be available. \ No newline at end of file +{% for admin in core.get_admins() %} + +
+ + #{{ admin.username }} + + + {{ admin.mail }} + + + + {{ core.icon.remove | raw }} + + +
+ +{% endfor %} \ No newline at end of file diff --git a/public_html/view/settings.php b/public_html/view/settings.php index d9d4e55..470ca9d 100755 --- a/public_html/view/settings.php +++ b/public_html/view/settings.php @@ -57,7 +57,7 @@ /* LISTE ADMINISTRATEURS * */ - echo "
"; + echo "
>"; $view = View::load('settings.admin.view'); echo $view->render();