Completed
Branch master (7d3f82)
by Thomas
09:15
created
htdocs/okapi/views/method_doc.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public static function call($methodname)
21 21
     {
22
-        require_once($GLOBALS['rootpath'].'okapi/service_runner.php');
23
-        require_once($GLOBALS['rootpath'].'okapi/views/menu.inc.php');
22
+        require_once($GLOBALS['rootpath'] . 'okapi/service_runner.php');
23
+        require_once($GLOBALS['rootpath'] . 'okapi/views/menu.inc.php');
24 24
 
25 25
         try
26 26
         {
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
         }
34 34
         $vars = array(
35 35
             'method' => $method,
36
-            'menu' => OkapiMenu::get_menu_html($methodname.".html"),
37
-            'okapi_base_url' => Settings::get('SITE_URL')."okapi/",
36
+            'menu' => OkapiMenu::get_menu_html($methodname . ".html"),
37
+            'okapi_base_url' => Settings::get('SITE_URL') . "okapi/",
38 38
             'installations' => OkapiMenu::get_installations(),
39 39
             'okapi_rev' => Okapi::$version_number,
40 40
         );
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
         {
27 27
             $method = OkapiServiceRunner::call('services/apiref/method', new OkapiInternalRequest(
28 28
                 null, null, array('name' => $methodname)));
29
-        }
30
-        catch (BadRequest $e)
29
+        } catch (BadRequest $e)
31 30
         {
32 31
             throw new Http404();
33 32
         }
Please login to merge, or discard this patch.
htdocs/okapi/views/apps/revoke_access.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     {
18 18
         # Determine which user is logged in to OC.
19 19
 
20
-        require_once($GLOBALS['rootpath']."okapi/lib/oc_session.php");
20
+        require_once($GLOBALS['rootpath'] . "okapi/lib/oc_session.php");
21 21
         $OC_user_id = OCSession::get_user_id();
22 22
 
23 23
         # Ensure a user is logged in.
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         if ($OC_user_id == null)
26 26
         {
27 27
             $after_login = "okapi/apps/"; # it is correct, if you're wondering
28
-            $login_url = Settings::get('SITE_URL')."login.php?target=".urlencode($after_login);
28
+            $login_url = Settings::get('SITE_URL') . "login.php?target=" . urlencode($after_login);
29 29
             return new OkapiRedirectResponse($login_url);
30 30
         }
31 31
 
@@ -36,18 +36,18 @@  discard block
 block discarded – undo
36 36
         Db::execute("
37 37
             delete from okapi_tokens
38 38
             where
39
-                user_id = '".Db::escape_string($OC_user_id)."'
40
-                and consumer_key = '".Db::escape_string($consumer_key)."'
39
+                user_id = '".Db::escape_string($OC_user_id) . "'
40
+                and consumer_key = '".Db::escape_string($consumer_key) . "'
41 41
         ");
42 42
         Db::execute("
43 43
             delete from okapi_authorizations
44 44
             where
45
-                user_id = '".Db::escape_string($OC_user_id)."'
46
-                and consumer_key = '".Db::escape_string($consumer_key)."'
45
+                user_id = '".Db::escape_string($OC_user_id) . "'
46
+                and consumer_key = '".Db::escape_string($consumer_key) . "'
47 47
         ");
48 48
 
49 49
         # Redirect back to the apps page.
50 50
 
51
-        return new OkapiRedirectResponse(Settings::get('SITE_URL')."okapi/apps/");
51
+        return new OkapiRedirectResponse(Settings::get('SITE_URL') . "okapi/apps/");
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
htdocs/okapi/views/apps/authorized.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 okapi_consumers c,
30 30
                 okapi_tokens t
31 31
             where
32
-                t.`key` = '".Db::escape_string($token_key)."'
32
+                t.`key` = '".Db::escape_string($token_key) . "'
33 33
                 and t.consumer_key = c.`key`
34 34
         ");
35 35
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         }
42 42
 
43 43
         $vars = array(
44
-            'okapi_base_url' => Settings::get('SITE_URL')."okapi/",
44
+            'okapi_base_url' => Settings::get('SITE_URL') . "okapi/",
45 45
             'token' => $token,
46 46
             'verifier' => $verifier,
47 47
             'site_name' => Okapi::get_normalized_site_name(),
Please login to merge, or discard this patch.
htdocs/okapi/views/apps/index.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 
21 21
         # Determine which user is logged in to OC.
22 22
 
23
-        require_once($GLOBALS['rootpath']."okapi/lib/oc_session.php");
23
+        require_once($GLOBALS['rootpath'] . "okapi/lib/oc_session.php");
24 24
         $OC_user_id = OCSession::get_user_id();
25 25
 
26 26
         if ($OC_user_id == null)
27 27
         {
28
-            $after_login = "okapi/apps/".(($langpref != Settings::get('SITELANG'))?"?langpref=".$langpref:"");
29
-            $login_url = Settings::get('SITE_URL')."login.php?target=".urlencode($after_login);
28
+            $after_login = "okapi/apps/" . (($langpref != Settings::get('SITELANG')) ? "?langpref=" . $langpref : "");
29
+            $login_url = Settings::get('SITE_URL') . "login.php?target=" . urlencode($after_login);
30 30
             return new OkapiRedirectResponse($login_url);
31 31
         }
32 32
 
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
                 okapi_consumers c,
39 39
                 okapi_authorizations a
40 40
             where
41
-                a.user_id = '".Db::escape_string($OC_user_id)."'
41
+                a.user_id = '".Db::escape_string($OC_user_id) . "'
42 42
                 and c.`key` = a.consumer_key
43 43
             order by c.name
44 44
         ");
45 45
         $vars = array();
46
-        $vars['okapi_base_url'] = Settings::get('SITE_URL')."okapi/";
46
+        $vars['okapi_base_url'] = Settings::get('SITE_URL') . "okapi/";
47 47
         $vars['site_url'] = Settings::get('SITE_URL');
48 48
         $vars['site_name'] = Okapi::get_normalized_site_name();
49 49
         $vars['site_logo'] = Settings::get('SITE_LOGO');
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,9 @@
 block discarded – undo
48 48
         $vars['site_name'] = Okapi::get_normalized_site_name();
49 49
         $vars['site_logo'] = Settings::get('SITE_LOGO');
50 50
         $vars['apps'] = array();
51
-        while ($row = Db::fetch_assoc($rs))
52
-            $vars['apps'][] = $row;
51
+        while ($row = Db::fetch_assoc($rs)) {
52
+                    $vars['apps'][] = $row;
53
+        }
53 54
         Db::free_result($rs);
54 55
 
55 56
         $response = new OkapiHttpResponse();
Please login to merge, or discard this patch.
htdocs/okapi/views/introduction.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@
 block discarded – undo
18 18
 {
19 19
     public static function call()
20 20
     {
21
-        require_once($GLOBALS['rootpath'].'okapi/service_runner.php');
22
-        require_once($GLOBALS['rootpath'].'okapi/views/menu.inc.php');
21
+        require_once($GLOBALS['rootpath'] . 'okapi/service_runner.php');
22
+        require_once($GLOBALS['rootpath'] . 'okapi/views/menu.inc.php');
23 23
 
24 24
         $vars = array(
25 25
             'menu' => OkapiMenu::get_menu_html("introduction.html"),
26
-            'okapi_base_url' => Settings::get('SITE_URL')."okapi/",
26
+            'okapi_base_url' => Settings::get('SITE_URL') . "okapi/",
27 27
             'site_url' => Settings::get('SITE_URL'),
28 28
             'method_index' => OkapiServiceRunner::call('services/apiref/method_index',
29 29
                 new OkapiInternalRequest(new OkapiInternalConsumer(), null, array())),
Please login to merge, or discard this patch.
htdocs/okapi/views/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         # This is called when someone displays "http://../okapi/" (with no
20 20
         # html path at the end). We will redirect to the introduction page.
21 21
 
22
-        return new OkapiRedirectResponse(Settings::get('SITE_URL').
22
+        return new OkapiRedirectResponse(Settings::get('SITE_URL') .
23 23
             "okapi/introduction.html");
24 24
     }
25 25
 }
Please login to merge, or discard this patch.
htdocs/okapi/views/signup.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,18 +55,18 @@
 block discarded – undo
55 55
             return $response;
56 56
         }
57 57
 
58
-        require_once($GLOBALS['rootpath'].'okapi/service_runner.php');
59
-        require_once($GLOBALS['rootpath'].'okapi/views/menu.inc.php');
58
+        require_once($GLOBALS['rootpath'] . 'okapi/service_runner.php');
59
+        require_once($GLOBALS['rootpath'] . 'okapi/views/menu.inc.php');
60 60
 
61 61
         $vars = array(
62 62
             'menu' => OkapiMenu::get_menu_html("signup.html"),
63
-            'okapi_base_url' => Settings::get('SITE_URL')."okapi/",
63
+            'okapi_base_url' => Settings::get('SITE_URL') . "okapi/",
64 64
             'site_url' => Settings::get('SITE_URL'),
65 65
             'site_name' => Okapi::get_normalized_site_name(),
66 66
             'installations' => OkapiMenu::get_installations(),
67 67
             'okapi_rev' => Okapi::$version_number,
68 68
             'data_license_html' => Settings::get('DATA_LICENSE_URL')
69
-                ? "<a href='".Settings::get('DATA_LICENSE_URL')."'>Data License</a>"
69
+                ? "<a href='" . Settings::get('DATA_LICENSE_URL') . "'>Data License</a>"
70 70
                 : "Data License",
71 71
         );
72 72
 
Please login to merge, or discard this patch.
Braces   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -26,21 +26,21 @@
 block discarded – undo
26 26
             $email = isset($_REQUEST['email']) ? $_REQUEST['email'] : "";
27 27
             $accepted_terms = isset($_REQUEST['terms']) ? $_REQUEST['terms'] : "";
28 28
             $ok = false;
29
-            if (!$appname)
30
-                $notice = "Please provide a valid application name.";
31
-            elseif (mb_strlen($appname) > 100)
32
-                $notice = "Application name should be less than 100 characters long.";
33
-            elseif (mb_strlen($appurl) > 250)
34
-                $notice = "Application URL should be less than 250 characters long.";
35
-            elseif ($appurl && (substr($appurl, 0, 7) != "http://") && (substr($appurl, 0, 8) != "https://"))
36
-                $notice = "Application homepage URL should start with http(s)://. (Note: this URL is OPTIONAL and it is NOT for OAuth callback.)";
37
-            elseif (!$email)
38
-                $notice = "Please provide a valid email address.";
39
-            elseif (mb_strlen($email) > 70)
40
-                $notice = "Email address should be less than 70 characters long.";
41
-            elseif (!$accepted_terms)
42
-                $notice = "You have to read and accept OKAPI Terms of Use.";
43
-            else
29
+            if (!$appname) {
30
+                            $notice = "Please provide a valid application name.";
31
+            } elseif (mb_strlen($appname) > 100) {
32
+                            $notice = "Application name should be less than 100 characters long.";
33
+            } elseif (mb_strlen($appurl) > 250) {
34
+                            $notice = "Application URL should be less than 250 characters long.";
35
+            } elseif ($appurl && (substr($appurl, 0, 7) != "http://") && (substr($appurl, 0, 8) != "https://")) {
36
+                            $notice = "Application homepage URL should start with http(s)://. (Note: this URL is OPTIONAL and it is NOT for OAuth callback.)";
37
+            } elseif (!$email) {
38
+                            $notice = "Please provide a valid email address.";
39
+            } elseif (mb_strlen($email) > 70) {
40
+                            $notice = "Email address should be less than 70 characters long.";
41
+            } elseif (!$accepted_terms) {
42
+                            $notice = "You have to read and accept OKAPI Terms of Use.";
43
+            } else
44 44
             {
45 45
                 $ok = true;
46 46
                 Okapi::register_new_consumer($appname, $appurl, $email);
Please login to merge, or discard this patch.
htdocs/map2.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                        WHERE option_id=6 AND user_id='&1'", true, $login->userid))
68 68
 ) {
69 69
     $fullscreen = true;
70
-    $tpl->popup = true;        // disables page header and -frame
70
+    $tpl->popup = true; // disables page header and -frame
71 71
     $tpl->popupmargin = false;
72 72
 } else {
73 73
     $fullscreen = false;
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
     $caches_found = 0;
457 457
     while ($r = sql_fetch_assoc($rs)) {
458 458
         echo '<cache name="' . xmlentities($r['name']) . '" wpoc="' . xmlentities($r['wp_oc']) . '" />' . "\n";
459
-        ++ $caches_found;
459
+        ++$caches_found;
460 460
     }
461 461
     sql_free_result($rs);
462 462
 
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
         "SELECT `slave_id`
497 497
         FROM `map2_result`
498 498
         WHERE `result_id`='&1' AND DATE_ADD(`date_created`, INTERVAL '&2' SECOND)>NOW()",
499
-        - 2,
499
+        -2,
500 500
         $nResultId,
501 501
         $opt['map']['maxcacheage']
502 502
     );
Please login to merge, or discard this patch.
htdocs/templates2/ocstyle/search.tpl.inc.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
  ****************************************************************************/
9 9
 
10 10
     // search.php -> $tpl->error
11
-     $outputformat_notexist = _('The selected output format is unknown!');
12
-     $error_query_not_found = _('The search operation could not be executed, please reenter the search data.');
11
+        $outputformat_notexist = _('The selected output format is unknown!');
12
+        $error_query_not_found = _('The search operation could not be executed, please reenter the search data.');
13 13
     $unknown_searchoption = _('unknown search option');
14 14
     $unknown_searchtype = _('unknown search type');
15 15
 
Please login to merge, or discard this patch.