Changeset View
Changeset View
Standalone View
Standalone View
lib/api/kolab_api_service_domain_types.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | public static $DEFAULT_TYPE_ATTRS = array( | ||||
'objectclass' => array( | 'objectclass' => array( | ||||
'top', | 'top', | ||||
'domainrelatedobject', | 'domainrelatedobject', | ||||
'inetdomain', | 'inetdomain', | ||||
), | ), | ||||
), | ), | ||||
); | ); | ||||
public static $HOSTED_TYPE_ATTRS = array( | |||||
'auto_form_fields' => array(), | |||||
'form_fields' => array( | |||||
'associateddomain' => array( | |||||
'type' => 'list' | |||||
), | |||||
// 'inetdomainbasedn' => array( | |||||
// 'optional' => true, | |||||
// ), | |||||
'inetdomainstatus' => array( | |||||
'optional' => true, | |||||
'type' => 'select', | |||||
'values' => array( | |||||
'', 'active', 'suspended', 'deleted', | |||||
), | |||||
), | |||||
), | |||||
'fields' => array( | |||||
'domainrelatedobject_only' => 1, | |||||
'objectclass' => array( | |||||
'top', | |||||
'domainrelatedobject', | |||||
'inetdomain', | |||||
), | |||||
), | |||||
); | |||||
/** | /** | ||||
* Returns service capabilities. | * Returns service capabilities. | ||||
* | * | ||||
* @param string $domain Domain name | * @param string $domain Domain name | ||||
* | * | ||||
* @return array Capabilities list | * @return array Capabilities list | ||||
*/ | */ | ||||
Show All 17 Lines | public function domain_types_list($get, $post) | ||||
// @TODO: move to database | // @TODO: move to database | ||||
$types = array( | $types = array( | ||||
1 => array( | 1 => array( | ||||
'key' => 'standard', | 'key' => 'standard', | ||||
'name' => 'Standard domain', | 'name' => 'Standard domain', | ||||
'description' => 'A standard domain name space', | 'description' => 'A standard domain name space', | ||||
'attributes' => self::$DEFAULT_TYPE_ATTRS, | 'attributes' => self::$DEFAULT_TYPE_ATTRS, | ||||
), | ), | ||||
2 => array( | |||||
'key' => 'hosted', | |||||
'name' => 'Hosted domain', | |||||
'description' => 'A hosted domain name space', | |||||
'attributes' => self::$HOSTED_TYPE_ATTRS, | |||||
), | |||||
); | ); | ||||
return array( | return array( | ||||
'list' => $types, | 'list' => $types, | ||||
'count' => count($types), | 'count' => count($types), | ||||
); | ); | ||||
} | } | ||||
} | } |