You are here

function _sharerich_get_field_names in Sharerich 7.2

Same name and namespace in other branches
  1. 7.3 sharerich.module \_sharerich_get_field_names()

Helper function to get sharerich extra field instances from a display.

Parameters

array $source Drupal FAPI:

Return value

array $names Sharerich related fields

2 calls to _sharerich_get_field_names()
sharerich_form_field_ui_display_overview_form_alter in ./sharerich.module
Implements hook_form_FORM_ID_alter().
_sharerich_display_overview_form_submit in ./sharerich.module
Sharerich field_ui_display_overview_form submit handler.

File

./sharerich.module, line 772

Code

function _sharerich_get_field_names($source = array()) {
  $names = array();
  if (is_array($source)) {
    foreach ($source as $key => $value) {
      if (preg_match('/^sharerich_(\\d+).*$/', $key, $matches)) {
        $names[$matches[1]] = $matches[0];
      }
    }
  }
  return $names;
}