Example #1
0
 /**
  * @return array
  */
 public function getField()
 {
     $fieldset = $this->field->getFieldset();
     $fieldsInFieldset = array();
     foreach ($fieldset->getFields() as $field) {
         $fieldsInFieldset[] = $field->getIdentifier();
     }
     return array('identifier' => $this->field->getIdentifier(), 'formType' => 'fieldset', 'formAttributes' => array('childFields' => $fieldsInFieldset, 'label' => false, 'title' => $fieldset->getName(), 'fieldsetId' => '_fieldset_' . $fieldset->getId(), 'description' => $fieldset->getDescription(), 'attr' => array('help_text' => $this->field->getDescription())));
 }
Example #2
0
 /**
  * @return array
  */
 public function getField()
 {
     $fieldHasModule = $this->objectManager->getRepository("BigfishEavBundle:ModuleHasField")->findField($this->field, $this->module);
     $container = isset($this->options["container"]) ? $this->options["container"] : null;
     $options = $fieldHasModule->getOptions();
     if (isset($options['area'])) {
         $area = $this->objectManager->getRepository('BigfishPagekitBundle:Area')->find((int) $options['area']);
         if ($area) {
             $category = $area->getCategory();
         }
     }
     return array('identifier' => $this->field->getIdentifier(), 'formType' => $this->field->getFormType(), 'formAttributes' => array('resource' => $container->getResource(), 'area' => isset($area) ? $area : null, 'category' => isset($category) ? $category : null, "container" => $container, "field" => $this->field, 'label' => $this->field->getName(), 'attr' => array('help_text' => $this->field->getDescription())));
 }
Example #3
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>'))));
 }
Example #4
0
 /**
  * @return array
  */
 public function getField()
 {
     $findBelongsTo = $this->objectManager->getRepository('BigfishEavBundle:ModuleHasField')->findOneRelatedModule($this->field, $this->module);
     $relatedModule = $findBelongsTo->getBelongsTo();
     $query = $this->objectRepository->getRepository($relatedModule)->setClass(new EavModuleRepository())->findByNotDeleted();
     $options = $findBelongsTo->getOptions() ? $findBelongsTo->getOptions() : array();
     if (!array_key_exists('choiceItemLabel', $options)) {
         throw new \Exception('choiceItemLabel is required');
     }
     $choices = array();
     foreach ($query as $item) {
         $choices[$item['container_id']] = $this->parser->parse($options['choiceItemLabel'], array('row' => $item));
     }
     if (array_key_exists('multiple', $options)) {
         $this->typeChoice['multiple'] = (bool) $options['multiple'];
     }
     if (array_key_exists('expanded', $options)) {
         $this->typeChoice['expanded'] = (bool) $options['expanded'];
     }
     return array('identifier' => $this->field->getIdentifier(), 'formType' => new RelatedContainerType($choices, $this->typeChoice), 'formAttributes' => array('label' => $this->field->getName(), 'attr' => array('help_text' => $this->field->getDescription())));
 }
Example #5
0
 /**
  * @return array
  */
 public function getField()
 {
     return array('identifier' => $this->field->getIdentifier(), 'formType' => $this->field->getFormType(), 'formAttributes' => array('label' => $this->field->getName(), 'attr' => array('help_text' => $this->field->getDescription())));
 }
Example #6
0
 /**
  * @return array
  */
 public function getField()
 {
     $findBelongsTo = $this->objectManager->getRepository('BigfishEavBundle:ModuleHasField')->findOneRelatedModule($this->field, $this->module);
     $container = isset($this->options['container']) ? $this->options['container'] : null;
     return array('identifier' => $this->field->getIdentifier(), 'formType' => $this->field->getFormType(), 'formAttributes' => array('gridModule' => $findBelongsTo, 'container' => $container, 'field' => $this->field, 'label' => $this->field->getName(), 'attr' => array('help_text' => $this->field->getDescription())));
 }