@@ -84,7 +84,7 @@ |
||
84 | 84 | $variable = $parts[0] . '->' . $parts[1]; |
85 | 85 | } |
86 | 86 | |
87 | - if ( isset($variable_parts[1]) |
|
87 | + if (isset($variable_parts[1]) |
|
88 | 88 | && array_key_exists($variable_parts[1], self::$_filters)) { |
89 | 89 | switch ($variable_parts[1]) { |
90 | 90 | case 's': |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $node = $nap->get_node($node_id); |
55 | 55 | |
56 | - if ( !array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
56 | + if (!array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
57 | 57 | && $node[MIDCOM_NAV_COMPONENT] != 'midcom.helper.search') { |
58 | 58 | $l10n = $this->_i18n->get_l10n($node[MIDCOM_NAV_COMPONENT]); |
59 | 59 | $this->_request_data['components'][$node[MIDCOM_NAV_COMPONENT]] = $l10n->get($node[MIDCOM_NAV_COMPONENT]); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $this->prepare_query_data(); |
113 | 113 | $this->prepare_formdata($_REQUEST['type']); |
114 | 114 | |
115 | - if ( count(explode(' ', $data['query'])) == 1 |
|
115 | + if (count(explode(' ', $data['query'])) == 1 |
|
116 | 116 | && strpos($data['query'], '*') === false |
117 | 117 | && $this->_config->get('single_term_auto_wilcard')) { |
118 | 118 | //If there is only one search term append * to the query if auto_wildcard is enabled |
@@ -192,12 +192,12 @@ discard block |
||
192 | 192 | $this->_request_data['last_document_number'] = $last_document_id + 1; |
193 | 193 | $this->_request_data['shown_documents'] = $last_document_id - $first_document_id + 1; |
194 | 194 | $this->_request_data['results_per_page'] = $results_per_page; |
195 | - $this->_request_data['all_results'] =& $result; |
|
195 | + $this->_request_data['all_results'] = & $result; |
|
196 | 196 | $this->_request_data['result'] = array_slice($result, $first_document_id, $results_per_page); |
197 | 197 | |
198 | 198 | // Register GUIDs for cache engine |
199 | 199 | foreach ($this->_request_data['result'] as $doc) { |
200 | - if ( !isset($doc->source) |
|
200 | + if (!isset($doc->source) |
|
201 | 201 | || !mgd_is_guid($doc->source)) { |
202 | 202 | // Non-Midgard results don't need to go through cache registration |
203 | 203 | continue; |
@@ -100,12 +100,12 @@ |
||
100 | 100 | { |
101 | 101 | $this->_master = $master; |
102 | 102 | |
103 | - $this->_request_data =& $master->_request_data; |
|
103 | + $this->_request_data = & $master->_request_data; |
|
104 | 104 | $this->_topic = $master->_topic; |
105 | 105 | |
106 | 106 | // Load component specific stuff, special treatment if the handler has |
107 | 107 | // a component different than the master handler set. |
108 | - if ( $this->_component |
|
108 | + if ($this->_component |
|
109 | 109 | && $this->_component != $master->_component) { |
110 | 110 | $this->_config->store_from_object($this->_topic, $this->_component, true); |
111 | 111 | } else { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | $http_client = new org_openpsa_httplib(); |
57 | 57 | $http_client->set_param('timeout', 300); |
58 | -if ( !empty($_SERVER['PHP_AUTH_USER']) |
|
58 | +if (!empty($_SERVER['PHP_AUTH_USER']) |
|
59 | 59 | && !empty($_SERVER['PHP_AUTH_PW'])) { |
60 | 60 | $http_client->basicauth['user'] = $_SERVER['PHP_AUTH_USER']; |
61 | 61 | $http_client->basicauth['password'] = $_SERVER['PHP_AUTH_PW']; |
@@ -86,7 +86,7 @@ |
||
86 | 86 | return; |
87 | 87 | } |
88 | 88 | $initialized = true; |
89 | - if ( !midcom::get()->auth->user |
|
89 | + if (!midcom::get()->auth->user |
|
90 | 90 | || !midcom::get()->config->get('toolbars_enable_centralized') |
91 | 91 | || !midcom::get()->auth->can_user_do('midcom:centralized_toolbar', null, $this)) { |
92 | 92 | return; |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | { |
464 | 464 | // Complete fields |
465 | 465 | $this->indexed = time(); |
466 | - if ( $this->author == '' |
|
466 | + if ($this->author == '' |
|
467 | 467 | && isset($this->creator->name)) { |
468 | 468 | $this->author = $this->creator->name; |
469 | 469 | } |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | public function read_metadata_from_object($object) |
607 | 607 | { |
608 | 608 | // Published is set to non-empty value, use it as creation data |
609 | - if ( !empty($object->metadata->published) |
|
609 | + if (!empty($object->metadata->published) |
|
610 | 610 | && !preg_match('/0{1,4}-0{1,2}0{1,2}\s+0{1,2}:0{1,2}:0{1,2}/', $object->metadata->published)) { |
611 | 611 | $this->created = $this->read_unixtime($object->metadata->published); |
612 | 612 | } elseif (isset($object->metadata->created)) { |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | return @strtotime($stamp); |
646 | 646 | } |
647 | 647 | // Unix timestamp |
648 | - return (int)$stamp; |
|
648 | + return (int) $stamp; |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | private function process_attachment() |
95 | 95 | { |
96 | - if ( !isset($this->attachment->metadata) |
|
96 | + if (!isset($this->attachment->metadata) |
|
97 | 97 | || !is_object($this->attachment->metadata)) { |
98 | 98 | return; |
99 | 99 | } |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | if (strlen(trim($this->attachment->title)) > 0) { |
145 | - $this->title = "{$this->attachment->title} ({$this->attachment->name})"; |
|
145 | + $this->title = "{$this->attachment->title} ({$this->attachment->name})"; |
|
146 | 146 | $this->content .= "\n{$this->attachment->title}\n{$this->attachment->name}"; |
147 | 147 | } else { |
148 | - $this->title = $this->attachment->name; |
|
148 | + $this->title = $this->attachment->name; |
|
149 | 149 | $this->content .= "\n{$this->attachment->name}"; |
150 | 150 | } |
151 | 151 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $etag = trim($parser->data['headers']['etag']); |
102 | 102 | |
103 | 103 | $feed_etag = $this->_feed->get_parameter('net.nemein.rss', 'etag'); |
104 | - if ( !empty($feed_etag) |
|
104 | + if (!empty($feed_etag) |
|
105 | 105 | && $feed_etag == $etag) { |
106 | 106 | // Feed hasn't changed, skip updating |
107 | 107 | debug_add("Feed {$this->_feed->url} has not changed since " . date('c', $this->_feed->latestfetch), MIDCOM_LOG_WARN); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $guid = $item->get_id(); |
188 | 188 | $title = $item->get_title(); |
189 | 189 | |
190 | - if ( ( empty($title) |
|
190 | + if ((empty($title) |
|
191 | 191 | || trim($title) == '...') |
192 | 192 | && empty($guid)) { |
193 | 193 | // Something wrong with this entry, skip it |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $meta_values['published'] = $article_date; |
256 | 256 | } |
257 | 257 | |
258 | - if ( $this->apply_values($article, $values, $meta_values) |
|
258 | + if ($this->apply_values($article, $values, $meta_values) |
|
259 | 259 | && !$article->update()) { |
260 | 260 | return false; |
261 | 261 | } |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | private function find_author(net_nemein_rss_parser_item $item) |
285 | 285 | { |
286 | 286 | // Try to figure out item author |
287 | - if ( $this->_feed->forceauthor |
|
287 | + if ($this->_feed->forceauthor |
|
288 | 288 | && $this->_feed->defaultauthor) { |
289 | 289 | // Feed has a "default author" set, use it |
290 | 290 | return new midcom_db_person($this->_feed->defaultauthor); |
291 | 291 | } |
292 | 292 | $author = $this->match_item_author($item); |
293 | 293 | $fallback_person_id = 1; |
294 | - if ( !$author |
|
294 | + if (!$author |
|
295 | 295 | || $author->id == $fallback_person_id) { |
296 | 296 | if ($this->_feed->defaultauthor) { |
297 | 297 | // Feed has a "default author" set, use it |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | } |
478 | 478 | } |
479 | 479 | |
480 | - if ( !empty($author_info['username']) |
|
480 | + if (!empty($author_info['username']) |
|
481 | 481 | && $person = midcom::get()->auth->get_user_by_name($author_info['username'])) { |
482 | 482 | return $person->get_storage(); |
483 | 483 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $qb->add_constraint('name', '<>', ''); |
47 | 47 | |
48 | 48 | // Unless in Auto-Index mode or the index article is hidden, we skip the index article. |
49 | - if ( !$this->_config->get('autoindex') |
|
49 | + if (!$this->_config->get('autoindex') |
|
50 | 50 | && !$this->_config->get('indexinnav')) { |
51 | 51 | $qb->add_constraint('name', '<>', 'index'); |
52 | 52 | } |