You are here

function hosting_subdirs_alter_alias_documentation in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 subdirs/hosting_subdirs.module \hosting_subdirs_alter_alias_documentation()

Add inline documentation about subdirs.

1 string reference to 'hosting_subdirs_alter_alias_documentation'
hosting_subdirs_form_alter in subdirs/hosting_subdirs.module
Implements hook_form_alter().

File

subdirs/hosting_subdirs.module, line 24
Allow sites to be installed in subdirectories.

Code

function hosting_subdirs_alter_alias_documentation($form, $form_state) {

  // Explain about base URLS in the context of subdirectories.
  $domain_help = 'Hint: If you plan to use a subdomain (e.g., example.com/site1, and also use the root domain (e.g., example.com), you must create a site with the root domain *before* adding sites in its subdirectories. Note: Once the first site in a subdirectory is created and the parent site also exists, the parent site must be re-verified (just once) to turn on the web server configuration for the first (and any future) sites in its subdirectory.';
  if (isset($form['title']['#description'])) {
    $form['title']['#description'] .= $domain_help;
  }
  else {
    $form['title']['#description'] = $domain_help;
  }

  // Explain what we're doing with aliases and redirection.
  $alias_help = 'Note: If the site is installed in a subdirectory (e.g., example.com/site1), it gets renamed internally (e.g., site1.example.com), and an alias added for the subdirectory path (e.g., example.com/foo). In addition, redirection will be setup up to point to the subdirectory domain. You can still add more standard aliases (e.g., bar.example.com, green.example.com).';
  if (isset($form['aliases_wrapper']['#description'])) {
    $form['aliases_wrapper']['#description'] .= $alias_help;
  }
  else {
    $form['aliases_wrapper']['#description'] = $alias_help;
  }

  // Indicate the internal URL.
  if (isset($form_state['node']->redirection) && $form_state['node']->redirection) {
    $form['info']['title']['#markup'] = $form_state['node']->redirection . ' (Internal URL: ' . $form_state['node']->title . ')';
  }
  return $form;
}