@@ -29,10 +29,9 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function configureOptions(OptionsResolver $resolver) |
| 31 | 31 | { |
| 32 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) |
|
| 32 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) |
|
| 33 | 33 | { |
| 34 | - $widget_defaults = array |
|
| 35 | - ( |
|
| 34 | + $widget_defaults = array( |
|
| 36 | 35 | 'creation_mode_enabled' => false, |
| 37 | 36 | 'class' => null, |
| 38 | 37 | 'component' => null, |
@@ -51,10 +50,9 @@ discard block |
||
| 51 | 50 | ); |
| 52 | 51 | return helper::resolve_options($widget_defaults, $value); |
| 53 | 52 | }); |
| 54 | - $resolver->setNormalizer('type_config', function (Options $options, $value) |
|
| 53 | + $resolver->setNormalizer('type_config', function(Options $options, $value) |
|
| 55 | 54 | { |
| 56 | - $type_defaults = array |
|
| 57 | - ( |
|
| 55 | + $type_defaults = array( |
|
| 58 | 56 | 'options' => array(), |
| 59 | 57 | 'allow_other' => false, |
| 60 | 58 | 'allow_multiple' => ($options['dm2_type'] == 'mnrelation'), |
@@ -116,8 +116,7 @@ |
||
| 116 | 116 | { |
| 117 | 117 | $object = new $options['widget_config']['class']($identifier); |
| 118 | 118 | $preset[$identifier] = \midcom_helper_datamanager2_widget_autocomplete::create_item_label($object, $options['widget_config']['result_headers'], $options['widget_config']['get_label_for']); |
| 119 | - } |
|
| 120 | - catch (midcom_error $e) |
|
| 119 | + } catch (midcom_error $e) |
|
| 121 | 120 | { |
| 122 | 121 | $e->log(); |
| 123 | 122 | } |
@@ -36,20 +36,18 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function configureOptions(OptionsResolver $resolver) |
| 38 | 38 | { |
| 39 | - $resolver->setDefaults(array |
|
| 40 | - ( |
|
| 39 | + $resolver->setDefaults(array( |
|
| 41 | 40 | 'error_bubbling' => false |
| 42 | 41 | )); |
| 43 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) |
|
| 42 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) |
|
| 44 | 43 | { |
| 45 | - $widget_defaults = array |
|
| 46 | - ( |
|
| 44 | + $widget_defaults = array( |
|
| 47 | 45 | 'map_action_elements' => false, |
| 48 | 46 | 'show_title' => false |
| 49 | 47 | ); |
| 50 | 48 | return helper::resolve_options($widget_defaults, $value); |
| 51 | 49 | }); |
| 52 | - $resolver->setNormalizer('constraints', function (Options $options, $value) |
|
| 50 | + $resolver->setNormalizer('constraints', function(Options $options, $value) |
|
| 53 | 51 | { |
| 54 | 52 | if ($options['required']) |
| 55 | 53 | { |
@@ -72,7 +70,7 @@ discard block |
||
| 72 | 70 | } |
| 73 | 71 | $builder->add('delete', compat::get_type_name('checkbox'), array('attr' => array( |
| 74 | 72 | "class" => "midcom_datamanager_photo_checkbox" |
| 75 | - ), "required" => false )); |
|
| 73 | + ), "required" => false)); |
|
| 76 | 74 | $builder->add('identifier', compat::get_type_name('hidden'), array('data' => 'file')); |
| 77 | 75 | |
| 78 | 76 | $head = midcom::get()->head; |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function configureOptions(OptionsResolver $resolver) |
| 31 | 31 | { |
| 32 | - $resolver->setDefaults(array |
|
| 33 | - ( |
|
| 32 | + $resolver->setDefaults(array( |
|
| 34 | 33 | 'operation' => '', |
| 35 | 34 | )); |
| 36 | 35 | } |
@@ -20,8 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function configureOptions(OptionsResolver $resolver) |
| 22 | 22 | { |
| 23 | - $resolver->setDefaults(array |
|
| 24 | - ( |
|
| 23 | + $resolver->setDefaults(array( |
|
| 25 | 24 | 'widget_config' => array(), |
| 26 | 25 | 'type_config' => array(), |
| 27 | 26 | 'dm2_type' => null, |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | new type\radiocheckselect, |
| 29 | 29 | new type\subform, |
| 30 | 30 | new type\select, |
| 31 | - new type\tinymce, |
|
| 31 | + new type\tinymce, |
|
| 32 | 32 | new type\toolbar, |
| 33 | 33 | ); |
| 34 | 34 | } |
@@ -17,8 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | protected function loadTypes() |
| 19 | 19 | { |
| 20 | - return array |
|
| 21 | - ( |
|
| 20 | + return array( |
|
| 22 | 21 | new type\autocomplete, |
| 23 | 22 | new type\blobs, |
| 24 | 23 | new type\codemirror, |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if ( $input === null |
|
| 38 | - || ( $input instanceof DateTime |
|
| 37 | + if ($input === null |
|
| 38 | + || ($input instanceof DateTime |
|
| 39 | 39 | && $input->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) |
| 40 | 40 | { |
| 41 | 41 | return $result; |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function reverseTransform($array) |
| 63 | 63 | { |
| 64 | - if (!is_array($array) ) { |
|
| 64 | + if (!is_array($array)) { |
|
| 65 | 65 | throw new TransformationFailedException('Expected an array.'); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if (empty($array['date']) |
| 69 | - || ( $array['date'] instanceof DateTime |
|
| 69 | + || ($array['date'] instanceof DateTime |
|
| 70 | 70 | && $array['date']->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) |
| 71 | 71 | { |
| 72 | 72 | return; |
@@ -45,8 +45,7 @@ discard block |
||
| 45 | 45 | if ($this->config['type_config']['storage_type'] === datetype::UNIXTIME) |
| 46 | 46 | { |
| 47 | 47 | $date->setTimestamp($input); |
| 48 | - } |
|
| 49 | - else if ($this->config['type_config']['storage_type'] === datetype::ISO) |
|
| 48 | + } else if ($this->config['type_config']['storage_type'] === datetype::ISO) |
|
| 50 | 49 | { |
| 51 | 50 | $date->modify($input); |
| 52 | 51 | } |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | if ($this->config['type_config']['storage_type'] === datetype::UNIXTIME) |
| 80 | 79 | { |
| 81 | 80 | return $array['date']->format('U'); |
| 82 | - } |
|
| 83 | - else if ($this->config['type_config']['storage_type'] === datetype::ISO) |
|
| 81 | + } else if ($this->config['type_config']['storage_type'] === datetype::ISO) |
|
| 84 | 82 | { |
| 85 | 83 | return $array['date']->format('Y-m-d H:i:s'); |
| 86 | 84 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function transform($array) |
| 21 | 21 | { |
| 22 | - if (!is_array($array) ) { |
|
| 22 | + if (!is_array($array)) { |
|
| 23 | 23 | throw new TransformationFailedException('Expected an array.'); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | $description = $attachment->get_parameter('midcom.helper.datamanager2.type.blobs', 'description'); |
| 52 | 52 | } |
| 53 | - return array |
|
| 54 | - ( |
|
| 53 | + return array( |
|
| 55 | 54 | 'filename' => $attachment->name, |
| 56 | 55 | 'description' => $description, |
| 57 | 56 | 'title' => $attachment->title, |
@@ -81,8 +80,7 @@ discard block |
||
| 81 | 80 | $title = (!empty($data['title'])) ? $data['title'] : $data['file']['name']; |
| 82 | 81 | $description = (array_key_exists('description', $data)) ? $data['description'] : $title; |
| 83 | 82 | $stat = stat($data['file']['tmp_name']); |
| 84 | - return array |
|
| 85 | - ( |
|
| 83 | + return array( |
|
| 86 | 84 | 'filename' => $data['file']['name'], |
| 87 | 85 | 'description' => $description, |
| 88 | 86 | 'title' => $title, |
@@ -104,7 +102,7 @@ discard block |
||
| 104 | 102 | |
| 105 | 103 | public function reverseTransform($array) |
| 106 | 104 | { |
| 107 | - if (!is_array($array) ) { |
|
| 105 | + if (!is_array($array)) { |
|
| 108 | 106 | throw new TransformationFailedException('Expected an array.'); |
| 109 | 107 | } |
| 110 | 108 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function transform($input) |
| 23 | 23 | { |
| 24 | - if ( $this->config['dm2_type'] == 'select' |
|
| 24 | + if ($this->config['dm2_type'] == 'select' |
|
| 25 | 25 | && $this->config['type_config']['allow_multiple']) |
| 26 | 26 | { |
| 27 | 27 | switch ($this->config['type_config']['multiple_storagemode']) |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function reverseTransform($array) |
| 45 | 45 | { |
| 46 | - if (!is_array($array) ) { |
|
| 46 | + if (!is_array($array)) { |
|
| 47 | 47 | throw new TransformationFailedException('Expected an array.'); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return reset($array['selection']); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if ( $this->config['dm2_type'] == 'select' |
|
| 60 | + if ($this->config['dm2_type'] == 'select' |
|
| 61 | 61 | && $this->config['type_config']['allow_multiple']) |
| 62 | 62 | { |
| 63 | 63 | switch ($this->config['type_config']['multiple_storagemode']) |