@@ -89,7 +89,7 @@ |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | // Approve if possible |
92 | - if ( $approval_status |
|
92 | + if ($approval_status |
|
93 | 93 | && $object->can_do('midcom:approve')) { |
94 | 94 | $object->metadata->approve(); |
95 | 95 | } |
@@ -68,7 +68,8 @@ |
||
68 | 68 | // Use the DB Factory to resolve the class and to get the object |
69 | 69 | try { |
70 | 70 | $object = midcom::get()->dbfactory->get_object_by_guid($identifier); |
71 | - } catch (midcom_error) { |
|
71 | + } |
|
72 | + catch (midcom_error) { |
|
72 | 73 | // This is probably a pseudo leaf, store the score to the current node |
73 | 74 | $this->_topic->set_parameter('midcom.helper.nav.score', $identifier, $score); |
74 | 75 | return true; |
@@ -111,7 +111,7 @@ |
||
111 | 111 | $request = $request->withHeader('User-Agent', 'Midgard/' . substr(mgd_version(), 0, 4)); |
112 | 112 | |
113 | 113 | // Handle basic auth |
114 | - if ( !empty($username) |
|
114 | + if (!empty($username) |
|
115 | 115 | && !empty($password)) { |
116 | 116 | // Set basic auth |
117 | 117 | $request = $request->withHeader('Authorization', 'Basic ' . base64_encode($username . ':' . $password)); |
@@ -121,7 +121,8 @@ |
||
121 | 121 | |
122 | 122 | try { |
123 | 123 | $response = $client->send($request); |
124 | - } catch (Exception $e) { |
|
124 | + } |
|
125 | + catch (Exception $e) { |
|
125 | 126 | $this->error = $e->getMessage(); |
126 | 127 | debug_add("Got error '{$this->error}' from HTTP request", MIDCOM_LOG_INFO); |
127 | 128 | return false; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | public function _on_handle($handler, array $args) |
28 | 28 | { |
29 | 29 | $buttons = []; |
30 | - if ( $this->_topic->can_do('midgard:update') |
|
30 | + if ($this->_topic->can_do('midgard:update') |
|
31 | 31 | && $this->_topic->can_do('midcom:component_config')) { |
32 | 32 | $workflow = $this->get_workflow('datamanager'); |
33 | 33 | $buttons[] = $workflow->get_button('config/', [ |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | MIDCOM_TOOLBAR_GLYPHICON => 'wrench', |
36 | 36 | ]); |
37 | 37 | } |
38 | - if ( $this->_topic->can_do('midgard:update') |
|
38 | + if ($this->_topic->can_do('midgard:update') |
|
39 | 39 | && $this->_topic->can_do('net.nehmer.comments:moderation')) { |
40 | 40 | $buttons[] = [ |
41 | 41 | MIDCOM_TOOLBAR_URL => 'moderate/reported_abuse/', |
@@ -108,12 +108,12 @@ |
||
108 | 108 | $this->_master = $master; |
109 | 109 | $this->router = $router; |
110 | 110 | |
111 | - $this->_request_data =& $master->_request_data; |
|
111 | + $this->_request_data = & $master->_request_data; |
|
112 | 112 | $this->_topic = $master->_topic; |
113 | 113 | |
114 | 114 | // Load component specific stuff, special treatment if the handler has |
115 | 115 | // a component different than the master handler set. |
116 | - if ( $this->_component |
|
116 | + if ($this->_component |
|
117 | 117 | && $this->_component != $master->_component) { |
118 | 118 | $this->_config->store_from_object($this->_topic, $this->_component, true); |
119 | 119 | } else { |
@@ -5,13 +5,13 @@ |
||
5 | 5 | ?> |
6 | 6 | <form method='get' name='midcom_helper_search_form' action='&(action);' class='midcom.helper.search'> |
7 | 7 | <label for="midcom_helper_search_query"> |
8 | -<?php echo $data['l10n']->get('query');?>: |
|
8 | +<?php echo $data['l10n']->get('query'); ?>: |
|
9 | 9 | <input type='text' size='60' name='query' id='midcom_helper_search_query' value=&(query:h); /> |
10 | 10 | </label> |
11 | 11 | <input type='hidden' name='type' value='basic' /> |
12 | 12 | <input type='hidden' name='page' value='1' /> |
13 | -<input type='submit' name='submit' value='<?php echo $data['l10n']->get('search');?>' /> |
|
13 | +<input type='submit' name='submit' value='<?php echo $data['l10n']->get('search'); ?>' /> |
|
14 | 14 | </form> |
15 | 15 | <p> |
16 | - <a href="&(advanced);&(data['params']);"><?php echo $data['l10n']->get('advanced search');?></a> |
|
16 | + <a href="&(advanced);&(data['params']);"><?php echo $data['l10n']->get('advanced search'); ?></a> |
|
17 | 17 | </p> |
18 | 18 | \ No newline at end of file |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $link = $data['router']->generate('components_component', ['component' => $component]); |
8 | 8 | |
9 | 9 | echo "<li class=\"component\">"; |
10 | - echo "<a href=\"{$link}\">" . midcom::get()->i18n->get_string($component, $component) ." </a>\n"; |
|
10 | + echo "<a href=\"{$link}\">" . midcom::get()->i18n->get_string($component, $component) . " </a>\n"; |
|
11 | 11 | echo "<ul>\n"; |
12 | 12 | foreach ($elements as $name => $path) { |
13 | 13 | echo "<li>"; |
@@ -61,7 +61,8 @@ |
||
61 | 61 | { |
62 | 62 | try { |
63 | 63 | $this->_object = midcom::get()->dbfactory->get_object_by_guid($guid); |
64 | - } catch (midcom_error $e) { |
|
64 | + } |
|
65 | + catch (midcom_error $e) { |
|
65 | 66 | if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) { |
66 | 67 | $relocate = $this->router->generate('object_deleted', ['guid' => $guid]); |
67 | 68 | midcom::get()->relocate($relocate); |
@@ -223,10 +223,10 @@ |
||
223 | 223 | $new_type_reflector = midcom_helper_reflector::get($new_type); |
224 | 224 | $link_properties = $new_type_reflector->get_link_properties(); |
225 | 225 | foreach ($link_properties as $property => $link) { |
226 | - if ( ($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__)) |
|
226 | + if (($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__)) |
|
227 | 227 | || $link['type'] == MGD_TYPE_GUID) { |
228 | 228 | $defaults[$property] = $this->_object->{$link['target']}; |
229 | - } elseif ( $property == $parent_property |
|
229 | + } elseif ($property == $parent_property |
|
230 | 230 | && midcom_helper_reflector::is_same_class($new_type, $this->_object->__mgdschema_class_name__)) { |
231 | 231 | $defaults[$property] = $this->_object->$parent_property; |
232 | 232 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | private function _populate_node_toolbar() |
22 | 22 | { |
23 | - if ( $this->_topic->can_do('midgard:update') |
|
23 | + if ($this->_topic->can_do('midgard:update') |
|
24 | 24 | && $this->_topic->can_do('midcom:component_config')) { |
25 | 25 | $workflow = $this->get_workflow('datamanager'); |
26 | 26 | $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [ |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | $this->_view_toolbar->add_items($buttons); |
60 | 60 | |
61 | - if ( $this->_topic->can_do('midgard:update') |
|
61 | + if ($this->_topic->can_do('midgard:update') |
|
62 | 62 | && $this->_topic->can_do('midcom:component_config')) { |
63 | 63 | $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [ |
64 | 64 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), |