public static function generate_style($style, $auto_width = TRUE) { $buffer = ''; if ($style === NULL) { $style = array(); } if (isset($style['auto_width'])) { $auto_width = $style['auto_width']; } if ($auto_width && !isset($style['width'])) { $style['width'] = '200px'; } if (isset($style['width'])) { self::$last_width = intval($style['width']); } else { self::$last_width = 0; } foreach ($style as $var => $val) { if ($buffer != '') { $buffer .= ' '; } $buffer .= $var . ': ' . $val . ';'; } if ($buffer != '') { return ' style="' . $buffer . '"'; } return ''; }