@@ -138,7 +138,8 @@ discard block |
||
138 | 138 | try { |
139 | 139 | $this->_object = new $classname($this->_id); |
140 | 140 | return $this->_object; |
141 | - } catch (Exception $e) { |
|
141 | + } |
|
142 | + catch (Exception $e) { |
|
142 | 143 | $this->_stop($e->getMessage(), $e->getCode()); |
143 | 144 | } |
144 | 145 | } |
@@ -211,7 +212,8 @@ discard block |
||
211 | 212 | if (is_null($this->_response)) { |
212 | 213 | $this->_stop('Could not handle request, unknown method', 405); |
213 | 214 | } |
214 | - } catch (midcom_error $e) { |
|
215 | + } |
|
216 | + catch (midcom_error $e) { |
|
215 | 217 | $this->_responseStatus = $e->getCode(); |
216 | 218 | return $this->_send_response($e->getMessage()); |
217 | 219 | } |
@@ -143,7 +143,7 @@ |
||
143 | 143 | |
144 | 144 | $this->_modules[$name] = new $classname(); |
145 | 145 | $this->_modules[$name]->initialize(); |
146 | - $this->$name =& $this->_modules[$name]; |
|
146 | + $this->$name = & $this->_modules[$name]; |
|
147 | 147 | array_unshift($this->_unload_queue, $name); |
148 | 148 | } |
149 | 149 |
@@ -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); |
@@ -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."); |