private function mimemail_compress::css_style_to_array in Mime Mail 6
Same name and namespace in other branches
- 7 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 222 - Converts CSS styles into inline style attributes.
Class
- mimemail_compress
- Compress 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;
}