You are here

function _hosting_node_link in Hosting 7.4

Same name and namespace in other branches
  1. 5 hosting.module \_hosting_node_link()
  2. 6.2 hosting.module \_hosting_node_link()
  3. 7.3 hosting.module \_hosting_node_link()

Generates a link to a node.

8 calls to _hosting_node_link()
hosting_client_form_user_profile_form_alter in client/hosting_client.access.inc
Implements hook_form_FORM_ID_alter().
hosting_client_view_user in client/hosting_client.access.inc
Add visible items when viewing a user().
hosting_platform_post_hosting_verify_task in platform/hosting_platform.drush.inc
Implements hook_post_hosting_TASK_TYPE_task().
hosting_platform_view in platform/hosting_platform.module
Implements hook_view().
hosting_set_breadcrumb in ./hosting.module
Generate context sensitive breadcrumbs.

... See full list

4 string references to '_hosting_node_link'
hostingService_http_cluster::view in web_cluster/hosting_web_cluster.service.inc
hostingService_http_pack::view in web_pack/hosting_web_pack.service.inc
hosting_platform_hosting_summary in platform/hosting_platform.module
Implements hook_hosting_summary().
hosting_site_form in site/hosting_site.form.inc
Implements hook_form().

File

./hosting.module, line 561
Hosting module.

Code

function _hosting_node_link($nid, $title = NULL) {
  if (is_null($nid)) {
    return t("None");
  }
  $node = node_load($nid);
  if (!isset($title)) {
    $title = isset($node->title) ? $node->title : NULL;

    // Override with the redirect target, when available.
    $title = $node->type == 'site' ? hosting_site_canonical_url($node) : $title;

    // Override with the human-readable name, when available.
    $title = isset($node->human_name) && strlen($node->human_name) ? $node->human_name : $title;
  }
  $title = filter_xss($title);
  if (isset($node->nid)) {
    return node_access('view', $node) ? l($title, "node/" . $node->nid) : $title;
  }
}