@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public function _on_initialize() |
68 | 68 | { |
69 | - if ( !$this->name |
|
69 | + if (!$this->name |
|
70 | 70 | || !$this->assignee) { |
71 | 71 | throw new midcom_error("The field {$this->name} had no name or assignee specified with it, cannot start up."); |
72 | 72 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | private function _update_cache() |
145 | 145 | { |
146 | 146 | $this->_merged = $this->_global; |
147 | - if ( !empty($this->_local) |
|
147 | + if (!empty($this->_local) |
|
148 | 148 | && is_array($this->_local)) { |
149 | 149 | $this->_merged = array_merge($this->_merged, $this->_local); |
150 | 150 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function store(array $params, $reset = true) |
188 | 188 | { |
189 | - if ( !$this->_object_stored |
|
189 | + if (!$this->_object_stored |
|
190 | 190 | && $this->_object) { |
191 | 191 | $this->_store_from_object(); |
192 | 192 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function get($key) |
248 | 248 | { |
249 | - if ( !$this->_object_stored |
|
249 | + if (!$this->_object_stored |
|
250 | 250 | && $this->_object) { |
251 | 251 | $this->_store_from_object(); |
252 | 252 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function get_all() |
280 | 280 | { |
281 | - if ( !$this->_object_stored |
|
281 | + if (!$this->_object_stored |
|
282 | 282 | && $this->_object) { |
283 | 283 | $this->_store_from_object(); |
284 | 284 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function exists($key) |
296 | 296 | { |
297 | - if ( !$this->_object_stored |
|
297 | + if (!$this->_object_stored |
|
298 | 298 | && $this->_object) { |
299 | 299 | $this->_store_from_object(); |
300 | 300 | } |
@@ -69,7 +69,8 @@ |
||
69 | 69 | // Use the DB Factory to resolve the class and to get the object |
70 | 70 | try { |
71 | 71 | $object = midcom::get()->dbfactory->get_object_by_guid($identifier); |
72 | - } catch (midcom_error $e) { |
|
72 | + } |
|
73 | + catch (midcom_error $e) { |
|
73 | 74 | // This is probably a pseudo leaf, store the score to the current node |
74 | 75 | $this->_topic->set_parameter('midcom.helper.nav.score', $identifier, $score); |
75 | 76 | return true; |
@@ -89,7 +89,7 @@ discard block |
||
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 | } |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | // jQuery sorting |
136 | 136 | midcom::get()->head->enable_jquery_ui(array('mouse', 'sortable')); |
137 | 137 | |
138 | - midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL.'/midcom.admin.folder/jquery-postfix.js'); |
|
138 | + midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.folder/jquery-postfix.js'); |
|
139 | 139 | |
140 | 140 | // Custom styles |
141 | - $this->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.admin.folder/midcom-admin-order.css'); |
|
141 | + $this->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.admin.folder/midcom-admin-order.css'); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function _handler_approval($handler_id, array $args, array &$data) |
25 | 25 | { |
26 | - if ( !array_key_exists('guid', $_REQUEST) |
|
26 | + if (!array_key_exists('guid', $_REQUEST) |
|
27 | 27 | || !array_key_exists('return_to', $_REQUEST)) { |
28 | 28 | throw new midcom_error('Cannot process approval request, request is incomplete.'); |
29 | 29 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $select_attributes['class'] .= ' selectcomponent'; |
46 | 46 | |
47 | 47 | $select_element = $this->_form->createElement('select', $this->name, $this->_translate($this->_field['title']), |
48 | - array(), $select_attributes); |
|
48 | + array(), $select_attributes); |
|
49 | 49 | |
50 | 50 | // Translate and add |
51 | 51 | foreach ($this->_all_elements as $key => $value) { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | parent::__construct(); |
34 | 34 | $this->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.admin.help/style-editor.css'); |
35 | 35 | |
36 | - midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL.'/midcom.admin.help/twisty.js'); |
|
36 | + midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.help/twisty.js'); |
|
37 | 37 | if (defined('MGD_TYPE_NONE')) { |
38 | 38 | $this->mgdtypes[MGD_TYPE_NONE] = 'none'; |
39 | 39 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | static function check_component($component) |
50 | 50 | { |
51 | - if ( !midcom::get()->componentloader->is_installed($component) |
|
51 | + if (!midcom::get()->componentloader->is_installed($component) |
|
52 | 52 | && $component != 'midcom') { |
53 | 53 | throw new midcom_error("Failed to generate documentation path for component {$component} as it is not installed."); |
54 | 54 | } |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | $files = array(); |
235 | 235 | $pattern = $component_dir . '*.{' . midcom::get()->i18n->get_current_language() . ',' . midcom::get()->config->get('i18n_fallback_language') . '}.txt'; |
236 | 236 | |
237 | - foreach (glob($pattern, GLOB_NOSORT|GLOB_BRACE) as $path) { |
|
237 | + foreach (glob($pattern, GLOB_NOSORT | GLOB_BRACE) as $path) { |
|
238 | 238 | $entry = basename($path); |
239 | - if ( substr($entry, 0, 5) == 'index' |
|
239 | + if (substr($entry, 0, 5) == 'index' |
|
240 | 240 | || substr($entry, 0, 7) == 'handler' |
241 | 241 | || substr($entry, 0, 9) == 'urlmethod') { |
242 | 242 | // Ignore dotfiles, handlers & index.lang.txt |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | // TODO: We're using "private" members here, better expose them through a method |
263 | 263 | $handler = midcom::get()->componentloader->get_interface_class($component); |
264 | - $request =& $handler->_context_data[midcom_core_context::get()->id]['handler']; |
|
264 | + $request = & $handler->_context_data[midcom_core_context::get()->id]['handler']; |
|
265 | 265 | if (!isset($request->_request_switch)) { |
266 | 266 | // No request switch available, skip loading it |
267 | 267 | return $data; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $exec_path = MIDCOM_ROOT . '/' . $component_path . '/exec'; |
317 | 317 | } |
318 | 318 | |
319 | - if ( !is_dir($exec_path) |
|
319 | + if (!is_dir($exec_path) |
|
320 | 320 | || !is_readable($exec_path)) { |
321 | 321 | // Directory not accessible, skip loading it |
322 | 322 | return $data; |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | { |
428 | 428 | $this->add_breadcrumb("__ais/help/", $this->_l10n->get('midcom.admin.help')); |
429 | 429 | |
430 | - if ( $handler_id == '____ais-help-help' |
|
430 | + if ($handler_id == '____ais-help-help' |
|
431 | 431 | || $handler_id == '____ais-help-component') { |
432 | 432 | $this->add_breadcrumb( |
433 | 433 | "__ais/help/{$this->_request_data['component']}/", |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | } |
437 | 437 | |
438 | 438 | if ($handler_id == '____ais-help-help') { |
439 | - if ( $this->_request_data['help_id'] == 'handlers' |
|
439 | + if ($this->_request_data['help_id'] == 'handlers' |
|
440 | 440 | || $this->_request_data['help_id'] == 'urlmethods' |
441 | 441 | || $this->_request_data['help_id'] == 'mgdschemas') { |
442 | 442 | $this->add_breadcrumb( |
@@ -30,7 +30,7 @@ |
||
30 | 30 | public function _on_loaded() |
31 | 31 | { |
32 | 32 | // if we are missing the component, use the nullcomponent. |
33 | - if ( !$this->component |
|
33 | + if (!$this->component |
|
34 | 34 | || !array_key_exists($this->component, midcom::get()->componentloader->manifests)) { |
35 | 35 | debug_add("Topic {$this->id} has no component assigned to it, using 'midcom.core.nullcomponent'.", |
36 | 36 | MIDCOM_LOG_INFO); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $this->context->set_key(MIDCOM_CONTEXT_PAGETITLE, $meta[MIDCOM_NAV_NAME]); |
50 | 50 | } |
51 | 51 | |
52 | - if ( $this->context->id == 0 |
|
52 | + if ($this->context->id == 0 |
|
53 | 53 | && !midcom::get()->skip_page_style) { |
54 | 54 | // Let metadata service add its meta tags |
55 | 55 | midcom::get()->metadata->populate_meta_head(); |
@@ -28,14 +28,14 @@ |
||
28 | 28 | |
29 | 29 | public function send() |
30 | 30 | { |
31 | - if ( $this->url == '' |
|
32 | - || ( substr($this->url, 0, 1) != "/") |
|
31 | + if ($this->url == '' |
|
32 | + || (substr($this->url, 0, 1) != "/") |
|
33 | 33 | && !preg_match('|^https?://|', $this->url)) { |
34 | 34 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
35 | 35 | if ($prefix == '') { |
36 | 36 | $prefix = '/'; |
37 | 37 | } |
38 | - $this->url = "{$prefix}{$this->url}"; |
|
38 | + $this->url = "{$prefix}{$this->url}"; |
|
39 | 39 | debug_add("This is a relative URL from the local site, prepending anchor prefix: {$this->url}"); |
40 | 40 | } |
41 | 41 | $location = "Location: {$this->url}"; |