@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Mapping of service names to classes implementing the service |
| 40 | 40 | */ |
| 41 | - private static $_service_classes = array |
|
| 42 | - ( |
|
| 41 | + private static $_service_classes = array( |
|
| 43 | 42 | 'auth' => 'midcom_services_auth', |
| 44 | 43 | 'componentloader' => 'midcom_helper__componentloader', |
| 45 | 44 | 'cache' => 'midcom_services_cache', |
@@ -67,12 +66,12 @@ discard block |
||
| 67 | 66 | /////////////////////////////////// |
| 68 | 67 | // Try to be smart about the paths: |
| 69 | 68 | // Define default constants |
| 70 | - if (! defined('MIDCOM_ROOT')) |
|
| 69 | + if (!defined('MIDCOM_ROOT')) |
|
| 71 | 70 | { |
| 72 | 71 | define('MIDCOM_ROOT', __DIR__); |
| 73 | 72 | } |
| 74 | 73 | |
| 75 | - if (! defined('MIDCOM_STATIC_ROOT')) |
|
| 74 | + if (!defined('MIDCOM_STATIC_ROOT')) |
|
| 76 | 75 | { |
| 77 | 76 | $pos = strrpos(MIDCOM_ROOT, '/'); |
| 78 | 77 | if ($pos === false) |
@@ -82,14 +81,14 @@ discard block |
||
| 82 | 81 | } |
| 83 | 82 | define('MIDCOM_STATIC_ROOT', substr(MIDCOM_ROOT, 0, $pos) . '/static'); |
| 84 | 83 | } |
| 85 | - if (! defined('MIDCOM_STATIC_URL')) |
|
| 84 | + if (!defined('MIDCOM_STATIC_URL')) |
|
| 86 | 85 | { |
| 87 | 86 | define('MIDCOM_STATIC_URL', '/midcom-static'); |
| 88 | 87 | } |
| 89 | 88 | |
| 90 | 89 | if (!defined('OPENPSA2_THEME_ROOT')) |
| 91 | 90 | { |
| 92 | - define ('OPENPSA2_THEME_ROOT', MIDCOM_ROOT . '/../var/themes/'); |
|
| 91 | + define('OPENPSA2_THEME_ROOT', MIDCOM_ROOT . '/../var/themes/'); |
|
| 93 | 92 | } |
| 94 | 93 | |
| 95 | 94 | // Instantiate the MidCOM main class |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | if (count($history) == 0) |
| 9 | 9 | { |
| 10 | - echo $data['l10n']->get('no revisions exist'); |
|
| 10 | + echo $data['l10n']->get('no revisions exist'); |
|
| 11 | 11 | } |
| 12 | 12 | else |
| 13 | 13 | { |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | if (count($history) == 0) |
| 9 | 9 | { |
| 10 | 10 | echo $data['l10n']->get('no revisions exist'); |
| 11 | -} |
|
| 12 | -else |
|
| 11 | +} else |
|
| 13 | 12 | { |
| 14 | 13 | ?> |
| 15 | 14 | <form name="no_bergfald_rcs_history" action="" > |
@@ -43,27 +42,22 @@ discard block |
||
| 43 | 42 | { |
| 44 | 43 | $user_card = new org_openpsa_widgets_contact($person); |
| 45 | 44 | $person_label = $user_card->show_inline(); |
| 46 | - } |
|
| 47 | - else |
|
| 45 | + } else |
|
| 48 | 46 | { |
| 49 | 47 | $person_label = $person->name; |
| 50 | 48 | } |
| 51 | 49 | echo " <td>{$person_label}</td>\n"; |
| 52 | - } |
|
| 53 | - elseif ($history['ip']) |
|
| 50 | + } elseif ($history['ip']) |
|
| 54 | 51 | { |
| 55 | 52 | echo " <td>{$history['ip']}</td>\n"; |
| 56 | - } |
|
| 57 | - else |
|
| 53 | + } else |
|
| 58 | 54 | { |
| 59 | 55 | echo " <td></td>\n"; |
| 60 | 56 | } |
| 61 | - } |
|
| 62 | - elseif ($history['ip']) |
|
| 57 | + } elseif ($history['ip']) |
|
| 63 | 58 | { |
| 64 | 59 | echo " <td>{$history['ip']}</td>\n"; |
| 65 | - } |
|
| 66 | - else |
|
| 60 | + } else |
|
| 67 | 61 | { |
| 68 | 62 | echo " <td></td>\n"; |
| 69 | 63 | } |
@@ -9,11 +9,11 @@ discard block |
||
| 9 | 9 | if ($data['previous_revision']) |
| 10 | 10 | { |
| 11 | 11 | echo "<<\n"; |
| 12 | - echo "<a href=\"{$prefix}__ais/rcs/preview/{$data['guid']}/{$data['previous_revision']}\">". sprintf($l10n->get('version %s'), $data['previous_revision']) ."</a>\n"; |
|
| 12 | + echo "<a href=\"{$prefix}__ais/rcs/preview/{$data['guid']}/{$data['previous_revision']}\">" . sprintf($l10n->get('version %s'), $data['previous_revision']) . "</a>\n"; |
|
| 13 | 13 | echo "(<em><a href=\"{$prefix}__ais/rcs/diff/{$data['guid']}/{$data['previous_revision']}/{$data['latest_revision']}/\">{$l10n->get('show differences')}</a></em>)\n"; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( $data['previous_revision'] |
|
| 16 | +if ($data['previous_revision'] |
|
| 17 | 17 | && $data['next_revision']) |
| 18 | 18 | { |
| 19 | 19 | echo " | "; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if ($data['next_revision']) |
| 23 | 23 | { |
| 24 | - echo "<a href=\"{$prefix}__ais/rcs/preview/{$data['guid']}/{$data['latest_revision']}\">". sprintf($l10n->get('version %s'), $data['latest_revision']) ."</a>\n"; |
|
| 24 | + echo "<a href=\"{$prefix}__ais/rcs/preview/{$data['guid']}/{$data['latest_revision']}\">" . sprintf($l10n->get('version %s'), $data['latest_revision']) . "</a>\n"; |
|
| 25 | 25 | echo "(<em><a href=\"{$prefix}__ais/rcs/diff/{$data['guid']}/{$data['latest_revision']}/{$data['next_revision']}/\">{$l10n->get('show differences')}</a></em>)\n"; |
| 26 | 26 | echo ">>\n"; |
| 27 | 27 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Three fold fallback in localization |
| 55 | - echo "<dt>". $data['handler']->translate($attribute) ."</dt>\n"; |
|
| 55 | + echo "<dt>" . $data['handler']->translate($attribute) . "</dt>\n"; |
|
| 56 | 56 | echo " <dd>" . nl2br($value) . "</dd>\n"; |
| 57 | 57 | } |
| 58 | 58 | ?> |
@@ -96,8 +96,7 @@ discard block |
||
| 96 | 96 | private function _prepare_toolbars($revision = '', $diff_view = false) |
| 97 | 97 | { |
| 98 | 98 | $this->_view_toolbar->add_item( |
| 99 | - array |
|
| 100 | - ( |
|
| 99 | + array( |
|
| 101 | 100 | MIDCOM_TOOLBAR_URL => midcom::get()->permalinks->create_permalink($this->_guid), |
| 102 | 101 | MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('back to %s'), $this->_resolve_object_title()), |
| 103 | 102 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_up.png', |
@@ -116,7 +115,7 @@ discard block |
||
| 116 | 115 | $show_previous = false; |
| 117 | 116 | if ($diff_view) |
| 118 | 117 | { |
| 119 | - if ( $before != '' |
|
| 118 | + if ($before != '' |
|
| 120 | 119 | && $before2 != '') |
| 121 | 120 | { |
| 122 | 121 | // When browsing diffs we want to display buttons to previous instead of current |
@@ -137,16 +136,14 @@ discard block |
||
| 137 | 136 | $buttons = array(); |
| 138 | 137 | if ($show_previous) |
| 139 | 138 | { |
| 140 | - $buttons[] = array |
|
| 141 | - ( |
|
| 139 | + $buttons[] = array( |
|
| 142 | 140 | MIDCOM_TOOLBAR_URL => "__ais/rcs/diff/{$this->_guid}/{$first}/{$second}/", |
| 143 | 141 | MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('view %s differences with previous (%s)'), $second, $first), |
| 144 | 142 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png', |
| 145 | 143 | ); |
| 146 | 144 | } |
| 147 | 145 | |
| 148 | - $buttons[] = array |
|
| 149 | - ( |
|
| 146 | + $buttons[] = array( |
|
| 150 | 147 | MIDCOM_TOOLBAR_URL => "__ais/rcs/preview/{$this->_guid}/{$revision}/", |
| 151 | 148 | MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('view this revision (%s)'), $revision), |
| 152 | 149 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/search.png', |
@@ -155,16 +152,14 @@ discard block |
||
| 155 | 152 | // Display restore and next buttons only if we're not in latest revision |
| 156 | 153 | if ($after != '') |
| 157 | 154 | { |
| 158 | - $buttons[] = array |
|
| 159 | - ( |
|
| 155 | + $buttons[] = array( |
|
| 160 | 156 | MIDCOM_TOOLBAR_URL => "__ais/rcs/restore/{$this->_guid}/{$revision}/", |
| 161 | 157 | MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('restore this revision (%s)'), $revision), |
| 162 | 158 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/editpaste.png', |
| 163 | 159 | MIDCOM_TOOLBAR_ENABLED => $this->_object->can_do('midgard:update'), |
| 164 | 160 | ); |
| 165 | 161 | |
| 166 | - $buttons[] = array |
|
| 167 | - ( |
|
| 162 | + $buttons[] = array( |
|
| 168 | 163 | MIDCOM_TOOLBAR_URL => "__ais/rcs/diff/{$this->_guid}/{$revision}/{$after}/", |
| 169 | 164 | MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('view %s differences with next (%s)'), $revision, $after), |
| 170 | 165 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_right.png', |
@@ -222,7 +217,7 @@ discard block |
||
| 222 | 217 | $this->_guid = $args[0]; |
| 223 | 218 | $this->_load_object(); |
| 224 | 219 | |
| 225 | - if ( !$this->_backend->version_exists($args[1]) |
|
| 220 | + if (!$this->_backend->version_exists($args[1]) |
|
| 226 | 221 | || !$this->_backend->version_exists($args[2])) |
| 227 | 222 | { |
| 228 | 223 | throw new midcom_error_notfound("One of the revisions {$args[1]} or {$args[2]} does not exist."); |
@@ -238,7 +233,7 @@ discard block |
||
| 238 | 233 | $this->_request_data['earlier_revision'] = $this->_backend->get_prev_version($args[1]); |
| 239 | 234 | $this->_request_data['previous_revision'] = $args[1]; |
| 240 | 235 | $this->_request_data['latest_revision'] = $args[2]; |
| 241 | - $this->_request_data['next_revision'] = $this->_backend->get_next_version($args[2]); |
|
| 236 | + $this->_request_data['next_revision'] = $this->_backend->get_next_version($args[2]); |
|
| 242 | 237 | |
| 243 | 238 | $this->_request_data['guid'] = $args[0]; |
| 244 | 239 | |
@@ -246,13 +241,11 @@ discard block |
||
| 246 | 241 | midcom::get()->head->set_pagetitle($this->_request_data['view_title']); |
| 247 | 242 | |
| 248 | 243 | $this->_prepare_breadcrumb(); |
| 249 | - $this->add_breadcrumb |
|
| 250 | - ( |
|
| 244 | + $this->add_breadcrumb( |
|
| 251 | 245 | "__ais/rcs/preview/{$this->_guid}/{$data['latest_revision']}/", |
| 252 | 246 | sprintf($this->_l10n->get('version %s'), $data['latest_revision']) |
| 253 | 247 | ); |
| 254 | - $this->add_breadcrumb |
|
| 255 | - ( |
|
| 248 | + $this->add_breadcrumb( |
|
| 256 | 249 | "__ais/rcs/diff/{$this->_guid}/{$data['previous_revision']}/{$data['latest_revision']}/", |
| 257 | 250 | sprintf($this->_l10n->get('changes from version %s'), $data['previous_revision']) |
| 258 | 251 | ); |
@@ -309,8 +302,7 @@ discard block |
||
| 309 | 302 | midcom::get()->head->set_pagetitle($this->_request_data['view_title']); |
| 310 | 303 | |
| 311 | 304 | $this->_prepare_breadcrumb(); |
| 312 | - $this->add_breadcrumb |
|
| 313 | - ( |
|
| 305 | + $this->add_breadcrumb( |
|
| 314 | 306 | "__ais/rcs/preview/{$this->_guid}/{$revision}/", |
| 315 | 307 | sprintf($this->_l10n->get('version %s'), $revision) |
| 316 | 308 | ); |
@@ -318,7 +310,7 @@ discard block |
||
| 318 | 310 | // Set the version numbers |
| 319 | 311 | $data['previous_revision'] = $this->_backend->get_prev_version($args[1]); |
| 320 | 312 | $data['latest_revision'] = $args[1]; |
| 321 | - $data['next_revision'] = $this->_backend->get_next_version($args[1]); |
|
| 313 | + $data['next_revision'] = $this->_backend->get_next_version($args[1]); |
|
| 322 | 314 | $data['guid'] = $args[0]; |
| 323 | 315 | } |
| 324 | 316 | |
@@ -347,7 +339,7 @@ discard block |
||
| 347 | 339 | |
| 348 | 340 | $this->_prepare_toolbars($args[1]); |
| 349 | 341 | |
| 350 | - if ( $this->_backend->version_exists($args[1]) |
|
| 342 | + if ($this->_backend->version_exists($args[1]) |
|
| 351 | 343 | && $this->_backend->restore_to_revision($args[1])) |
| 352 | 344 | { |
| 353 | 345 | midcom::get()->uimessages->add($this->_l10n->get($this->_component), sprintf($this->_l10n->get('restore to version %s successful'), $args[1])); |
@@ -124,8 +124,7 @@ |
||
| 124 | 124 | $second = $before; |
| 125 | 125 | $show_previous = true; |
| 126 | 126 | } |
| 127 | - } |
|
| 128 | - else |
|
| 127 | + } else |
|
| 129 | 128 | { |
| 130 | 129 | if ($before != '') |
| 131 | 130 | { |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $aerodromeinfo = explode(',', $line); |
| 14 | 14 | |
| 15 | 15 | // Skip the non-ICAO ones |
| 16 | - if ( empty($aerodromeinfo[0]) |
|
| 16 | + if (empty($aerodromeinfo[0]) |
|
| 17 | 17 | || strlen($aerodromeinfo[0]) != 4) |
| 18 | 18 | { |
| 19 | 19 | continue; |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | if ($coordinates) |
| 10 | 10 | { |
| 11 | 11 | printf('According to your GeoRSS feed your position is %s', org_routamc_positioning_utils::microformat_location($coordinates['latitude'], $coordinates['longitude'])); |
| 12 | -} |
|
| 13 | -else |
|
| 12 | +} else |
|
| 14 | 13 | { |
| 15 | 14 | echo "Failed to get position, last error is {$html->error}"; |
| 16 | 15 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $import = $manual->import($manual_position); |
| 44 | - echo $manual->error."<br />\n"; |
|
| 44 | + echo $manual->error . "<br />\n"; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $user_position = new org_routamc_positioning_person($user); |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | throw new midcom_error("Failed to get your current position."); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | -echo "<p>".sprintf('Your position is %s', org_routamc_positioning_utils::pretty_print_coordinates($coordinates['latitude'], $coordinates['longitude']))."</p>\n"; |
|
| 81 | +echo "<p>" . sprintf('Your position is %s', org_routamc_positioning_utils::pretty_print_coordinates($coordinates['latitude'], $coordinates['longitude'])) . "</p>\n"; |
|
| 82 | 82 | |
| 83 | 83 | $run_times = 1; |
| 84 | 84 | $run = 0; |
@@ -20,14 +20,12 @@ |
||
| 20 | 20 | { |
| 21 | 21 | printf('You\'re in %s, %s', $user_location['latitude'], $user_location['longitude']); |
| 22 | 22 | // Will print "You're in 60.2345, 25.00456" |
| 23 | -} |
|
| 24 | -else |
|
| 23 | +} else |
|
| 25 | 24 | { |
| 26 | 25 | if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') |
| 27 | 26 | { |
| 28 | 27 | echo "You're here"; |
| 29 | - } |
|
| 30 | - else |
|
| 28 | + } else |
|
| 31 | 29 | { |
| 32 | 30 | echo "No location found"; |
| 33 | 31 | } |