@@ -28,14 +28,14 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function send() |
| 30 | 30 | { |
| 31 | - if ( $this->url == '' |
|
| 32 | - || ( substr($this->url, 0, 1) != "/") |
|
| 31 | + if ($this->url == '' |
|
| 32 | + || (substr($this->url, 0, 1) != "/") |
|
| 33 | 33 | && !preg_match('|^https?://|', $this->url)) { |
| 34 | 34 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
| 35 | 35 | if ($prefix == '') { |
| 36 | 36 | $prefix = '/'; |
| 37 | 37 | } |
| 38 | - $this->url = "{$prefix}{$this->url}"; |
|
| 38 | + $this->url = "{$prefix}{$this->url}"; |
|
| 39 | 39 | debug_add("This is a relative URL from the local site, prepending anchor prefix: {$this->url}"); |
| 40 | 40 | } |
| 41 | 41 | $location = "Location: {$this->url}"; |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | continue; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | - if ( !$object->can_do('midgard:update') |
|
| 12 | + if (!$object->can_do('midgard:update') |
|
| 13 | 13 | || !$object->can_do('midgard:attachments')) { |
| 14 | 14 | printf(midcom::get()->i18n->get_string('not recreating object %s %s, reason %s', 'midcom'), $type, $object->guid, 'Insufficient privileges') . "\n"; |
| 15 | 15 | continue; |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | public function __construct($context = null) |
| 80 | 80 | { |
| 81 | - if ( is_null($context) |
|
| 81 | + if (is_null($context) |
|
| 82 | 82 | || is_numeric($context)) { |
| 83 | 83 | $this->_domain = midcom_core_context::get($context)->get_key(MIDCOM_CONTEXT_COMPONENT); |
| 84 | 84 | } else { |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | */ |
| 110 | 110 | public function members_to_fields() |
| 111 | 111 | { |
| 112 | - if ( empty($this->topic_guid) |
|
| 112 | + if (empty($this->topic_guid) |
|
| 113 | 113 | || empty($this->topic_url) |
| 114 | 114 | || empty($this->component)) { |
| 115 | 115 | //if one of those is missing, we override all three to ensure consistency |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $id = count(self::$_contexts); |
| 96 | 96 | } |
| 97 | 97 | $this->id = $id; |
| 98 | - self::$_contexts[$id] =& $this; |
|
| 98 | + self::$_contexts[$id] = & $this; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | return self::$_contexts[$id]; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if ( $id < 0 |
|
| 127 | + if ($id < 0 |
|
| 128 | 128 | || $id >= count(self::$_contexts)) { |
| 129 | 129 | debug_add("Could not get invalid context $id.", MIDCOM_LOG_WARN); |
| 130 | 130 | $ret = false; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | return false; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - if ( ( $key === MIDCOM_CONTEXT_ROOTTOPICID |
|
| 166 | + if (($key === MIDCOM_CONTEXT_ROOTTOPICID |
|
| 167 | 167 | || $key === MIDCOM_CONTEXT_ROOTTOPIC) |
| 168 | 168 | && $this->_data[$key] === null) { |
| 169 | 169 | $this->_initialize_root_topic(); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $component = $this->_data[MIDCOM_CONTEXT_COMPONENT]; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - return ( array_key_exists($component, $this->_data[MIDCOM_CONTEXT_CUSTOMDATA]) |
|
| 253 | + return (array_key_exists($component, $this->_data[MIDCOM_CONTEXT_CUSTOMDATA]) |
|
| 254 | 254 | && array_key_exists($key, $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$component])); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $component = $this->_data[MIDCOM_CONTEXT_COMPONENT]; |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | - $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$component][$key] =& $value; |
|
| 306 | + $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$component][$key] = & $value; |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | public function get_component() |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function send() |
| 30 | 30 | { |
| 31 | 31 | $context = midcom_core_context::get(); |
| 32 | - $data =& $context->get_custom_key('request_data'); |
|
| 32 | + $data = & $context->get_custom_key('request_data'); |
|
| 33 | 33 | midcom::get()->style->enter_context($context->id); |
| 34 | 34 | |
| 35 | 35 | if (isset($data['view_title'])) { |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.user'), $this->_l10n_midcom->get('updated')); |
| 59 | 59 | return new midcom_response_relocate("__mfa/asgard_midgard.admin.user/group/edit/{$data['group']->guid}/"); |
| 60 | 60 | } |
| 61 | - debug_add('Failed to update the group, last error was '. midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
|
| 61 | + debug_add('Failed to update the group, last error was ' . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
|
| 62 | 62 | debug_print_r('We operated on this object', $data['group'], MIDCOM_LOG_ERROR); |
| 63 | 63 | |
| 64 | 64 | throw new midcom_error('Failed to update the group, see error level log for details'); |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | if (!empty($fields["username"])) { |
| 28 | 28 | $user = midcom::get()->auth->get_user_by_name($fields["username"]); |
| 29 | 29 | |
| 30 | - if ( $user |
|
| 31 | - && ( !isset($fields['person']) |
|
| 30 | + if ($user |
|
| 31 | + && (!isset($fields['person']) |
|
| 32 | 32 | || $user->guid != $fields['person'])) { |
| 33 | 33 | $result["username"] = sprintf(midcom::get()->i18n->get_string("username %s is already in use", "midgard.admin.user"), $fields['username']); |
| 34 | 34 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | */ |
| 52 | 52 | private function _find_suspects_event(midcom_core_dbaobject $object, $defaults, array &$links_array) |
| 53 | 53 | { |
| 54 | - if ( !is_array($object->participants) |
|
| 54 | + if (!is_array($object->participants) |
|
| 55 | 55 | || count($object->participants) < 1) { |
| 56 | 56 | //We have invalid list or zero participants, abort |
| 57 | 57 | return; |