You are here

function domain_theme_lookup in Domain Access 7.3

Same name and namespace in other branches
  1. 5 domain_theme/domain_theme.module \domain_theme_lookup()
  2. 6.2 domain_theme/domain_theme.module \domain_theme_lookup()
  3. 7.2 domain_theme/domain_theme.module \domain_theme_lookup()

Get domain theme information

Parameters

$domain_id: The domain_id taken from {domain}.

$theme: The string representation of a {domain_theme} entry. Optional. If this value is NULL, the default theme for this domain will be returned.

$reset: A boolean flag to clear the static variable if necessary. Not used. Here for consistency.

Return value

An array containing the requested row from the {domain_theme} table. Returns -1 on failure.

5 calls to domain_theme_lookup()
domain_theme_batch_lookup in domain_theme/domain_theme.domain.inc
Return a theme setting for batch processing.
domain_theme_custom_theme in domain_theme/domain_theme.module
Implements hook_custom_theme().
domain_theme_form in domain_theme/domain_theme.admin.inc
Form callback to set theme per domain.
domain_theme_form_submit in domain_theme/domain_theme.admin.inc
Form submit handler.
domain_theme_settings_submit in domain_theme/domain_theme.admin.inc
Process domain_theme_settings form submissions.

File

domain_theme/domain_theme.module, line 137
Domain Theme module for the Domain Access module group.

Code

function domain_theme_lookup($domain_id, $theme = NULL, $reset = FALSE) {
  if (!is_null($theme)) {
    $return = db_query("SELECT domain_id, theme, settings, status FROM {domain_theme} WHERE domain_id = :domain_id AND theme= :theme", array(
      ':domain_id' => $domain_id,
      ':theme' => $theme,
    ))
      ->fetchAssoc();
  }
  else {
    $return = db_query("SELECT domain_id, theme, settings, status FROM {domain_theme} WHERE domain_id = :domain_id AND status = 1", array(
      ':domain_id' => $domain_id,
    ))
      ->fetchAssoc();
  }
  if (empty($return)) {
    $return = -1;
  }
  return $return;
}