ATM, print uses it's own icons for displaying the link icon for printing and emailing.
As far as I understand the code, these are called in print_ui.module, function theme_print_ui_format_link.
Line 512 calls drupal_get_path('module', $module) . '/icons/' . $link['icon']; to get the icon from the submodule.

This makes is impossible (without patching the print module and overwriting e.g. the icons/print-icon.png) to use a themed icon.

Wouldn't it be better to fetch a "generic" print icon from the theme - and provide the default if the theme has none?
Then it would be easy to provide an icon by the theme.

Comments

sonictruth’s picture

Having this module use render arrays or the theme system for the links would would make this kind of thing infinitely easier. Seems like a glaring oversight to me.

Renee S’s picture

Not impossible: that's a theme function, you can override it in your theme's template.php file. For example:

/**
 * Format the Printer-friendly link
 *
 * @return
 *   array of formatted attributes
 * @ingroup themeable
 */
function ourtheme_print_ui_format_link() {
  $print_html_link_class = variable_get('print_html_link_class', PRINT_HTML_LINK_CLASS_DEFAULT);
  $print_html_new_window = variable_get('print_html_new_window', PRINT_HTML_NEW_WINDOW_DEFAULT);

  $title = t('Print-friendly');
  //$class = strip_tags($print_html_link_class) . ' tipsy-n';
  $class = 'tipsy-n';
  $target = "_self";

  if($print_html_new_window == 0) {
          $target = "_blank";
  }

  return array('text' => "<i class=\"icon-print\"></i>",
               'html' => "<a href='#'></a>",
               'attributes' => array('title' => $title, 'class' => $class, 'target' => $target),
  );
}
sonictruth’s picture

I know it's possible to override the theme function and that's actually what I ended up doing but if the module was building render arrays instead of markup it would be way easier to adjust the icons.