@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | //Substyle handling |
| 61 | - if ( !empty($data['message_array']['substyle']) |
|
| 61 | + if (!empty($data['message_array']['substyle']) |
|
| 62 | 62 | && !preg_match('/^builtin:/', $data['message_array']['substyle'])) { |
| 63 | 63 | debug_add("Appending substyle {$data['message_array']['substyle']}"); |
| 64 | 64 | midcom::get()->style->append_substyle($data['message_array']['substyle']); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | private function _real_show_compose($handler_id, array &$data) |
| 118 | 118 | { |
| 119 | 119 | $prefix = ''; |
| 120 | - if ( !empty($data['message_array']['substyle']) |
|
| 120 | + if (!empty($data['message_array']['substyle']) |
|
| 121 | 121 | && preg_match('/^builtin:(.*)/', $data['message_array']['substyle'], $matches_style)) { |
| 122 | 122 | $prefix = $matches_style[1] . '-'; |
| 123 | 123 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | if (!$this->timestamp) { |
| 25 | 25 | $this->timestamp = time(); |
| 26 | 26 | } |
| 27 | - if ( !$this->referrer |
|
| 27 | + if (!$this->referrer |
|
| 28 | 28 | && !empty($_SERVER['HTTP_REFERER'])) { |
| 29 | 29 | $this->referrer = $_SERVER['HTTP_REFERER']; |
| 30 | 30 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | echo " <th>{$type}</th>\n"; |
| 35 | 35 | echo " <td style=\"text-align: right;\">" . number_format($count) . "</td>\n"; |
| 36 | 36 | if (isset($cleanups_kept[$type])) { |
| 37 | - echo " <td style=\"text-align: right;\">" . number_format($cleanups_kept[$type]) ."</td>\n"; |
|
| 37 | + echo " <td style=\"text-align: right;\">" . number_format($cleanups_kept[$type]) . "</td>\n"; |
|
| 38 | 38 | } |
| 39 | 39 | echo " </tr>\n"; |
| 40 | 40 | } |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | $button_config[MIDCOM_TOOLBAR_URL] = $url; |
| 74 | 74 | //The constants are numeric, so array_merge won't work... |
| 75 | 75 | foreach ($options as $key => $value) { |
| 76 | - if ( is_array($value) |
|
| 76 | + if (is_array($value) |
|
| 77 | 77 | && !empty($button_config[$key])) { |
| 78 | 78 | $value = array_merge($button_config[$key], $value); |
| 79 | 79 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | midcom::get()->auth->require_admin_user(); |
| 3 | 3 | |
| 4 | -if ( empty($_POST['to']) |
|
| 4 | +if (empty($_POST['to']) |
|
| 5 | 5 | || empty($_POST['from'])) { |
| 6 | 6 | ?> |
| 7 | 7 | <h2>Send test email</h2> |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | include dirname(__DIR__) . '/config-default.inc.php'; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -if (! defined('MIDCOM_STATIC_URL')) { |
|
| 26 | +if (!defined('MIDCOM_STATIC_URL')) { |
|
| 27 | 27 | define('MIDCOM_STATIC_URL', '/midcom-static'); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | protected function _add_visibility_checks() |
| 130 | 130 | { |
| 131 | - if ( $this->hide_invisible |
|
| 131 | + if ($this->hide_invisible |
|
| 132 | 132 | && !$this->_visibility_checks_added) { |
| 133 | 133 | if (!midcom::get()->config->get('show_hidden_objects')) { |
| 134 | 134 | $this->add_constraint('metadata.hidden', '=', false); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | // Deal with empty arrays, which would produce invalid queries |
| 195 | 195 | // This is done here to avoid repetitive code in callers, and because |
| 196 | 196 | // it's easy enough to generalize: IN empty set => always false, NOT IN empty set => always true |
| 197 | - if ( is_array($value) |
|
| 197 | + if (is_array($value) |
|
| 198 | 198 | && empty($value)) { |
| 199 | 199 | if ($operator == 'NOT IN') { |
| 200 | 200 | return true; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $this->_add_visibility_checks(); |
| 107 | 107 | |
| 108 | - if ( empty($this->_limit) |
|
| 108 | + if (empty($this->_limit) |
|
| 109 | 109 | && empty($this->_offset)) { |
| 110 | 110 | // No point to do windowing |
| 111 | 111 | $newresult = $this->_execute_and_check_privileges(); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | $this->_query->set_limit($window_size); |
| 152 | 152 | |
| 153 | - while ( ($resultset = $this->_execute_and_check_privileges()) |
|
| 153 | + while (($resultset = $this->_execute_and_check_privileges()) |
|
| 154 | 154 | || $this->denied > $denied) { |
| 155 | 155 | $size = count($resultset); |
| 156 | 156 | $total_size = $size + ($this->denied - $denied); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | // Hide the articles that have the publish time in the future and if |
| 43 | 43 | // the user is not administrator |
| 44 | - if ( $this->_config->get('enable_scheduled_publishing') |
|
| 44 | + if ($this->_config->get('enable_scheduled_publishing') |
|
| 45 | 45 | && !midcom::get()->auth->admin) { |
| 46 | 46 | // Show the article only if the publishing time has passed or the viewer |
| 47 | 47 | // is the author |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | private function _add_pseudo_leaves(array &$leaves) |
| 85 | 85 | { |
| 86 | - if ( $this->_config->get('archive_enable') |
|
| 86 | + if ($this->_config->get('archive_enable') |
|
| 87 | 87 | && $this->_config->get('archive_in_navigation')) { |
| 88 | 88 | $leaves["{$this->_topic->id}_ARCHIVE"] = [ |
| 89 | 89 | MIDCOM_NAV_URL => "archive/", |
| 90 | 90 | MIDCOM_NAV_NAME => $this->_l10n->get('archive'), |
| 91 | 91 | ]; |
| 92 | 92 | } |
| 93 | - if ( $this->_config->get('rss_enable') |
|
| 93 | + if ($this->_config->get('rss_enable') |
|
| 94 | 94 | && $this->_config->get('feeds_in_navigation')) { |
| 95 | 95 | $leaves[self::LEAFID_FEEDS] = [ |
| 96 | 96 | MIDCOM_NAV_URL => "feeds/", |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | ]; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if ( $this->_config->get('categories_in_navigation') |
|
| 101 | + if ($this->_config->get('categories_in_navigation') |
|
| 102 | 102 | && $this->_config->get('categories') != '') { |
| 103 | 103 | $categories = explode(',', $this->_config->get('categories')); |
| 104 | 104 | foreach ($categories as $category) { |
@@ -109,14 +109,14 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - if ( $this->_config->get('archive_years_in_navigation') |
|
| 112 | + if ($this->_config->get('archive_years_in_navigation') |
|
| 113 | 113 | && $this->_config->get('archive_years_enable')) { |
| 114 | 114 | $qb = midcom_db_article::new_query_builder(); |
| 115 | 115 | $qb->add_constraint('topic', '=', $this->_topic->id); |
| 116 | 116 | |
| 117 | 117 | // Hide the articles that have the publish time in the future and if |
| 118 | 118 | // the user is not administrator |
| 119 | - if ( $this->_config->get('enable_scheduled_publishing') |
|
| 119 | + if ($this->_config->get('enable_scheduled_publishing') |
|
| 120 | 120 | && !midcom::get()->auth->admin) { |
| 121 | 121 | // Show the article only if the publishing time has passed or the viewer |
| 122 | 122 | // is the author |