Adding ADMIN css file only to admin pages
nimazuk - February 10, 2008 - 05:06
| Project: | Iconizer |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | thePanz |
| Status: | closed |
Jump to:
Description
The iconizer module adds admin CSS file to all pages, this causes a bandwidth performance issue because the CSS file will be downloaded for all users even anonymous ones!
Here I added extra condition in ADD CSS FUNCTION that fixes this problem and loads the admin css only in admin pages.
( && arg(0)=="admin" )
iconizer.module line: 183
<?php
/**
* Add CSS function
*/
function _iconizer_add_css() {
if(variable_get('iconizer_admin_icons', 1) == 1 && arg(0)=="admin") {
drupal_add_css(_iconizer_admin_css(variable_get('iconizer_admin_icons_theme', 'default')),'module','screen');
}
.
.
.
?>
#1
Hi, thank you for your patch!
It's a really great idea to reduce bandwidth usage for non-admin pages load!
I'll add it in next version! (Hope to find some free time to do it! :| )
Regards and thank you again! :)
#2
#3
Feature/Fix added into latest -DEV version.
#4
Automatically closed -- issue fixed for two weeks with no activity.