@@ -68,7 +68,7 @@ |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | $config = $this->get_config_for_topic($topic); |
71 | - if ( $object->name == 'index' |
|
71 | + if ($object->name == 'index' |
|
72 | 72 | && !$config->get('autoindex')) { |
73 | 73 | return ''; |
74 | 74 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | )); |
45 | 45 | } |
46 | 46 | |
47 | - if ( $this->_article->topic === $this->_topic->id |
|
47 | + if ($this->_article->topic === $this->_topic->id |
|
48 | 48 | && $this->_article->can_do('midgard:delete')) { |
49 | 49 | $delete = $this->get_workflow('delete', array('object' => $this->_article)); |
50 | 50 | $buttons[] = $delete->get_button("delete/{$this->_article->guid}/"); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | if ($this->_config->get('enable_ajax_editing')) { |
99 | 99 | $this->_request_data['controller'] = midcom_helper_datamanager2_controller::create('ajax'); |
100 | - $this->_request_data['controller']->schemadb =& $this->_request_data['schemadb']; |
|
100 | + $this->_request_data['controller']->schemadb = & $this->_request_data['schemadb']; |
|
101 | 101 | $this->_request_data['controller']->set_storage($this->_article); |
102 | 102 | $this->_request_data['controller']->process_ajax(); |
103 | 103 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if ($this->_config->get('comments_enable')) { |
106 | 106 | if ($comments_node = $this->_seek_comments()) { |
107 | 107 | $this->_request_data['comments_url'] = $comments_node[MIDCOM_NAV_RELATIVEURL] . "comment/{$this->_article->guid}"; |
108 | - if ( $this->_topic->can_do('midgard:update') |
|
108 | + if ($this->_topic->can_do('midgard:update') |
|
109 | 109 | && $this->_topic->can_do('net.nehmer.comments:moderation')) { |
110 | 110 | net_nehmer_comments_viewer::add_head_elements(); |
111 | 111 | } |
@@ -218,7 +218,8 @@ |
||
218 | 218 | if ($this->_config->get('comments_topic')) { |
219 | 219 | try { |
220 | 220 | $comments_topic = new midcom_db_topic($this->_config->get('comments_topic')); |
221 | - } catch (midcom_error $e) { |
|
221 | + } |
|
222 | + catch (midcom_error $e) { |
|
222 | 223 | return false; |
223 | 224 | } |
224 | 225 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | )); |
45 | 45 | } |
46 | 46 | |
47 | - if ( $this->_article->topic === $this->_topic->id |
|
47 | + if ($this->_article->topic === $this->_topic->id |
|
48 | 48 | && $this->_article->can_do('midgard:delete')) { |
49 | 49 | $delete = $this->get_workflow('delete', array('object' => $this->_article)); |
50 | 50 | $buttons[] = $delete->get_button("delete/{$this->_article->guid}/"); |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | |
116 | 116 | if ($this->_config->get('enable_ajax_editing')) { |
117 | 117 | $this->_request_data['controller'] = midcom_helper_datamanager2_controller::create('ajax'); |
118 | - $this->_request_data['controller']->schemadb =& $this->_request_data['schemadb']; |
|
118 | + $this->_request_data['controller']->schemadb = & $this->_request_data['schemadb']; |
|
119 | 119 | $this->_request_data['controller']->set_storage($this->_article); |
120 | 120 | $this->_request_data['controller']->process_ajax(); |
121 | 121 | } |
122 | 122 | |
123 | 123 | $arg = $this->_article->name ?: $this->_article->guid; |
124 | - if ( $arg != 'index' |
|
124 | + if ($arg != 'index' |
|
125 | 125 | && $this->_config->get('hide_navigation')) { |
126 | 126 | $this->add_breadcrumb("{$arg}/", $this->_article->title); |
127 | 127 | } |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | midcom::get()->metadata->set_request_metadata($this->_article->metadata->revised, $this->_article->guid); |
132 | 132 | $this->bind_view_to_object($this->_article, $this->_datamanager->schema->name); |
133 | 133 | |
134 | - if ( $this->_config->get('indexinnav') |
|
134 | + if ($this->_config->get('indexinnav') |
|
135 | 135 | || $this->_config->get('autoindex') |
136 | 136 | || $this->_article->name != 'index') { |
137 | 137 | $this->set_active_leaf($this->_article->id); |
138 | 138 | } |
139 | 139 | |
140 | - if ( $this->_config->get('folder_in_title') |
|
140 | + if ($this->_config->get('folder_in_title') |
|
141 | 141 | && $this->_topic->extra != $this->_article->title) { |
142 | 142 | midcom::get()->head->set_pagetitle("{$this->_topic->extra}: {$this->_article->title}"); |
143 | 143 | } else { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function _show_view($handler_id, array &$data) |
193 | 193 | { |
194 | - if ( $this->_config->get('enable_ajax_editing') |
|
194 | + if ($this->_config->get('enable_ajax_editing') |
|
195 | 195 | && isset($data['controller'])) { |
196 | 196 | // For AJAX handling it is the controller that renders everything |
197 | 197 | $this->_request_data['view_article'] = $this->_request_data['controller']->get_content_html(); |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | * if the field has the default value or is empty, the user gets a free pass |
41 | 41 | * (if the field is required, this is caught by a separate rule) |
42 | 42 | */ |
43 | - if ( $date == "" |
|
43 | + if ($date == "" |
|
44 | 44 | || $date == "0000-00-00" |
45 | 45 | || $date == "0000-00-00 00:00:00") { |
46 | 46 | debug_add("value {$date} is assumed to be intentionally blank"); |
47 | 47 | return true; |
48 | 48 | } |
49 | - if ( preg_match("/^\d{4}-\d{2}-\d{2}/", $date) == 0 |
|
49 | + if (preg_match("/^\d{4}-\d{2}-\d{2}/", $date) == 0 |
|
50 | 50 | && preg_match("/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/", $date) == 0) { |
51 | 51 | debug_add("value {$date} is incorrectly formatted"); |
52 | 52 | return false; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | private function _sanitize_time($value, $options) |
66 | 66 | { |
67 | - if ( empty($value[0][$options . '_hours']) |
|
67 | + if (empty($value[0][$options . '_hours']) |
|
68 | 68 | && empty($value[0][$options . '_minutes']) |
69 | 69 | && empty($value[0][$options . '_seconds'])) { |
70 | 70 | return ''; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | ); |
145 | 145 | } |
146 | 146 | |
147 | - if ( midcom::get()->config->get('midcom_services_rcs_enable') |
|
147 | + if (midcom::get()->config->get('midcom_services_rcs_enable') |
|
148 | 148 | && $object->can_do('midgard:update') |
149 | 149 | && $object->_use_rcs) { |
150 | 150 | $buttons[] = array( |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | private function get_toolbar_update_items($object) |
206 | 206 | { |
207 | 207 | $buttons = array(); |
208 | - if ( is_a($object, 'midcom_db_topic') |
|
208 | + if (is_a($object, 'midcom_db_topic') |
|
209 | 209 | && $object->component |
210 | 210 | && $object->can_do('midcom:component_config')) { |
211 | 211 | $buttons[] = array( |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | MIDCOM_TOOLBAR_ENABLED => $object->can_do('midgard:privileges'), |
244 | 244 | ); |
245 | 245 | |
246 | - if ( midcom::get()->componentloader->is_installed('midcom.helper.replicator') |
|
246 | + if (midcom::get()->componentloader->is_installed('midcom.helper.replicator') |
|
247 | 247 | && midcom::get()->auth->admin) { |
248 | 248 | $buttons[] = array( |
249 | 249 | MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.helper.replicator/object/{$object->guid}/", |
@@ -117,7 +117,8 @@ |
||
117 | 117 | } |
118 | 118 | break; |
119 | 119 | } |
120 | - } catch (midcom_error $e) { |
|
120 | + } |
|
121 | + catch (midcom_error $e) { |
|
121 | 122 | $e->log(); |
122 | 123 | } |
123 | 124 | } |
@@ -78,11 +78,11 @@ discard block |
||
78 | 78 | |
79 | 79 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) |
80 | 80 | { |
81 | - if ( $object instanceof org_openpsa_contacts_group_dba |
|
81 | + if ($object instanceof org_openpsa_contacts_group_dba |
|
82 | 82 | || $object instanceof midcom_db_group) { |
83 | 83 | return "group/{$object->guid}/"; |
84 | 84 | } |
85 | - if ( $object instanceof org_openpsa_contacts_person_dba |
|
85 | + if ($object instanceof org_openpsa_contacts_person_dba |
|
86 | 86 | || $object instanceof midcom_db_person) { |
87 | 87 | return "person/{$object->guid}/"; |
88 | 88 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | // We have a feed URL, but we should check if it is GeoRSS as well |
112 | 112 | $items = net_nemein_rss_fetch::raw_fetch($data['rss_url'])->get_items(); |
113 | 113 | |
114 | - if ( count($items) > 0 |
|
115 | - && ( $items[0]->get_latitude() |
|
114 | + if (count($items) > 0 |
|
115 | + && ($items[0]->get_latitude() |
|
116 | 116 | || $items[0]->get_longitude())) { |
117 | 117 | // This is a GeoRSS feed |
118 | 118 | $data['georss_url'] = $data['rss_url']; |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | $data = $this->_get_data_from_url($group->homepage); |
176 | 176 | |
177 | 177 | // Use the data we got |
178 | - if ( midcom::get()->componentloader->is_installed('org.routamc.positioning') |
|
178 | + if (midcom::get()->componentloader->is_installed('org.routamc.positioning') |
|
179 | 179 | && array_key_exists('icbm', $data)) { |
180 | 180 | // We know where the group is located |
181 | 181 | $icbm_parts = explode(',', $data['icbm']); |
182 | 182 | if (count($icbm_parts) == 2) { |
183 | 183 | $latitude = (float) $icbm_parts[0]; |
184 | 184 | $longitude = (float) $icbm_parts[1]; |
185 | - if ( abs($latitude) < 90 |
|
185 | + if (abs($latitude) < 90 |
|
186 | 186 | && abs($longitude) < 180) { |
187 | 187 | $location = new org_routamc_positioning_location_dba(); |
188 | 188 | $location->date = time(); |
@@ -159,7 +159,8 @@ |
||
159 | 159 | |
160 | 160 | try { |
161 | 161 | $object = new $classname($guid); |
162 | - } catch (midcom_error $e) { |
|
162 | + } |
|
163 | + catch (midcom_error $e) { |
|
163 | 164 | $handler->print_error($type . " {$guid} not found, error " . $e->getMessage()); |
164 | 165 | return false; |
165 | 166 | } |
@@ -124,7 +124,7 @@ |
||
124 | 124 | $this->datamanager = new midcom_helper_datamanager2_datamanager($data['schemadb_group']); |
125 | 125 | if (midcom::get()->config->get('enable_ajax_editing')) { |
126 | 126 | $this->controller = midcom_helper_datamanager2_controller::create('ajax'); |
127 | - $this->controller->schemadb =& $data['schemadb_group']; |
|
127 | + $this->controller->schemadb = & $data['schemadb_group']; |
|
128 | 128 | $this->controller->set_storage($data['group']); |
129 | 129 | $this->controller->process_ajax(); |
130 | 130 | $this->datamanager = $this->controller->datamanager; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function _on_creating() |
44 | 44 | { |
45 | - return ( $this->validate_tag($this->tag) |
|
45 | + return ($this->validate_tag($this->tag) |
|
46 | 46 | && $this->_check_duplicates() == 0); |
47 | 47 | } |
48 | 48 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | midcom::get()->uimessages->add(midcom::get()->i18n->get_string('net.nemein.tag', 'net.nemein.tag'), sprintf(midcom::get()->i18n->get_string('tag "%s" is not valid. tags may not be numeric', 'net.nemein.tag'), $tag), 'info'); |
67 | 67 | return false; |
68 | 68 | } |
69 | - if ( strstr($tag, '"') |
|
69 | + if (strstr($tag, '"') |
|
70 | 70 | || strstr($tag, "'")) { |
71 | 71 | midcom::get()->uimessages->add(midcom::get()->i18n->get_string('net.nemein.tag', 'net.nemein.tag'), sprintf(midcom::get()->i18n->get_string('tag "%s" is not valid. tags may not contain quotes', 'net.nemein.tag'), $tag), 'info'); |
72 | 72 | return false; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function _on_updating() |
79 | 79 | { |
80 | - return ( $this->validate_tag($this->tag) |
|
80 | + return ($this->validate_tag($this->tag) |
|
81 | 81 | && $this->_check_duplicates() == 0); |
82 | 82 | } |
83 | 83 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | <h1>Merge tags</h1> |
5 | 5 | |
6 | 6 | <?php |
7 | -if ( isset($_POST['from']) |
|
7 | +if (isset($_POST['from']) |
|
8 | 8 | && isset($_POST['to'])) { |
9 | 9 | if (net_nemein_tag_handler::merge_tags($_POST['from'], $_POST['to'])) { |
10 | 10 | echo "<p>Successfully merged tag \"{$_POST['from']}\" to \"{$_POST['to']}\"</p>\n"; |