Commit 8c88e64b authored by Robert Lyon's avatar Robert Lyon
Browse files

Fixing the layout images being broken by locale setting



Bug 1468144

If your php site locale is one that uses comma as decimal seperator,
eg in Dutch 12,5 is the same as 12.5 in English then the layout thumbs
break.

Need to change , back to . for it to work.

The best way to do this would be to set the locale to english for the
layout creation and then set it back again but we can't be sure which
english is available so I've just done a str_replace of , to .

Change-Id: I807eda47e76d3654137681bded26164e535eb9eb
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 33b4f602
......@@ -75,7 +75,7 @@ class LayoutPreviewImage {
$columns = explode(',', $row);
foreach ($columns as $column) {
$col_width = $this->get_percentage_column_width(count($columns), $column);
$layout .= "<rect x='{$x}' y='{$y}' width='{$col_width}' height='{$col_height}' class='{$style}'/>";
$layout .= "<rect x='" . number_format($x, 2, '.', '') . "' y='" . number_format($y, 2, '.', '') . "' width='" . number_format($col_width, 2, '.', '') . "' height='" . number_format($col_height, 2, '.', '') . "' class='{$style}'/>";
$x += ($col_width + self::$spacer); // increment x val for next col
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment