68 lines
1.5 KiB
PHP
68 lines
1.5 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace view\user\group;
|
||
|
|
||
|
use \generic\core\i_view;
|
||
|
use \api\core\Request;
|
||
|
use \error\core\Err;
|
||
|
|
||
|
|
||
|
class main extends i_view{
|
||
|
|
||
|
/* (1) Attributes
|
||
|
---------------------------------------------------------*/
|
||
|
public $icon;
|
||
|
public $theme;
|
||
|
|
||
|
|
||
|
public function __construct(){
|
||
|
|
||
|
/* (1) Setup attributes
|
||
|
---------------------------------------------------------*/
|
||
|
/* (1) Fill attributes */
|
||
|
$this->icon = [
|
||
|
'remove' => file_get_contents( __PUBLIC__.'/src/static/sub-menu-side/remove.svg' ),
|
||
|
'edit' => file_get_contents( __PUBLIC__.'/src/static/sub-menu-side/edit.svg' ),
|
||
|
'type' => file_get_contents( __PUBLIC__.'/src/static/container/type.svg' ),
|
||
|
'group' => file_get_contents( __PUBLIC__.'/src/static/container/group.svg' )
|
||
|
];
|
||
|
|
||
|
$this->theme = $_SESSION['WAREHOUSE']['theme'];
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
public function get_clusters(){
|
||
|
$request = new Request('clusterDefault/getAll', [
|
||
|
'class' => 0
|
||
|
]);
|
||
|
|
||
|
$answer = $request->dispatch();
|
||
|
|
||
|
// si erreur, on affiche rien par défaut
|
||
|
if( $answer->error->get() != Err::Success )
|
||
|
return [];
|
||
|
|
||
|
return $answer->get('clusters');
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
public function get_members($id_cluster){
|
||
|
$usersReq = new Request('clusterDefault/getMembers', [
|
||
|
'id_cluster' => (int) $id_cluster,
|
||
|
'class' => 0
|
||
|
]);
|
||
|
|
||
|
$usersRes = $usersReq->dispatch();
|
||
|
// si erreur, on affiche rien par défaut
|
||
|
if( $usersRes->error->get() != Err::Success )
|
||
|
return [];
|
||
|
|
||
|
return $usersRes->get('members');
|
||
|
}
|
||
|
|
||
|
}
|