You are here

function hosting_node_tab_title in Hosting 7.4

Replace the text used on node page "tabs".

1 string reference to 'hosting_node_tab_title'
hosting_menu_alter in ./hosting.module
Implements hook_menu_alter().

File

./hosting.module, line 238
Hosting module.

Code

function hosting_node_tab_title($default, $node) {

  // Use "X Dashboard" and "X Settings" for nodes that are hosting contexts.
  $type_names = node_type_get_names();
  if (!empty($node->hosting_name)) {
    switch ($default) {
      case "View":
        return t('@type Dashboard', [
          '@type' => $type_names[$node->type],
        ]);
      case "Edit":
        return t('@type Settings', [
          '@type' => $type_names[$node->type],
        ]);
    }
  }

  // Use "Task Log" for the "View" tab of task nodes.
  if ($default == 'View' && $node->type == 'task') {
    return t('Task Logs');
  }

  // Otherwise, just return the page text
  return t($default);
}