function admin_menu_theme_settings in Administration menu 6.3
Same name and namespace in other branches
- 5.3 admin_menu.inc \admin_menu_theme_settings()
- 5.2 admin_menu.module \admin_menu_theme_settings()
- 6 admin_menu.inc \admin_menu_theme_settings()
- 7.3 admin_menu.inc \admin_menu_theme_settings()
Form builder function for module settings.
1 string reference to 'admin_menu_theme_settings'
- admin_menu_menu in ./
admin_menu.module - Implements hook_menu().
File
- ./
admin_menu.inc, line 240 - Menu builder functions for Administration menu.
Code
function admin_menu_theme_settings() {
$form['admin_menu_margin_top'] = array(
'#type' => 'checkbox',
'#title' => t('Adjust top margin'),
'#default_value' => variable_get('admin_menu_margin_top', 1),
'#description' => t('If enabled, the site output is shifted down approximately 20 pixels from the top of the viewport to display the administration menu. If disabled, some absolute- or fixed-positioned page elements may be covered by the administration menu.'),
);
$form['admin_menu_position_fixed'] = array(
'#type' => 'checkbox',
'#title' => t('Keep menu at top of page'),
'#default_value' => variable_get('admin_menu_position_fixed', 0),
'#description' => t('Displays the administration menu always at the top of the browser viewport (even when scrolling the page).'),
);
// @todo Re-confirm this with latest browser versions.
$form['admin_menu_position_fixed']['#description'] .= '<br /><strong>' . t('In some browsers, this setting may result in a malformed page, an invisible cursor, non-selectable elements in forms, or other issues.') . '</strong>';
$form['admin_menu_cache_client'] = array(
'#type' => 'checkbox',
'#title' => t('Cache menu in client-side browser'),
'#default_value' => variable_get('admin_menu_cache_client', 1),
);
$form['tweaks'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced settings'),
);
$form['tweaks']['admin_menu_tweak_modules'] = array(
'#type' => 'checkbox',
'#title' => t('Collapse fieldsets on modules page'),
'#default_value' => variable_get('admin_menu_tweak_modules', 0),
'#description' => t('If enabled, fieldsets on the <a href="!modules-url">modules</a> page are automatically collapsed when loading the page.', array(
'!modules-url' => url('admin/build/modules'),
)),
);
if (module_exists('util')) {
$form['tweaks']['admin_menu_tweak_modules']['#description'] .= '<br /><strong>' . t('If the Utility module was installed for this purpose, it can be safely disabled and uninstalled.') . '</strong>';
}
$form['tweaks']['admin_menu_tweak_permissions'] = array(
'#type' => 'checkbox',
'#title' => t('Collapse modules on permissions page'),
'#default_value' => variable_get('admin_menu_tweak_permissions', 0),
'#description' => t('Collapses permissions by module on the <a href="@permissions-url">permissions</a> page.', array(
'@permissions-url' => url('admin/user/permissions'),
)),
);
$form['tweaks']['admin_menu_tweak_tabs'] = array(
'#type' => 'checkbox',
'#title' => t('Move local tasks into menu'),
'#default_value' => variable_get('admin_menu_tweak_tabs', 0),
'#description' => t('If enabled, the tabs on the current page are moved into the administration menu. This feature is only available in themes that use the CSS classes <code>tabs primary</code> and <code>tabs secondary</code> for tabs.'),
);
// Fetch all available modules manually, since module_list() only returns
// currently enabled modules, which makes this setting pointless if developer
// modules are currently disabled.
$all_modules = array();
$result = db_query("SELECT name, filename FROM {system} WHERE type = 'module' ORDER BY name ASC");
while ($module = db_fetch_object($result)) {
if (file_exists($module->filename)) {
$all_modules[$module->name] = $module->name;
}
}
$devel_modules = variable_get('admin_menu_devel_modules', _admin_menu_developer_modules());
$devel_modules = array_intersect($all_modules, $devel_modules);
$form['tweaks']['admin_menu_devel_modules_skip'] = array(
'#type' => 'checkboxes',
'#title' => t('Developer modules to keep enabled'),
'#default_value' => variable_get('admin_menu_devel_modules_skip', array()),
'#options' => $devel_modules,
'#access' => !empty($devel_modules),
'#description' => t('Enabled developer modules in this list will not be disabled when the link <em>Disable developer modules</em> in the menu below the icon is invoked.'),
);
return system_settings_form($form);
}