Download & Extend

Adding ADMIN css file only to admin pages

Project:Iconizer
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:thePanz
Status:closed (fixed)

Issue Summary

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');
  }
.
.
.
?>

Comments

#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

Assigned to:Anonymous» thePanz
Status:needs review» reviewed & tested by the community

#3

Status:reviewed & tested by the community» fixed

Feature/Fix added into latest -DEV version.

#4

Status:fixed» closed (fixed)

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

nobody click here