@@ -3,10 +3,10 @@ |
||
3 | 3 | <table cellpadding='3'> |
4 | 4 | <thead> |
5 | 5 | <tr> |
6 | - <td><?php $data['l10n']->show('filename');?></td> |
|
7 | - <td><?php $data['l10n']->show('filedescription');?></td> |
|
8 | - <td><?php $data['l10n']->show('filetype');?></td> |
|
9 | - <td><?php $data['l10n']->show('filesize');?></td> |
|
10 | - <td><?php $data['l10n']->show('file lastmodified');?></td> |
|
6 | + <td><?php $data['l10n']->show('filename'); ?></td> |
|
7 | + <td><?php $data['l10n']->show('filedescription'); ?></td> |
|
8 | + <td><?php $data['l10n']->show('filetype'); ?></td> |
|
9 | + <td><?php $data['l10n']->show('filesize'); ?></td> |
|
10 | + <td><?php $data['l10n']->show('file lastmodified'); ?></td> |
|
11 | 11 | </tr> |
12 | 12 | </thead> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $title = $this->data['midcom_services_auth_access_denied_title']; |
4 | 4 | $login_warning = $this->data['midcom_services_auth_access_denied_login_warning']; |
5 | 5 | |
6 | -midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.services.auth/style.css'); |
|
6 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
7 | 7 | ?> |
8 | 8 | <!DOCTYPE html> |
9 | 9 | <html lang="<?php echo midcom::get()->i18n->get_current_language(); ?>"> |
@@ -2,7 +2,7 @@ |
||
2 | 2 | $title = $this->data['midcom_services_auth_show_login_page_title']; |
3 | 3 | $login_warning = $this->data['midcom_services_auth_show_login_page_login_warning']; |
4 | 4 | |
5 | -midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.services.auth/style.css'); |
|
5 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
6 | 6 | ?> |
7 | 7 | <!DOCTYPE html> |
8 | 8 | <html lang="<?php echo midcom::get()->i18n->get_current_language(); ?>"> |
@@ -474,7 +474,7 @@ |
||
474 | 474 | { |
475 | 475 | return |
476 | 476 | ( |
477 | - $this->string_exists($string, $this->_language) |
|
477 | + $this->string_exists($string, $this->_language) |
|
478 | 478 | || $this->string_exists($string, $this->_fallback_language) |
479 | 479 | ); |
480 | 480 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | self::$_localedb[$this->_library] = []; |
143 | 143 | } |
144 | 144 | |
145 | - $this->_stringdb =& self::$_localedb[$this->_library]; |
|
145 | + $this->_stringdb = & self::$_localedb[$this->_library]; |
|
146 | 146 | |
147 | 147 | $this->set_language(midcom::get()->i18n->get_current_language()); |
148 | 148 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $data = $this->parse_data(file($filename), $lang, $filename); |
178 | 178 | |
179 | 179 | // get site-specific l10n |
180 | - $component_locale = midcom_helper_misc::get_snippet_content_graceful("conf:/" . $this->_component_name . '/l10n/'. $this->database . '.' . $lang . '.txt'); |
|
180 | + $component_locale = midcom_helper_misc::get_snippet_content_graceful("conf:/" . $this->_component_name . '/l10n/' . $this->database . '.' . $lang . '.txt'); |
|
181 | 181 | if (!empty($component_locale)) { |
182 | 182 | $data = array_merge($data, $this->parse_data(explode("\n", $component_locale), $lang, $component_locale)); |
183 | 183 | } |
@@ -58,7 +58,6 @@ |
||
58 | 58 | * @property string $revisor The person that modified the object, read-only. |
59 | 59 | * @property integer $approved The time of approval of the object, or 0 if not approved. Set automatically through approve/unapprove. |
60 | 60 | * @property string $approver The person that approved/unapproved the object. Set automatically through approve/unapprove. |
61 | - |
|
62 | 61 | * @package midcom.helper |
63 | 62 | */ |
64 | 63 | class midcom_helper_metadata |
@@ -658,7 +658,8 @@ |
||
658 | 658 | && mgd_is_guid($guid)) { |
659 | 659 | try { |
660 | 660 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
661 | - } catch (midcom_error $e) { |
|
661 | + } |
|
662 | + catch (midcom_error $e) { |
|
662 | 663 | debug_add("Failed to create a metadata instance for the GUID {$guid}: " . $e->getMessage(), MIDCOM_LOG_WARN); |
663 | 664 | debug_print_r("Source was:", $source); |
664 | 665 |
@@ -513,11 +513,11 @@ discard block |
||
513 | 513 | } |
514 | 514 | |
515 | 515 | $now = time(); |
516 | - if ( $this->get('schedulestart') |
|
516 | + if ($this->get('schedulestart') |
|
517 | 517 | && $this->get('schedulestart') > $now) { |
518 | 518 | return false; |
519 | 519 | } |
520 | - if ( $this->get('scheduleend') |
|
520 | + if ($this->get('scheduleend') |
|
521 | 521 | && $this->get('scheduleend') < $now) { |
522 | 522 | return false; |
523 | 523 | } |
@@ -535,9 +535,9 @@ discard block |
||
535 | 535 | public function is_object_visible_onsite() |
536 | 536 | { |
537 | 537 | return |
538 | - ( ( midcom::get()->config->get('show_hidden_objects') |
|
538 | + ((midcom::get()->config->get('show_hidden_objects') |
|
539 | 539 | || $this->is_visible()) |
540 | - && ( midcom::get()->config->get('show_unapproved_objects') |
|
540 | + && (midcom::get()->config->get('show_unapproved_objects') |
|
541 | 541 | || $this->is_approved()) |
542 | 542 | ); |
543 | 543 | } |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | $object = $source; |
625 | 625 | $guid = $source->guid; |
626 | 626 | } elseif (is_array($source)) { |
627 | - if ( !array_key_exists(MIDCOM_NAV_GUID, $source) |
|
627 | + if (!array_key_exists(MIDCOM_NAV_GUID, $source) |
|
628 | 628 | || is_null($source[MIDCOM_NAV_GUID])) { |
629 | 629 | debug_print_r('We got an invalid input, cannot return metadata:', $source); |
630 | 630 | return false; |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $guid = $source; |
636 | 636 | } |
637 | 637 | |
638 | - if ( is_null($object) |
|
638 | + if (is_null($object) |
|
639 | 639 | && mgd_is_guid($guid)) { |
640 | 640 | try { |
641 | 641 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | } |
671 | 671 | |
672 | 672 | // Lock was created by the user, return "not locked" |
673 | - if ( !empty(midcom::get()->auth->user->guid) |
|
673 | + if (!empty(midcom::get()->auth->user->guid) |
|
674 | 674 | && $this->get('locker') === midcom::get()->auth->user->guid) { |
675 | 675 | return false; |
676 | 676 | } |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | { |
689 | 689 | midcom::get()->auth->require_do('midgard:update', $this->__object); |
690 | 690 | |
691 | - if ( is_object($this->__object) |
|
691 | + if (is_object($this->__object) |
|
692 | 692 | && $this->__object->lock()) { |
693 | 693 | $this->_cache = []; |
694 | 694 | return true; |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | */ |
706 | 706 | public function can_unlock() |
707 | 707 | { |
708 | - return ( $this->__object->can_do('midcom:unlock') |
|
708 | + return ($this->__object->can_do('midcom:unlock') |
|
709 | 709 | || midcom::get()->auth->can_user_do('midcom:unlock', null, midcom_services_auth::class)); |
710 | 710 | } |
711 | 711 | |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | */ |
717 | 717 | public function unlock() |
718 | 718 | { |
719 | - if ( $this->can_unlock() |
|
719 | + if ($this->can_unlock() |
|
720 | 720 | && is_object($this->__object) |
721 | 721 | && $this->__object->unlock()) { |
722 | 722 | $this->_cache = []; |
@@ -407,7 +407,7 @@ |
||
407 | 407 | |
408 | 408 | $parent = $parent->get_parent_group(); |
409 | 409 | } |
410 | - */ |
|
410 | + */ |
|
411 | 411 | $this->_inheritance_chains[$id] = $inheritance_chain; |
412 | 412 | } |
413 | 413 | } |
@@ -182,7 +182,8 @@ discard block |
||
182 | 182 | } |
183 | 183 | try { |
184 | 184 | $this->_storage = new $person_class($id); |
185 | - } catch (mgd_exception $e) { |
|
185 | + } |
|
186 | + catch (mgd_exception $e) { |
|
186 | 187 | debug_add("Failed to retrieve the person ID {$id}: " . $e->getMessage(), MIDCOM_LOG_INFO); |
187 | 188 | throw new midcom_error_midgard($e, $id); |
188 | 189 | } |
@@ -230,7 +231,8 @@ discard block |
||
230 | 231 | if (mgd_is_guid($id)) { |
231 | 232 | try { |
232 | 233 | return new $person_class($id); |
233 | - } catch (mgd_exception $e) { |
|
234 | + } |
|
235 | + catch (mgd_exception $e) { |
|
234 | 236 | debug_add("Failed to retrieve the person GUID {$id}: " . $e->getMessage(), MIDCOM_LOG_INFO); |
235 | 237 | throw new midcom_error_midgard($e, $id); |
236 | 238 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | $this->_inheritance_chains = []; |
359 | 359 | |
360 | 360 | foreach ($this->_direct_groups as $id => $group) { |
361 | - $this->_all_groups[$id] =& $this->_direct_groups[$id]; |
|
361 | + $this->_all_groups[$id] = & $this->_direct_groups[$id]; |
|
362 | 362 | $inheritance_chain = [$group->id]; |
363 | 363 | /** |
364 | 364 | * FIXME: Parent group members should inherit permissions from |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | } |
488 | 488 | // We scan through our groups looking for a midgard group with the right name |
489 | 489 | foreach ($this->_all_groups as $group_object) { |
490 | - if ( midcom::get()->dbfactory->is_a($group_object, midcom_core_group::class) |
|
490 | + if (midcom::get()->dbfactory->is_a($group_object, midcom_core_group::class) |
|
491 | 491 | && $group_object->get_storage()->name == $group) { |
492 | 492 | return true; |
493 | 493 | } |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | |
534 | 534 | $timeout = midcom::get()->config->get('auth_login_session_timeout', 0); |
535 | 535 | $last_seen = $person->get_parameter('midcom', 'online'); |
536 | - if ( !$last_seen |
|
536 | + if (!$last_seen |
|
537 | 537 | || ($timeout > 0 && time() - $timeout > $last_seen)) { |
538 | 538 | return 'offline'; |
539 | 539 | } |
@@ -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); |
@@ -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 | ?> |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | private function send($httpcode, $message) |
250 | 250 | { |
251 | 251 | $error_actions = midcom::get()->config->get('error_actions'); |
252 | - if ( !isset($error_actions[$httpcode]) |
|
252 | + if (!isset($error_actions[$httpcode]) |
|
253 | 253 | || !isset($error_actions[$httpcode]['action'])) { |
254 | 254 | // No action specified for this error code, skip |
255 | 255 | return; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | return; |
280 | 280 | } |
281 | 281 | |
282 | - if ( !is_writable($config['filename']) |
|
282 | + if (!is_writable($config['filename']) |
|
283 | 283 | && !is_writable(dirname($config['filename']))) { |
284 | 284 | debug_add("Error logging file {$config['filename']} is not writable", MIDCOM_LOG_WARN); |
285 | 285 | return; |