You are here

function theme_taxonomy_title_admin_settings in Taxonomy Title 6

Same name and namespace in other branches
  1. 7 taxonomy_title.theme.inc \theme_taxonomy_title_admin_settings()

Theme function for admin form, turns into a table

1 theme call to theme_taxonomy_title_admin_settings()
taxonomy_title_admin_settings in ./taxonomy_title.admin.inc
@file Settings form for taxonomy title.

File

./taxonomy_title.admin.inc, line 71
Settings form for taxonomy title.

Code

function theme_taxonomy_title_admin_settings($form) {
  if (!module_exists('page_title')) {
    $title_head = t('Affect Title tag');
  }
  else {
    $title_head = t('Affect Title tag*');
  }
  $header = array(
    t('Terms in vocabulary'),
    array(
      'data' => t('Affect Heading tag'),
      'class' => 'checkbox',
    ),
    array(
      'data' => $title_head,
      'class' => 'checkbox',
    ),
  );
  $rows = array();
  foreach ($form['taxonomy_title_page_titles']['#options'] as $vid => $name) {
    $row = array();
    $row[] = check_plain($name);
    unset($form['taxonomy_title_headings'][$vid]['#title']);
    $row[] = array(
      'data' => drupal_render($form['taxonomy_title_headings'][$vid]),
      'class' => 'checkbox',
    );
    unset($form['taxonomy_title_page_titles'][$vid]['#title']);
    $row[] = array(
      'data' => drupal_render($form['taxonomy_title_page_titles'][$vid]),
      'class' => 'checkbox',
    );
    $rows[] = $row;
  }

  // Add a row with screenshots.
  $heading_example = theme('image', drupal_get_path('module', 'taxonomy_title') . '/includes/' . 'heading.png');
  $title_example = theme('image', drupal_get_path('module', 'taxonomy_title') . '/includes/' . 'title.png');
  $rows[] = array(
    t('Example'),
    array(
      'data' => $heading_example,
      'class' => 'checkbox',
    ),
    array(
      'data' => $title_example,
      'class' => 'checkbox',
    ),
  );

  // Create the table inside the form.
  $form['settings']['table'] = array(
    '#value' => theme('table', $header, $rows),
    '#weight' => 1,
  );
  return drupal_render($form);
}