@@ -166,7 +166,7 @@ |
||
166 | 166 | } |
167 | 167 | } |
168 | 168 | // Only display the requested user as participant |
169 | - $event->participants[$data['person']->id] = true; |
|
169 | + $event->participants[$data['person']->id] = true; |
|
170 | 170 | // Always force busy in this view |
171 | 171 | $event->busy = true; |
172 | 172 | $encoder->add_event($event); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | class org_openpsa_calendar_midcom_indexer extends midcom_helper_datamanager2_indexer_client |
15 | 15 | { |
16 | - public function prepare_document(midcom_services_indexer_document &$document, midcom_helper_datamanager2_datamanager $dm) |
|
16 | + public function prepare_document(midcom_services_indexer_document & $document, midcom_helper_datamanager2_datamanager $dm) |
|
17 | 17 | { |
18 | 18 | $document->title = $dm->storage->object->get_label(); |
19 | 19 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | class org_openpsa_invoices_midcom_indexer extends midcom_helper_datamanager2_indexer_client |
15 | 15 | { |
16 | - public function prepare_document(midcom_services_indexer_document &$document, midcom_helper_datamanager2_datamanager $dm) |
|
16 | + public function prepare_document(midcom_services_indexer_document & $document, midcom_helper_datamanager2_datamanager $dm) |
|
17 | 17 | { |
18 | 18 | $document->title = $this->_l10n->get('invoice') . ' ' . $dm->storage->object->get_label(); |
19 | 19 | } |
@@ -183,17 +183,17 @@ |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
186 | - * Inserts a link detector to the given HTML source. All outgoing |
|
187 | - * HTTP links in the source HTML are replaced with the given |
|
188 | - * link detector address so that the token "URL" is replaced with |
|
189 | - * encoded form of the original link. It is expected that the link detector |
|
190 | - * address points to a script that records the passed link and |
|
191 | - * forwards the client to the real link target. |
|
192 | - * |
|
193 | - * @param string $html the HTML source |
|
194 | - * @param string $address the link detector address |
|
195 | - * @return HTML source with the link detector |
|
196 | - */ |
|
186 | + * Inserts a link detector to the given HTML source. All outgoing |
|
187 | + * HTTP links in the source HTML are replaced with the given |
|
188 | + * link detector address so that the token "URL" is replaced with |
|
189 | + * encoded form of the original link. It is expected that the link detector |
|
190 | + * address points to a script that records the passed link and |
|
191 | + * forwards the client to the real link target. |
|
192 | + * |
|
193 | + * @param string $html the HTML source |
|
194 | + * @param string $address the link detector address |
|
195 | + * @return HTML source with the link detector |
|
196 | + */ |
|
197 | 197 | private function _insert_link_detector($html, $address) |
198 | 198 | { |
199 | 199 | $address = addslashes($address); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | //Check for bounce detector usage |
33 | 33 | if (!empty($config['bounce_detector_address'])) { |
34 | 34 | //Force bouncer as backend if default specified |
35 | - if ( empty($config['mail_send_backend']) |
|
35 | + if (empty($config['mail_send_backend']) |
|
36 | 36 | || $config['mail_send_backend'] == 'try_default') { |
37 | 37 | $config['mail_send_backend'] = 'bouncer'; |
38 | 38 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | //Set some List-xxx headers to avoid auto-replies and in general to be a good netizen |
91 | 91 | $mail->headers['List-Id'] = "<{$this->_message->guid}@{$_SERVER['SERVER_NAME']}>"; |
92 | - $mail->headers['List-Unsubscribe'] = '<' . $member->get_unsubscribe_url() . '>'; |
|
92 | + $mail->headers['List-Unsubscribe'] = '<' . $member->get_unsubscribe_url() . '>'; |
|
93 | 93 | |
94 | 94 | debug_add('mail->from: ' . $mail->from . ', mail->to: ' . $mail->to . ', mail->subject: ' . $mail->subject); |
95 | 95 | switch ($this->_message->orgOpenpsaObtype) { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | // If you don't want to add the image as an attachment to the field, add show_attachment customdata-definition to |
143 | 143 | // schema and set it to false |
144 | - if ( isset($typedata->storage->_schema->fields[$field]['customdata']['show_attachment']) |
|
144 | + if (isset($typedata->storage->_schema->fields[$field]['customdata']['show_attachment']) |
|
145 | 145 | && $typedata->storage->_schema->fields[$field]['customdata']['show_attachment'] === false) { |
146 | 146 | continue; |
147 | 147 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $address = addslashes($address); |
184 | 184 | return preg_replace_callback( |
185 | 185 | '/href="(http:\/\/.*?)"/i', |
186 | - function ($match) use ($address) { |
|
186 | + function($match) use ($address) { |
|
187 | 187 | return 'href="' . str_replace("URL", rawurlencode($match[1]), $address) . '"'; |
188 | 188 | }, |
189 | 189 | $html); |
@@ -813,7 +813,7 @@ |
||
813 | 813 | { |
814 | 814 | if ( $this->storage->object |
815 | 815 | && midcom::get()->config->get('indexer_backend') |
816 | - //check if there is an index_method set |
|
816 | + //check if there is an index_method set |
|
817 | 817 | && ( !array_key_exists('index_method', $this->_datamanager->schema->fields[$this->name]) |
818 | 818 | || |
819 | 819 | // do not index the attachment for index_method attachment & noindex |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | } |
256 | 256 | |
257 | 257 | // Store score if is sortable and we have value |
258 | - if ( $this->sortable |
|
258 | + if ($this->sortable |
|
259 | 259 | && isset($this->_sorted_list[$identifier])) { |
260 | 260 | // Store the attachment score |
261 | 261 | $attachment->metadata->score = $count - $this->_sorted_list[$identifier] + 1; |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | return false; |
319 | 319 | } |
320 | 320 | |
321 | - if ( $autodelete |
|
321 | + if ($autodelete |
|
322 | 322 | && !@unlink($tmpname)) { |
323 | 323 | debug_add('Failed to automatically delete the source file, ignoring silently.', MIDCOM_LOG_WARN); |
324 | 324 | midcom::get()->debug->log_php_error(MIDCOM_LOG_WARN); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | */ |
368 | 368 | function add_attachment_by_handle($identifier, $filename, $title, $mimetype, $source) |
369 | 369 | { |
370 | - if ( array_key_exists($identifier, $this->attachments)) { |
|
370 | + if (array_key_exists($identifier, $this->attachments)) { |
|
371 | 371 | debug_add("Failed to add the attachment record: The identifier '{$identifier}' is already in use.", MIDCOM_LOG_INFO); |
372 | 372 | return false; |
373 | 373 | } |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | return false; |
498 | 498 | } |
499 | 499 | |
500 | - if ( $autodelete |
|
500 | + if ($autodelete |
|
501 | 501 | && !@unlink($tmpname)) { |
502 | 502 | debug_add('Failed to automatically delete the source file, ignoring silently.', MIDCOM_LOG_WARN); |
503 | 503 | midcom::get()->debug->log_php_error(MIDCOM_LOG_WARN); |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | if ($this->attachments_info) { |
655 | 655 | $result .= "<ul>\n"; |
656 | 656 | foreach ($this->attachments_info as $info) { |
657 | - if ( $info['description'] |
|
657 | + if ($info['description'] |
|
658 | 658 | && $info['description'] != $info['filename']) { |
659 | 659 | $title = "{$info['filename']} - {$info['description']}"; |
660 | 660 | } else { |
@@ -753,14 +753,14 @@ discard block |
||
753 | 753 | */ |
754 | 754 | private function _index_attachment($attachment) |
755 | 755 | { |
756 | - if ( $this->storage->object |
|
756 | + if ($this->storage->object |
|
757 | 757 | && midcom::get()->config->get('indexer_backend') |
758 | 758 | //check if there is an index_method set |
759 | - && ( !array_key_exists('index_method', $this->_datamanager->schema->fields[$this->name]) |
|
759 | + && (!array_key_exists('index_method', $this->_datamanager->schema->fields[$this->name]) |
|
760 | 760 | || |
761 | 761 | // do not index the attachment for index_method attachment & noindex |
762 | 762 | // for index_method=attachment the content of the attachment is stored in content of the object |
763 | - ( $this->_datamanager->schema->fields[$this->name]['index_method'] !== 'attachment' |
|
763 | + ($this->_datamanager->schema->fields[$this->name]['index_method'] !== 'attachment' |
|
764 | 764 | && $this->_datamanager->schema->fields[$this->name]['index_method'] !== 'noindex'))) { |
765 | 765 | $document = new midcom_services_indexer_document_attachment($attachment, $this->storage->object); |
766 | 766 | $indexer = midcom::get()->indexer; |
@@ -188,7 +188,8 @@ |
||
188 | 188 | { |
189 | 189 | try { |
190 | 190 | $attachment = new midcom_db_attachment($guid); |
191 | - } catch (midcom_error $e) { |
|
191 | + } |
|
192 | + catch (midcom_error $e) { |
|
192 | 193 | debug_add("Failed to load the attachment {$guid} from disk, aborting.", MIDCOM_LOG_INFO); |
193 | 194 | $e->log(); |
194 | 195 | return; |
@@ -41,5 +41,5 @@ |
||
41 | 41 | return $document; |
42 | 42 | } |
43 | 43 | |
44 | - abstract public function prepare_document(midcom_services_indexer_document &$document, midcom_helper_datamanager2_datamanager $dm); |
|
44 | + abstract public function prepare_document(midcom_services_indexer_document & $document, midcom_helper_datamanager2_datamanager $dm); |
|
45 | 45 | } |
@@ -123,7 +123,7 @@ |
||
123 | 123 | $this->_set_type('datamanager2'); |
124 | 124 | |
125 | 125 | $this->_datamanager = $datamanager; |
126 | - $this->_schema =& $this->_datamanager->schema; |
|
126 | + $this->_schema = & $this->_datamanager->schema; |
|
127 | 127 | |
128 | 128 | $this->_process_datamanager(); |
129 | 129 | $this->_complete_fields(); |
@@ -164,7 +164,7 @@ |
||
164 | 164 | * |
165 | 165 | * @param midcom_helper_datamanager2_datamanager &$object A reference to the DM2 object |
166 | 166 | */ |
167 | - protected function _index_cast_to_document(midcom_helper_datamanager2_datamanager &$object) |
|
167 | + protected function _index_cast_to_document(midcom_helper_datamanager2_datamanager & $object) |
|
168 | 168 | { |
169 | 169 | $object = $this->new_document($object); |
170 | 170 | } |
@@ -135,7 +135,8 @@ discard block |
||
135 | 135 | |
136 | 136 | try { |
137 | 137 | return $this->_backend->index($documents); |
138 | - } catch (Exception $e) { |
|
138 | + } |
|
139 | + catch (Exception $e) { |
|
139 | 140 | debug_add("Indexing error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
140 | 141 | return false; |
141 | 142 | } |
@@ -175,7 +176,8 @@ discard block |
||
175 | 176 | } |
176 | 177 | try { |
177 | 178 | return $this->_backend->delete($RIs); |
178 | - } catch (Exception $e) { |
|
179 | + } |
|
180 | + catch (Exception $e) { |
|
179 | 181 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
180 | 182 | return false; |
181 | 183 | } |
@@ -196,7 +198,8 @@ discard block |
||
196 | 198 | |
197 | 199 | try { |
198 | 200 | return $this->_backend->delete_all($constraint); |
199 | - } catch (Exception $e) { |
|
201 | + } |
|
202 | + catch (Exception $e) { |
|
200 | 203 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
201 | 204 | return false; |
202 | 205 | } |
@@ -230,7 +233,8 @@ discard block |
||
230 | 233 | |
231 | 234 | try { |
232 | 235 | $result_raw = $this->_backend->query($query, $filter, $options); |
233 | - } catch (Exception $e) { |
|
236 | + } |
|
237 | + catch (Exception $e) { |
|
234 | 238 | debug_add("Query error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
235 | 239 | return false; |
236 | 240 | } |
@@ -256,7 +260,8 @@ discard block |
||
256 | 260 | if (!empty($document->topic_guid)) { |
257 | 261 | try { |
258 | 262 | midcom_db_topic::get_cached($document->topic_guid); |
259 | - } catch (midcom_error $e) { |
|
263 | + } |
|
264 | + catch (midcom_error $e) { |
|
260 | 265 | // Skip document, the object is hidden. |
261 | 266 | debug_add("Skipping the generic document {$document->title}, its topic seems to be invisible, we cannot proceed."); |
262 | 267 | continue; |
@@ -269,7 +274,8 @@ discard block |
||
269 | 274 | // Strip language code from end of RI if it looks like "<GUID>_<LANG>" |
270 | 275 | try { |
271 | 276 | midcom::get()->dbfactory->get_object_by_guid(preg_replace('/^([0-9a-f]{32,80})_[a-z]{2}$/', '\\1', $document->RI)); |
272 | - } catch (midcom_error $e) { |
|
277 | + } |
|
278 | + catch (midcom_error $e) { |
|
273 | 279 | // Skip document, the object is hidden, deleted or otherwise unavailable. |
274 | 280 | //@todo Maybe nonexistent objects should be removed from index? |
275 | 281 | continue; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -midcom::get()->head->add_stylesheet( MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
2 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
3 | 3 | $title = 'About Midgard'; |
4 | 4 | midcom::get()->auth->require_valid_user(); |
5 | 5 | ?> |