@name "; break; case 'user': return "
@firstname @lastname #@username @icon_remove @icon_edit @icon_card @code @icon_mail @mail @icon_group @grouplist +
"; break; default: return " @userlist"; break; } } public static function userlist($params){ $view = ''; /* [1] On récupère la liste des utilisateurs =========================================================*/ $request = new ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault' $answer = $request->dispatch(); // On recupere la reponse // si erreur, on affiche l'explicitation if( $answer->error != ManagerError::Success ) return "Une erreur est survenue, veuilez contacter le webmaster si cette erreur persiste."; $USERLIST = $answer->get('users'); foreach($USERLIST as $u=>$user){ $clustersReq = new ModuleRequest('userDefault/getClusters', [ 'id_user' => $user['id_user'] ]); $clustersRes = $clustersReq->dispatch(); /* (2) Gestion si erreur */ if( $clustersRes->error == ManagerError::Success ) $clusters = $clustersRes->get('clusters'); else $clusters = []; $USERLIST[$u]['grouplist'] = View::replaceMultiple( self::templateUserlist('cluster'), $clusters, [ 'id_user' => $user['id_user'] ] ); } $view_user = View::replaceMultiple( self::templateUserlist('user'), $USERLIST, [ 'icon_remove' => file_get_contents( __ROOT__.'/src/static/sub-menu-side/remove.svg' ), 'icon_edit' => file_get_contents( __ROOT__.'/src/static/sub-menu-side/edit.svg' ), 'icon_card' => file_get_contents( __ROOT__.'/src/static/container/card.svg' ), 'icon_mail' => file_get_contents( __ROOT__.'/src/static/container/mail.svg' ), 'icon_group' => file_get_contents( __ROOT__.'/src/static/container/group.svg' ), ]); return View::replaceSingle(self::templateUserlist(), [ 'userlist' => $view_user ]); } } ?>