use Fluidbook\Tools\Links\Link;
use Nette\Utils\Image;
-trait Links {
+trait Links
+{
/**
* @throws \SodiumException
*/
- public function compileLinks() {
+ public function compileLinks()
+ {
/** @var Link[] $links */
$links = $this->getLinks();
return $css;
}
- public function getLinks() {
+ public function getLinks()
+ {
return [];
}
- protected function getLinksFromPDF() {
- $booleans = ['video_loop', 'video_auto_start', 'video_controls', 'video_sound_on'];
+ protected function getLinksFromPDF()
+ {
+ $booleans = ['video_loop', 'video_auto_start', 'video_controls', 'video_sound_on', 'video_cc'];
$numbers = ['left', 'top', 'width', 'height'];
$links = [];
}
$link = ['uid' => self::makeUID()];
- $cols = ['page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'tooltip' => '', 'image_rollover' => '', 'numerotation' => 'physical', "inline" => true];
+ $cols = ['page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'video_cc' => true, 'tooltip' => '', 'image_rollover' => '', 'numerotation' => 'physical', "inline" => true];
$k = 0;
return $links;
}
- protected static function makeUID() {
+ protected static function makeUID()
+ {
return substr(md5(uniqid('fblink_', true)), 2, 8) . '00';
}
- protected function _htmlLinkList($list) {
+ protected function _htmlLinkList($list)
+ {
if (!count($list)) {
return [];
}
}
- protected function _sortLinksByDepth($a, $b) {
+ protected function _sortLinksByDepth($a, $b)
+ {
$c = $a->getDepth() - $b->getDepth();
if ($c === 0) {
$c = $b->getSurface() - $a->getSurface();
return $c;
}
- public function _sortLinks($a, $b) {
+ public function _sortLinks($a, $b)
+ {
$priorities = array(26 => -1, 35 => 1);
return $pb - $pa;
}
- protected static function base36($val) {
+ protected static function base36($val)
+ {
$chars = '0123456789abcdefghijklmnopqrstuvwxyz';
$base = strlen($chars);
$str = '';
/**
* @return number
*/
- public function getLinkScale() {
+ public function getLinkScale()
+ {
return (float)$this->config->cssScale;
}
/**
* @throws \Exception
*/
- public function copyLinkDir($source, $dest) {
+ public function copyLinkDir($source, $dest)
+ {
$this->vdir->copyDirectory($source, $dest);
}
/**
* @throws Exception
*/
- public function simpleCopyLinkFile($source, $dest, $addVdir = true) {
+ public function simpleCopyLinkFile($source, $dest, $addVdir = true)
+ {
if ($addVdir) {
$dest = $dest;
}
$this->vdir->copy($source, $dest);
}
- public function getVideosFormats() {
+ public function getVideosFormats()
+ {
return ['mp4', 'jpg'];
}
- public function copyLinkFile($source, $dest, $video = false) {
+ public function copyLinkFile($source, $dest, $video = false)
+ {
$types = $this->getVideosFormats();
if ($video) {
$e = explode('.', $source);
/**
* @throws Exception
*/
- public function unzipFile($file, $moveAssets = false, $baseDir = null) {
+ public function unzipFile($file, $moveAssets = false, $baseDir = null)
+ {
$fdir = is_null($baseDir) ? 'data/links/' . str_replace('.', '_', Files::getFilename($file)) : $baseDir;
$dir = $this->wdir . $fdir;