You are here

function sharerich_field_extra_fields in Sharerich 7.3

Same name and namespace in other branches
  1. 7 sharerich.module \sharerich_field_extra_fields()
  2. 7.2 sharerich.module \sharerich_field_extra_fields()

Implements hook_field_extra_fields().

Parameters

bool $get_defaults: Set TRUE to return default confs.

string $type: Node type to filter results to.

Return value

array

4 calls to sharerich_field_extra_fields()
sharerich_field_formatter_settings_form in ./sharerich.module
Pseudo hook_field_formatter_settings_form().
sharerich_field_formatter_settings_summary in ./sharerich.module
Pseudo hook_field_formatter_settings_summary().
sharerich_form_field_ui_display_overview_form_alter in ./sharerich.module
Implements hook_form_FORM_ID_alter().
sharerich_node_view in ./sharerich.module
Implements hook_node_view().

File

./sharerich.module, line 441

Code

function sharerich_field_extra_fields($get_defaults = 0, $type = NULL) {
  if ($get_defaults) {
    $defaults = _sharerich_extra_field_default_info($get_defaults);
    return array(
      'extra_fields' => $defaults,
    );
  }
  $extra = array();
  if ($type) {
    $count = (int) variable_get('sharerich_node_' . $type, 0);
    _sharerich_extra_field_default_info_set($extra, $type, $count);
  }
  else {
    foreach (node_type_get_types() as $node) {
      $count = (int) variable_get('sharerich_node_' . $node->type, 0);
      _sharerich_extra_field_default_info_set($extra, $node->type, $count);
    }
  }
  return $extra;
}