mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Return registration levels on the API
This commit is contained in:
parent
e35323915f
commit
f726b4cc2b
@ -7,6 +7,15 @@
|
|||||||
|
|
||||||
class GroupsController {
|
class GroupsController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API groups registration levels
|
||||||
|
*/
|
||||||
|
const GROUPS_REGISTRATION_LEVELS = array(
|
||||||
|
GroupInfo::OPEN_REGISTRATION => "open",
|
||||||
|
GroupInfo::MODERATED_REGISTRATION => "moderated",
|
||||||
|
GroupInfo::CLOSED_REGISTRATION => "closed"
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API groups membership levels
|
* API groups membership levels
|
||||||
*/
|
*/
|
||||||
@ -224,6 +233,7 @@ class GroupsController {
|
|||||||
$data["number_members"] = $info->get_number_members();
|
$data["number_members"] = $info->get_number_members();
|
||||||
$data["membership"] = self::GROUPS_MEMBERSHIP_LEVELS[$info->get_membership_level()];
|
$data["membership"] = self::GROUPS_MEMBERSHIP_LEVELS[$info->get_membership_level()];
|
||||||
$data["visibility"] = self::GROUPS_VISIBILITY_LEVELS[$info->get_visibility()];
|
$data["visibility"] = self::GROUPS_VISIBILITY_LEVELS[$info->get_visibility()];
|
||||||
|
$data["registration_level"] = self::GROUPS_REGISTRATION_LEVELS[$info->get_registration_level()];
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -365,6 +365,7 @@ class GroupsComponent {
|
|||||||
$info->set_number_members($this->countMembers($info->get_id()));
|
$info->set_number_members($this->countMembers($info->get_id()));
|
||||||
$info->set_membership_level($this->getMembershipLevel(userID, $info->get_id()));
|
$info->set_membership_level($this->getMembershipLevel(userID, $info->get_id()));
|
||||||
$info->set_visibility($data["visibility"]);
|
$info->set_visibility($data["visibility"]);
|
||||||
|
$info->set_registration_level($data["registration_level"]);
|
||||||
|
|
||||||
if($data["path_logo"] != null && $data["path_logo"] != "" && $data["path_logo"] != "null")
|
if($data["path_logo"] != null && $data["path_logo"] != "" && $data["path_logo"] != "null")
|
||||||
$info->set_logo($data["path_logo"]);
|
$info->set_logo($data["path_logo"]);
|
||||||
|
Loading…
Reference in New Issue
Block a user