You are here

private function mimemail_compress::css_style_to_array in Mime Mail 7

Same name and namespace in other branches
  1. 6 modules/mimemail_compress/mimemail_compress.inc \mimemail_compress::css_style_to_array()
1 call to mimemail_compress::css_style_to_array()
mimemail_compress::compress in modules/mimemail_compress/mimemail_compress.inc

File

modules/mimemail_compress/mimemail_compress.inc, line 294
Converts CSS styles into inline style attributes.

Class

mimemail_compress
Compresses HTML and CSS into combined message.

Code

private function css_style_to_array($style) {
  $definitions = explode(';', $style);
  $css_styles = array();
  foreach ($definitions as $def) {
    if (empty($def) || strpos($def, ':') === FALSE) {
      continue;
    }
    list($key, $value) = explode(':', $def, 2);
    if (empty($key) || empty($value)) {
      continue;
    }
    $css_styles[trim($key)] = trim($value);
  }
  return $css_styles;
}