function commons_groups_field_default_field_instances in Drupal Commons 7.3
Implements hook_field_default_field_instances().
File
- modules/
commons/ commons_groups/ commons_groups.features.field_instance.inc, line 10 - commons_groups.features.field_instance.inc
Code
function commons_groups_field_default_field_instances() {
$field_instances = array();
$commons_groups_entity_types = commons_groups_get_group_content_entity_types();
if (!empty($commons_groups_entity_types)) {
foreach ($commons_groups_entity_types as $entity_type => $bundles) {
foreach (array_keys($bundles) as $bundle) {
commons_groups_field_definition($field_instances, $entity_type, $bundle);
}
}
}
$group_bundles = og_get_all_group_bundle();
if (empty($group_bundles['node'])) {
// Make sure group_bundles contains at least the group node bundle, in order
// to create the group audience field for it when installing the profile.
$group_bundles['node'] = array(
'group' => TRUE,
);
}
foreach (array_keys($group_bundles['node']) as $bundle) {
commons_groups_field_definition_group($field_instances, 'node', $bundle);
}
// Exported field_instance: 'og_membership-og_membership_type_default-og_membership_request'
$field_instances['og_membership-og_membership_type_default-og_membership_request'] = array(
'bundle' => 'og_membership_type_default',
'default_value' => NULL,
'deleted' => '0',
'description' => 'This is the text a user may send to the group administrators.',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => 0,
),
),
'entity_type' => 'og_membership',
'field_name' => 'og_membership_request',
'label' => 'Request message',
'required' => FALSE,
'settings' => array(
'text_processing' => 0,
'user_register_form' => FALSE,
),
'widget' => array(
'module' => 'text',
'settings' => array(
'rows' => 5,
),
'type' => 'text_textarea',
'weight' => 0,
),
);
// Translatables
// Included for use with string extractors like potx.
t('Determine if this is an OG group.');
t('Group');
t('Group membership');
t('Group visibility');
t('Group content visibility');
t('Group roles and permissions');
t('Request message');
t('This is the text a user may send to the group administrators.');
t('Group Logo');
t('Hide contributed content from non-members');
t('Privacy settings');
return $field_instances;
}