예제 #1
0
 public function __construct(File $Source, File $Splash = null)
 {
     if ($Location = $Source->getRealPath()) {
         $FileInfo = new \finfo(FILEINFO_MIME_TYPE);
         $MimeType = $FileInfo->buffer(file_get_contents($Location));
     } else {
         $MimeType = '';
     }
     $this->Template = $this->getTemplate(__DIR__ . '/Video.twig');
     $this->Template->setVariable('MimeType', $MimeType);
     $this->Template->setVariable('Source', $Source->getLocation());
     array_push($this->Source, $Source->getLocation());
     if ($Splash !== null && $Splash->getRealPath()) {
         $this->Template->setVariable('Splash', $Splash->getLocation());
     } else {
         $Splash = FileSystem::getFileLoader('Common/Style/Resource/Logo/kuw_logo2.png');
         $this->Template->setVariable('Splash', $Splash->getLocation());
     }
     $this->Template->setVariable('Splash', $Splash->getLocation());
 }
예제 #2
0
 /**
  * @param IBridgeInterface $File
  * @param string           $Title
  * @param string           $Description
  * @param array            $ButtonList
  * @param string           $Type THUMBNAIL_TYPE_DEFAULT
  */
 public function __construct(IBridgeInterface $File, $Title, $Description = '', $ButtonList = array(), $Type = self::THUMBNAIL_TYPE_DEFAULT)
 {
     if (!is_array($ButtonList)) {
         $ButtonList = array($ButtonList);
     }
     $this->Template = $this->getTemplate(__DIR__ . '/Thumbnail.twig');
     if ($File->getRealPath()) {
         $this->Template->setVariable('File', $File->getLocation());
         $Size = getimagesize($File->getRealPath());
         $this->Template->setVariable('Height', $Size[1]);
     } else {
         $File = FileSystem::getFileLoader('Common/Style/Resource/logo_kreide2.png');
         $this->Template->setVariable('File', $File->getLocation());
         $Size = getimagesize($File->getRealPath());
         $this->Template->setVariable('Height', $Size[1]);
     }
     $this->Template->setVariable('Type', $Type);
     $this->Template->setVariable('Title', $Title);
     $this->Template->setVariable('Description', $Description);
     $this->Template->setVariable('ButtonList', $ButtonList);
     $this->File = $File;
 }