You are here

function lingotek_admin_configuration_view in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.admin.inc \lingotek_admin_configuration_view()
  2. 7.3 lingotek.admin.inc \lingotek_admin_configuration_view()
  3. 7.4 lingotek.admin.inc \lingotek_admin_configuration_view()
  4. 7.5 lingotek.admin.inc \lingotek_admin_configuration_view()
1 string reference to 'lingotek_admin_configuration_view'
lingotek_menu in ./lingotek.module
Implements hook_menu().

File

./lingotek.admin.inc, line 2403

Code

function lingotek_admin_configuration_view($form_short_id = NULL, $show_fieldset = TRUE) {
  lingotek_is_module_setup();
  lingotek_notify_if_no_languages_added();
  $account = LingotekAccount::instance();
  $api = LingotekApi::instance();
  $site = variable_get('site_name', 'Drupal Site');
  $show_advanced = $account
    ->showAdvanced();

  //$form_short_id values:  config, logging, utilities, language_switcher
  $form_id = "lingotek_admin_{$form_short_id}_form";
  if (!is_null($form_short_id) && function_exists($form_id)) {
    return drupal_get_form($form_id);
  }
  ctools_include('modal');
  ctools_modal_add_js();
  $show_fieldset = FALSE;
  $output = array();
  $output['lingotek'] = array(
    '#type' => 'vertical_tabs',
    '#attached' => array(
      'css' => array(
        '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css' => array(
          'type' => 'external',
        ),
      ),
      'js' => array(
        drupal_get_path('module', 'lingotek') . '/js/lingotek.admin.js',
      ),
    ),
  );
  $account_summary = array(
    drupal_get_form('lingotek_admin_account_status_form', $show_fieldset),
    drupal_get_form('lingotek_admin_connection_form', $show_fieldset),
  );
  $output['lingotek'][] = lingotek_wrap_in_fieldset($account_summary, t('Account'), array(
    'id' => 'ltk-account',
  ));
  foreach (lingotek_managed_entity_types(TRUE) as $machine_name => $entity_type) {
    $entity_settings = drupal_get_form('lingotek_admin_entity_bundle_profiles_form', $machine_name, $show_fieldset);
    $output['lingotek'][] = lingotek_wrap_in_fieldset($entity_settings, t('Translate @type', array(
      '@type' => $entity_type['label'],
    )), array(
      'id' => lingotek_get_tab_id($machine_name),
      'class' => array(
        'ltk-entity',
      ),
    ));
  }
  $output['lingotek'][] = lingotek_wrap_in_fieldset(drupal_get_form('lingotek_admin_additional_translation_settings_form', $show_fieldset), t('Translate Configuration'), array(
    'id' => 'ltk-config',
  ));
  $output['lingotek'][] = lingotek_wrap_in_fieldset(drupal_get_form('lingotek_admin_profiles_form', $show_fieldset), t('Translation Profiles'), array(
    'id' => 'ltk-profiles',
  ));
  if ($show_advanced) {
    $output['lingotek'][] = lingotek_wrap_in_fieldset(drupal_get_form('lingotek_admin_advanced_parsing_form', TRUE), t('Advanced Content Parsing'), array(
      'id' => 'ltk-advanced-content-parsing',
    ));
  }
  $output['lingotek'][] = lingotek_wrap_in_fieldset(drupal_get_form('lingotek_admin_prefs_form', $show_fieldset), t('Preferences'), array(
    'id' => 'ltk-prefs',
  ));
  $output['lingotek'][] = lingotek_wrap_in_fieldset(drupal_get_form('lingotek_admin_logging_form', $show_fieldset), t('Logging'), array(
    'id' => 'ltk-logging',
  ));
  $utilities = array(
    drupal_get_form('lingotek_admin_cleanup_form', $show_fieldset),
    drupal_get_form('lingotek_admin_utilities_form', $show_fieldset),
  );
  $output['lingotek'][] = lingotek_wrap_in_fieldset($utilities, t('Utilities'), array(
    'id' => 'ltk-utils',
  ));
  return $output;
}