function theme_taxonomy_title_admin_settings in Taxonomy Title 7
Same name and namespace in other branches
- 6 taxonomy_title.admin.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_settings_form in ./
taxonomy_title.admin.inc - Admin settings form.
File
- ./
taxonomy_title.theme.inc, line 10 - Theme functions for the taxonomy title module.
Code
function theme_taxonomy_title_admin_settings($variables) {
$form = $variables['form'];
if (!module_exists('page_title') && !module_exists('metatag')) {
$title_head = t('Affect title tag');
}
else {
$title_head = t('Affect title tag *');
}
$header = array(
t('Terms in vocabulary'),
t('Global default value'),
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);
$row[] = drupal_render($form['taxonomy_title_default_' . $vid]);
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_path = drupal_get_path('module', 'taxonomy_title') . '/images/' . 'heading.png';
$heading_example = theme('image', array(
'path' => $heading_path,
));
$title_path = drupal_get_path('module', 'taxonomy_title') . '/images/' . 'title.png';
$title_example = theme('image', array(
'path' => $title_path,
));
$rows[] = array(
t('Example'),
array(
'data' => '',
),
array(
'data' => $heading_example,
'class' => 'checkbox',
),
array(
'data' => $title_example,
'class' => 'checkbox',
),
);
// Create the table inside the form.
$form['settings'] = array(
'#markup' => theme('table', array(
'header' => $header,
'rows' => $rows,
)),
'#weight' => -1,
);
$form['#sorted'] = FALSE;
return drupal_render_children($form);
}