function domain_theme_lookup in Domain Access 7.2
Same name and namespace in other branches
- 5 domain_theme/domain_theme.module \domain_theme_lookup()
- 6.2 domain_theme/domain_theme.module \domain_theme_lookup()
- 7.3 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.module - 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 132 - 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;
}