You are here

function _hosting_site_goto_link in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 site/hosting_site.module \_hosting_site_goto_link()
  2. 7.3 site/hosting_site.module \_hosting_site_goto_link()

Generate a link allowing the user to log into their new site, or simply go to the site front page if the link has expired.

1 call to _hosting_site_goto_link()
hosting_site_view in site/hosting_site.nodeapi.inc
Implements hook_view().

File

site/hosting_site.module, line 188
Contains hook implementations for Hosting site module.

Code

function _hosting_site_goto_link($node) {
  $cache = cache_get("hosting:site:" . $node->nid . ":login_link");
  if (user_access('create login-reset task') && $cache && REQUEST_TIME < $cache->data['expire']) {
    $title = t("Log in to !url", array(
      '!url' => hosting_site_canonical_url($node),
    ));
  }
  else {
    $title = t("Go to !url", array(
      '!url' => hosting_site_canonical_url($node),
    ));
  }
  $url = "node/" . $node->nid . "/goto_site";
  return theme('hosting_site_goto_link', array(
    'title' => $title,
    'url' => $url,
  ));
}