Ejemplo n.º 1
0
 /**
  * @param File $element
  * @return string
  */
 public function render(ElementInterface $element)
 {
     if ($element instanceof File && $element->getFileObject()) {
         $fileObject = $element->getFileObject();
         $fm = FileManager::getInstance();
         $element->setAttribute('class', 'hidden');
         $render = parent::render($element);
         $render .= '<div class="file-container"><div class="file-icon">';
         if ($element instanceof FileImage) {
             $render .= '<img src="' . $this->view->basePath($fm->getThumbImage($fileObject, 64, 64)) . '">';
         } else {
             $render .= '<img src="/img/mfcc-admin-module/file-icons/' . $fileObject->getFileExtension() . '.svg">';
         }
         $render .= '</div><div class="file-info"><strong>' . $fileObject->getName() . '</strong><br><span class="file-size">' . $fileObject->getFormattedSize() . '</span><button type="button" class="btn btn-xs btn-danger file-remove"><i class="fa fa-remove"></i> Remove</button></div></div>';
     } else {
         $render = parent::render($element);
     }
     return $render;
 }
Ejemplo n.º 2
0
 public function getListedValue()
 {
     $fm = FileManager::getInstance();
 }
Ejemplo n.º 3
0
 /**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return mixed
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     FileManager::setConstructParams($serviceLocator->get('Doctrine\\ORM\\EntityManager'), $serviceLocator->get('FileManagerOptions')->toArray(), new FileSystem($serviceLocator->get(\BsbFlysystem\Service\AdapterManager::class)->get('default')), new Filesystem($serviceLocator->get(\BsbFlysystem\Service\AdapterManager::class)->get('cache')));
     return FileManager::getInstance();
 }