Admin Theme Support
kwinters - May 20, 2009 - 15:30
| Project: | Node clone |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Please implement admin theme support (use the admin theme for node cloning if it is also used for node editing).
It seems like the easiest way to do this is to add a hook_init with the following:
<?php
if (variable_get('node_admin_theme', '0') && arg(0) == 'node' && arg(2) == 'clone') {
global $custom_theme;
$custom_theme = variable_get('admin_theme', '0');
drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
}
?>
#1
yes, that seems to be what system module is doing (in a pathetically inflexible way)
http://api.drupal.org/api/function/system_init/6
#2
Provided patch against HEAD, added documentation.
There doesn't appear to be a better way to do this in D6.
#3
Looks reasonable - does it work?
#4
Yes. To test, apply the patch, set an admin theme with "Use administration theme for content editing" enabled. Find a node, hit Clone. The theme applied should be the same as for Edit.
If you don't check the content editing box, both Edit and Clone will use the main site theme instead of the admin theme.
#5
Great patch, thanks! Someone needs to merge this in :)