@@ -23,7 +23,7 @@ |
||
23 | 23 | include __DIR__ . '/config-default.inc.php'; |
24 | 24 | } |
25 | 25 | |
26 | -if (! defined('MIDCOM_STATIC_URL')) { |
|
26 | +if (!defined('MIDCOM_STATIC_URL')) { |
|
27 | 27 | define('MIDCOM_STATIC_URL', '/midcom-static'); |
28 | 28 | } |
29 | 29 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | midcom::get()->auth->require_valid_user(); |
37 | 37 | midcom::get()->skip_page_style = true; |
38 | 38 | |
39 | - $this->add_stylesheet(MIDCOM_STATIC_URL ."/midcom.helper.imagepopup/styling.css", 'screen'); |
|
39 | + $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.imagepopup/styling.css", 'screen'); |
|
40 | 40 | |
41 | 41 | $data['filetype'] = $args[0]; |
42 | 42 | $data['object'] = null; |
@@ -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 | if ($value === null) { |
49 | 49 | $value = array(); |
50 | 50 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return $value; |
55 | 55 | }; |
56 | 56 | |
57 | - $get_config = function (Options $options, $value) { |
|
57 | + $get_config = function(Options $options, $value) { |
|
58 | 58 | return \midcom_baseclasses_components_configuration::get('midcom.helper.datamanager2', 'config'); |
59 | 59 | }; |
60 | 60 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | 'config' => $get_config |
64 | 64 | )); |
65 | 65 | |
66 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
66 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
67 | 67 | $widget_defaults = array( |
68 | 68 | 'mode' => 'exact', |
69 | 69 | 'theme' => $options['config']->get('tinymce_default_theme'), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ); |
74 | 74 | return helper::resolve_options($widget_defaults, $value); |
75 | 75 | }); |
76 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
76 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
77 | 77 | $type_defaults = array( |
78 | 78 | |
79 | 79 | ); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'elements' => $view->vars['id'], |
107 | 107 | 'local_config' => $options['widget_config']['local_config'], |
108 | 108 | 'language' => midcom::get()->i18n->get_current_language(), |
109 | - 'img' => ($options['widget_config']['use_imagepopup'])? $this->_get_image_popup($form) : '', |
|
109 | + 'img' => ($options['widget_config']['use_imagepopup']) ? $this->_get_image_popup($form) : '', |
|
110 | 110 | ); |
111 | 111 | $snippet = $this->_get_snippet($tiny_options); |
112 | 112 | $view->vars['tinymce_snippet'] = $snippet; |
@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | $qb = midcom_db_member::new_query_builder(); |
56 | 56 | $qb->add_constraint('gid', '=', $this->_group->id); |
57 | - if ( $qb->count_unchecked() > $this->_config->get('list_users_max') |
|
57 | + if ($qb->count_unchecked() > $this->_config->get('list_users_max') |
|
58 | 58 | && isset($schemadb['default']->fields['persons'])) { |
59 | 59 | unset($schemadb['default']->fields['persons']); |
60 | 60 | $field_order_key = array_search('persons', $schemadb['default']->field_order); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $this->_guid = $args[0]; |
203 | 203 | $this->_load_object(); |
204 | 204 | |
205 | - if ( !$this->_backend->version_exists($args[1]) |
|
205 | + if (!$this->_backend->version_exists($args[1]) |
|
206 | 206 | || !$this->_backend->version_exists($args[2])) { |
207 | 207 | throw new midcom_error_notfound("One of the revisions {$args[1]} or {$args[2]} does not exist."); |
208 | 208 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $this->_request_data['earlier_revision'] = $this->_backend->get_prev_version($args[1]); |
218 | 218 | $this->_request_data['previous_revision'] = $args[1]; |
219 | 219 | $this->_request_data['latest_revision'] = $args[2]; |
220 | - $this->_request_data['next_revision'] = $this->_backend->get_next_version($args[2]); |
|
220 | + $this->_request_data['next_revision'] = $this->_backend->get_next_version($args[2]); |
|
221 | 221 | |
222 | 222 | $this->_request_data['guid'] = $args[0]; |
223 | 223 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | // Set the version numbers |
292 | 292 | $data['previous_revision'] = $this->_backend->get_prev_version($args[1]); |
293 | 293 | $data['latest_revision'] = $args[1]; |
294 | - $data['next_revision'] = $this->_backend->get_next_version($args[1]); |
|
294 | + $data['next_revision'] = $this->_backend->get_next_version($args[1]); |
|
295 | 295 | $data['guid'] = $args[0]; |
296 | 296 | } |
297 | 297 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $this->_object->require_do('midgard:update'); |
319 | 319 | // TODO: set another privilege for restoring? |
320 | 320 | |
321 | - if ( $this->_backend->version_exists($args[1]) |
|
321 | + if ($this->_backend->version_exists($args[1]) |
|
322 | 322 | && $this->_backend->restore_to_revision($args[1])) { |
323 | 323 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), sprintf($this->_l10n->get('restore to version %s successful'), $args[1])); |
324 | 324 | return new midcom_response_relocate(midcom::get()->permalinks->create_permalink($this->_object->guid)); |
@@ -336,7 +336,7 @@ |
||
336 | 336 | public function update_cache() |
337 | 337 | { |
338 | 338 | // Check if the attachment can be read anonymously |
339 | - if ( midcom::get()->config->get('attachment_cache_enabled') |
|
339 | + if (midcom::get()->config->get('attachment_cache_enabled') |
|
340 | 340 | && !$this->can_do('midgard:read', 'EVERYONE')) { |
341 | 341 | // Not public file, ensure it is removed |
342 | 342 | $filename = $this->get_cache_path(); |
@@ -98,8 +98,8 @@ |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | // Check the Metadata if and only if we are configured to do so. |
101 | - if ( is_object($this->object) |
|
102 | - && ( midcom::get()->config->get('show_hidden_objects') == false |
|
101 | + if (is_object($this->object) |
|
102 | + && (midcom::get()->config->get('show_hidden_objects') == false |
|
103 | 103 | || midcom::get()->config->get('show_unapproved_objects') == false)) { |
104 | 104 | // Check Hiding, Scheduling and Approval |
105 | 105 | $metadata = $this->object->metadata; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | public function is_readable_by($user_id) |
30 | 30 | { |
31 | - return ( empty($this->object) |
|
31 | + return (empty($this->object) |
|
32 | 32 | || !$this->guid |
33 | 33 | || !$user_id |
34 | 34 | || midcom::get()->auth->acl->can_do_byguid('midgard:read', $this->guid, $this->object->__midcom_class_name__, $user_id)); |
@@ -52,7 +52,8 @@ |
||
52 | 52 | } elseif (!empty($this->data[MIDCOM_NAV_GUID])) { |
53 | 53 | try { |
54 | 54 | $this->data[MIDCOM_NAV_OBJECT] = midcom::get()->dbfactory->get_object_by_guid($this->data[MIDCOM_NAV_GUID]); |
55 | - } catch (midcom_error $e) { |
|
55 | + } |
|
56 | + catch (midcom_error $e) { |
|
56 | 57 | } |
57 | 58 | } else { |
58 | 59 | debug_add("Warning: The leaf {$this->leafid} of topic {$topic->id} does set neither a GUID nor an object."); |
@@ -166,7 +166,8 @@ discard block |
||
166 | 166 | break; |
167 | 167 | } |
168 | 168 | } |
169 | - } catch (midcom_error $e) { |
|
169 | + } |
|
170 | + catch (midcom_error $e) { |
|
170 | 171 | } |
171 | 172 | |
172 | 173 | $path_parts = array_reverse($path_parts); |
@@ -410,7 +411,8 @@ discard block |
||
410 | 411 | && $db_style = $this->get_style_id_from_path($root_topic->style)) { |
411 | 412 | $_style = $this->_get_element_in_styletree($db_style, $_element); |
412 | 413 | } |
413 | - } catch (midcom_error_forbidden $e) { |
|
414 | + } |
|
415 | + catch (midcom_error_forbidden $e) { |
|
414 | 416 | $e->log(); |
415 | 417 | } |
416 | 418 |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $element = $matches[2]; |
311 | 311 | } |
312 | 312 | |
313 | - if ( isset($stylepath) |
|
313 | + if (isset($stylepath) |
|
314 | 314 | && $styleid = $this->get_style_id_from_path($stylepath)) { |
315 | 315 | array_unshift($this->_scope, $styleid); |
316 | 316 | } |
@@ -354,9 +354,9 @@ discard block |
||
354 | 354 | */ |
355 | 355 | public function render($preparsed, $path, array $data = array()) |
356 | 356 | { |
357 | - if ( empty($data) |
|
357 | + if (empty($data) |
|
358 | 358 | && midcom_core_context::get()->has_custom_key('request_data')) { |
359 | - $data =& midcom_core_context::get()->get_custom_key('request_data'); |
|
359 | + $data = & midcom_core_context::get()->get_custom_key('request_data'); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | if (eval('?>' . $preparsed) === false) { |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | try { |
392 | 392 | $root_topic = $context->get_key(MIDCOM_CONTEXT_ROOTTOPIC); |
393 | - if ( $root_topic->style |
|
393 | + if ($root_topic->style |
|
394 | 394 | && $db_style = $this->get_style_id_from_path($root_topic->style)) { |
395 | 395 | $_style = $this->_get_element_in_styletree($db_style, $_element); |
396 | 396 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | if (array_key_exists($src, $this->_styles)) { |
426 | 426 | return $this->_styles[$src]; |
427 | 427 | } |
428 | - if ( $this->_scope[0] != '' |
|
428 | + if ($this->_scope[0] != '' |
|
429 | 429 | && $result = $this->_get_element_in_styletree($this->_scope[0], $_element)) { |
430 | 430 | $this->_styles[$src] = $result; |
431 | 431 | return $this->_styles[$src]; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | if (array_key_exists($src, $this->_snippets)) { |
444 | 444 | return $this->_snippets[$src]; |
445 | 445 | } |
446 | - if ( midcom::get()->config->get('theme') |
|
446 | + if (midcom::get()->config->get('theme') |
|
447 | 447 | && $content = midcom_helper_misc::get_element_content($_element)) { |
448 | 448 | $this->_snippets[$src] = $content; |
449 | 449 | return $content; |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | |
452 | 452 | $current_context = midcom_core_context::get()->id; |
453 | 453 | foreach ($this->_styledirs[$current_context] as $path) { |
454 | - $filename = $path . "/{$_element}.php"; |
|
454 | + $filename = $path . "/{$_element}.php"; |
|
455 | 455 | if (file_exists($filename)) { |
456 | 456 | $this->_snippets[$filename] = file_get_contents($filename); |
457 | 457 | return $this->_snippets[$filename]; |
@@ -501,11 +501,11 @@ discard block |
||
501 | 501 | } |
502 | 502 | } else { |
503 | 503 | $style = $topic->style; |
504 | - if ( !$topic->style |
|
504 | + if (!$topic->style |
|
505 | 505 | && !empty($GLOBALS['midcom_style_inherited'])) { |
506 | 506 | $style = $GLOBALS['midcom_style_inherited']; |
507 | 507 | } |
508 | - if ( is_string($style) |
|
508 | + if (is_string($style) |
|
509 | 509 | && strpos($style, 'theme:') === 0) { |
510 | 510 | $theme_dir = OPENPSA2_THEME_ROOT . midcom::get()->config->get('theme') . '/style'; |
511 | 511 | $parts = explode('/', str_replace('theme:/', '', $style)); |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | { |
534 | 534 | // get component's snippetdir (for default styles) |
535 | 535 | $loader = midcom::get()->componentloader; |
536 | - if ( !$topic |
|
536 | + if (!$topic |
|
537 | 537 | || !$topic->guid) { |
538 | 538 | return null; |
539 | 539 | } |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | /* then the contextstyle */ |
670 | 670 | $this->_styledirs[$current_context][count($this->_styledirs[$current_context])] = $component_style; |
671 | 671 | |
672 | - $this->_styledirs[$current_context] = array_merge($this->_styledirs[$current_context], $this->_styledirs_append[$current_context]); |
|
672 | + $this->_styledirs[$current_context] = array_merge($this->_styledirs[$current_context], $this->_styledirs_append[$current_context]); |
|
673 | 673 | } |
674 | 674 | |
675 | 675 | /** |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | $this->_styledirs_append[$context] = array(); |
699 | 699 | } |
700 | 700 | |
701 | - if ( $this->_topic |
|
701 | + if ($this->_topic |
|
702 | 702 | && $_st = $this->_get_component_style($this->_topic)) { |
703 | 703 | array_unshift($this->_scope, $_st); |
704 | 704 | } |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | */ |
719 | 719 | public function leave_context() |
720 | 720 | { |
721 | - if ( $this->_topic |
|
721 | + if ($this->_topic |
|
722 | 722 | && $this->_get_component_style($this->_topic)) { |
723 | 723 | array_shift($this->_scope); |
724 | 724 | } |