case 14:
return new colorLink($id, $init, $compiler);
case 15:
+
+ if (stristr($init['to'], '.zip')) {
+ return new inlineSlideshowLink($id, $init, $compiler);
+ } else {
return new imageLink($id, $init, $compiler);
+ }
case 16:
return new fileLink($id, $init, $compiler);
case 17:
public function getHTMLContainer()
{
- return '<div class="' . $this->getHTMLContainerClass() . '" data-id="' . $this->uid . '" id="l_' . $this->id . '">' . $this->getHTMLContent() . '</div>';
+ return '<div class="' . $this->getHTMLContainerClass() . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $this->getAdditionnalContent() . '>' . $this->getHTMLContent() . '</div>';
}
public function getHTMLContainerClass()
public function getAdditionnalContent()
{
+ return '';
}
}
+class inlineSlideshowLink extends contentLink
+{
+ public function getHTMLContent()
+ {
+ $d = $this->unzipFile($this->to, false);
+ $this->compiler->vdir->copyDirectory($d['dir'], $d['fdir']);
+
+ $iterator = CubeIT_Files::getRecursiveDirectoryIterator($d['dir']);
+
+ $files = array();
+ foreach ($iterator as $f) {
+ /* @var $f SplFileInfo */
+ $files[] = $f->getFilename();
+ }
+ sort($files);
+ $f = htmlspecialchars(json_encode($files), ENT_QUOTES);
+
+ return '<div class="inlineslideshow" data-dir="' . str_replace('.', '_', $this->to) . '" data-images="' . $f . '"></div>';
+ }
+}
+
class fileLink extends normalLink
{