You are here

function minisite_site_load in Mini site 7

Load minisite.

Possible side effect of issuing a redirect if the minisite is not aliased.

Parameters

boolean $redirect: If this is TRUE and the minisite is not aliased this function will perform the redirect.

Return value

mixed

  • FALSE is the minisite is not found or invalid
  • An array of info if the minisite is found and aliased, or $redirect is FALSE
  • NULL if the minisite is found, unaliased and $redirect is TRUE
2 calls to minisite_site_load()
minisite_deliver in includes/minisite.theme.inc
Deliver minisite.
minisite_page_delivery_callback_alter in includes/minisite.theme.inc
Alter page delivery callback.

File

./minisite.module, line 59
Module file.

Code

function minisite_site_load($redirect = TRUE) {
  $minisite_info = minisite_site_lookup();
  if (empty($minisite_info) || empty($minisite_info['mid']) || empty($minisite_info['source'])) {
    return FALSE;
  }
  if (!empty($minisite_info['alias_status']) && $minisite_info['alias_status'] == 1) {
    return $minisite_info;
  }
  if ($redirect) {
    $minisite_site_url = _minisite_site_file_public_path_base_url() . $minisite_info['source'] . '/index.html';
    drupal_goto($minisite_site_url);
  }
  else {
    return $minisite_info;
  }
}