There is already a way to have custom icons by dropping them into the module's images folder. However, this module also has a (faulty) implementation for doing this by dropping the icon into the 'controlpanel' subfolder in the theme folder. That happens, currently, by using the following line (line 145) to figure out the current theme:
$theme_path = path_to_theme() . '/controlpanel/' . variable_get('controlpanel_icon_size' . $block, '48x48');
path_to_theme()
is the wrong function to use here. As noted in the Drupal API, path_to_theme()
DOES NOT return the active theme's path when invoked in the scope of a theming call (in this case, it's called from theme_controlpanel_panel_view()
, which is very obviously a theming call). It only returns the path to the active theme when called OUTSIDE the scope of a theming call. (This is documented more clearly in the link to the Drupal API, above.)
Comment | File | Size | Author |
---|---|---|---|
#1 | controlpanel-theme-icons-1279456-1.patch | 640 bytes | sbandyopadhyay |
Comments
Comment #1
sbandyopadhyay CreditAttribution: sbandyopadhyay commentedI've attached a patch that uses the global variable
$theme_key
in combination withdrupal_get_path()
to accomplish the same effect.After applying this patch, one can simply create a folder called "controlpanel" in a theme folder, copy the icon folders from "images" (included in the controlpanel.module download) into that folder, and take it from there.