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
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

thePanz - February 14, 2008 - 09:54

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

thePanz - February 14, 2008 - 09:55
Assigned to:Anonymous» thePanz
Status:needs review» reviewed & tested by the community

#3

thePanz - February 28, 2008 - 15:00
Status:reviewed & tested by the community» fixed

Feature/Fix added into latest -DEV version.

#4

Anonymous (not verified) - March 13, 2008 - 15:05
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.