39a40,62
> function my_domains_theme_page($my_domains) {
>   global $custom_theme;
>   if (isset($my_domains['domain_id'])) {
>     // Set the custom theme, for display.
>     $custom_theme = variable_get('theme_default', 'garland');
>     $theme = domain_theme_lookup($my_domains['domain_id']);
>     // The above returns -1 on failure.
>     if ($theme != -1) {
>       $custom_theme = $theme['theme'];
>       drupal_set_message(t('You are viewing the active theme for %domain.', array('%domain' => $my_domains['sitename'])));
>     }
> 
>     // Load the system form file.
>     include_once drupal_get_path('module', 'system') .'/system.admin.inc';
> 
>     drupal_set_title(t('!site : Domain theme settings', array('!site' => $my_domains['sitename'])));
>     $output = theme_domain_theme_reset($my_domains);
>     return $output . drupal_get_form('system_themes_form');
>   }
>   else {
>     return t('Invalid domain request.');
>   }
> }
210a234,239
> function my_domains_theme_reset($my_domains) {
>   if ($domain == -1) {
>     return t('An invalid request has been made.');
>   }
>   return drupal_get_form('domain_theme_reset_form', $my_domains);
> }
283a313,315
> function my_domains_theme_settings($theme, $my_domains) {
>   // Load the system form file.
>   include_once(drupal_get_path('module', 'system') .'/system.admin.inc');
284a317,333
>   $theme = db_fetch_array(db_query("SELECT theme, settings FROM {domain_theme} WHERE domain_id = %d AND theme = '%s'", $my_domains['domain_id'], $theme));
>   drupal_set_message(t('You are viewing the %theme settings for %domain.', array('%theme' => $theme['theme'], '%domain' => $my_domains['sitename'])));
>   // Write uploads to the proper directory?
>   if ($my_domains['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($theme)) {
>     domain_theme_set_variables($theme);
>     return drupal_get_form('system_theme_settings', $theme['theme']);
>   }
>   else {
>     return drupal_get_form('system_theme_settings');
>   }
> }
