Example #1
0
 /**
  * @return array
  */
 public function getField()
 {
     $container = isset($this->options['container']) ? $this->options['container'] : null;
     $ids = array();
     $height = array();
     $width = array();
     $helpMessage = array();
     foreach ($this->field->getDimensions() as $dimension) {
         $height[] = (int) $dimension->getMinHeight();
         $height[] = (int) $dimension->getFixedHeight();
         $width[] = (int) $dimension->getMinWidth();
         $width[] = (int) $dimension->getFixedWidth();
         $ids[] = $dimension->getId();
     }
     $helpMessage[] = $this->field->getDescription();
     if (count($height) > 0) {
         $helpMessage[] = $this->translator->trans('bigfish.media.help.sizes', array('%height%' => max($height), '%width%' => max($width)));
     }
     return array('identifier' => $this->field->getIdentifier(), 'formType' => $this->field->getFormType(), 'formAttributes' => array('container' => $container, 'field' => $this->field, 'label' => $this->field->getName(), 'attr' => array('data-dimensions' => implode(',', $ids), 'class' => 'uploadValue', 'help_text' => ltrim(implode('<BR>', $helpMessage), '<BR>'))));
 }