second commit
This commit is contained in:
parent
dc8b19aade
commit
77749a9dab
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,13 @@
|
|||
@font-face {
|
||||
font-family: 'Font Awesome 5 Brands';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-display: auto;
|
||||
src: url("../webfonts/fa-brands-400.eot");
|
||||
src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.woff") format("woff"), url("../webfonts/fa-brands-400.ttf") format("truetype"), url("../webfonts/fa-brands-400.svg#fontawesome") format("svg");
|
||||
}
|
||||
|
||||
.fab {
|
||||
font-family: 'Font Awesome 5 Brands';
|
||||
}
|
||||
/*# sourceMappingURL=brands.css.map */
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,UAAU;EACR,WAAW,EAAE,uBAAuB;EACpC,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,MAAM;EACnB,YAAY,ECDgB,IAAI;EDEhC,GAAG,EAAE,oCAAyC;EAC9C,GAAG,EAAE,2CAAgD,CAAC,2BAA2B,EACjF,sCAA2C,CAAC,eAAe,EAC3D,qCAA0C,CAAC,cAAc,EACzD,oCAAyC,CAAC,kBAAkB,EAC5D,gDAAqD,CAAC,aAAa;;;AAGrE,AAAA,IAAI,CAAC;EACH,WAAW,EAAE,uBAAuB;CACrC",
|
||||
"sources": [
|
||||
"brands.scss",
|
||||
"_variables.scss"
|
||||
],
|
||||
"names": [],
|
||||
"file": "brands.css"
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,14 @@
|
|||
@font-face {
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: auto;
|
||||
src: url("../webfonts/fa-regular-400.eot");
|
||||
src: url("../webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.woff") format("woff"), url("../webfonts/fa-regular-400.ttf") format("truetype"), url("../webfonts/fa-regular-400.svg#fontawesome") format("svg");
|
||||
}
|
||||
|
||||
.far {
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-weight: 400;
|
||||
}
|
||||
/*# sourceMappingURL=regular.css.map */
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,UAAU;EACR,WAAW,EAAE,qBAAqB;EAClC,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,GAAG;EAChB,YAAY,ECDgB,IAAI;EDEhC,GAAG,EAAE,qCAA0C;EAC/C,GAAG,EAAE,4CAAiD,CAAC,2BAA2B,EAClF,uCAA4C,CAAC,eAAe,EAC5D,sCAA2C,CAAC,cAAc,EAC1D,qCAA0C,CAAC,kBAAkB,EAC7D,iDAAsD,CAAC,aAAa;;;AAGtE,AAAA,IAAI,CAAC;EACH,WAAW,EAAE,qBAAqB;EAClC,WAAW,EAAE,GAAG;CACjB",
|
||||
"sources": [
|
||||
"regular.scss",
|
||||
"_variables.scss"
|
||||
],
|
||||
"names": [],
|
||||
"file": "regular.css"
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
@font-face {
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-display: auto;
|
||||
src: url("../webfonts/fa-solid-900.eot");
|
||||
src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.woff") format("woff"), url("../webfonts/fa-solid-900.ttf") format("truetype"), url("../webfonts/fa-solid-900.svg#fontawesome") format("svg");
|
||||
}
|
||||
|
||||
.fa,
|
||||
.fas {
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-weight: 900;
|
||||
}
|
||||
/*# sourceMappingURL=solid.css.map */
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAEA,UAAU;EACR,WAAW,EAAE,qBAAqB;EAClC,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,GAAG;EAChB,YAAY,ECDgB,IAAI;EDEhC,GAAG,EAAE,mCAAwC;EAC7C,GAAG,EAAE,0CAA+C,CAAC,2BAA2B,EAChF,qCAA0C,CAAC,eAAe,EAC1D,oCAAyC,CAAC,cAAc,EACxD,mCAAwC,CAAC,kBAAkB,EAC3D,+CAAoD,CAAC,aAAa;;;AAGpE,AAAA,GAAG;AACH,IAAI,CAAC;EACH,WAAW,EAAE,qBAAqB;EAClC,WAAW,EAAE,GAAG;CACjB",
|
||||
"sources": [
|
||||
"solid.scss",
|
||||
"_variables.scss"
|
||||
],
|
||||
"names": [],
|
||||
"file": "solid.css"
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -49,7 +49,7 @@ class OfficeConverter
|
|||
$outdir = $this->tempPath;
|
||||
$shell = $this->exec($this->makeCommand($outdir, $outputExtension));
|
||||
if (0 != $shell['return']) {
|
||||
throw new OfficeConverterException($shell['stderr']. 'Convertion Failure! Contact Server Admin.');
|
||||
throw new OfficeConverterException('Convertion Failure! Contact Server Admin.');
|
||||
}
|
||||
|
||||
return $this->prepOutput($outdir, $filename, $outputExtension);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
|
||||
*/
|
||||
|
||||
$vendorDirPath = '../vendor';
|
||||
$vendorDirPath = '../../vendor';
|
||||
if (file_exists($vendorDirPath . '/autoload.php')) {
|
||||
require $vendorDirPath . '/autoload.php';
|
||||
} else {
|
||||
|
|
|
@ -129,6 +129,8 @@ class TemplateProcessor
|
|||
$this->tempDocumentMainPart = $this->readPartWithRels($this->getMainPartName());
|
||||
$this->tempDocumentSettingsPart = $this->readPartWithRels($this->getSettingsPartName());
|
||||
$this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());
|
||||
|
||||
$this->_countRels=100; //start id for relationship between image and document.xml
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -839,6 +841,15 @@ class TemplateProcessor
|
|||
|
||||
$this->zipClass->addFromString($this->getDocumentContentTypesName(), $this->tempDocumentContentTypes);
|
||||
|
||||
if($this->_rels!="")
|
||||
{
|
||||
$this->zipClass->addFromString('word/_rels/document.xml.rels', $this->_rels);
|
||||
}
|
||||
if($this->_types!="")
|
||||
{
|
||||
$this->zipClass->addFromString('[Content_Types].xml', $this->_types);
|
||||
}
|
||||
|
||||
// Close zip file
|
||||
if (false === $this->zipClass->close()) {
|
||||
throw new Exception('Could not close zip file.'); // @codeCoverageIgnore
|
||||
|
@ -1249,4 +1260,91 @@ class TemplateProcessor
|
|||
{
|
||||
return preg_match('/[^>]\${|}[^<]/i', $text) == 1;
|
||||
}
|
||||
|
||||
public function setImg( $strKey, $img){
|
||||
$strKey = '${'.$strKey.'}';
|
||||
$relationTmpl = '<Relationship Id="RID" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/IMG"/>';
|
||||
|
||||
$imgTmpl = '<w:pict><v:shape type="#_x0000_t75" style="width:WIDpx;height:HEIpx"><v:imagedata r:id="RID" o:title=""/></v:shape></w:pict>';
|
||||
|
||||
$toAdd = $toAddImg = $toAddType = '';
|
||||
$aSearch = array('RID', 'IMG');
|
||||
$aSearchType = array('IMG', 'EXT');
|
||||
$countrels=$this->_countRels++;
|
||||
//I'm work for jpg files, if you are working with other images types -> Write conditions here
|
||||
$imgExt = 'jpg';
|
||||
$imgName = 'img' . $countrels . '.' . $imgExt;
|
||||
|
||||
$this->zipClass->deleteName('word/media/' . $imgName);
|
||||
$this->zipClass->addFile($img['src'], 'word/media/' . $imgName);
|
||||
|
||||
$typeTmpl = '<Override PartName="/word/media/'.$imgName.'" ContentType="image/EXT"/>';
|
||||
|
||||
|
||||
$rid = 'rId' . $countrels;
|
||||
$countrels++;
|
||||
list($w,$h) = getimagesize($img['src']);
|
||||
|
||||
if(isset($img['swh'])) //Image proportionally larger side
|
||||
{
|
||||
if($w<=$h)
|
||||
{
|
||||
$ht=(int)$img['swh'];
|
||||
$ot=$w/$h;
|
||||
$wh=(int)$img['swh']*$ot;
|
||||
$wh=round($wh);
|
||||
}
|
||||
if($w>=$h)
|
||||
{
|
||||
$wh=(int)$img['swh'];
|
||||
$ot=$h/$w;
|
||||
$ht=(int)$img['swh']*$ot;
|
||||
$ht=round($ht);
|
||||
}
|
||||
$w=$wh;
|
||||
$h=$ht;
|
||||
}
|
||||
|
||||
if(isset($img['size']))
|
||||
{
|
||||
$w = $img['size'][0];
|
||||
$h = $img['size'][1];
|
||||
}
|
||||
|
||||
|
||||
$toAddImg .= str_replace(array('RID', 'WID', 'HEI'), array($rid, $w, $h), $imgTmpl) ;
|
||||
if(isset($img['dataImg']))
|
||||
{
|
||||
$toAddImg.='<w:br/><w:t>'.$this->limpiarString($img['dataImg']).'</w:t><w:br/>';
|
||||
}
|
||||
|
||||
$aReplace = array($imgName, $imgExt);
|
||||
$toAddType .= str_replace($aSearchType, $aReplace, $typeTmpl) ;
|
||||
|
||||
$aReplace = array($rid, $imgName);
|
||||
$toAdd .= str_replace($aSearch, $aReplace, $relationTmpl);
|
||||
|
||||
|
||||
$this->tempDocumentMainPart=str_replace('<w:t>' . $strKey . '</w:t>', $toAddImg, $this->tempDocumentMainPart);
|
||||
//print $this->tempDocumentMainPart;
|
||||
|
||||
|
||||
|
||||
if($this->_rels=="")
|
||||
{
|
||||
$this->_rels=$this->zipClass->getFromName('word/_rels/document.xml.rels');
|
||||
$this->_types=$this->zipClass->getFromName('[Content_Types].xml');
|
||||
}
|
||||
|
||||
$this->_types = str_replace('</Types>', $toAddType, $this->_types) . '</Types>';
|
||||
$this->_rels = str_replace('</Relationships>', $toAdd, $this->_rels) . '</Relationships>';
|
||||
}
|
||||
|
||||
function limpiarString($str) {
|
||||
return str_replace(
|
||||
array('&', '<', '>', "\n"),
|
||||
array('&', '<', '>', "\n" . '<w:br/>'),
|
||||
$str
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue