You are here

function lingotek_get_entity_setup_path in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 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 1397
Utility functions.

Code

function lingotek_get_entity_setup_path($entity_type, $next = FALSE) {
  $node_next = 'admin/config/lingotek/comment-translation-settings';
  if (!module_exists('comment')) {
    $node_next = 'admin/config/lingotek/additional-translation-settings';
  }
  $entities = array(
    'node' => array(
      'current' => 'admin/config/lingotek/node-translation-settings',
      'next' => $node_next,
    ),
    'comment' => array(
      'current' => 'admin/config/lingotek/comment-translation-settings',
      'next' => 'admin/config/lingotek/additional-translation-settings',
    ),
    'config' => array(
      'current' => 'admin/config/lingotek/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;
}