@@ -96,7 +96,7 @@ |
||
96 | 96 | $data['reflector'] = midcom_helper_reflector::get($data['type']); |
97 | 97 | $data['label_property'] = $data['reflector']->get_label_property(); |
98 | 98 | |
99 | - if ( isset($_POST['undelete']) |
|
99 | + if (isset($_POST['undelete']) |
|
100 | 100 | && is_array($_POST['undelete'])) { |
101 | 101 | if (isset($_POST['purge'])) { |
102 | 102 | $this->_purge(); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | // List installed MgdSchema types and convert to DBA classes |
22 | 22 | foreach ($this->_request_data['schema_types'] as $schema_type) { |
23 | - if ( !is_null($type) |
|
23 | + if (!is_null($type) |
|
24 | 24 | && $schema_type != $type) { |
25 | 25 | // Skip |
26 | 26 | continue; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $qb->add_constraint('metadata.revised', '>=', $since); |
50 | 50 | } |
51 | 51 | |
52 | - if ( $only_mine |
|
52 | + if ($only_mine |
|
53 | 53 | && midcom::get()->auth->user) { |
54 | 54 | $qb->add_constraint('metadata.authors', 'LIKE', '|' . midcom::get()->auth->user->guid . '|'); |
55 | 55 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $data['view_title'] = $this->_l10n->get('asgard'); |
95 | 95 | |
96 | - if ( isset($_POST['execute_mass_action']) |
|
96 | + if (isset($_POST['execute_mass_action']) |
|
97 | 97 | && !empty($_POST['selections']) |
98 | 98 | && isset($_POST['mass_action'])) { |
99 | 99 | $method_name = "_mass_{$_POST['mass_action']}"; |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | $data['review_by'] = null; |
111 | - if ( $this->_config->get('enable_review_dates') |
|
111 | + if ($this->_config->get('enable_review_dates') |
|
112 | 112 | && isset($_REQUEST['review_by']) |
113 | 113 | && $_REQUEST['review_by'] != 'any') { |
114 | 114 | $data['review_by'] = (int) $_REQUEST['review_by']; |
115 | 115 | } |
116 | 116 | |
117 | 117 | $data['type_filter'] = null; |
118 | - if ( isset($_REQUEST['type_filter']) |
|
118 | + if (isset($_REQUEST['type_filter']) |
|
119 | 119 | && $_REQUEST['type_filter'] != 'any') { |
120 | 120 | $data['type_filter'] = $_REQUEST['type_filter']; |
121 | 121 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | continue; |
275 | 275 | } |
276 | 276 | |
277 | - if ( $object->can_do('midgard:update') |
|
277 | + if ($object->can_do('midgard:update') |
|
278 | 278 | && $object->can_do('midcom:approve')) { |
279 | 279 | $object->metadata->approve(); |
280 | 280 | midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.asgard'), sprintf($this->_l10n->get('object %s approved'), $object->guid)); |
@@ -147,7 +147,8 @@ discard block |
||
147 | 147 | foreach ($activities as $activity) { |
148 | 148 | try { |
149 | 149 | $object = midcom::get()->dbfactory->get_object_by_guid($activity->target); |
150 | - } catch (midcom_error $e) { |
|
150 | + } |
|
151 | + catch (midcom_error $e) { |
|
151 | 152 | if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) { |
152 | 153 | // TODO: Visualize deleted objects somehow |
153 | 154 | } |
@@ -155,7 +156,8 @@ discard block |
||
155 | 156 | } |
156 | 157 | try { |
157 | 158 | $actor = midcom_db_person::get_cached($activity->actor); |
158 | - } catch (midcom_error $e) { |
|
159 | + } |
|
160 | + catch (midcom_error $e) { |
|
159 | 161 | $actor = null; |
160 | 162 | } |
161 | 163 | |
@@ -253,7 +255,8 @@ discard block |
||
253 | 255 | foreach ($guids as $guid) { |
254 | 256 | try { |
255 | 257 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
256 | - } catch (midcom_error $e) { |
|
258 | + } |
|
259 | + catch (midcom_error $e) { |
|
257 | 260 | continue; |
258 | 261 | } |
259 | 262 | |
@@ -270,7 +273,8 @@ discard block |
||
270 | 273 | foreach ($guids as $guid) { |
271 | 274 | try { |
272 | 275 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
273 | - } catch (midcom_error $e) { |
|
276 | + } |
|
277 | + catch (midcom_error $e) { |
|
274 | 278 | continue; |
275 | 279 | } |
276 | 280 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | public function getToolbarConfig($object) |
21 | 21 | { |
22 | - if ( $object->can_do('midgard:delete') |
|
22 | + if ($object->can_do('midgard:delete') |
|
23 | 23 | && !empty($object->up)) { |
24 | 24 | // show delete for all collection children |
25 | 25 | return array( |
@@ -93,8 +93,8 @@ |
||
93 | 93 | |
94 | 94 | private function prepare_url($url) |
95 | 95 | { |
96 | - if ( substr($url, 0, 1) != '/' |
|
97 | - && ! preg_match('|^https?://|', $url)) { |
|
96 | + if (substr($url, 0, 1) != '/' |
|
97 | + && !preg_match('|^https?://|', $url)) { |
|
98 | 98 | $url = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . $url; |
99 | 99 | } |
100 | 100 | return '"' . $url . '"'; |
@@ -88,7 +88,7 @@ |
||
88 | 88 | )) |
89 | 89 | ->setRequired('object') |
90 | 90 | ->setAllowedTypes('object', 'midcom_core_dbaobject') |
91 | - ->setNormalizer('label', function ($options, $value) { |
|
91 | + ->setNormalizer('label', function($options, $value) { |
|
92 | 92 | if ($value === null) { |
93 | 93 | return midcom_helper_reflector::get_object_title($options['object']); |
94 | 94 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | if (!empty($this->config['widget_config']['sortable'])) { |
103 | - uasort($this->map, function ($a, $b) { |
|
103 | + uasort($this->map, function($a, $b) { |
|
104 | 104 | if ($a->metadata->score == $b->metadata->score) { |
105 | 105 | return strnatcasecmp($a->name, $b->name); |
106 | 106 | } |
@@ -37,7 +37,8 @@ |
||
37 | 37 | foreach ($items as $identifier => $guid) { |
38 | 38 | try { |
39 | 39 | $results[$identifier] = new midcom_db_attachment($guid); |
40 | - } catch (midcom_error $e) { |
|
40 | + } |
|
41 | + catch (midcom_error $e) { |
|
41 | 42 | $e->log(); |
42 | 43 | } |
43 | 44 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | $qb = midcom::get()->dbfactory->new_query_builder($this->config['type_config']['mapping_class_name']); |
100 | 100 | $qb->add_constraint($this->config['type_config']['master_fieldname'], '=', $this->get_master_foreign_key()); |
101 | 101 | |
102 | - if ( $this->config['type_config']['sortable'] |
|
102 | + if ($this->config['type_config']['sortable'] |
|
103 | 103 | && preg_match('/^(ASC|DESC)/i', $this->config['type_config']['sortable_sort_order'], $regs)) { |
104 | 104 | $order = strtoupper($regs[1]); |
105 | 105 | $qb->add_order('metadata.score', $order); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function set_storage(midcom_core_dbaobject $storage = null, $schema = null) |
126 | 126 | { |
127 | - if ( $schema === null |
|
127 | + if ($schema === null |
|
128 | 128 | && !empty($storage->id)) { |
129 | 129 | $schema = $storage->get_parameter('midcom.helper.datamanager2', 'schema_name'); |
130 | 130 | } |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | // Replace the dots in the component name with underscores |
189 | 189 | $name = midcom::get()->componentloader->path_to_prefix($name); |
190 | 190 | } |
191 | - if (! $name) { |
|
191 | + if (!$name) { |
|
192 | 192 | // Fallback for componentless operation |
193 | 193 | $name = 'midcom_helper_datamanager2'; |
194 | 194 | } |
195 | 195 | |
196 | - if ( $this->form === null |
|
196 | + if ($this->form === null |
|
197 | 197 | || $this->form->getName() != $name) { |
198 | 198 | $this->get_storage(); |
199 | 199 | $builder = self::get_factory()->createNamedBuilder($name, compat::get_type_name('form'), $this->storage); |
@@ -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 | if ($value === null) { |
48 | 48 | $value = array(); |
49 | 49 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return $value; |
54 | 54 | }; |
55 | 55 | |
56 | - $get_config = function (Options $options, $value) { |
|
56 | + $get_config = function(Options $options, $value) { |
|
57 | 57 | return \midcom_baseclasses_components_configuration::get('midcom.helper.datamanager2', 'config'); |
58 | 58 | }; |
59 | 59 | |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | 'config' => $get_config |
63 | 63 | )); |
64 | 64 | |
65 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
65 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
66 | 66 | $widget_defaults = array( |
67 | 67 | 'enabled' => true, |
68 | 68 | 'language' => 'php', |
69 | 69 | ); |
70 | 70 | return helper::resolve_options($widget_defaults, $value); |
71 | 71 | }); |
72 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
72 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
73 | 73 | $type_defaults = array( |
74 | 74 | 'modes' => array('xml', 'javascript', 'css', 'clike', 'php'), |
75 | 75 | ); |