@@ -408,10 +408,10 @@ discard block |
||
| 408 | 408 | $value_array[] = $tag_open_values[0]; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | - $value = implode('',$value_array); |
|
| 411 | + $value = implode('', $value_array); |
|
| 412 | 412 | |
| 413 | - if($run_again) { |
|
| 414 | - $value = $this->convertHtmlToOpenXMLTag($value,$tag); |
|
| 413 | + if ($run_again) { |
|
| 414 | + $value = $this->convertHtmlToOpenXMLTag($value, $tag); |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | return $value; |
@@ -422,9 +422,9 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | protected function convertHtmlToOpenXML($value) |
| 424 | 424 | { |
| 425 | - $line_breaks = array("<br />","<br/>","<br>"); |
|
| 426 | - $line_breaks = array("<br />","<br/>","<br>"); |
|
| 427 | - $value = str_replace($line_breaks,'<w:br/>',$value); |
|
| 425 | + $line_breaks = array("<br />", "<br/>", "<br>"); |
|
| 426 | + $line_breaks = array("<br />", "<br/>", "<br>"); |
|
| 427 | + $value = str_replace($line_breaks, '<w:br/>', $value); |
|
| 428 | 428 | |
| 429 | 429 | $value = $this->convertHtmlToOpenXMLTag($value, "b"); |
| 430 | 430 | $value = $this->convertHtmlToOpenXMLTag($value, "i"); |
@@ -137,8 +137,9 @@ discard block |
||
| 137 | 137 | protected function MustacheRender($items, $mustache_template) |
| 138 | 138 | { |
| 139 | 139 | $m = new \Mustache_Engine(array('escape' => function($value) { |
| 140 | - if (str_replace('*[[DONOTESCAPE]]*', '', $value) != $value) |
|
| 141 | - return str_replace('*[[DONOTESCAPE]]*', '', $value); |
|
| 140 | + if (str_replace('*[[DONOTESCAPE]]*', '', $value) != $value) { |
|
| 141 | + return str_replace('*[[DONOTESCAPE]]*', '', $value); |
|
| 142 | + } |
|
| 142 | 143 | return htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); |
| 143 | 144 | })); |
| 144 | 145 | return $m->render($mustache_template, $items); |
@@ -163,8 +164,9 @@ discard block |
||
| 163 | 164 | $jpeg_already_set = false; |
| 164 | 165 | foreach ($ct_file as $ct) |
| 165 | 166 | { |
| 166 | - if ((string) $ct_file->Default[$i]['Extension'] == "jpeg") |
|
| 167 | - $jpeg_already_set = true; |
|
| 167 | + if ((string) $ct_file->Default[$i]['Extension'] == "jpeg") { |
|
| 168 | + $jpeg_already_set = true; |
|
| 169 | + } |
|
| 168 | 170 | $i++; |
| 169 | 171 | } |
| 170 | 172 | |
@@ -293,10 +295,11 @@ discard block |
||
| 293 | 295 | $img_rework = \Image::make($this->storagePath($this->local_path.'word/media/'.$imgs[$k]['img_file_src'])); |
| 294 | 296 | $w = $img['width']; |
| 295 | 297 | $h = $img['height']; |
| 296 | - if ($w > $h) |
|
| 297 | - $h = null; |
|
| 298 | - else |
|
| 299 | - $w = null; |
|
| 298 | + if ($w > $h) { |
|
| 299 | + $h = null; |
|
| 300 | + } else { |
|
| 301 | + $w = null; |
|
| 302 | + } |
|
| 300 | 303 | $img_rework->resize($w, $h, function($constraint) { |
| 301 | 304 | $constraint->aspectRatio(); |
| 302 | 305 | $constraint->upsize(); |