You are here

function bueditor_sprite_buttons in BUEditor 6.2

Same name and namespace in other branches
  1. 7 admin/bueditor.sprite.inc \bueditor_sprite_buttons()

Create an icon sprite for a set of buttons.

2 calls to bueditor_sprite_buttons()
bueditor_sprite in admin/bueditor.sprite.inc
Create and return editor sprite depending on editor settings or buttons.
bueditor_sprite_editor in admin/bueditor.sprite.inc
Create an icon sprite for an editor.

File

admin/bueditor.sprite.inc, line 32
Generates CSS sprites for editor buttons.

Code

function bueditor_sprite_buttons($buttons, $iconpath) {
  $icons = array();
  $iconpath = bueditor_path_tr($iconpath);
  foreach ($buttons as $button) {
    if (substr($button->title, 0, 4) != 'tpl:' && preg_match('/\\.(png|gif|jpg)$/', $button->icon)) {
      $icons[] = $iconpath . '/' . $button->icon;
    }
  }
  return bueditor_sprite_icons($icons);
}