Admin theme for node (add, edit) and user (edit)

If you want to use your selected admin theme when creating a node or editing an user, you can do this easily with a very small custom module. In your custom module's hook_menu(), add this (outside of the $may_cache block):

<?php
 
if ((arg(0) == 'node' && arg(1) == 'add') ||  (arg(0) == 'node' && arg(2) == 'edit') ||  (arg(0) == 'user' && arg(2) == 'edit') ) {
      global
$custom_theme;
     
$custom_theme = variable_get('admin_theme', '0');
     
drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
  }
?>

Or whatever other set of path rules you want.

See also:

Has something like this been

SubEl - July 3, 2008 - 04:39

Has something like this been contributed to drupal.org? I can't seem to find any modules that do this. I don't know the first thing about php or creating modules, but I'd really like to have this functionality on my site.

 
 

Drupal is a registered trademark of Dries Buytaert.