function styleswitcher_admin in Style Switcher 7.2
Same name and namespace in other branches
- 6.2 styleswitcher.admin.inc \styleswitcher_admin()
- 7 styleswitcher.module \styleswitcher_admin()
Page callback: Constructs a form for the Styleswitcher configuration.
See also
1 string reference to 'styleswitcher_admin'
- styleswitcher_menu in ./
styleswitcher.module - Implements hook_menu().
File
- ./
styleswitcher.admin.inc, line 16 - Styleswitcher configuration functionality.
Code
function styleswitcher_admin($form, &$form_state) {
$styles = styleswitcher_custom_styles();
ksort($styles);
$header = array(
t('Style'),
array(
'data' => t('Operations'),
'colspan' => '2',
),
);
$rows = array();
foreach ($styles as $name => $style) {
$name_hyphenated = strtr($name, '_', '-');
// Build the table row.
$row = array();
$row[]['data'] = array(
'#theme' => 'styleswitcher_admin_style_overview',
'#style' => $style,
);
$row[]['data'] = array(
'#markup' => l(t('edit'), 'admin/config/user-interface/styleswitcher/' . $name_hyphenated),
);
$row[]['data'] = array(
'#markup' => l(t('delete'), 'admin/config/user-interface/styleswitcher/' . $name_hyphenated . '/delete'),
// Do not allow to delete the blank style.
'#access' => isset($style['path']),
);
$rows[] = $row;
}
$form['styleswitcher_custom_styles'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
);
$form['styleswitcher_enable_overlay'] = array(
'#type' => 'checkbox',
'#title' => t('Enable overlay'),
'#description' => t('Enable the overlay and fade when switching stylesheets.'),
'#default_value' => variable_get('styleswitcher_enable_overlay', 1),
);
$form['#submit'][] = 'styleswitcher_admin_submit';
return system_settings_form($form);
}