View source
<?php
function commons_groups_features_pipe_alter(&$pipe, $data, $export) {
if (!empty($pipe['field_instance'])) {
foreach ($pipe['field_instance'] as $delta => $value) {
$args = explode('-', $value);
$field_name = $args[2];
$excluded_fields = array(
'og_group_ref',
'field_og_access_default_value',
'field_og_subscribe_settings',
'og_roles_permissions',
'group_access',
'field_group_logo',
'group_group',
'body',
);
if (in_array($field_name, $excluded_fields)) {
unset($pipe['field_instance'][$delta]);
}
}
}
if (!empty($pipe['field_base'])) {
foreach ($pipe['field_base'] as $delta => $value) {
if ($delta == 'og_group_ref') {
unset($pipe['field_base'][$delta]);
}
}
}
}
function commons_groups_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "strongarm" && $api == "strongarm") {
return array(
"version" => "1",
);
}
}
function commons_groups_views_api($module = NULL, $api = NULL) {
return array(
"api" => "3.0",
);
}
function commons_groups_image_default_styles() {
$styles = array();
$styles['35x35'] = array(
'label' => '35x35',
'effects' => array(
1 => array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 35,
'height' => 35,
),
'weight' => 1,
),
),
);
$styles['50x50'] = array(
'label' => '50x50',
'effects' => array(
2 => array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 50,
'height' => 50,
),
'weight' => 1,
),
),
);
return $styles;
}
function commons_groups_node_info() {
$items = array(
'group' => array(
'name' => t('Group'),
'base' => 'node_content',
'description' => t('Use groups to contain people and content related by a shared interest or purpose.'),
'has_title' => '1',
'title_label' => t('Group name'),
'help' => '',
),
);
return $items;
}