/ Published in: PHP
                    
                                        
**Important: this snipplet has moved to Github.**
- [Force the admin theme on additional non-admin paths in Drupal 6](https://gist.github.com/1973090)
                - [Force the admin theme on additional non-admin paths in Drupal 6](https://gist.github.com/1973090)
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?php
/**
* In this example, it uses the administration theme on "node creation", "node edition",
* "user registration", "user profile" and "forgot password" pages.
*/
function MODULENAME_init(){
// The list of paths on which to use the administration theme
'user',
'user/*',
'user/password',
'user/*/edit',
'user/*/geodata',
'node/add/*',
'node/*/edit',
'node/*/delete'
);
$path = drupal_get_path_alias($_GET['q']);
$use_admin_theme = false;
foreach ($patterns as $pattern){
if (drupal_match_path($path, $pattern)){
$use_admin_theme = true;
break;
}
}
if ($use_admin_theme){
global $custom_theme;
$custom_theme = variable_get('admin_theme', '0');
drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
}
}
?>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                