Changeset View
Changeset View
Standalone View
Standalone View
lib/kolab_api_service.php
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | protected function object_types($object_name) | ||||
if ($devel_mode == null) { | if ($devel_mode == null) { | ||||
if (!empty($this->cache['object_types']) && !empty($this->cache['object_types'][$object_name])) { | if (!empty($this->cache['object_types']) && !empty($this->cache['object_types'][$object_name])) { | ||||
return $this->cache['object_types'][$object_name]; | return $this->cache['object_types'][$object_name]; | ||||
} | } | ||||
} | } | ||||
// get list of object types | // get list of object types | ||||
if ($object_name == 'domain') { | if ($object_name == 'domain') { | ||||
$object_types = array( | $object_types = array(); | ||||
'1' => array( | |||||
if ($this->conf->get('kolab_wap', 'hosted_root_dn')) { | |||||
$object_types['1'] = array( | |||||
'key' => 'hosted', | |||||
'attributes' => kolab_api_service_domain_types::$HOSTED_TYPE_ATTRS, | |||||
); | |||||
} else { | |||||
$object_types['1'] = array( | |||||
'key' => 'default', | 'key' => 'default', | ||||
'attributes' => kolab_api_service_domain_types::$DEFAULT_TYPE_ATTRS, | 'attributes' => kolab_api_service_domain_types::$DEFAULT_TYPE_ATTRS, | ||||
), | |||||
); | ); | ||||
} | |||||
$object_types['1']['attributes']['form_fields']['aci'] = array( | $object_types['1']['attributes']['form_fields']['aci'] = array( | ||||
'type' => 'list', | 'type' => 'list', | ||||
'optional' => true, | 'optional' => true, | ||||
); | ); | ||||
} | } | ||||
else { | else { | ||||
$sql_result = $this->db->query("SELECT * FROM `{$object_name}_types` ORDER BY `name`"); | $sql_result = $this->db->query("SELECT * FROM `{$object_name}_types` ORDER BY `name`"); | ||||
$object_types = array(); | $object_types = array(); | ||||
▲ Show 20 Lines • Show All 452 Lines • Show Last 20 Lines |