You are here

function globallink_config_features_export_options in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink.features.inc \globallink_config_features_export_options()
  2. 7.5 globallink.features.inc \globallink_config_features_export_options()

Implementation of hook_features_export_options. [component_hook]

This hook will alert features of which specific items of this component may be exported. For instances, in this case, we want to make available all the existing items. If there are no items to be exported, this component will not be made available in the features export page.

Return value

array A keyed array of items, suitable for use with a FormAPI select or checkboxes element.

File

./globallink.features.inc, line 20
Provides Features integration for the GlobalLink module to export settings and field configurations.

Code

function globallink_config_features_export_options() {
  $options = array();

  //options for globallink settings
  $options['globallink_pd_url'] = 'URL';
  $options['globallink_pd_username'] = 'User Id';
  $options['globallink_pd_password'] = 'Password';
  $options['globallink_pd_projectid'] = 'Project Short Code(s)';
  $options['globallink_pd_submissionprefix'] = 'Submission Name Prefix';
  $options['globallink_pd_classifier'] = 'Classifier';
  $options['globallink_pd_max_target'] = 'Max Target Count';

  //options for adaptor settings
  $options['globallink_pager_limit'] = 'Dashboard Pager Limit';
  $options['globallink_enable_preview'] = 'Enable Preview For Receive Translations';
  $options['globallink_implementation_type'] = 'Node/Field Translation Filter Implementation';
  $options['globallink_publish_node'] = 'Publish Translated Content';
  $options['globallink_cron_type'] = 'Automatic Update Status';
  $options['globallink_proxy_url'] = 'Proxy URL';
  $options['globallink_entity_create_revisions'] = 'Create Revisions for Entities';

  //options for globallink field configurations settings
  $result = db_query("SELECT locale_code, locale_desc FROM {globallink_locale} WHERE drupal_locale_code NOT LIKE :code", array(
    ':code' => 'NULL',
  ))
    ->fetchAll();
  foreach ($result as $row) {
    $options[$row->locale_code] = $row->locale_desc;
  }

  //options for globallink field configurations settings
  $query = "SELECT content_type, field_name FROM {globallink_field_config}";
  $result = db_query($query);
  foreach ($result as $row) {
    $options[$row->content_type . "|" . $row->field_name] = ucfirst($row->content_type) . ':' . $row->field_name;
  }
  return $options;
}