You are here

function theme_domain_theme_form in Domain Access 7.2

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

FormsAPI theming.

File

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

Code

function theme_domain_theme_form($variables) {
  $form = $variables['form'];
  $output = '';
  $output .= drupal_render($form['intro']);
  $themes = system_rebuild_theme_data();
  $header = array(
    t('Screenshot'),
    t('Theme'),
    t('Default'),
    t('Options'),
  );
  $rows = array();
  foreach (element_children($form['theme']) as $key) {
    $default = '';
    if ($form['theme'][$key]['#value'] == $key) {
      $default = t('(default theme)');
    }
    $row = array(
      theme('image', array(
        'path' => $themes[$key]->info['screenshot'],
      )),
      '<h3>' . $themes[$key]->info['name'] . ' ' . (isset($themes[$key]->info['version']) ? $themes[$key]->info['version'] : '') . ' ' . $default . '</h3>' . t($themes[$key]->info['description']),
      drupal_render($form['theme'][$key]),
      l('configure', 'admin/structure/domain/theme/' . $key . '/' . $form['domain_id']['#value'] . '/theme-settings'),
    );
    $rows[] = $row;
  }
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  return $output;
}