You are here

function hook_domainlinks in Domain Access 7.2

Same name and namespace in other branches
  1. 5 API.php \hook_domainlinks()
  2. 6.2 API.php \hook_domainlinks()

Returns links to additional functions for the Domain Access module's admin screen

Note that if your page requires a user_access check other than 'administer domains' you should explictly check permissions before returning the array.

Parameters

$domain: An array of data for the active domain, taken from the {domain} table.

  • domain_id -- the unique identifier of this domain
  • subdomain -- the host path of the url for this domain
  • sitename -- the human-readable name of this domain

Return value

An array of links to append to the admin screen, in the format:

  • title -- the link title
  • path -- the link path (a Drupal-formatted path)

The data returned by this function will be passed through the l() function.

If you do not provide a link for a specific domain, return FALSE.

Related topics

4 functions implement hook_domainlinks()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

domain_alias_domainlinks in domain_alias/domain_alias.module
Implements hook_domainlinks()
domain_conf_domainlinks in domain_conf/domain_conf.module
Implements hook_domainlinks()
domain_content_domainlinks in domain_content/domain_content.module
Implements hook_domainlinks()
domain_theme_domainlinks in domain_theme/domain_theme.module
Implements hook_domainlinks()
1 invocation of hook_domainlinks()
domain_view in ./domain.admin.inc
The main administration page, a list of active domains.

File

./domain.api.php, line 109
API documentation file.

Code

function hook_domainlinks($domain) {

  // These actions do not apply to the primary domain.
  if (user_access('my permission') && $domain['domain_id'] > 0) {
    $links[] = array(
      'title' => t('settings'),
      'path' => 'admin/structure/domain/myaction/' . $domain['domain_id'],
    );
    return $links;
  }
  return FALSE;
}