public $lessVariables = [];
protected $_indexVars = null;
public $accessibleTexts = [];
+ protected $_svgSymbols = [];
public $_signature;
/**
die($svgfile . ' does not exist');
}
}
+ if (count($this->_svgSymbols)) {
+ $svg .= '<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">' . implode('', $this->_svgSymbols) . '</svg>' . "\n";
+
+ }
if ($this->phonegap) {
$csp = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self' data: gap: 'unsafe-inline' *; style-src 'self' 'unsafe-inline'; font-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' " . implode(' ', array_unique($this->securityPolicyWhitelist)) . "; img-src * data:\">";
for ($i = 1; $i <= 5; $i++) {
$ic = $this->book->parametres->{'navExtraIcon' . $i};
if ($ic != '') {
- $this->vdir->copy($this->wdir . '/' . $ic, 'data/images/' . $ic);
+ if (stristr($ic, '.svg')) {
+ $e = explode('.', $ic);
+ $sname = 'external-' . $e[0];
+ $this->addSVGSymbolFromFile($this->wdir . '/' . $ic, $sname);
+ $this->config->{'navExtraIcon' . $i} = $sname;
+ } else {
+ $this->vdir->copy($this->wdir . '/' . $ic, 'data/images/' . $ic);
+ }
}
}
}
+ protected function addSVGSymbolFromFile($svg, $symbolName)
+ {
+ $xml = simplexml_load_string(file_get_contents($svg));
+ $viewBox = (string)$xml['viewBox'];
+
+ $this->_svgSymbols[] = '<symbol id="' . $symbolName . '" viewBox="' . $viewBox . '">' . $this->SimpleXMLElement_innerXML($xml) . '</symbol>';
+ }
+
protected function writeLinks()
{
global $core;