You are here

function globallink_update_gl_field_config in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink_field_configuration.inc \globallink_update_gl_field_config()
  2. 7.6 globallink_field_configuration.inc \globallink_update_gl_field_config()

Updates GlobalLink field configuration.

Parameters

string $type: The content type.

array $fids: The array of field IDs.

1 call to globallink_update_gl_field_config()
globallink_field_submit in ./globallink_field_configuration.inc
Handles submission of globallink_field form.

File

./globallink_field_configuration.inc, line 309
globallink_field_configuration.inc is a file that contains most functions needed on the Field Configuration UI.

Code

function globallink_update_gl_field_config($type, $fids) {

  // First update everything to 0 for this type
  db_update('globallink_field_config')
    ->fields(array(
    'translatable' => 0,
  ))
    ->condition('content_type', $type, '=')
    ->execute();
  foreach ($fids as $fid) {
    db_update('globallink_field_config')
      ->fields(array(
      'translatable' => 1,
    ))
      ->condition('fid', $fid, '=')
      ->execute();
  }
}