Beispiel #1
0
 /**
  * Get an array of Alchemy\Phrasea\Media\Subdef\Subdef available for the current Media Type
  *
  * @return array
  */
 public function getAvailableSubdefTypes()
 {
     $subdefTypes = [];
     $availableDevices = [self::DEVICE_ALL, self::DEVICE_HANDHELD, self::DEVICE_PRINT, self::DEVICE_PROJECTION, self::DEVICE_SCREEN, self::DEVICE_TV];
     if (isset(self::$mediaTypeToSubdefTypes[$this->subdef_group->getType()])) {
         foreach (self::$mediaTypeToSubdefTypes[$this->subdef_group->getType()] as $subdefType) {
             if ($subdefType == $this->subdef_type->getType()) {
                 $mediatype_obj = $this->subdef_type;
             } else {
                 switch ($subdefType) {
                     case SubdefSpecs::TYPE_ANIMATION:
                         $mediatype_obj = new Gif($this->translator);
                         break;
                     case SubdefSpecs::TYPE_AUDIO:
                         $mediatype_obj = new Audio($this->translator);
                         break;
                     case SubdefSpecs::TYPE_FLEXPAPER:
                         $mediatype_obj = new FlexPaper($this->translator);
                         break;
                     case SubdefSpecs::TYPE_IMAGE:
                         $mediatype_obj = new Image($this->translator);
                         break;
                     case SubdefSpecs::TYPE_VIDEO:
                         $mediatype_obj = new Video($this->translator);
                         break;
                     default:
                         continue;
                         break;
                 }
             }
             $mediatype_obj->registerOption(new \Alchemy\Phrasea\Media\Subdef\OptionType\Multi($this->translator->trans('Target Device'), 'devices', $availableDevices, $this->devices));
             $subdefTypes[] = $mediatype_obj;
         }
     }
     return $subdefTypes;
 }