You are here

function domain_theme_settings in Domain Access 6.2

Same name and namespace in other branches
  1. 7.3 domain_theme/domain_theme.admin.inc \domain_theme_settings()
  2. 7.2 domain_theme/domain_theme.admin.inc \domain_theme_settings()

The domain theme page callback router.

Parameters

$theme: The theme being configured.

$domain: The $domain object created by domain_lookup().

1 string reference to 'domain_theme_settings'
domain_theme_menu in domain_theme/domain_theme.module
Implement hook_menu()

File

domain_theme/domain_theme.admin.inc, line 262
Include file to handle theme configration screen

Code

function domain_theme_settings($theme, $domain) {

  // Load the system form file.
  include_once drupal_get_path('module', 'system') . '/system.admin.inc';
  $settings = db_fetch_array(db_query("SELECT theme, settings FROM {domain_theme} WHERE domain_id = %d AND theme = '%s'", $domain['domain_id'], $theme));
  drupal_set_message(t('You are viewing the %theme settings for %domain.', array(
    '%theme' => $theme,
    '%domain' => $domain['sitename'],
  )));

  // Write uploads to the proper directory.
  if ($domain['domain_id'] > 0) {
    global $conf;
    $conf['file_directory_path'] = file_directory_path() . '/domain-' . $domain['domain_id'];
  }

  // If there are settings, we have to load ours.
  if (!empty($settings)) {
    domain_theme_set_variables($settings);
    return drupal_get_form('system_theme_settings', $settings['theme']);
  }
  else {
    return drupal_get_form('system_theme_settings', $theme);
  }
}