@@ -33,8 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function configureOptions(OptionsResolver $resolver) |
35 | 35 | { |
36 | - $resolver->setDefaults(array |
|
37 | - ( |
|
36 | + $resolver->setDefaults(array( |
|
38 | 37 | 'operations' => array(), |
39 | 38 | 'mapped' => false |
40 | 39 | )); |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | { |
55 | 54 | $label = "form submit: {$operation}"; |
56 | 55 | } |
57 | - $attributes = array |
|
58 | - ( |
|
56 | + $attributes = array( |
|
59 | 57 | 'operation' => $operation, |
60 | 58 | 'label' => $l10n->get($label), |
61 | 59 | 'attr' => array('class' => 'submit ' . $operation) |
@@ -65,8 +65,7 @@ |
||
65 | 65 | //@todo Move to template? |
66 | 66 | $attributes['attr']['accesskey'] = 's'; |
67 | 67 | $attributes['attr']['class'] .= ' save_' . $key; |
68 | - } |
|
69 | - else if ($operation == controller::CANCEL) |
|
68 | + } else if ($operation == controller::CANCEL) |
|
70 | 69 | { |
71 | 70 | //@todo Move to template? |
72 | 71 | $attributes['attr']['accesskey'] = 'd'; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | parent::configureOptions($resolver); |
45 | 45 | |
46 | - $map_attr = function (Options $options, $value) |
|
46 | + $map_attr = function(Options $options, $value) |
|
47 | 47 | { |
48 | 48 | if ($value === null) |
49 | 49 | { |
@@ -55,30 +55,27 @@ discard block |
||
55 | 55 | return $value; |
56 | 56 | }; |
57 | 57 | |
58 | - $get_config = function (Options $options, $value) |
|
58 | + $get_config = function(Options $options, $value) |
|
59 | 59 | { |
60 | 60 | return \midcom_baseclasses_components_configuration::get('midcom.helper.datamanager2', 'config'); |
61 | 61 | }; |
62 | 62 | |
63 | - $resolver->setDefaults(array |
|
64 | - ( |
|
63 | + $resolver->setDefaults(array( |
|
65 | 64 | 'attr' => $map_attr, |
66 | 65 | 'config' => $get_config |
67 | 66 | )); |
68 | 67 | |
69 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) |
|
68 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) |
|
70 | 69 | { |
71 | - $widget_defaults = array |
|
72 | - ( |
|
70 | + $widget_defaults = array( |
|
73 | 71 | 'enabled' => true, |
74 | 72 | 'language' => 'php', |
75 | 73 | ); |
76 | 74 | return helper::resolve_options($widget_defaults, $value); |
77 | 75 | }); |
78 | - $resolver->setNormalizer('type_config', function (Options $options, $value) |
|
76 | + $resolver->setNormalizer('type_config', function(Options $options, $value) |
|
79 | 77 | { |
80 | - $type_defaults = array |
|
81 | - ( |
|
78 | + $type_defaults = array( |
|
82 | 79 | 'modes' => array('xml', 'javascript', 'css', 'clike', 'php'), |
83 | 80 | ); |
84 | 81 | return helper::resolve_options($type_defaults, $value); |
@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | public function configureOptions(OptionsResolver $resolver) |
40 | 40 | { |
41 | 41 | parent::configureOptions($resolver); |
42 | - $resolver->setDefaults(array |
|
43 | - ( |
|
42 | + $resolver->setDefaults(array( |
|
44 | 43 | 'allow_add' => true, |
45 | 44 | 'allow_delete' => true, |
46 | 45 | 'prototype' => true, |
@@ -48,20 +47,19 @@ discard block |
||
48 | 47 | 'delete_empty' => true, |
49 | 48 | 'error_bubbling' => false |
50 | 49 | )); |
51 | - $resolver->setNormalizer('type', function (Options $options, $value) |
|
50 | + $resolver->setNormalizer('type', function(Options $options, $value) |
|
52 | 51 | { |
53 | 52 | return $options['dm2_type']; |
54 | 53 | }); |
55 | - $resolver->setNormalizer('type_config', function (Options $options, $value) |
|
54 | + $resolver->setNormalizer('type_config', function(Options $options, $value) |
|
56 | 55 | { |
57 | - $widget_defaults = array |
|
58 | - ( |
|
56 | + $widget_defaults = array( |
|
59 | 57 | 'sortable' => false, |
60 | 58 | 'max_count' => 0 |
61 | 59 | ); |
62 | 60 | return helper::resolve_options($widget_defaults, $value); |
63 | 61 | }); |
64 | - $resolver->setNormalizer('constraints', function (Options $options, $value) |
|
62 | + $resolver->setNormalizer('constraints', function(Options $options, $value) |
|
65 | 63 | { |
66 | 64 | $validation = array(); |
67 | 65 | if ($options['type_config']['max_count'] > 0) |
@@ -78,15 +76,14 @@ discard block |
||
78 | 76 | } |
79 | 77 | return $validation; |
80 | 78 | }); |
81 | - $resolver->setNormalizer('options', function (Options $options, $value) |
|
79 | + $resolver->setNormalizer('options', function(Options $options, $value) |
|
82 | 80 | { |
83 | - return array |
|
84 | - ( |
|
81 | + return array( |
|
85 | 82 | 'required' => false, //@todo no idea why this is necessary |
86 | 83 | 'widget_config' => $options['widget_config'] |
87 | 84 | ); |
88 | 85 | }); |
89 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) |
|
86 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) |
|
90 | 87 | { |
91 | 88 | if (!array_key_exists('sortable', $value)) |
92 | 89 | { |
@@ -24,10 +24,9 @@ |
||
24 | 24 | */ |
25 | 25 | public function configureOptions(OptionsResolver $resolver) |
26 | 26 | { |
27 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) |
|
27 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) |
|
28 | 28 | { |
29 | - $widget_defaults = array |
|
30 | - ( |
|
29 | + $widget_defaults = array( |
|
31 | 30 | 'map_action_elements' => false, |
32 | 31 | 'show_title' => true, |
33 | 32 | 'show_description' => false, |
@@ -45,14 +45,12 @@ discard block |
||
45 | 45 | { |
46 | 46 | parent::configureOptions($resolver); |
47 | 47 | |
48 | - $resolver->setDefaults(array |
|
49 | - ( |
|
48 | + $resolver->setDefaults(array( |
|
50 | 49 | 'error_bubbling' => false |
51 | 50 | )); |
52 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) |
|
51 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) |
|
53 | 52 | { |
54 | - $widget_defaults = array |
|
55 | - ( |
|
53 | + $widget_defaults = array( |
|
56 | 54 | 'showOn' => 'both', |
57 | 55 | 'format' => '%Y-%m-%d %H:%M', |
58 | 56 | 'hide_seconds' => true, |
@@ -62,10 +60,9 @@ discard block |
||
62 | 60 | ); |
63 | 61 | return helper::resolve_options($widget_defaults, $value); |
64 | 62 | }); |
65 | - $resolver->setNormalizer('type_config', function (Options $options, $value) |
|
63 | + $resolver->setNormalizer('type_config', function(Options $options, $value) |
|
66 | 64 | { |
67 | - $type_defaults = array |
|
68 | - ( |
|
65 | + $type_defaults = array( |
|
69 | 66 | 'storage_type' => jsdate::ISO, |
70 | 67 | ); |
71 | 68 | return helper::resolve_options($type_defaults, $value); |
@@ -79,8 +76,7 @@ discard block |
||
79 | 76 | { |
80 | 77 | $builder->addModelTransformer(new jsdatetransformer($options)); |
81 | 78 | |
82 | - $date_options = array |
|
83 | - ( |
|
79 | + $date_options = array( |
|
84 | 80 | 'widget' => 'single_text' |
85 | 81 | ); |
86 | 82 | |
@@ -97,8 +93,7 @@ discard block |
||
97 | 93 | { |
98 | 94 | $pattern .= ':[0-5][0-9]'; |
99 | 95 | } |
100 | - $time_options = array |
|
101 | - ( |
|
96 | + $time_options = array( |
|
102 | 97 | 'widget' => 'single_text', |
103 | 98 | 'with_seconds' => !$options['widget_config']['hide_seconds'], |
104 | 99 | 'attr' => array('size' => 11, 'pattern' => $pattern), |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | parent::configureOptions($resolver); |
46 | 46 | |
47 | - $map_attr = function (Options $options, $value) |
|
47 | + $map_attr = function(Options $options, $value) |
|
48 | 48 | { |
49 | 49 | if ($value === null) |
50 | 50 | { |
@@ -56,21 +56,19 @@ discard block |
||
56 | 56 | return $value; |
57 | 57 | }; |
58 | 58 | |
59 | - $get_config = function (Options $options, $value) |
|
59 | + $get_config = function(Options $options, $value) |
|
60 | 60 | { |
61 | 61 | return \midcom_baseclasses_components_configuration::get('midcom.helper.datamanager2', 'config'); |
62 | 62 | }; |
63 | 63 | |
64 | - $resolver->setDefaults(array |
|
65 | - ( |
|
64 | + $resolver->setDefaults(array( |
|
66 | 65 | 'attr' => $map_attr, |
67 | 66 | 'config' => $get_config |
68 | 67 | )); |
69 | 68 | |
70 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) |
|
69 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) |
|
71 | 70 | { |
72 | - $widget_defaults = array |
|
73 | - ( |
|
71 | + $widget_defaults = array( |
|
74 | 72 | 'mode' => 'exact', |
75 | 73 | 'theme' => $options['config']->get('tinymce_default_theme'), |
76 | 74 | 'local_config' => '', |
@@ -79,10 +77,9 @@ discard block |
||
79 | 77 | ); |
80 | 78 | return helper::resolve_options($widget_defaults, $value); |
81 | 79 | }); |
82 | - $resolver->setNormalizer('type_config', function (Options $options, $value) |
|
80 | + $resolver->setNormalizer('type_config', function(Options $options, $value) |
|
83 | 81 | { |
84 | - $type_defaults = array |
|
85 | - ( |
|
82 | + $type_defaults = array( |
|
86 | 83 | |
87 | 84 | ); |
88 | 85 | return helper::resolve_options($type_defaults, $value); |
@@ -109,14 +106,13 @@ discard block |
||
109 | 106 | |
110 | 107 | $schema_name = 'default'; |
111 | 108 | $config = $this->get_configuration($options); |
112 | - $tiny_options = array |
|
113 | - ( |
|
109 | + $tiny_options = array( |
|
114 | 110 | 'config' => $config, |
115 | 111 | 'mode' => $options['widget_config']['mode'], |
116 | 112 | 'elements' => $view->vars['id'], |
117 | 113 | 'local_config' => $options['widget_config']['local_config'], |
118 | 114 | 'language' => midcom::get()->i18n->get_current_language(), |
119 | - 'img' => ($options['widget_config']['use_imagepopup'])? $this->_get_image_popup($schema_name, $form) : '', |
|
115 | + 'img' => ($options['widget_config']['use_imagepopup']) ? $this->_get_image_popup($schema_name, $form) : '', |
|
120 | 116 | ); |
121 | 117 | $snippet = $this->_get_snippet($tiny_options); |
122 | 118 | $view->vars['tinymce_snippet'] = $snippet; |
@@ -33,26 +33,25 @@ |
||
33 | 33 | public function configureOptions(OptionsResolver $resolver) |
34 | 34 | { |
35 | 35 | parent::configureOptions($resolver); |
36 | - $map_options = function (Options $options) |
|
36 | + $map_options = function(Options $options) |
|
37 | 37 | { |
38 | 38 | $return_options = array(); |
39 | 39 | if (isset($options['type_config']['options'])) |
40 | 40 | { |
41 | - foreach($options['type_config']['options'] as $key => $value) |
|
41 | + foreach ($options['type_config']['options'] as $key => $value) |
|
42 | 42 | { |
43 | 43 | //symfony expects only strings |
44 | - $return_options[$value] = (string)$key; |
|
44 | + $return_options[$value] = (string) $key; |
|
45 | 45 | } |
46 | 46 | return $return_options; |
47 | 47 | } |
48 | 48 | }; |
49 | - $map_multiple = function (Options $options) |
|
49 | + $map_multiple = function(Options $options) |
|
50 | 50 | { |
51 | 51 | return !empty($options['type_config']['allow_multiple']); |
52 | 52 | }; |
53 | 53 | |
54 | - $resolver->setDefaults(array |
|
55 | - ( |
|
54 | + $resolver->setDefaults(array( |
|
56 | 55 | 'choices' => $map_options, |
57 | 56 | 'choices_as_values' => true, |
58 | 57 | 'expanded' => true, |
@@ -33,22 +33,21 @@ |
||
33 | 33 | { |
34 | 34 | parent::configureOptions($resolver); |
35 | 35 | |
36 | - $map_options = function (Options $options) |
|
36 | + $map_options = function(Options $options) |
|
37 | 37 | { |
38 | 38 | $return_options = array(); |
39 | 39 | if (isset($options['type_config']['options'])) |
40 | 40 | { |
41 | - foreach($options['type_config']['options'] as $key => $value) |
|
41 | + foreach ($options['type_config']['options'] as $key => $value) |
|
42 | 42 | { |
43 | 43 | //symfony expects only strings |
44 | - $return_options[$value] = (string)$key; |
|
44 | + $return_options[$value] = (string) $key; |
|
45 | 45 | } |
46 | 46 | return $return_options; |
47 | 47 | } |
48 | 48 | }; |
49 | 49 | |
50 | - $resolver->setDefaults(array |
|
51 | - ( |
|
50 | + $resolver->setDefaults(array( |
|
52 | 51 | 'choices' => $map_options, |
53 | 52 | 'choices_as_values' => true |
54 | 53 | )); |
@@ -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'), |
@@ -172,8 +172,7 @@ |
||
172 | 172 | } |
173 | 173 | $this->_jobs[] = $job; |
174 | 174 | } |
175 | - } |
|
176 | - catch (midcom_error $e) |
|
175 | + } catch (midcom_error $e) |
|
177 | 176 | { |
178 | 177 | $e->log(MIDCOM_LOG_ERROR); |
179 | 178 | debug_print_r('Got this job declaration:', $job); |