public $securityPolicyWhitelist = ['*.google-analytics.com', '*.youtube.com', '*.ytimg.com', '*.googletagmanager.com'];
public $writeLinksData = false;
public $content_lock = [];
+ public $cssfont = [];
protected $_indexVars = null;
public $_signature;
$hiddenLinks = [];
foreach ($links as $linkData) {
- if (isset($linkData['image']) && $linkData['image'] && $linkData['type'] != 28) {
+ if (isset($linkData['image']) && $linkData['image'] && $linkData['type'] != 28 && $linkData['type'] != 35) {
$dupData = $linkData;
$dupData['image'] = '';
$dupData['to'] = $linkData['image'];
$lessVariables['tooltip-background'] = wsHTML5::colorToCSS($this->theme->parametres->tooltipBackColor);
$lessVariables['tooltip-color'] = wsHTML5::colorToCSS($this->theme->parametres->tooltipTextColor);
+ #fonts
+ foreach ($this->cssfont as $item) {
+ $res[] = '@font-face{font-family: "' . $item . '";src:url("data/fonts/' . $item . '.woff") format("woff");}';
+ }
+
# ZoomPopup close button background
$res[] = '.zoomPopupClose {background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
$this->addLess('videojs/videojs');
}
+ public function addFont($fontFile)
+ {
+ $f = $this->wdir . '/' . $fontFile;
+ $e = explode('.', $f);
+ $ext = array_pop($f);
+ $hash = 'fb_' . substr(md5($fontFile), 0, 10);
+ if (array_search($hash, $this->cssfont) !== false) {
+ return;
+ }
+ $final = $hash . '.woff';
+ if (!file_exists($final) || filemtime($final) < filemtime($f)) {
+ $dest = $this->wdir . '/' . $final;
+ if ($ext == 'otf' || $ext == 'woff') {
+ `sfnt2woff $f $dest`;
+ } else if ($ext == 'woff') {
+ copy($f, $dest);
+ }
+ }
+ $this->vdir->copy($dest, 'data/fonts/' . $hash . '.woff');
+ $this->cssfont[] = $hash;
+ return $hash;
+ }
+
public function addJsLib($name, $files)
{
if (!is_array($files)) {
case 34:
$compiler->addContentLock($init['page'], $init['to']);
break;
+ case 35:
+ return new textLink($id, $init, $compiler);
+ break;
default:
return null;
}
}
}
+class textLink extends contentLink
+{
+ public function getCSS()
+ {
+
+ $font = $this->compiler->addFont($this->image);
+ return 'font-family:' . $font . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';';
+
+ }
+
+ public function getAdditionnalContent()
+ {
+ $res = parent::getAdditionnalContent();
+ return $res;
+ }
+
+ public function getHTMLContent()
+ {
+ return $this->to;
+ }
+}
+
class imageLink extends contentLink
{