@@ -529,8 +529,9 @@ |
||
529 | 529 | ':graphicFrameLocks xmlns:a="' . |
530 | 530 | 'http://schemas.openxmlformats.org/drawingml/2006/main"'; |
531 | 531 | |
532 | - if ($noChangeAspect != '') |
|
533 | - $xmlAux .= ' noChangeAspect="' . $noChangeAspect . '"'; |
|
532 | + if ($noChangeAspect != '') { |
|
533 | + $xmlAux .= ' noChangeAspect="' . $noChangeAspect . '"'; |
|
534 | + } |
|
534 | 535 | $xmlAux .= '></' . CreateImage::NAMESPACEWORD1 . ':graphicFrameLocks>'; |
535 | 536 | |
536 | 537 | $this->_xml = str_replace( |
@@ -1523,8 +1523,9 @@ discard block |
||
1523 | 1523 | } elseif (strpos($type, 'line') !== false) { |
1524 | 1524 | $this->generateLINECHART(); |
1525 | 1525 | $this->generateGROUPING('standard'); |
1526 | - if (isset($dats[0])) $legends = $dats[0]; |
|
1527 | - else { |
|
1526 | + if (isset($dats[0])) { |
|
1527 | + $legends = $dats[0]; |
|
1528 | + } else { |
|
1528 | 1529 | echo('You must write a legend'); |
1529 | 1530 | return false; |
1530 | 1531 | } |
@@ -1563,7 +1564,9 @@ discard block |
||
1563 | 1564 | |
1564 | 1565 | $num = 0; |
1565 | 1566 | foreach ($dats as $legend => $dat) { |
1566 | - if ($legend == '0') continue; |
|
1567 | + if ($legend == '0') { |
|
1568 | + continue; |
|
1569 | + } |
|
1567 | 1570 | $this->generatePT($num); |
1568 | 1571 | $this->generateV($legend); |
1569 | 1572 | $num++; |
@@ -1577,7 +1580,9 @@ discard block |
||
1577 | 1580 | $this->generatePTCOUNT($sizeDats); |
1578 | 1581 | $num = 0; |
1579 | 1582 | foreach ($dats as $legend => $dat) { |
1580 | - if ($legend == '0') continue; |
|
1583 | + if ($legend == '0') { |
|
1584 | + continue; |
|
1585 | + } |
|
1581 | 1586 | $this->generatePT($num); |
1582 | 1587 | $this->generateV($dat[$i]); |
1583 | 1588 | $num++; |
@@ -1647,14 +1652,14 @@ discard block |
||
1647 | 1652 | { |
1648 | 1653 | $args = func_get_args(); |
1649 | 1654 | $ajusteTexto = 0; |
1650 | - if (isset($args[0][1]['sizeX'])) |
|
1651 | - $sizeX = $args[0][1]['sizeX'] * CreateImage::CONSTWORD; |
|
1652 | - else { |
|
1655 | + if (isset($args[0][1]['sizeX'])) { |
|
1656 | + $sizeX = $args[0][1]['sizeX'] * CreateImage::CONSTWORD; |
|
1657 | + } else { |
|
1653 | 1658 | $sizeX = 2993296; |
1654 | 1659 | } |
1655 | - if (isset($args[0][1]['sizeY'])) |
|
1656 | - $sizeY = $args[0][1]['sizeY'] * CreateImage::CONSTWORD; |
|
1657 | - else { |
|
1660 | + if (isset($args[0][1]['sizeY'])) { |
|
1661 | + $sizeY = $args[0][1]['sizeY'] * CreateImage::CONSTWORD; |
|
1662 | + } else { |
|
1658 | 1663 | $sizeY = 2238233; |
1659 | 1664 | } |
1660 | 1665 |
@@ -112,7 +112,9 @@ discard block |
||
112 | 112 | } |
113 | 113 | $this->generatePGMAR($args); |
114 | 114 | $this->generateCOLS(); |
115 | - if (!empty($args[0]['titlePage'])) $this->generateTITLEPG(); |
|
115 | + if (!empty($args[0]['titlePage'])) { |
|
116 | + $this->generateTITLEPG(); |
|
117 | + } |
|
116 | 118 | $this->generateDOCGRID(); |
117 | 119 | } |
118 | 120 | |
@@ -190,10 +192,18 @@ discard block |
||
190 | 192 | $footer = '0'; |
191 | 193 | $gutter = '0'; |
192 | 194 | $args = func_get_args(); |
193 | - if (isset($args[0][0]['top'])) $top = $args[0][0]['top']; |
|
194 | - if (isset($args[0][0]['bottom'])) $bottom = $args[0][0]['bottom']; |
|
195 | - if (isset($args[0][0]['right'])) $right = $args[0][0]['right']; |
|
196 | - if (isset($args[0][0]['left'])) $left = $args[0][0]['left']; |
|
195 | + if (isset($args[0][0]['top'])) { |
|
196 | + $top = $args[0][0]['top']; |
|
197 | + } |
|
198 | + if (isset($args[0][0]['bottom'])) { |
|
199 | + $bottom = $args[0][0]['bottom']; |
|
200 | + } |
|
201 | + if (isset($args[0][0]['right'])) { |
|
202 | + $right = $args[0][0]['right']; |
|
203 | + } |
|
204 | + if (isset($args[0][0]['left'])) { |
|
205 | + $left = $args[0][0]['left']; |
|
206 | + } |
|
197 | 207 | |
198 | 208 | $xml = '<' . CreateElement::NAMESPACEWORD . ':pgMar ' . |
199 | 209 | CreateElement::NAMESPACEWORD . ':top="' . $top . '" ' . |
@@ -189,9 +189,10 @@ |
||
189 | 189 | |
190 | 190 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':footnote'; |
191 | 191 | |
192 | - if ($type != '') |
|
193 | - $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
192 | + if ($type != '') { |
|
193 | + $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
194 | 194 | ':type="' . $type . '"'; |
195 | + } |
|
195 | 196 | |
196 | 197 | $this->_xml = $xmlAux . ' ' . CreateElement::NAMESPACEWORD . |
197 | 198 | ':id="' . (self::$_id - 2) . |
@@ -520,18 +520,22 @@ |
||
520 | 520 | { |
521 | 521 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':shd ' . |
522 | 522 | CreateElement::NAMESPACEWORD . ':val="' . $val . '"'; |
523 | - if ($color != '') |
|
524 | - $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
523 | + if ($color != '') { |
|
524 | + $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
525 | 525 | ':color="' . $color . '"'; |
526 | - if ($fill != '') |
|
527 | - $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
526 | + } |
|
527 | + if ($fill != '') { |
|
528 | + $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
528 | 529 | ':fill="' . $fill . '"'; |
529 | - if ($themeFill != '') |
|
530 | - $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
530 | + } |
|
531 | + if ($themeFill != '') { |
|
532 | + $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
531 | 533 | ':themeFill="' . $themeFill . '"'; |
532 | - if ($themeFillTint != '') |
|
533 | - $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
534 | + } |
|
535 | + if ($themeFillTint != '') { |
|
536 | + $xmlAux .= ' ' . CreateElement::NAMESPACEWORD . |
|
534 | 537 | ':themeFillTint="' . $themeFillTint . '"'; |
538 | + } |
|
535 | 539 | $xmlAux .= '></' . CreateElement::NAMESPACEWORD . |
536 | 540 | ':shd>__GENERATETBLPR__'; |
537 | 541 | $this->_xml = str_replace('__GENERATETBLPR__', $xmlAux, $this->_xml); |
@@ -206,10 +206,18 @@ |
||
206 | 206 | { |
207 | 207 | $xmlAux = '<' . CreateElement::NAMESPACEWORD . ':shd w:val="' . |
208 | 208 | $val . '"'; |
209 | - if ($color != '') $xmlAux .= ' w:color="' . $color . '"'; |
|
210 | - if ($fill != '') $xmlAux .= ' w:fill="' . $fill . '"'; |
|
211 | - if ($bgcolor != '') $xmlAux .= ' wx:bgcolor="' . $bgcolor . '"'; |
|
212 | - if ($themeFill != '') $xmlAux .= ' w:themeFill="' . $themeFill . '"'; |
|
209 | + if ($color != '') { |
|
210 | + $xmlAux .= ' w:color="' . $color . '"'; |
|
211 | + } |
|
212 | + if ($fill != '') { |
|
213 | + $xmlAux .= ' w:fill="' . $fill . '"'; |
|
214 | + } |
|
215 | + if ($bgcolor != '') { |
|
216 | + $xmlAux .= ' wx:bgcolor="' . $bgcolor . '"'; |
|
217 | + } |
|
218 | + if ($themeFill != '') { |
|
219 | + $xmlAux .= ' w:themeFill="' . $themeFill . '"'; |
|
220 | + } |
|
213 | 221 | $xmlAux .= '></' . CreateElement::NAMESPACEWORD . ':shd>'; |
214 | 222 | $this->_xml = str_replace('__GENERATETCPR__', $xmlAux, $this->_xml); |
215 | 223 | } |
@@ -109,14 +109,18 @@ discard block |
||
109 | 109 | !empty($args[1]['wordWrap']) |
110 | 110 | ) { |
111 | 111 | $this->generatePPR(); |
112 | - if (!empty($args[1]['jc'])) |
|
113 | - $this->generateJC($args[1]['jc']); |
|
114 | - if (!empty($args[1]['pageBreakBefore'])) |
|
115 | - $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']); |
|
116 | - if (!empty($args[1]['widowControl'])) |
|
117 | - $this->generateWIDOWCONTROL($args[1]['widowControl']); |
|
118 | - if (!empty($args[1]['wordWrap'])) |
|
119 | - $this->generateWORDWRAP($args[1]['wordWrap']); |
|
112 | + if (!empty($args[1]['jc'])) { |
|
113 | + $this->generateJC($args[1]['jc']); |
|
114 | + } |
|
115 | + if (!empty($args[1]['pageBreakBefore'])) { |
|
116 | + $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']); |
|
117 | + } |
|
118 | + if (!empty($args[1]['widowControl'])) { |
|
119 | + $this->generateWIDOWCONTROL($args[1]['widowControl']); |
|
120 | + } |
|
121 | + if (!empty($args[1]['wordWrap'])) { |
|
122 | + $this->generateWORDWRAP($args[1]['wordWrap']); |
|
123 | + } |
|
120 | 124 | } |
121 | 125 | $this->generateR(); |
122 | 126 | if ( |
@@ -166,16 +170,20 @@ discard block |
||
166 | 170 | if (!empty($args[1]['val']) && !empty($args[0])) { |
167 | 171 | $this->generateP(); |
168 | 172 | $this->generatePPR(); |
169 | - if ($args[1]['type'] == 'subtitle') |
|
170 | - $this->generatePSTYLE('Subttulo' . $args[1]['val']); |
|
171 | - else |
|
172 | - $this->generatePSTYLE('Ttulo' . $args[1]['val']); |
|
173 | - if (!empty($args[1]['pageBreakBefore'])) |
|
174 | - $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']); |
|
175 | - if (!empty($args[1]['widowControl'])) |
|
176 | - $this->generateWIDOWCONTROL($args[1]['widowControl']); |
|
177 | - if (!empty($args[1]['wordWrap'])) |
|
178 | - $this->generateWORDWRAP($args[1]['wordWrap']); |
|
173 | + if ($args[1]['type'] == 'subtitle') { |
|
174 | + $this->generatePSTYLE('Subttulo' . $args[1]['val']); |
|
175 | + } else { |
|
176 | + $this->generatePSTYLE('Ttulo' . $args[1]['val']); |
|
177 | + } |
|
178 | + if (!empty($args[1]['pageBreakBefore'])) { |
|
179 | + $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']); |
|
180 | + } |
|
181 | + if (!empty($args[1]['widowControl'])) { |
|
182 | + $this->generateWIDOWCONTROL($args[1]['widowControl']); |
|
183 | + } |
|
184 | + if (!empty($args[1]['wordWrap'])) { |
|
185 | + $this->generateWORDWRAP($args[1]['wordWrap']); |
|
186 | + } |
|
179 | 187 | self::$_idTitle++; |
180 | 188 | $this->generateBOOKMARKSTART( |
181 | 189 | self::$_idTitle, '_Toc' . (self::$_idTitle + self::IDTITLE) |
@@ -132,8 +132,9 @@ discard block |
||
132 | 132 | break; |
133 | 133 | } |
134 | 134 | foreach ($dats as $ind => $val) { |
135 | - if ($ind == '0') |
|
136 | - continue; |
|
135 | + if ($ind == '0') { |
|
136 | + continue; |
|
137 | + } |
|
137 | 138 | $this->generateROW($row, $sizeCols); |
138 | 139 | $col = 1; |
139 | 140 | $letra = 'A'; |
@@ -142,8 +143,9 @@ discard block |
||
142 | 143 | $letra++; |
143 | 144 | foreach ($val as $valores) { |
144 | 145 | $s = ''; |
145 | - if ($col != $sizeCols) |
|
146 | - $s = 1; |
|
146 | + if ($col != $sizeCols) { |
|
147 | + $s = 1; |
|
148 | + } |
|
147 | 149 | $this->generateC($letra . $row, $s); |
148 | 150 | $this->generateV($valores); |
149 | 151 | $col++; |
@@ -187,8 +189,9 @@ discard block |
||
187 | 189 | protected function generateDIMENSION($sizeX, $sizeY) |
188 | 190 | { |
189 | 191 | $char = 'A'; |
190 | - for ($i = 0; $i < $sizeY; $i++) |
|
191 | - $char++; |
|
192 | + for ($i = 0; $i < $sizeY; $i++) { |
|
193 | + $char++; |
|
194 | + } |
|
192 | 195 | $sizeX += $sizeY; |
193 | 196 | $xml = '<dimension ref="A1:' . $char . $sizeX . |
194 | 197 | '"></dimension>__GENERATEWORKSHEET__'; |
@@ -838,8 +838,7 @@ discard block |
||
838 | 838 | 'Images must have "data" and "type" values.' |
839 | 839 | ); |
840 | 840 | } |
841 | - } |
|
842 | - catch (Exception $e) { |
|
841 | + } catch (Exception $e) { |
|
843 | 842 | self::$log->fatal($e->getMessage()); |
844 | 843 | exit(); |
845 | 844 | } |
@@ -902,26 +901,25 @@ discard block |
||
902 | 901 | $this->generateDEFAULT( |
903 | 902 | $dir['extension'], $attrImage['mime'] |
904 | 903 | ); |
905 | - if ((string) $image != '') |
|
906 | - $this->_wordRelsDocumentRelsC .= |
|
904 | + if ((string) $image != '') { |
|
905 | + $this->_wordRelsDocumentRelsC .= |
|
907 | 906 | $this->generateRELATIONSHIP( |
908 | 907 | 'rId' . self::$intIdWord, 'image', |
909 | 908 | 'media/image' . self::$intIdWord . '.' |
910 | 909 | . $dir['extension'] |
911 | 910 | ); |
911 | + } |
|
912 | 912 | } else { |
913 | 913 | throw new Exception('Image format is not supported.'); |
914 | 914 | } |
915 | - } |
|
916 | - catch (Exception $e) { |
|
915 | + } catch (Exception $e) { |
|
917 | 916 | self::$log->fatal($e->getMessage()); |
918 | 917 | exit(); |
919 | 918 | } |
920 | 919 | } else { |
921 | 920 | throw new Exception('Image does not exist.'); |
922 | 921 | } |
923 | - } |
|
924 | - catch (Exception $e) { |
|
922 | + } catch (Exception $e) { |
|
925 | 923 | self::$log->fatal($e->getMessage()); |
926 | 924 | exit(); |
927 | 925 | } |
@@ -1363,8 +1361,7 @@ discard block |
||
1363 | 1361 | 'Images must have "data" and "type" values.' |
1364 | 1362 | ); |
1365 | 1363 | } |
1366 | - } |
|
1367 | - catch (Exception $e) { |
|
1364 | + } catch (Exception $e) { |
|
1368 | 1365 | self::$log->fatal($e->getMessage()); |
1369 | 1366 | exit(); |
1370 | 1367 | } |
@@ -1422,26 +1419,25 @@ discard block |
||
1422 | 1419 | $this->generateDEFAULT( |
1423 | 1420 | $dir['extension'], $attrImage['mime'] |
1424 | 1421 | ); |
1425 | - if ((string) $image != '') |
|
1426 | - $this->_wordRelsDocumentRelsC .= |
|
1422 | + if ((string) $image != '') { |
|
1423 | + $this->_wordRelsDocumentRelsC .= |
|
1427 | 1424 | $this->generateRELATIONSHIP( |
1428 | 1425 | 'rId' . self::$intIdWord, 'image', |
1429 | 1426 | 'media/image' . self::$intIdWord . '.' |
1430 | 1427 | . $dir['extension'] |
1431 | 1428 | ); |
1429 | + } |
|
1432 | 1430 | } else { |
1433 | 1431 | throw new Exception('Image format is not supported.'); |
1434 | 1432 | } |
1435 | - } |
|
1436 | - catch (Exception $e) { |
|
1433 | + } catch (Exception $e) { |
|
1437 | 1434 | self::$log->fatal($e->getMessage()); |
1438 | 1435 | exit(); |
1439 | 1436 | } |
1440 | 1437 | } else { |
1441 | 1438 | throw new Exception('Image does not exist.'); |
1442 | 1439 | } |
1443 | - } |
|
1444 | - catch (Exception $e) { |
|
1440 | + } catch (Exception $e) { |
|
1445 | 1441 | self::$log->fatal($e->getMessage()); |
1446 | 1442 | exit(); |
1447 | 1443 | } |
@@ -2429,13 +2425,14 @@ discard block |
||
2429 | 2425 | private function generateRELATIONSHIP() |
2430 | 2426 | { |
2431 | 2427 | $arrArgs = func_get_args(); |
2432 | - if ($arrArgs[1] == 'vbaProject') |
|
2433 | - $strType = |
|
2428 | + if ($arrArgs[1] == 'vbaProject') { |
|
2429 | + $strType = |
|
2434 | 2430 | 'http://schemas.microsoft.com/office/2006/relationships/vbaProject'; |
2435 | - else |
|
2436 | - $strType = |
|
2431 | + } else { |
|
2432 | + $strType = |
|
2437 | 2433 | 'http://schemas.openxmlformats.org/officeDocument/2006/' . |
2438 | 2434 | 'relationships/' . $arrArgs[1]; |
2435 | + } |
|
2439 | 2436 | |
2440 | 2437 | return '<Relationship Id="' . $arrArgs[0] . '" Type="' . $strType . |
2441 | 2438 | '" Target="' . $arrArgs[2] . '"></Relationship>'; |