function admin_menu_form_alter in Administration menu 7.3
Same name and namespace in other branches
- 8.3 admin_menu.module \admin_menu_form_alter()
- 5.3 admin_menu.inc \admin_menu_form_alter()
- 5 admin_menu.module \admin_menu_form_alter()
- 5.2 admin_menu.module \admin_menu_form_alter()
Implements hook_form_alter().
File
- ./
admin_menu.module, line 933 - Render an administrative menu as a dropdown menu at the top of the window.
Code
function admin_menu_form_alter(&$form, &$form_state, $form_id) {
$global_flush_ids = array(
'admin_menu_theme_settings' => 1,
// Update links for clean/non-clean URLs.
'system_clean_url_settings' => 1,
// Incorporate changed user permissions.
'user_admin_permissions' => 1,
// Removing a role potentially means less permissions.
'user_admin_role_delete_confirm' => 1,
// User name and roles may be changed on the user account form.
'user_profile_form' => 1,
);
if (isset($global_flush_ids[$form_id])) {
$form['#submit'][] = 'admin_menu_form_alter_flush_cache_submit';
// Optionally limit the cache flush to a certain user ID.
$form_state['admin_menu_uid'] = NULL;
if ($form_id == 'user_profile_form') {
$form_state['admin_menu_uid'] = $form_state['user']->uid;
}
}
// UX: Add a confirmation to the permissions form to ask the user whether to
// auto-enable the 'access administration menu' permission along with
// 'access administration pages'.
if ($form_id == 'user_admin_permissions') {
$form['#attached']['js'][] = drupal_get_path('module', 'admin_menu') . '/admin_menu.admin.js';
}
}