You are here

function lingotek_get_entity_setup_path in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lingotek.util.inc \lingotek_get_entity_setup_path()
  2. 7.6 lingotek.util.inc \lingotek_get_entity_setup_path()

Return redirect-path information by entity type for Lingotek-supported entities

Parameters

$entity_type: a string containing the name of the given entity type

$next: whether to redirect to the next setup destination or just return the current one

7 calls to lingotek_get_entity_setup_path()
lingotek_admin_entity_bundle_profiles_form_submit in ./lingotek.admin.inc
Node Translation Settings - Form Submit
lingotek_setup_additional_translation_settings_form in ./lingotek.setup.inc
lingotek_setup_additional_translation_settings_form_submit in ./lingotek.setup.inc
lingotek_setup_comment_translation_settings_form in ./lingotek.setup.inc
lingotek_setup_comment_translation_settings_form_submit in ./lingotek.setup.inc

... See full list

File

./lingotek.util.inc, line 2124
Utility functions.

Code

function lingotek_get_entity_setup_path($entity_type, $next = FALSE) {
  $node_next = LINGOTEK_MENU_LANG_BASE_URL . '/comment-translation-settings';
  if (!module_exists('comment')) {
    $node_next = LINGOTEK_MENU_LANG_BASE_URL . '/additional-translation-settings';
  }
  $entities = array(
    'node' => array(
      'current' => LINGOTEK_MENU_LANG_BASE_URL . '/node-translation-settings',
      'next' => $node_next,
    ),
    'comment' => array(
      'current' => LINGOTEK_MENU_LANG_BASE_URL . '/comment-translation-settings',
      'next' => LINGOTEK_MENU_LANG_BASE_URL . '/additional-translation-settings',
    ),
    'config' => array(
      'current' => LINGOTEK_MENU_LANG_BASE_URL . '/additional-translation-settings',
      'next' => 'admin/settings/lingotek',
    ),
  );
  if (isset($entities[$entity_type])) {
    if ($next) {
      return $entities[$entity_type]['next'];
    }
    else {
      return $entities[$entity_type]['current'];
    }
  }
  return NULL;
}