@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | public function __construct($context = null) |
80 | 80 | { |
81 | - if ( is_null($context) |
|
81 | + if (is_null($context) |
|
82 | 82 | || is_numeric($context)) { |
83 | 83 | $this->_domain = midcom_core_context::get($context)->get_key(MIDCOM_CONTEXT_COMPONENT); |
84 | 84 | } else { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function number($value, $precision = 2) |
31 | 31 | { |
32 | - if ( is_float($value) |
|
32 | + if (is_float($value) |
|
33 | 33 | && version_compare(Intl::getIcuVersion(), '49', '<')) { |
34 | 34 | // workaround for http://bugs.icu-project.org/trac/ticket/8561 |
35 | 35 | if ($precision == 0) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $value = time(); |
58 | 58 | } |
59 | 59 | //PHP < 5.3.4 compat |
60 | - if ( version_compare(PHP_VERSION, '5.3.5', '<') |
|
60 | + if (version_compare(PHP_VERSION, '5.3.5', '<') |
|
61 | 61 | && $value instanceof DateTime) { |
62 | 62 | $value = (int) $value->format('U') + timezone_offset_get($value->getTimeZone(), $value); |
63 | 63 | } |
@@ -94,7 +94,7 @@ |
||
94 | 94 | if (is_a($object, 'midcom_db_attachment')) { |
95 | 95 | // Faster linking to attachments |
96 | 96 | $parent = $object->get_parent(); |
97 | - if ( is_a($parent, 'midcom_db_topic') |
|
97 | + if (is_a($parent, 'midcom_db_topic') |
|
98 | 98 | && $nav->is_node_in_tree($parent->id, $nav->get_root_node())) { |
99 | 99 | $napobj = $nav->get_node($parent->id); |
100 | 100 | return $napobj[MIDCOM_NAV_FULLURL] . $object->name; |
@@ -72,7 +72,8 @@ |
||
72 | 72 | |
73 | 73 | try { |
74 | 74 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
75 | - } catch (midcom_error $e) { |
|
75 | + } |
|
76 | + catch (midcom_error $e) { |
|
76 | 77 | debug_add("Failed to resolve the GUID {$guid}, this is most probably an access denied error.", MIDCOM_LOG_ERROR); |
77 | 78 | debug_add('Last MidCOM error string: ' . $e->getMessage()); |
78 | 79 | return null; |
@@ -213,7 +213,8 @@ |
||
213 | 213 | $browser = new Browser; |
214 | 214 | try { |
215 | 215 | $response = $browser->send($request); |
216 | - } catch (Exception $e) { |
|
216 | + } |
|
217 | + catch (Exception $e) { |
|
217 | 218 | debug_add("Failed to execute request " . $request->getUrl() . ": " . $e->getMessage(), MIDCOM_LOG_WARN); |
218 | 219 | return false; |
219 | 220 | } |
@@ -109,7 +109,7 @@ |
||
109 | 109 | */ |
110 | 110 | public function members_to_fields() |
111 | 111 | { |
112 | - if ( empty($this->topic_guid) |
|
112 | + if (empty($this->topic_guid) |
|
113 | 113 | || empty($this->topic_url) |
114 | 114 | || empty($this->component)) { |
115 | 115 | //if one of those is missing, we override all three to ensure consistency |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $id = count(self::$_contexts); |
96 | 96 | } |
97 | 97 | $this->id = $id; |
98 | - self::$_contexts[$id] =& $this; |
|
98 | + self::$_contexts[$id] = & $this; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return self::$_contexts[$id]; |
125 | 125 | } |
126 | 126 | |
127 | - if ( $id < 0 |
|
127 | + if ($id < 0 |
|
128 | 128 | || $id >= count(self::$_contexts)) { |
129 | 129 | debug_add("Could not get invalid context $id.", MIDCOM_LOG_WARN); |
130 | 130 | $ret = false; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return false; |
164 | 164 | } |
165 | 165 | |
166 | - if ( ( $key === MIDCOM_CONTEXT_ROOTTOPICID |
|
166 | + if (($key === MIDCOM_CONTEXT_ROOTTOPICID |
|
167 | 167 | || $key === MIDCOM_CONTEXT_ROOTTOPIC) |
168 | 168 | && $this->_data[$key] === null) { |
169 | 169 | $this->_initialize_root_topic(); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $component = $this->_data[MIDCOM_CONTEXT_COMPONENT]; |
251 | 251 | } |
252 | 252 | |
253 | - return ( array_key_exists($component, $this->_data[MIDCOM_CONTEXT_CUSTOMDATA]) |
|
253 | + return (array_key_exists($component, $this->_data[MIDCOM_CONTEXT_CUSTOMDATA]) |
|
254 | 254 | && array_key_exists($key, $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$component])); |
255 | 255 | } |
256 | 256 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $component = $this->_data[MIDCOM_CONTEXT_COMPONENT]; |
304 | 304 | } |
305 | 305 | |
306 | - $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$component][$key] =& $value; |
|
306 | + $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$component][$key] = & $value; |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | public function get_component() |
@@ -181,7 +181,8 @@ |
||
181 | 181 | } else { |
182 | 182 | try { |
183 | 183 | $root_node = midcom_db_topic::get_cached($guid); |
184 | - } catch (midcom_error $e) { |
|
184 | + } |
|
185 | + catch (midcom_error $e) { |
|
185 | 186 | if ($e instanceof midcom_error_forbidden) { |
186 | 187 | throw $e; |
187 | 188 | } |
@@ -94,7 +94,7 @@ |
||
94 | 94 | 'midcom' => array( |
95 | 95 | 'style-init' => '', |
96 | 96 | 'style-finish' => '', |
97 | - ) |
|
97 | + ) |
|
98 | 98 | ), |
99 | 99 | 'nodes' => array(), |
100 | 100 | ); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | public function __construct(array &$data) |
24 | 24 | { |
25 | - $this->_data =& $data; |
|
25 | + $this->_data = & $data; |
|
26 | 26 | midcom::get()->head->enable_jquery_ui(array('accordion')); |
27 | 27 | } |
28 | 28 | |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | - if ( midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style') |
|
37 | - && ( $this->_data['handler_id'] !== '____mfa-asgard-object_create' |
|
36 | + if (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_style') |
|
37 | + && ($this->_data['handler_id'] !== '____mfa-asgard-object_create' |
|
38 | 38 | || $this->_data['current_type'] == 'midgard_element')) { |
39 | 39 | $help_element = $this->_get_help_style_elementnames($this->_data['object']); |
40 | - } elseif ( midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element') |
|
40 | + } elseif (midcom::get()->dbfactory->is_a($this->_data['object'], 'midgard_element') |
|
41 | 41 | && $this->_data['handler_id'] !== '____mfa-asgard-object_create') { |
42 | 42 | $help_element = $this->_get_help_element(); |
43 | 43 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | private function _get_help_element() |
51 | 51 | { |
52 | - if ( empty($this->_data['object']->name) |
|
52 | + if (empty($this->_data['object']->name) |
|
53 | 53 | || empty($this->_data['object']->style)) { |
54 | 54 | // We cannot help with empty elements |
55 | 55 | return; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | $this->_object = midcom::get()->dbfactory->get_object_by_guid($this->_guid); |
53 | 53 | |
54 | - if ( !midcom::get()->config->get('midcom_services_rcs_enable') |
|
54 | + if (!midcom::get()->config->get('midcom_services_rcs_enable') |
|
55 | 55 | || !$this->_object->_use_rcs) { |
56 | 56 | throw new midcom_error_notfound("Revision control not supported for " . get_class($this->_object) . "."); |
57 | 57 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $show_previous = false; |
190 | 190 | if ($diff_view) { |
191 | - if ( $before != '' |
|
191 | + if ($before != '' |
|
192 | 192 | && $before2 != '') { |
193 | 193 | // When browsing diffs we want to display buttons to previous instead of current |
194 | 194 | $first = $before2; |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $this->_guid = $args[0]; |
302 | 302 | $this->_load_object(); |
303 | 303 | |
304 | - if ( !$this->_backend->version_exists($args[1]) |
|
304 | + if (!$this->_backend->version_exists($args[1]) |
|
305 | 305 | || !$this->_backend->version_exists($args[2])) { |
306 | 306 | throw new midcom_error_notfound("One of the revisions {$args[1]} or {$args[2]} does not exist."); |
307 | 307 | } |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | $this->_prepare_toolbars($args[1]); |
391 | 391 | |
392 | - if ( $this->_backend->version_exists($args[1]) |
|
392 | + if ($this->_backend->version_exists($args[1]) |
|
393 | 393 | && $this->_backend->restore_to_revision($args[1])) { |
394 | 394 | midcom::get()->uimessages->add($this->_l10n->get('midcom.admin.rcs'), sprintf($this->_l10n->get('restore to version %s successful'), $args[1])); |
395 | 395 | return new midcom_response_relocate("__mfa/asgard/object/open/{$this->_guid}/"); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function send() |
30 | 30 | { |
31 | 31 | $context = midcom_core_context::get(); |
32 | - $data =& $context->get_custom_key('request_data'); |
|
32 | + $data = & $context->get_custom_key('request_data'); |
|
33 | 33 | midcom::get()->style->enter_context($context->id); |
34 | 34 | |
35 | 35 | if (isset($data['view_title'])) { |