Browse Source

Cleanup /format pre-move

tags/3.5.2
Hypolite Petovan 2 years ago
parent
commit
56ee734b00
85 changed files with 516 additions and 575 deletions
  1. 1
    1
      boot.php
  2. 2
    2
      include/Probe.php
  3. 1
    1
      include/api.php
  4. 1
    1
      include/auth.php
  5. 2
    0
      include/auth_ejabberd.php
  6. 2
    0
      include/bb2diaspora.php
  7. 2
    1
      include/bbcode.php
  8. 1
    1
      include/cli_startup.php
  9. 0
    1
      include/conversation.php
  10. 2
    1
      include/cronjobs.php
  11. 1
    1
      include/dbstructure.php
  12. 1
    1
      include/delivery.php
  13. 1
    1
      include/diaspora.php
  14. 1
    1
      include/event.php
  15. 2
    2
      include/items.php
  16. 1
    3
      include/message.php
  17. 1
    1
      include/network.php
  18. 1
    1
      include/notifier.php
  19. 26
    26
      include/oauth.php
  20. 2
    2
      include/oembed.php
  21. 1
    1
      include/plaintext.php
  22. 6
    6
      include/plugin.php
  23. 3
    2
      include/poller.php
  24. 2
    1
      include/pubsubpublish.php
  25. 1
    1
      include/shadowupdate.php
  26. 3
    3
      include/socgraph.php
  27. 0
    1
      include/text.php
  28. 6
    10
      include/uimport.php
  29. 2
    2
      index.php
  30. 1
    1
      mod/_well_known.php
  31. 1
    1
      mod/admin.php
  32. 3
    4
      mod/amcd.php
  33. 12
    13
      mod/apps.php
  34. 1
    2
      mod/community.php
  35. 0
    2
      mod/contactgroup.php
  36. 14
    12
      mod/credits.php
  37. 0
    1
      mod/delegate.php
  38. 0
    3
      mod/dfrn_poll.php
  39. 0
    6
      mod/directory.php
  40. 0
    2
      mod/dirfind.php
  41. 0
    1
      mod/display.php
  42. 0
    1
      mod/filer.php
  43. 1
    1
      mod/friendica.php
  44. 1
    0
      mod/hovercard.php
  45. 2
    2
      mod/install.php
  46. 7
    4
      mod/login.php
  47. 1
    1
      mod/maintenance.php
  48. 16
    17
      mod/manifest.php
  49. 1
    1
      mod/match.php
  50. 0
    1
      mod/mood.php
  51. 5
    35
      mod/newmember.php
  52. 1
    1
      mod/nodeinfo.php
  53. 15
    15
      mod/notice.php
  54. 0
    1
      mod/openid.php
  55. 11
    11
      mod/opensearch.php
  56. 1
    1
      mod/parse_url.php
  57. 3
    2
      mod/photos.php
  58. 1
    1
      mod/ping.php
  59. 2
    3
      mod/poke.php
  60. 4
    4
      mod/pretheme.php
  61. 6
    7
      mod/probe.php
  62. 0
    1
      mod/profile.php
  63. 0
    2
      mod/profile_photo.php
  64. 0
    1
      mod/qsearch.php
  65. 0
    2
      mod/receive.php
  66. 3
    3
      mod/robots_txt.php
  67. 18
    18
      mod/rsd_xml.php
  68. 4
    5
      mod/smilies.php
  69. 16
    15
      mod/statistics_json.php
  70. 0
    1
      mod/subthread.php
  71. 0
    1
      mod/tagger.php
  72. 0
    1
      mod/toggle_mobile.php
  73. 22
    23
      mod/uexport.php
  74. 30
    30
      mod/uimport.php
  75. 0
    1
      mod/videos.php
  76. 2
    3
      mod/wall_upload.php
  77. 1
    1
      util/db_update.php
  78. 1
    1
      util/maintenance.php
  79. 184
    185
      util/php2po.php
  80. 42
    42
      util/typo.php
  81. 1
    0
      view/theme/duepuntozero/config.php
  82. 2
    2
      view/theme/frio/php/default.php
  83. 1
    1
      view/theme/frio/php/frio_boot.php
  84. 1
    0
      view/theme/quattro/config.php
  85. 3
    4
      view/theme/smoothly/theme.php

+ 1
- 1
boot.php View File

@@ -19,7 +19,7 @@
19 19
 
20 20
 require_once(__DIR__ . DIRECTORY_SEPARATOR. 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');
21 21
 
22
-use \Friendica\Core\Config;
22
+use Friendica\Core\Config;
23 23
 
24 24
 require_once('include/config.php');
25 25
 require_once('include/network.php');

+ 2
- 2
include/Probe.php View File

@@ -5,8 +5,8 @@
5 5
  *
6 6
  */
7 7
 
8
-use \Friendica\Core\Config;
9
-use \Friendica\Core\PConfig;
8
+use Friendica\Core\Config;
9
+use Friendica\Core\PConfig;
10 10
 
11 11
 require_once("include/feed.php");
12 12
 require_once('include/email.php');

+ 1
- 1
include/api.php View File

@@ -6,7 +6,7 @@
6 6
  * @todo Automatically detect if incoming data is HTML or BBCode
7 7
  */
8 8
 
9
-use \Friendica\Core\Config;
9
+use Friendica\Core\Config;
10 10
 
11 11
 require_once 'include/HTTPExceptions.php';
12 12
 require_once 'include/bbcode.php';

+ 1
- 1
include/auth.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once('include/security.php');
6 6
 require_once('include/datetime.php');

+ 2
- 0
include/auth_ejabberd.php View File

@@ -32,6 +32,8 @@
32 32
  *
33 33
  */
34 34
 
35
+use Friendica\App;
36
+
35 37
 if (sizeof($_SERVER["argv"]) == 0)
36 38
 	die();
37 39
 

+ 2
- 0
include/bb2diaspora.php View File

@@ -1,5 +1,7 @@
1 1
 <?php
2 2
 
3
+use Friendica\App;
4
+
3 5
 use League\HTMLToMarkdown\HtmlConverter;
4 6
 
5 7
 require_once "include/oembed.php";

+ 2
- 1
include/bbcode.php View File

@@ -1,5 +1,6 @@
1 1
 <?php
2
-use \Friendica\Core\Config;
2
+
3
+use Friendica\Core\Config;
3 4
 
4 5
 require_once 'include/oembed.php';
5 6
 require_once 'include/event.php';

+ 1
- 1
include/cli_startup.php View File

@@ -1,6 +1,6 @@
1 1
 <?php /** @file */
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once('boot.php');
6 6
 

+ 0
- 1
include/conversation.php View File

@@ -3,7 +3,6 @@
3 3
 require_once "include/bbcode.php";
4 4
 require_once "include/acl_selectors.php";
5 5
 
6
-
7 6
 /*
8 7
  * Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
9 8
  * is identical to the code in mod/message.php for 'item_extract_images' and

+ 2
- 1
include/cronjobs.php View File

@@ -1,5 +1,6 @@
1 1
 <?php
2
-use \Friendica\Core\Config;
2
+
3
+use Friendica\Core\Config;
3 4
 
4 5
 function cronjobs_run(&$argv, &$argc){
5 6
 	global $a;

+ 1
- 1
include/dbstructure.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once("boot.php");
6 6
 require_once("include/text.php");

+ 1
- 1
include/delivery.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once('include/queue_fn.php');
6 6
 require_once('include/html2plain.php');

+ 1
- 1
include/diaspora.php View File

@@ -8,7 +8,7 @@
8 8
  * This will change in the future.
9 9
  */
10 10
 
11
-use \Friendica\Core\Config;
11
+use Friendica\Core\Config;
12 12
 
13 13
 require_once 'include/items.php';
14 14
 require_once 'include/bb2diaspora.php';

+ 1
- 1
include/event.php View File

@@ -535,7 +535,7 @@ function get_event_strings() {
535 535
  *
536 536
  * @param array $dates Array of possibly duplicated events
537 537
  * @return array Cleaned events
538
- * 
538
+ *
539 539
  * @todo We should replace this with a separate update function if there is some time left
540 540
  */
541 541
 function event_remove_duplicates($dates) {

+ 2
- 2
include/items.php View File

@@ -4,7 +4,7 @@
4 4
  * @file include/items.php
5 5
  */
6 6
 
7
-use \Friendica\ParseUrl;
7
+use Friendica\ParseUrl;
8 8
 
9 9
 require_once 'include/bbcode.php';
10 10
 require_once 'include/oembed.php';
@@ -339,7 +339,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
339 339
  * Adds a "lang" specification in a "postopts" element of given $arr,
340 340
  * if possible and not already present.
341 341
  * Expects "body" element to exist in $arr.
342
- * 
342
+ *
343 343
  * @todo Add a parameter to request forcing override
344 344
  */
345 345
 function item_add_language_opt(&$arr) {

+ 1
- 3
include/message.php View File

@@ -1,8 +1,6 @@
1 1
 <?php
2 2
 
3
-	// send a private message
4
-
5
-
3
+// send a private message
6 4
 
7 5
 
8 6
 function send_message($recipient=0, $body='', $subject='', $replyto=''){

+ 1
- 1
include/network.php View File

@@ -4,7 +4,7 @@
4 4
  * @file include/network.php
5 5
  */
6 6
 
7
-use \Friendica\Core\Config;
7
+use Friendica\Core\Config;
8 8
 
9 9
 require_once("include/xml.php");
10 10
 require_once('include/Probe.php');

+ 1
- 1
include/notifier.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once('include/queue_fn.php');
6 6
 require_once('include/html2plain.php');

+ 26
- 26
include/oauth.php View File

@@ -61,13 +61,13 @@ class FKOAuthDataStore extends OAuthDataStore {
61 61
 		logger(__function__.":".$consumer.", ". $callback);
62 62
 		$key = $this->gen_token();
63 63
 		$sec = $this->gen_token();
64
-		
64
+
65 65
 		if ($consumer->key){
66 66
 			$k = $consumer->key;
67 67
 		} else {
68 68
 			$k = $consumer;
69 69
 		}
70
-		
70
+
71 71
 		$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d)",
72 72
 				dbesc($key),
73 73
 				dbesc($sec),
@@ -80,19 +80,19 @@ class FKOAuthDataStore extends OAuthDataStore {
80 80
 
81 81
   function new_access_token($token, $consumer, $verifier = null) {
82 82
     logger(__function__.":".$token.", ". $consumer.", ". $verifier);
83
-    
83
+
84 84
     // return a new access token attached to this consumer
85 85
     // for the user associated with this token if the request token
86 86
     // is authorized
87 87
     // should also invalidate the request token
88
-    
88
+
89 89
     $ret=Null;
90
-    
90
+
91 91
     // get user for this verifier
92 92
     $uverifier = get_config("oauth", $verifier);
93 93
     logger(__function__.":".$verifier.",".$uverifier);
94 94
     if (is_null($verifier) || ($uverifier!==false)){
95
-		
95
+
96 96
 		$key = $this->gen_token();
97 97
 		$sec = $this->gen_token();
98 98
 		$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires, uid) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d, %d)",
@@ -103,13 +103,13 @@ class FKOAuthDataStore extends OAuthDataStore {
103 103
 				intval(ACCESS_TOKEN_DURATION),
104 104
 				intval($uverifier));
105 105
 		if ($r)
106
-			$ret = new OAuthToken($key,$sec);		
106
+			$ret = new OAuthToken($key,$sec);
107 107
 	}
108
-		
109
-		
108
+
109
+
110 110
 	q("DELETE FROM tokens WHERE id='%s'", $token->key);
111
-	
112
-	
111
+
112
+
113 113
 	if (!is_null($ret) && $uverifier!==false){
114 114
 		del_config("oauth", $verifier);
115 115
 	/*	$apps = get_pconfig($uverifier, "oauth", "apps");
@@ -117,9 +117,9 @@ class FKOAuthDataStore extends OAuthDataStore {
117 117
 		$apps[] = $consumer->key;
118 118
 		set_pconfig($uverifier, "oauth", "apps", $apps);*/
119 119
 	}
120
-		
120
+
121 121
     return $ret;
122
-    
122
+
123 123
   }
124 124
 }
125 125
 
@@ -172,9 +172,9 @@ class FKOAuth1 extends OAuthServer {
172 172
 			intval($_SESSION['uid'])
173 173
 		);
174 174
 
175
-		call_hooks('logged_in', $a->user);		
175
+		call_hooks('logged_in', $a->user);
176 176
 	}
177
-	
177
+
178 178
 }
179 179
 /*
180 180
 class FKOAuth2 extends OAuth2 {
@@ -190,13 +190,13 @@ class FKOAuth2 extends OAuth2 {
190 190
 			dbesc($client_secret),
191 191
 			dbesc($redirect_uri)
192 192
 		);
193
-		  
193
+
194 194
 		return $r;
195 195
 	}
196 196
 
197 197
 	protected function checkClientCredentials($client_id, $client_secret = NULL) {
198 198
 		$client_secret = $this->db_secret($client_secret);
199
-		
199
+
200 200
 		$r = q("SELECT pw FROM clients WHERE client_id = '%s'",
201 201
 			dbesc($client_id));
202 202
 
@@ -218,21 +218,21 @@ class FKOAuth2 extends OAuth2 {
218 218
 	protected function getAccessToken($oauth_token) {
219 219
 		$r = q("SELECT client_id, expires, scope FROM tokens WHERE id = '%s'",
220 220
 				dbesc($oauth_token));
221
-	
221
+
222 222
 		if (dbm::is_result($r))
223 223
 			return $r[0];
224 224
 		return null;
225 225
 	}
226 226
 
227 227
 
228
-	
228
+
229 229
 	protected function setAccessToken($oauth_token, $client_id, $expires, $scope = NULL) {
230 230
 		$r = q("INSERT INTO tokens (id, client_id, expires, scope) VALUES ('%s', '%s', %d, '%s')",
231 231
 				dbesc($oauth_token),
232 232
 				dbesc($client_id),
233 233
 				intval($expires),
234 234
 				dbesc($scope));
235
-				
235
+
236 236
 		return $r;
237 237
 	}
238 238
 
@@ -246,23 +246,23 @@ class FKOAuth2 extends OAuth2 {
246 246
 	protected function getAuthCode($code) {
247 247
 		$r = q("SELECT id, client_id, redirect_uri, expires, scope FROM auth_codes WHERE id = '%s'",
248 248
 				dbesc($code));
249
-		
249
+
250 250
 		if (dbm::is_result($r))
251 251
 			return $r[0];
252 252
 		return null;
253 253
 	}
254 254
 
255 255
 	protected function setAuthCode($code, $client_id, $redirect_uri, $expires, $scope = NULL) {
256
-		$r = q("INSERT INTO auth_codes 
257
-					(id, client_id, redirect_uri, expires, scope) VALUES 
256
+		$r = q("INSERT INTO auth_codes
257
+					(id, client_id, redirect_uri, expires, scope) VALUES
258 258
 					('%s', '%s', '%s', %d, '%s')",
259 259
 				dbesc($code),
260 260
 				dbesc($client_id),
261 261
 				dbesc($redirect_uri),
262 262
 				intval($expires),
263 263
 				dbesc($scope));
264
-		return $r;	  
265
-	}	
266
-	
264
+		return $r;
265
+	}
266
+
267 267
 }
268 268
 */

+ 2
- 2
include/oembed.php View File

@@ -4,8 +4,8 @@
4 4
  * @file include/oembed.php
5 5
  */
6 6
 
7
-use \Friendica\ParseUrl;
8
-use \Friendica\Core\Config;
7
+use Friendica\ParseUrl;
8
+use Friendica\Core\Config;
9 9
 
10 10
 function oembed_replacecb($matches){
11 11
 	$embedurl=$matches[1];

+ 1
- 1
include/plaintext.php View File

@@ -4,7 +4,7 @@
4 4
  * @file include/plaintext.php
5 5
  */
6 6
 
7
-use \Friendica\ParseUrl;
7
+use Friendica\ParseUrl;
8 8
 
9 9
 require_once("include/Photo.php");
10 10
 require_once("include/bbcode.php");

+ 6
- 6
include/plugin.php View File

@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 /**
3 3
  * @file include/plugin.php
4
- * 
4
+ *
5 5
  * @brief Some functions to handle addons and themes.
6 6
  */
7 7
 
@@ -164,7 +164,7 @@ function register_hook($hook,$file,$function,$priority=0) {
164 164
 
165 165
 /**
166 166
  * @brief unregisters a hook.
167
- * 
167
+ *
168 168
  * @param string $hook the name of the hook
169 169
  * @param string $file the name of the file that hooks into
170 170
  * @param string $function the name of the function that the hook called
@@ -325,7 +325,7 @@ function get_plugin_info($plugin){
325 325
 
326 326
 /**
327 327
  * @brief Parse theme comment in search of theme infos.
328
- * 
328
+ *
329 329
  * like
330 330
  * \code
331 331
  * ..* Name: My Theme
@@ -545,11 +545,11 @@ function upgrade_bool_message($bbcode = false) {
545 545
 
546 546
 /**
547 547
  * @brief Get the full path to relevant theme files by filename
548
- * 
548
+ *
549 549
  * This function search in the theme directory (and if not present in global theme directory)
550 550
  * if there is a directory with the file extension and  for a file with the given
551
- * filename. 
552
- * 
551
+ * filename.
552
+ *
553 553
  * @param string $file Filename
554 554
  * @param string $root Full root path
555 555
  * @return string Path to the file or empty string if the file isn't found

+ 3
- 2
include/poller.php View File

@@ -1,4 +1,7 @@
1 1
 <?php
2
+
3
+use Friendica\Core\Config;
4
+
2 5
 if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
3 6
 	$directory = dirname($_SERVER["argv"][0]);
4 7
 
@@ -10,8 +13,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
10 13
 	chdir($directory);
11 14
 }
12 15
 
13
-use \Friendica\Core\Config;
14
-
15 16
 require_once("boot.php");
16 17
 
17 18
 function poller_run($argv, $argc){

+ 2
- 1
include/pubsubpublish.php View File

@@ -1,5 +1,6 @@
1 1
 <?php
2
-use \Friendica\Core\Config;
2
+
3
+use Friendica\Core\Config;
3 4
 
4 5
 require_once('include/items.php');
5 6
 require_once('include/ostatus.php');

+ 1
- 1
include/shadowupdate.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once("boot.php");
6 6
 require_once("include/threads.php");

+ 3
- 3
include/socgraph.php View File

@@ -1,13 +1,13 @@
1 1
 <?php
2 2
 /**
3 3
  * @file include/socgraph.php
4
- * 
4
+ *
5 5
  * @todo Move GNU Social URL schemata (http://server.tld/user/number) to http://server.tld/username
6 6
  * @todo Fetch profile data from profile page for Redmatrix users
7 7
  * @todo Detect if it is a forum
8 8
  */
9 9
 
10
-use \Friendica\Core\Config;
10
+use Friendica\Core\Config;
11 11
 
12 12
 require_once('include/datetime.php');
13 13
 require_once("include/Scrape.php");
@@ -1430,7 +1430,7 @@ function common_friends_zcid($uid,$zcid,$start = 0, $limit = 9999,$shuffle = fal
1430 1430
 	$r = q("SELECT `gcontact`.*
1431 1431
 		FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
1432 1432
 		where `glink`.`zcid` = %d
1433
-		and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 ) 
1433
+		and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 )
1434 1434
 		$sql_extra limit %d, %d",
1435 1435
 		intval($zcid),
1436 1436
 		intval($uid),

+ 0
- 1
include/text.php View File

@@ -6,7 +6,6 @@ require_once("include/Smilies.php");
6 6
 require_once("include/map.php");
7 7
 require_once("mod/proxy.php");
8 8
 
9
-
10 9
 if(! function_exists('replace_macros')) {
11 10
 /**
12 11
  * This is our template processor

+ 6
- 10
include/uimport.php View File

@@ -1,11 +1,5 @@
1 1
 <?php
2 2
 
3
-/**
4
- * import account file exported from mod/uexport
5
- * args:
6
- *  $a       App     Friendica App Class
7
- *  $file   Array   array from $_FILES
8
- */
9 3
 require_once("include/Photo.php");
10 4
 define("IMPORT_DEBUG", False);
11 5
 
@@ -75,6 +69,12 @@ function import_cleanup($newuid) {
75 69
 	q("DELETE FROM `pconfig` WHERE uid = %d", $newuid);
76 70
 }
77 71
 
72
+/**
73
+ * @brief Import account file exported from mod/uexport
74
+ *
75
+ * @param App $a Friendica App Class
76
+ * @param array $file array from $_FILES
77
+ */
78 78
 function import_account(App $a, $file) {
79 79
 	logger("Start user import from " . $file['tmp_name']);
80 80
 	/*
@@ -255,10 +255,6 @@ function import_account(App $a, $file) {
255 255
 		}
256 256
 	}
257 257
 
258
-
259
-
260
-
261
-
262 258
 	foreach ($account['photo'] as &$photo) {
263 259
 		$photo['uid'] = $newuid;
264 260
 		$photo['data'] = hex2bin($photo['data']);

+ 2
- 2
index.php View File

@@ -13,7 +13,7 @@
13 13
  *
14 14
  */
15 15
 
16
-use \Friendica\Core\Config;
16
+use Friendica\Core\Config;
17 17
 
18 18
 require_once('boot.php');
19 19
 require_once('object/BaseObject.php');
@@ -486,7 +486,7 @@ header("X-Friendica-Version: " . FRIENDICA_VERSION);
486 486
 header("Content-type: text/html; charset=utf-8");
487 487
 
488 488
 /*
489
- * We use $_GET["mode"] for special page templates. So we will check if we have 
489
+ * We use $_GET["mode"] for special page templates. So we will check if we have
490 490
  * to load another page template than the default one.
491 491
  * The page templates are located in /view/php/ or in the theme directory.
492 492
  */

+ 1
- 1
mod/_well_known.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once("mod/hostxrd.php");
6 6
 require_once("mod/nodeinfo.php");

+ 1
- 1
mod/admin.php View File

@@ -6,7 +6,7 @@
6 6
  * @brief Friendica admin
7 7
  */
8 8
 
9
-use \Friendica\Core\Config;
9
+use Friendica\Core\Config;
10 10
 
11 11
 require_once("include/enotify.php");
12 12
 require_once("include/text.php");

+ 3
- 4
mod/amcd.php View File

@@ -1,8 +1,7 @@
1 1
 <?php
2 2
 
3 3
 function amcd_content(App $a) {
4
-//header("Content-type: text/json");
5
-echo <<< EOT
4
+	echo <<< JSON
6 5
 {
7 6
   "version":1,
8 7
   "sessionstatus":{
@@ -44,6 +43,6 @@ echo <<< EOT
44 43
     }
45 44
   }
46 45
 }
47
-EOT;
48
-killme();
46
+JSON;
47
+	killme();
49 48
 }

+ 12
- 13
mod/apps.php View File

@@ -1,25 +1,24 @@
1 1
 <?php
2 2
 
3
-function apps_content(App $a) {
4
-    $privateaddons = get_config('config','private_addons');
5
-      if ($privateaddons === "1") {
6
-	if((! (local_user())))  {
7
-	info( t("You must be logged in to use addons. "));
8
-      return;};
9
-}
10 3
 
11
-      $title = t('Applications');
4
+function apps_content(App $a) {
5
+	$privateaddons = get_config('config', 'private_addons');
6
+	if ($privateaddons === "1") {
7
+		if ((!(local_user()))) {
8
+			info(t("You must be logged in to use addons. "));
9
+			return;
10
+		};
11
+	}
12 12
 
13
-	if(count($a->apps)==0)
14
-		notice( t('No installed applications.') . EOL);
13
+	$title = t('Applications');
15 14
 
15
+	if (count($a->apps) == 0) {
16
+		notice(t('No installed applications.') . EOL);
17
+	}
16 18
 
17 19
 	$tpl = get_markup_template("apps.tpl");
18 20
 	return replace_macros($tpl, array(
19 21
 		'$title' => $title,
20 22
 		'$apps' => $a->apps,
21 23
 	));
22
-
23
-
24
-
25 24
 }

+ 1
- 2
mod/community.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 function community_init(App $a) {
6 6
 	if (! local_user()) {
@@ -9,7 +9,6 @@ function community_init(App $a) {
9 9
 	}
10 10
 }
11 11
 
12
-
13 12
 function community_content(App $a, $update = 0) {
14 13
 
15 14
 	$o = '';

+ 0
- 2
mod/contactgroup.php View File

@@ -3,8 +3,6 @@
3 3
 require_once('include/group.php');
4 4
 
5 5
 function contactgroup_content(App $a) {
6
-
7
-
8 6
 	if (! local_user()) {
9 7
 		killme();
10 8
 	}

+ 14
- 12
mod/credits.php View File

@@ -1,20 +1,22 @@
1 1
 <?php
2
+
2 3
 /**
3 4
  * Show a credits page for all the developers who helped with the project
4 5
  * (only contributors to the git repositories for friendica core and the
5 6
  * addons repository will be listed though ATM)
6 7
  */
7 8
 
8
-function credits_content (App $a) {
9
-    /* fill the page with credits */
10
-    $f = fopen('util/credits.txt','r');
11
-    $names = fread($f, filesize('util/credits.txt'));
12
-    $arr = explode("\n", htmlspecialchars($names));
13
-    fclose($f);
14
-    $tpl = get_markup_template('credits.tpl');
15
-    return replace_macros( $tpl, array(
16
-       '$title'		=> t('Credits'),
17
-       '$thanks'		=> t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
18
-       '$names'         => $arr,
19
-    ));
9
+
10
+function credits_content(App $a) {
11
+	/* fill the page with credits */
12
+	$f = fopen('util/credits.txt', 'r');
13
+	$names = fread($f, filesize('util/credits.txt'));
14
+	$arr = explode("\n", htmlspecialchars($names));
15
+	fclose($f);
16
+	$tpl = get_markup_template('credits.tpl');
17
+	return replace_macros($tpl, array(
18
+		'$title'  => t('Credits'),
19
+		'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
20
+		'$names'  => $arr,
21
+	));
20 22
 }

+ 0
- 1
mod/delegate.php View File

@@ -5,7 +5,6 @@ function delegate_init(App $a) {
5 5
 	return settings_init($a);
6 6
 }
7 7
 
8
-
9 8
 function delegate_content(App $a) {
10 9
 
11 10
 	if (! local_user()) {

+ 0
- 3
mod/dfrn_poll.php View File

@@ -3,10 +3,7 @@ require_once('include/items.php');
3 3
 require_once('include/auth.php');
4 4
 require_once('include/dfrn.php');
5 5
 
6
-
7 6
 function dfrn_poll_init(App $a) {
8
-
9
-
10 7
 	$dfrn_id         = ((x($_GET,'dfrn_id'))         ? $_GET['dfrn_id']              : '');
11 8
 	$type            = ((x($_GET,'type'))            ? $_GET['type']                 : 'data');
12 9
 	$last_update     = ((x($_GET,'last_update'))     ? $_GET['last_update']          : '');

+ 0
- 6
mod/directory.php View File

@@ -9,24 +9,18 @@ function directory_init(App $a) {
9 9
 		$a->page['aside'] .= findpeople_widget();
10 10
 
11 11
 		$a->page['aside'] .= follow_widget();
12
-
13 12
 	}
14 13
 	else {
15 14
 		unset($_SESSION['theme']);
16 15
 		unset($_SESSION['mobile-theme']);
17 16
 	}
18
-
19
-
20 17
 }
21 18
 
22
-
23 19
 function directory_post(App $a) {
24 20
 	if(x($_POST,'search'))
25 21
 		$a->data['search'] = $_POST['search'];
26 22
 }
27 23
 
28
-
29
-
30 24
 function directory_content(App $a) {
31 25
 	global $db;
32 26
 

+ 0
- 2
mod/dirfind.php View File

@@ -21,8 +21,6 @@ function dirfind_init(App $a) {
21 21
 	$a->page['aside'] .= follow_widget();
22 22
 }
23 23
 
24
-
25
-
26 24
 function dirfind_content(App $a, $prefix = "") {
27 25
 
28 26
 	$community = false;

+ 0
- 1
mod/display.php View File

@@ -106,7 +106,6 @@ function display_init(App $a) {
106 106
 	}
107 107
 
108 108
 	profile_load($a, $nick, 0, $profiledata);
109
-
110 109
 }
111 110
 
112 111
 function display_fetchauthor($a, $item) {

+ 0
- 1
mod/filer.php View File

@@ -4,7 +4,6 @@ require_once('include/security.php');
4 4
 require_once('include/bbcode.php');
5 5
 require_once('include/items.php');
6 6
 
7
-
8 7
 function filer_content(App $a) {
9 8
 
10 9
 	if (! local_user()) {

+ 1
- 1
mod/friendica.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 function friendica_init(App $a) {
6 6
 	if ($a->argv[1] == "json"){

+ 1
- 0
mod/hovercard.php View File

@@ -15,6 +15,7 @@ function hovercard_init(App $a) {
15 15
 	// Just for testing purposes
16 16
 	$_GET["mode"] = "minimal";
17 17
 }
18
+
18 19
 function hovercard_content() {
19 20
 	$profileurl	=	(x($_REQUEST,'profileurl')	? $_REQUEST['profileurl']	: "");
20 21
 	$datatype	=	(x($_REQUEST,'datatype')	?$_REQUEST['datatype']		: "json");

+ 2
- 2
mod/install.php View File

@@ -1,8 +1,8 @@
1 1
 <?php
2
-require_once "include/Photo.php";
3 2
 
4
-$install_wizard_pass=1;
3
+require_once "include/Photo.php";
5 4
 
5
+$install_wizard_pass = 1;
6 6
 
7 7
 function install_init(App $a) {
8 8
 

+ 7
- 4
mod/login.php View File

@@ -1,13 +1,16 @@
1 1
 <?php
2 2
 
3 3
 function login_content(App $a) {
4
-	if(x($_SESSION,'theme'))
4
+	if (x($_SESSION, 'theme')) {
5 5
 		unset($_SESSION['theme']);
6
-	if(x($_SESSION,'mobile-theme'))
6
+	}
7
+	if (x($_SESSION, 'mobile-theme')) {
7 8
 		unset($_SESSION['mobile-theme']);
9
+	}
8 10
 
9
-	if(local_user())
11
+	if (local_user()) {
10 12
 		goaway(z_root());
13
+	}
14
+	
11 15
 	return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
12
-
13 16
 }

+ 1
- 1
mod/maintenance.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 function maintenance_content(App $a) {
6 6
 

+ 16
- 17
mod/manifest.php View File

@@ -1,26 +1,25 @@
1 1
 <?php
2
-    use Friendica\Core\Config;
3 2
 
4
-    function manifest_content(App $a) {
3
+use Friendica\Core\Config;
5 4
 
6
-		$tpl = get_markup_template('manifest.tpl');
5
+function manifest_content(App $a) {
7 6
 
8
-		header('Content-type: application/manifest+json');
7
+	$tpl = get_markup_template('manifest.tpl');
9 8
 
10
-		$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
11
-		if ($touch_icon == '') {
12
-			$touch_icon = 'images/friendica-128.png';
13
-		}
9
+	header('Content-type: application/manifest+json');
14 10
 
15
-		$o = replace_macros($tpl, array(
16
-			'$baseurl' => App::get_baseurl(),
17
-			'$touch_icon' => $touch_icon,
18
-			'$title' => Config::get('config', 'sitename', 'Friendica'),
19
-		));
11
+	$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
12
+	if ($touch_icon == '') {
13
+		$touch_icon = 'images/friendica-128.png';
14
+	}
20 15
 
21
-		echo $o;
16
+	$o = replace_macros($tpl, array(
17
+		'$baseurl' => App::get_baseurl(),
18
+		'$touch_icon' => $touch_icon,
19
+		'$title' => Config::get('config', 'sitename', 'Friendica'),
20
+	));
22 21
 
23
-		killme();
22
+	echo $o;
24 23
 
25
-	}
26
-?>
24
+	killme();
25
+}

+ 1
- 1
mod/match.php View File

@@ -1,5 +1,5 @@
1 1
 <?php
2
-include_once('include/text.php');
2
+require_once('include/text.php');
3 3
 require_once('include/socgraph.php');
4 4
 require_once('include/contact_widgets.php');
5 5
 require_once('mod/proxy.php');

+ 0
- 1
mod/mood.php View File

@@ -4,7 +4,6 @@ require_once('include/security.php');
4 4
 require_once('include/bbcode.php');
5 5
 require_once('include/items.php');
6 6
 
7
-
8 7
 function mood_init(App $a) {
9 8
 
10 9
 	if (! local_user()) {

+ 5
- 35
mod/newmember.php View File

@@ -1,83 +1,53 @@
1 1
 <?php
2 2
 
3
-function newmember_content(App $a) {
4 3
 
4
+function newmember_content(App $a) {
5 5
 
6 6
 	$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
7
-
8 7
 	$o .= '<h3>' . t('New Member Checklist') . '</h3>';
9
-
10 8
 	$o .= '<div style="font-size: 120%;">';
11
-
12 9
 	$o .= t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
13
-
14 10
 	$o .= '<h4>' . t('Getting Started') . '</h4>';
15
-
16 11
 	$o .= '<ul>';
17
-
18 12
 	$o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
19
-
20 13
 	$o .= '</ul>';
21
-
22 14
 	$o .= '<h4>' . t('Settings') . '</h4>';
23
-
24 15
 	$o .= '<ul>';
25
-
26 16
 	$o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page -  change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
27
-
28 17
 	$o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
29
-
30 18
 	$o .= '</ul>';
31
-
32 19
 	$o .= '<h4>' . t('Profile') . '</h4>';
33
-
34 20
 	$o .= '<ul>';
35
-
36 21
 	$o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
37
-
38 22
 	$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
39
-
40 23
 	$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Profile Keywords') . '</a><br />' . t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
41
-
42 24
 	$o .= '</ul>';
43
-
44 25
 	$o .= '<h4>' . t('Connecting') . '</h4>';
45
-
46 26
 	$o .= '<ul>';
47 27
 
48
-    $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
28
+	$mail_disabled = ((function_exists('imap_open') && (!get_config('system', 'imap_disabled'))) ? 0 : 1);
49 29
 
50
-	if(! $mail_disabled)
30
+	if (!$mail_disabled) {
51 31
 		$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
32
+	}
52 33
 
53 34
 	$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Go to Your Contacts Page') . '</a><br />' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
54
-
55 35
 	$o .= '<li>' . '<a target="newmember" href="directory">' . t("Go to Your Site's Directory") . '</a><br />' . t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
56
-
57 36
 	$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Finding New People') . '</a><br />' . t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
58
-
59 37
 	$o .= '</ul>';
60
-
61 38
 	$o .= '<h4>' . t('Groups') . '</h4>';
62
-
63 39
 	$o .= '<ul>';
64
-
65 40
 	$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
66 41
 
67
-	if(get_config('system', 'newuser_private')) {
42
+	if (get_config('system', 'newuser_private')) {
68 43
 		$o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
69 44
 	}
70 45
 
71 46
 	$o .= '</ul>';
72
-
73 47
 	$o .= '<h4>' . t('Getting Help') . '</h4>';
74
-
75 48
 	$o .= '<ul>';
76
-
77 49
 	$o .= '<li>' . '<a target="newmember" href="help">' . t('Go to the Help Section') . '</a><br />' . t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
78
-
79 50
 	$o .= '</ul>';
80
-
81 51
 	$o .= '</div>';
82 52
 
83 53
 	return $o;

+ 1
- 1
mod/nodeinfo.php View File

@@ -5,7 +5,7 @@
5 5
  * Documentation: http://nodeinfo.diaspora.software/schema.html
6 6
 */
7 7
 
8
-use \Friendica\Core\Config;
8
+use Friendica\Core\Config;
9 9
 
10 10
 require_once 'include/plugin.php';
11 11
 

+ 15
- 15
mod/notice.php View File

@@ -1,20 +1,20 @@
1 1
 <?php
2
-	/* identi.ca -> friendica items permanent-url compatibility */
3 2
 
4
-	function notice_init(App $a) {
5
-		$id = $a->argv[1];
6
-		$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
7
-				intval($id)
8
-				);
9
-		if (dbm::is_result($r)){
10
-			$nick = $r[0]['nickname'];
11
-			$url = App::get_baseurl()."/display/$nick/$id";
12
-			goaway($url);
13
-		} else {
14
-			$a->error = 404;
15
-			notice( t('Item not found.') . EOL);
3
+/* identi.ca -> friendica items permanent-url compatibility */
16 4
 
17
-		}
18
-		return;
19 5
 
6
+function notice_init(App $a) {
7
+
8
+	$id = $a->argv[1];
9
+	$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
10
+	if (dbm::is_result($r)) {
11
+		$nick = $r[0]['nickname'];
12
+		$url = App::get_baseurl() . "/display/$nick/$id";
13
+		goaway($url);
14
+	} else {
15
+		$a->error = 404;
16
+		notice(t('Item not found.') . EOL);
20 17
 	}
18
+
19
+	return;
20
+}

+ 0
- 1
mod/openid.php View File

@@ -3,7 +3,6 @@
3 3
 
4 4
 require_once('library/openid.php');
5 5
 
6
-
7 6
 function openid_content(App $a) {
8 7
 
9 8
 	$noid = get_config('system','no_openid');

+ 11
- 11
mod/opensearch.php View File

@@ -1,18 +1,18 @@
1 1
 <?php
2
-    function opensearch_content(App $a) {
3 2
 
4
-		$tpl = get_markup_template('opensearch.tpl');
5 3
 
6
-		header("Content-type: application/opensearchdescription+xml");
4
+function opensearch_content(App $a) {
7 5
 
8
-		$o = replace_macros($tpl, array(
9
-			'$baseurl' => App::get_baseurl(),
10
-			'$nodename' => $a->get_hostname(),
11
-		));
6
+	$tpl = get_markup_template('opensearch.tpl');
12 7
 
13
-		echo $o;
8
+	header("Content-type: application/opensearchdescription+xml");
14 9
 
15
-		killme();
10
+	$o = replace_macros($tpl, array(
11
+		'$baseurl' => App::get_baseurl(),
12
+		'$nodename' => $a->get_hostname(),
13
+	));
16 14
 
17
-	}
18
-?>
15
+	echo $o;
16
+
17
+	killme();
18
+}

+ 1
- 1
mod/parse_url.php View File

@@ -10,7 +10,7 @@
10 10
  * @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
11 11
 */
12 12
 
13
-use \Friendica\ParseUrl;
13
+use Friendica\ParseUrl;
14 14
 
15 15
 require_once("include/items.php");
16 16
 

+ 3
- 2
mod/photos.php View File

@@ -1,4 +1,7 @@
1 1
 <?php
2
+
3
+use Friendica\Core\Config;
4
+
2 5
 require_once 'include/Photo.php';
3 6
 require_once 'include/photos.php';
4 7
 require_once 'include/items.php';
@@ -10,8 +13,6 @@ require_once 'include/tags.php';
10 13
 require_once 'include/threads.php';
11 14
 require_once 'include/Probe.php';
12 15
 
13
-use \Friendica\Core\Config;
14
-
15 16
 function photos_init(App $a) {
16 17
 
17 18
 	if ($a->argc > 1) {

+ 1
- 1
mod/ping.php View File

@@ -1,5 +1,5 @@
1 1
 <?php
2
-require_once("include/datetime.php");
2
+require_once('include/datetime.php');
3 3
 require_once('include/bbcode.php');
4 4
 require_once('include/ForumManager.php');
5 5
 require_once('include/group.php');

+ 2
- 3
mod/poke.php View File

@@ -1,7 +1,6 @@
1
-<?php /** @file */
1
+<?php
2 2
 
3 3
 /**
4
- *
5 4
  * Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
6 5
  * This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
7 6
  * other web request. You must be logged in and connected to a profile.
@@ -13,7 +12,7 @@
13 12
  * private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
14 13
  *
15 14
  */
16
-
15
+ * @file mod/poke.php
17 16
 require_once('include/security.php');
18 17
 require_once('include/bbcode.php');
19 18
 require_once('include/items.php');

+ 4
- 4
mod/pretheme.php View File

@@ -2,21 +2,21 @@
2 2
 
3 3
 function pretheme_init(App $a) {
4 4
 
5
-	if($_REQUEST['theme']) {
5
+	if ($_REQUEST['theme']) {
6 6
 		$theme = $_REQUEST['theme'];
7 7
 		$info = get_theme_info($theme);
8
-		if($info) {
8
+		if ($info) {
9 9
 			// unfortunately there will be no translation for this string
10 10
 			$desc = $info['description'];
11 11
 			$version = $info['version'];
12 12
 			$credits = $info['credits'];
13
-		}
14
-		else {
13
+		} else {
15 14
 			$desc = '';
16 15
 			$version = '';
17 16
 			$credits = '';
18 17
 		}
19 18
 		echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
20 19
 	}
20
+	
21 21
 	killme();
22 22
 }

+ 6
- 7
mod/probe.php View File

@@ -5,27 +5,26 @@ require_once('include/Scrape.php');
5 5
 function probe_content(App $a) {
6 6
 
7 7
 	if (!local_user()) {
8
-		http_status_exit(403,
9
-				array("title" => t("Public access denied."),
10
-					"description" => t("Only logged in users are permitted to perform a probing.")));
8
+		http_status_exit(403, array("title" => t("Public access denied."),
9
+			"description" => t("Only logged in users are permitted to perform a probing.")));
11 10
 		killme();
12 11
 	}
13 12
 
14 13
 	$o .= '<h3>Probe Diagnostic</h3>';
15 14
 
16 15
 	$o .= '<form action="probe" method="get">';
17
-	$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
16
+	$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] . '" />';
18 17
 	$o .= '<input type="submit" name="submit" value="Submit" /></form>';
19 18
 
20 19
 	$o .= '<br /><br />';
21 20
 
22
-	if(x($_GET,'addr')) {
23
-
21
+	if (x($_GET, 'addr')) {
24 22
 		$addr = trim($_GET['addr']);
25 23
 		$res = probe_url($addr);
26 24
 		$o .= '<pre>';
27
-		$o .= str_replace("\n",'<br />',print_r($res,true));
25
+		$o .= str_replace("\n", '<br />', print_r($res, true));
28 26
 		$o .= '</pre>';
29 27
 	}
28
+
30 29
 	return $o;
31 30
 }

+ 0
- 1
mod/profile.php View File

@@ -3,7 +3,6 @@
3 3
 require_once('include/contact_widgets.php');
4 4
 require_once('include/redir.php');
5 5
 
6
-
7 6
 function profile_init(App $a) {
8 7
 
9 8
 	if(! x($a->page,'aside'))

+ 0
- 2
mod/profile_photo.php View File

@@ -9,10 +9,8 @@ function profile_photo_init(App $a) {
9 9
 	}
10 10
 
11 11
 	profile_load($a,$a->user['nickname']);
12
-
13 12
 }
14 13
 
15
-
16 14
 function profile_photo_post(App $a) {
17 15
 
18 16
 	if (! local_user()) {

+ 0
- 1
mod/qsearch.php View File

@@ -48,4 +48,3 @@ function qsearch_init(App $a) {
48 48
 	echo json_encode((object) $results);
49 49
 	killme();
50 50
 }
51
-

+ 0
- 2
mod/receive.php View File

@@ -9,10 +9,8 @@ require_once('include/salmon.php');
9 9
 require_once('include/crypto.php');
10 10
 require_once('include/diaspora.php');
11 11
 
12
-
13 12
 function receive_post(App $a) {
14 13
 
15
-
16 14
 	$enabled = intval(get_config('system','diaspora_enabled'));
17 15
 	if(! $enabled) {
18 16
 		logger('mod-diaspora: disabled');

+ 3
- 3
mod/robots_txt.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+
2 3
 /**
3 4
  * @file mod/robots_text.php
4 5
  * @brief Module which returns the default robots.txt
@@ -13,7 +14,6 @@
13 14
  */
14 15
 function robots_txt_init(App $a)
15 16
 {
16
-
17 17
 	$allDisalloweds = array(
18 18
 		'/settings/',
19 19
 		'/admin/',
@@ -21,9 +21,9 @@ function robots_txt_init(App $a)
21 21
 	);
22 22
 
23 23
 	header('Content-Type: text/plain');
24
-	echo 'User-agent: *'.PHP_EOL;
24
+	echo 'User-agent: *' . PHP_EOL;
25 25
 	foreach ($allDisalloweds as $disallowed) {
26
-		echo 'Disallow: '.$disallowed.PHP_EOL;
26
+		echo 'Disallow: ' . $disallowed . PHP_EOL;
27 27
 	}
28 28
 	killme();
29 29
 }

+ 18
- 18
mod/rsd_xml.php View File

@@ -1,24 +1,24 @@
1 1
 <?php
2 2
 
3 3
 
4
-
5
-function rsd_xml_content(App $a) {
4
+function rsd_xml_content(App $a)
5
+{
6 6
 	header ("Content-Type: text/xml");
7 7
 	echo '<?xml version="1.0" encoding="UTF-8"?>
8
- <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
9
-   <service>
10
-     <engineName>Friendica</engineName>
11
-     <engineLink>http://friendica.com/</engineLink>
12
-     <apis>
13
-       <api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
14
-         <settings>
15
-           <docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
16
-           <setting name="OAuth">false</setting>
17
-         </settings>
18
-       </api>
19
-     </apis>
20
-   </service>
21
- </rsd>
22
-	';
23
-die();
8
+<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
9
+  <service>
10
+    <engineName>Friendica</engineName>
11
+    <engineLink>http://friendica.com/</engineLink>
12
+    <apis>
13
+      <api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
14
+        <settings>
15
+          <docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
16
+          <setting name="OAuth">false</setting>
17
+        </settings>
18
+      </api>
19
+    </apis>
20
+  </service>
21
+</rsd>';
22
+
23
+	killme();
24 24
 }

+ 4
- 5
mod/smilies.php View File

@@ -7,15 +7,14 @@
7 7
 require_once("include/Smilies.php");
8 8
 
9 9
 function smilies_content(App $a) {
10
-	if ($a->argv[1]==="json"){
10
+	if ($a->argv[1] === "json") {
11 11
 		$tmp = Smilies::get_list();
12 12
 		$results = array();
13
-		for($i = 0; $i < count($tmp['texts']); $i++) {
13
+		for ($i = 0; $i < count($tmp['texts']); $i++) {
14 14
 			$results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]);
15 15
 		}
16 16
 		json_return_and_die($results);
17
-	}
18
-	else {
19
-		return Smilies::replace('',true);
17
+	} else {
18
+		return Smilies::replace('', true);
20 19
 	}
21 20
 }

+ 16
- 15
mod/statistics_json.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+
2 3
 /**
3 4
  * @file mod/statistics_json.php
4 5
  */
@@ -7,21 +8,21 @@ require_once("include/plugin.php");
7 8
 
8 9
 function statistics_json_init(App $a) {
9 10
 
10
-        if (!get_config("system", "nodeinfo")) {
11
-                http_status_exit(404);
12
-                killme();
13
-        }
11
+	if (!get_config("system", "nodeinfo")) {
12
+		http_status_exit(404);
13
+		killme();
14
+	}
14 15
 
15 16
 	$statistics = array(
16
-			"name" => $a->config["sitename"],
17
-			"network" => FRIENDICA_PLATFORM,
18
-			"version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION,
19
-			"registrations_open" => ($a->config['register_policy'] != 0),
20
-			"total_users" => get_config('nodeinfo','total_users'),
21
-			"active_users_halfyear" => get_config('nodeinfo','active_users_halfyear'),
22
-			"active_users_monthly" => get_config('nodeinfo','active_users_monthly'),
23
-			"local_posts" => get_config('nodeinfo','local_posts')
24
-			);
17
+		"name" => $a->config["sitename"],
18
+		"network" => FRIENDICA_PLATFORM,
19
+		"version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION,
20
+		"registrations_open" => ($a->config['register_policy'] != 0),
21
+		"total_users" => get_config('nodeinfo', 'total_users'),
22
+		"active_users_halfyear" => get_config('nodeinfo', 'active_users_halfyear'),
23
+		"active_users_monthly" => get_config('nodeinfo', 'active_users_monthly'),
24
+		"local_posts" => get_config('nodeinfo', 'local_posts')
25
+	);
25 26
 
26 27
 	$statistics["services"] = array();
27 28
 	$statistics["services"]["appnet"] = plugin_enabled("appnet");
@@ -53,7 +54,7 @@ function statistics_json_init(App $a) {
53 54
 	$statistics["wordpress"] = $statistics["services"]["wordpress"];
54 55
 
55 56
 	header("Content-Type: application/json");
56
-	echo json_encode($statistics, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
57
-	logger("statistics_init: printed ".print_r($statistics, true), LOGGER_DATA);
57
+	echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
58
+	logger("statistics_init: printed " . print_r($statistics, true), LOGGER_DATA);
58 59
 	killme();
59 60
 }

+ 0
- 1
mod/subthread.php View File

@@ -4,7 +4,6 @@ require_once('include/security.php');
4 4
 require_once('include/bbcode.php');
5 5
 require_once('include/items.php');
6 6
 
7
-
8 7
 function subthread_content(App $a) {
9 8
 
10 9
 	if(! local_user() && ! remote_user()) {

+ 0
- 1
mod/tagger.php View File

@@ -4,7 +4,6 @@ require_once('include/security.php');
4 4
 require_once('include/bbcode.php');
5 5
 require_once('include/items.php');
6 6
 
7
-
8 7
 function tagger_content(App $a) {
9 8
 
10 9
 	if(! local_user() && ! remote_user()) {

+ 0
- 1
mod/toggle_mobile.php View File

@@ -16,4 +16,3 @@ function toggle_mobile_init(App $a) {
16 16
 
17 17
 	goaway($address);
18 18
 }
19
-

+ 22
- 23
mod/uexport.php View File

@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 
3 3
 function uexport_init(App $a) {
4
-	if (! local_user()) {
4
+	if (!local_user()) {
5 5
 		killme();
6 6
 	}
7 7
 
@@ -14,8 +14,8 @@ function uexport_content(App $a) {
14 14
 
15 15
 	if ($a->argc > 1) {
16 16
 		header("Content-type: application/json");
17
-		header('Content-Disposition: attachment; filename="'.$a->user['nickname'].'.'.$a->argv[1].'"');
18
-		switch($a->argv[1]) {
17
+		header('Content-Disposition: attachment; filename="' . $a->user['nickname'] . '.' . $a->argv[1] . '"');
18
+		switch ($a->argv[1]) {
19 19
 			case "backup":
20 20
 				uexport_all($a);
21 21
 				killme();
@@ -51,9 +51,9 @@ function _uexport_multirow($query) {
51 51
 	$result = array();
52 52
 	$r = q($query);
53 53
 	if (dbm::is_result($r)) {
54
-		foreach($r as $rr){
54
+		foreach ($r as $rr) {
55 55
 			$p = array();
56
-			foreach($rr as $k => $v) {
56
+			foreach ($rr as $k => $v) {
57 57
 				$p[$k] = $v;
58 58
 			}
59 59
 			$result[] = $p;
@@ -66,8 +66,8 @@ function _uexport_row($query) {
66 66
 	$result = array();
67 67
 	$r = q($query);
68 68
 	if (dbm::is_result($r)) {
69
-		foreach($r as $rr) {
70
-			foreach($rr as $k => $v) {
69
+		foreach ($r as $rr) {
70
+			foreach ($rr as $k => $v) {
71 71
 				$result[$k] = $v;
72 72
 			}
73 73
 		}
@@ -75,39 +75,38 @@ function _uexport_row($query) {
75 75
 	return $result;
76 76
 }
77 77
 
78
-
79
-function uexport_account($a){
78
+function uexport_account($a) {
80 79
 
81 80
 	$user = _uexport_row(
82
-		sprintf( "SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()) )
81
+		sprintf("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()))
83 82
 	);
84 83
 
85 84
 	$contact = _uexport_multirow(
86
-		sprintf( "SELECT * FROM `contact` WHERE `uid` = %d ",intval(local_user()) )
85
+		sprintf("SELECT * FROM `contact` WHERE `uid` = %d ", intval(local_user()))
87 86
 	);
88 87
 
89 88
 
90
-	$profile =_uexport_multirow(
91
-		sprintf( "SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()) )
89
+	$profile = _uexport_multirow(
90
+		sprintf("SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()))
92 91
 	);
93 92
 
94 93
 	$photo = _uexport_multirow(
95
-		sprintf( "SELECT * FROM `photo` WHERE uid = %d AND profile = 1", intval(local_user()) )
94
+		sprintf("SELECT * FROM `photo` WHERE uid = %d AND profile = 1", intval(local_user()))
96 95
 	);
97 96
 	foreach ($photo as &$p) {
98 97
 		$p['data'] = bin2hex($p['data']);
99 98
 	}
100 99
 
101 100
 	$pconfig = _uexport_multirow(
102
-		sprintf( "SELECT * FROM `pconfig` WHERE uid = %d",intval(local_user()) )
101
+		sprintf("SELECT * FROM `pconfig` WHERE uid = %d", intval(local_user()))
103 102
 	);
104 103
 
105 104
 	$group = _uexport_multirow(
106
-		sprintf( "SELECT * FROM `group` WHERE uid = %d",intval(local_user()) )
105
+		sprintf("SELECT * FROM `group` WHERE uid = %d", intval(local_user()))
107 106
 	);
108 107
 
109 108
 	$group_member = _uexport_multirow(
110
-		sprintf( "SELECT * FROM `group_member` WHERE uid = %d",intval(local_user()) )
109
+		sprintf("SELECT * FROM `group_member` WHERE uid = %d", intval(local_user()))
111 110
 	);
112 111
 
113 112
 	$output = array(
@@ -150,13 +149,13 @@ function uexport_all(App $a) {
150 149
 			intval($x),
151 150
 			intval(500)
152 151
 		);
153
-		/*if (dbm::is_result($r)) {
154
-			foreach($r as $rr)
155
-				foreach($rr as $k => $v)
156
-					$item[][$k] = $v;
157
-		}*/
152
+		/* if (dbm::is_result($r)) {
153
+		  foreach($r as $rr)
154
+		  foreach($rr as $k => $v)
155
+		  $item[][$k] = $v;
156
+		  } */
158 157
 
159 158
 		$output = array('item' => $r);
160
-		echo json_encode($output)."\n";
159
+		echo json_encode($output) . "\n";
161 160
 	}
162 161
 }

+ 30
- 30
mod/uimport.php View File

@@ -1,35 +1,35 @@
1 1
 <?php
2
+
2 3
 /**
3 4
  * View for user import
4
- * @TODO This file has DOS line endings!
5 5
  */
6 6
 
7 7
 require_once("include/uimport.php");
8 8
 
9 9
 function uimport_post(App $a) {
10
-	switch($a->config['register_policy']) {
11
-	case REGISTER_OPEN:
12
-		$blocked = 0;
13
-		$verified = 1;
14
-		break;
10
+	switch ($a->config['register_policy']) {
11
+		case REGISTER_OPEN:
12
+			$blocked = 0;
13
+			$verified = 1;
14
+			break;
15 15
 
16
-	case REGISTER_APPROVE:
17
-		$blocked = 1;
18
-		$verified = 0;
19
-		break;
16
+		case REGISTER_APPROVE:
17
+			$blocked = 1;
18
+			$verified = 0;
19
+			break;
20 20
 
21
-	default:
22
-	case REGISTER_CLOSED:
23
-		if ((! x($_SESSION,'authenticated') && (! x($_SESSION,'administrator')))) {
24
-			notice( t('Permission denied.') . EOL );
25
-			return;
26
-		}
27
-		$blocked = 1;
28
-		$verified = 0;
29
-		break;
21
+		default:
22
+		case REGISTER_CLOSED:
23
+			if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
24
+				notice(t('Permission denied.') . EOL);
25
+				return;
26
+			}
27
+			$blocked = 1;
28
+			$verified = 0;
29
+			break;
30 30
 	}
31 31
 
32
-	if (x($_FILES,'accountfile')){
32
+	if (x($_FILES, 'accountfile')) {
33 33
 		/// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE
34 34
 		import_account($a, $_FILES['accountfile']);
35 35
 		return;
@@ -38,26 +38,26 @@ function uimport_post(App $a) {
38 38
 
39 39
 function uimport_content(App $a) {
40 40
 
41
-	if ((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
41
+	if ((!local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
42 42
 		notice("Permission denied." . EOL);
43 43
 		return;
44 44
 	}
45 45
 
46
-	$max_dailies = intval(get_config('system','max_daily_registrations'));
46
+	$max_dailies = intval(get_config('system', 'max_daily_registrations'));
47 47
 	if ($max_dailies) {
48 48
 		$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
49 49
 		if ($r && $r[0]['total'] >= $max_dailies) {
50 50
 			logger('max daily registrations exceeded.');
51
-			notice( t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
51
+			notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
52 52
 			return;
53 53
 		}
54 54
 	}
55 55
 
56 56
 
57
-	if (x($_SESSION,'theme')) {
57
+	if (x($_SESSION, 'theme')) {
58 58
 		unset($_SESSION['theme']);
59 59
 	}
60
-	if (x($_SESSION,'mobile-theme')) {
60
+	if (x($_SESSION, 'mobile-theme')) {
61 61
 		unset($_SESSION['mobile-theme']);
62 62
 	}
63 63
 
@@ -65,11 +65,11 @@ function uimport_content(App $a) {
65 65
 	return replace_macros($tpl, array(
66 66
 		'$regbutt' => t('Import'),
67 67
 		'$import' => array(
68
-		'title' => t("Move account"),
69
-		'intro' => t("You can import an account from another Friendica server."),
70
-		'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
71
-		'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
72
-		'field' => array('accountfile', t('Account file'),'<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
68
+			'title' => t("Move account"),
69
+			'intro' => t("You can import an account from another Friendica server."),
70
+			'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
71
+			'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
72
+			'field' => array('accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
73 73
 		),
74 74
 	));
75 75
 }

+ 0
- 1
mod/videos.php View File

@@ -5,7 +5,6 @@ require_once('include/bbcode.php');
5 5
 require_once('include/security.php');
6 6
 require_once('include/redir.php');
7 7
 
8
-
9 8
 function videos_init(App $a) {
10 9
 
11 10
 	if($a->argc > 1)

+ 2
- 3
mod/wall_upload.php View File

@@ -3,17 +3,16 @@
3 3
 /**
4 4
  * @file mod/wall_upload.php
5 5
  * @brief Module for uploading a picture to the profile wall
6
- * 
6
+ *
7 7
  * By default the picture will be stored in the photo album with the name Wall Photos.
8 8
  * You can specify a different album by adding an optional query string "album="
9 9
  * to the url
10 10
  */
11 11
 
12
-use \Friendica\Core\Config;
12
+use Friendica\Core\Config;
13 13
 
14 14
 require_once 'include/Photo.php';
15 15
 
16
-
17 16
 function wall_upload_post(App $a, $desktopmode = true) {
18 17
 
19 18
 	logger("wall upload: starting new upload", LOGGER_DEBUG);

+ 1
- 1
util/db_update.php View File

@@ -3,7 +3,7 @@
3 3
 * @package util
4 4
 */
5 5
 
6
-/* 
6
+/*
7 7
 * require boot.php
8 8
 */
9 9
 require_once("boot.php");

+ 1
- 1
util/maintenance.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-use \Friendica\Core\Config;
3
+use Friendica\Core\Config;
4 4
 
5 5
 require_once("boot.php");
6 6
 

+ 184
- 185
util/php2po.php View File

@@ -1,204 +1,203 @@
1 1
 <?php
2
-	/**
3
-	 * Read strings.php file and create messages.po
4
-	 *
5
-	 * php utils/php2po.php <path/to/strings.php>
6
-	 * 
7
-	 * Output to <path/to/messages.po>
8
-	 */
9
-	 
10
-	DEFINE("NORM_REGEXP", "|[\\\]|");
11
-	
12
-	
13
-	if(! class_exists('App')) {
14
-		class TmpA {
15
-			public $strings = Array();
16
-		}
17
-		$a = new TmpA();
18
-	}
2
+/**
3
+ * Read strings.php file and create messages.po
4
+ *
5
+ * php utils/php2po.php <path/to/strings.php>
6
+ *
7
+ * Output to <path/to/messages.po>
8
+ */
19 9
 
20
-	if ($argc<2 || in_array('-h', $argv) || in_array('--h', $argv)) {
21
-		print "Usage: ".$argv[0]." [-p <n>] <strings.php>\n\n";
22
-		print "Options:\n";
23
-		print "p\tNumber of plural forms. Default: 2\n";
24
-		print "\n";
25
-		return;
26
-	}
27 10
 
28
-	$phpfile = $argv[1];
29
-	$pofile = dirname($phpfile)."/messages.po";
11
+DEFINE("NORM_REGEXP", "|[\\\]|");
30 12
 
31
-	if (!file_exists($phpfile)){
32
-		print "Unable to find '$phpfile'\n";
33
-		return;
13
+if(! class_exists('App')) {
14
+	class TmpA {
15
+		public $strings = Array();
34 16
 	}
17
+	$a = new TmpA();
18
+}
35 19
 
36
-	// utility functions
37
-	function startsWith($haystack, $needle) {
38
-		// search backwards starting from haystack length characters from the end
39
-		return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
40
-	}
20
+if ($argc<2 || in_array('-h', $argv) || in_array('--h', $argv)) {
21
+	print "Usage: ".$argv[0]." [-p <n>] <strings.php>\n\n";
22
+	print "Options:\n";
23
+	print "p\tNumber of plural forms. Default: 2\n";
24
+	print "\n";
25
+	return;
26
+}
27
+
28
+$phpfile = $argv[1];
29
+$pofile = dirname($phpfile)."/messages.po";
30
+
31
+if (!file_exists($phpfile)){
32
+	print "Unable to find '$phpfile'\n";
33
+	return;
34
+}
41 35
 
36
+// utility functions
37
+function startsWith($haystack, $needle) {
38
+	// search backwards starting from haystack length characters from the end
39
+	return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
40
+}
42 41
 
43
-	// start !
44
-	include_once($phpfile);
45
-
46
-	$out  = '';
47
-	$out .= "# FRIENDICA Distributed Social Network\n";
48
-	$out .= "# Copyright (C) 2010, 2011, 2012, 2013 the Friendica Project\n";
49
-	$out .= "# This file is distributed under the same license as the Friendica package.\n";
50
-	$out .= "# \n";
51
-	$out .= 'msgid ""' ."\n";
52
-	$out .= 'msgstr ""' ."\n";
53
-	$out .= '"Project-Id-Version: friendica\n"' ."\n";
54
-	$out .= '"Report-Msgid-Bugs-To: \n"' ."\n";
55
-	$out .= '"POT-Creation-Date: '. date("Y-m-d H:i:sO").'\n"' ."\n";
56
-	$out .= '"MIME-Version: 1.0\n"' ."\n";
57
-	$out .= '"Content-Type: text/plain; charset=UTF-8\n"' ."\n";
58
-	$out .= '"Content-Transfer-Encoding: 8bit\n"' ."\n";
59
-	
60
-	// search for plural info
61
-	$lang = "";
62
-	$lang_logic = "";
63
-	$lang_pnum = 2;
64
-	
65
-	$_idx = array_search('-p', $argv);
66
-	if ($_idx !== false) {
67
-		$lang_pnum = $argv[$_idx+1];
42
+
43
+// start !
44
+include_once($phpfile);
45
+
46
+$out  = '';
47
+$out .= "# FRIENDICA Distributed Social Network\n";
48
+$out .= "# Copyright (C) 2010, 2011, 2012, 2013 the Friendica Project\n";
49
+$out .= "# This file is distributed under the same license as the Friendica package.\n";
50
+$out .= "# \n";
51
+$out .= 'msgid ""' ."\n";
52
+$out .= 'msgstr ""' ."\n";
53
+$out .= '"Project-Id-Version: friendica\n"' ."\n";
54
+$out .= '"Report-Msgid-Bugs-To: \n"' ."\n";
55
+$out .= '"POT-Creation-Date: '. date("Y-m-d H:i:sO").'\n"' ."\n";
56
+$out .= '"MIME-Version: 1.0\n"' ."\n";
57
+$out .= '"Content-Type: text/plain; charset=UTF-8\n"' ."\n";
58
+$out .= '"Content-Transfer-Encoding: 8bit\n"' ."\n";
59
+
60
+// search for plural info
61
+$lang = "";
62
+$lang_logic = "";
63
+$lang_pnum = 2;
64
+
65
+$_idx = array_search('-p', $argv);
66
+if ($_idx !== false) {
67
+	$lang_pnum = $argv[$_idx+1];
68
+}
69
+
70
+$infile = file($phpfile);
71
+foreach($infile as $l) {
72
+	$l = trim($l);
73
+	if  (startsWith($l, 'function string_plural_select_')) {
74
+		$lang = str_replace( 'function string_plural_select_' , '', str_replace( '($n){','', $l) );
68 75
 	}
69
-	
70
-	$infile = file($phpfile);
71
-	foreach($infile as $l) {
72
-		$l = trim($l);
73
-		if  (startsWith($l, 'function string_plural_select_')) {
74
-			$lang = str_replace( 'function string_plural_select_' , '', str_replace( '($n){','', $l) );
75
-		}
76
-		if (startsWith($l, 'return')) {
77
-			$lang_logic = str_replace( '$', '', trim( str_replace( 'return ' , '',  $l) , ';') );
78
-			break;
79
-		}
76
+	if (startsWith($l, 'return')) {
77
+		$lang_logic = str_replace( '$', '', trim( str_replace( 'return ' , '',  $l) , ';') );
78
+		break;
80 79
 	}
81
-	
82
-	echo "Language: $lang\n";
83
-	echo "Plural forms: $lang_pnum\n";
84
-	echo "Plural logic: $lang_logic;\n";
85
-		
86
-	$out .= sprintf('"Language: %s\n"', $lang) ."\n";
87
-	$out .= sprintf('"Plural-Forms: nplurals=%s; plural=%s;\n"', $lang_pnum, $lang_logic)  ."\n";
88
-	$out .= "\n";
80
+}
89 81
 
90
-	print "\nLoading base message.po...";
91
-	
92
-	// load base messages.po and extract msgids
93
-	$base_msgids = array();
94
-	$norm_base_msgids = array();
95
-	$base_f = file("util/messages.po") or die("No base messages.po\n");
96
-	$_f = 0; $_mid = ""; $_mids = array();
97
-	foreach( $base_f as $l) {
98
-		$l = trim($l);
99
-		//~ print $l."\n";
100
-		
101
-		if (startsWith($l, 'msgstr')) {
102
-			if ($_mid != '""') {
103
-				$base_msgids[$_mid] =  $_mids;
104
-				$norm_base_msgids[preg_replace(NORM_REGEXP, "", $_mid)] = $_mid;
105
-				//~ print "\t\t\t".$_mid. print_r($base_msgids[$_mid], true);
106
-			}
107
-			
108
-			$_f = 0;
109
-			$_mid = "";
110
-			$_mids = array();
111
-			
112
-		}
113
-		
114
-		if (startsWith($l, '"') && $_f==2) {
115
-			$_mids[count($_mids)-1] .= "\n".$l;
116
-			//~ print "\t\t+mids: ".print_t($_mids, true);
117
-		}
118
-		if (startsWith($l, 'msgid_plural ')) {
119
-			$_f = 2;
120
-			$_mids[] = str_replace('msgid_plural ', '' , $l);
121
-			//~ print "\t\t mids: ".print_r($_mids, true);
122
-		}
123
-		
124
-		if (startsWith($l, '"') && $_f==1) {
125
-			$_mid .= "\n".$l;
126
-			$_mids[count($_mids)-1] .= "\n".$l;
127
-			//~ print "\t+mid: $_mid \n";
128
-		}
129
-		if (startsWith($l, 'msgid ')) {
130
-			$_f = 1;
131
-			$_mid = str_replace('msgid ', '' , $l);
132
-				$_mids = array($_mid);
133
-			//~ print "\t mid: $_mid \n";
82
+echo "Language: $lang\n";
83
+echo "Plural forms: $lang_pnum\n";
84
+echo "Plural logic: $lang_logic;\n";
85
+
86
+$out .= sprintf('"Language: %s\n"', $lang) ."\n";
87
+$out .= sprintf('"Plural-Forms: nplurals=%s; plural=%s;\n"', $lang_pnum, $lang_logic)  ."\n";
88
+$out .= "\n";
89
+
90
+print "\nLoading base message.po...";
91
+
92
+// load base messages.po and extract msgids
93
+$base_msgids = array();
94
+$norm_base_msgids = array();
95
+$base_f = file("util/messages.po") or die("No base messages.po\n");
96
+$_f = 0; $_mid = ""; $_mids = array();
97
+foreach( $base_f as $l) {
98
+	$l = trim($l);
99
+	//~ print $l."\n";
100
+
101
+	if (startsWith($l, 'msgstr')) {
102
+		if ($_mid != '""') {
103
+			$base_msgids[$_mid] =  $_mids;
104
+			$norm_base_msgids[preg_replace(NORM_REGEXP, "", $_mid)] = $_mid;
105
+			//~ print "\t\t\t".$_mid. print_r($base_msgids[$_mid], true);
134 106
 		}
135
-		//~ print "\t\t\t\t$_f\n\n";
107
+
108
+		$_f = 0;
109
+		$_mid = "";
110
+		$_mids = array();
111
+
136 112
 	}
137
-	
138
-	print " done\n";
139
-	print "Creating '$pofile'...";
140
-	// create msgid and msgstr 
141
-	
142
-	/**
143
-	 * Get a string and retun a message.po ready text
144
-	 * - replace " with \"
145
-	 * - replace tab char with \t
146
-	 * - manage multiline strings
147
-	 */
148
-	function massage_string($str) {
149
-		$str = str_replace('\\','\\\\',$str);
150
-		$str = str_replace('"','\"',$str);
151
-		$str = str_replace("\t",'\t',$str);
152
-		$str = str_replace("\n",'\n"'."\n".'"',$str);
153
-		if (strpos($str, "\n")!==false  && $str[0]!=='"') $str = '"'."\n".$str;
154
-		$str = preg_replace("|\n([^\"])|", "\n\"$1", $str);
155
-		return sprintf('"%s"', $str);
113
+
114
+	if (startsWith($l, '"') && $_f==2) {
115
+		$_mids[count($_mids)-1] .= "\n".$l;
116
+		//~ print "\t\t+mids: ".print_t($_mids, true);
156 117
 	}
157
-	
158
-	function find_original_msgid($str) {
159
-		global $norm_base_msgids;
160
-		$norm_str = preg_replace(NORM_REGEXP, "", $str);
161
-		if (array_key_exists($norm_str, $norm_base_msgids)) {
162
-			return $norm_base_msgids[$norm_str];
163
-		}
164
-		return $str;
118
+	if (startsWith($l, 'msgid_plural ')) {
119
+		$_f = 2;
120
+		$_mids[] = str_replace('msgid_plural ', '' , $l);
121
+		//~ print "\t\t mids: ".print_r($_mids, true);
165 122
 	}
166
-	
167
-	$warnings = "";
168
-	foreach($a->strings as $key=>$str) {
169
-		$msgid = massage_string($key);
170
-		
171
-		if (preg_match("|%[sd0-9](\$[sn])*|", $msgid)) {
172
-			$out .= "#, php-format\n";
173
-		}
174
-		$msgid = find_original_msgid($msgid);
175
-		$out .= 'msgid '. $msgid . "\n";
176
-		
177
-		if (is_array($str)) {
178
-			if (array_key_exists($msgid, $base_msgids) && isset($base_msgids[$msgid][1]))  {
179
-				$out .= 'msgid_plural '. $base_msgids[$msgid][1] . "\n";
180
-			} else {
181
-				$out .= 'msgid_plural '. $msgid . "\n";
182
-				$warnings .= "[W] No source plural form for msgid:\n". str_replace("\n","\n\t", $msgid) . "\n\n";
183
-			}
184
-			foreach ( $str as $n => $msgstr) {
185
-				$out .= 'msgstr['.$n.'] '. massage_string($msgstr) . "\n";
186
-			}
187
-		} else {
188
-			$out .= 'msgstr '. massage_string($str) . "\n";
189
-		}
190
-		
191
-		$out .= "\n";
192
-	
123
+
124
+	if (startsWith($l, '"') && $_f==1) {
125
+		$_mid .= "\n".$l;
126
+		$_mids[count($_mids)-1] .= "\n".$l;
127
+		//~ print "\t+mid: $_mid \n";
193 128
 	}
129
+	if (startsWith($l, 'msgid ')) {
130
+		$_f = 1;
131
+		$_mid = str_replace('msgid ', '' , $l);
132
+			$_mids = array($_mid);
133
+		//~ print "\t mid: $_mid \n";
134
+	}
135
+	//~ print "\t\t\t\t$_f\n\n";
136
+}
137
+
138
+print " done\n";
139
+print "Creating '$pofile'...";
140
+// create msgid and msgstr
141
+
142
+/**
143
+ * Get a string and retun a message.po ready text
144
+ * - replace " with \"
145
+ * - replace tab char with \t
146
+ * - manage multiline strings
147
+ */
148
+function massage_string($str) {
149
+	$str = str_replace('\\','\\\\',$str);
150
+	$str = str_replace('"','\"',$str);
151
+	$str = str_replace("\t",'\t',$str);
152
+	$str = str_replace("\n",'\n"'."\n".'"',$str);
153
+	if (strpos($str, "\n")!==false  && $str[0]!=='"') $str = '"'."\n".$str;
154
+	$str = preg_replace("|\n([^\"])|", "\n\"$1", $str);
155
+	return sprintf('"%s"', $str);
156
+}
157
+
158
+function find_original_msgid($str) {
159
+	global $norm_base_msgids;
160
+	$norm_str = preg_replace(NORM_REGEXP, "", $str);
161
+	if (array_key_exists($norm_str, $norm_base_msgids)) {
162
+		return $norm_base_msgids[$norm_str];
163
+	}
164
+	return $str;
165
+}
166
+
167
+$warnings = "";
168
+foreach($a->strings as $key=>$str) {
169
+	$msgid = massage_string($key);
194 170
 
195
-	file_put_contents($pofile, $out);
196
-	
197
-	print " done\n";
198
-	
199
-	if ($warnings=="") {
200
-		print "No warnings.\n";
171
+	if (preg_match("|%[sd0-9](\$[sn])*|", $msgid)) {
172
+		$out .= "#, php-format\n";
173
+	}
174
+	$msgid = find_original_msgid($msgid);
175
+	$out .= 'msgid '. $msgid . "\n";
176
+
177
+	if (is_array($str)) {
178
+		if (array_key_exists($msgid, $base_msgids) && isset($base_msgids[$msgid][1]))  {
179
+			$out .= 'msgid_plural '. $base_msgids[$msgid][1] . "\n";
180
+		} else {
181
+			$out .= 'msgid_plural '. $msgid . "\n";
182
+			$warnings .= "[W] No source plural form for msgid:\n". str_replace("\n","\n\t", $msgid) . "\n\n";
183
+		}
184
+		foreach ( $str as $n => $msgstr) {
185
+			$out .= 'msgstr['.$n.'] '. massage_string($msgstr) . "\n";
186
+		}
201 187
 	} else {
202
-		print $warnings;
188
+		$out .= 'msgstr '. massage_string($str) . "\n";
203 189
 	}
204
-	
190
+
191
+	$out .= "\n";
192
+
193
+}
194
+
195
+file_put_contents($pofile, $out);
196
+
197
+print " done\n";
198
+
199
+if ($warnings=="") {
200
+	print "No warnings.\n";
201
+} else {
202
+	print $warnings;
203
+}

+ 42
- 42
util/typo.php View File

@@ -1,59 +1,59 @@
1 1
 <?php
2
-	// Tired of chasing typos and finding them after a commit.
3
-	// Run this from cmdline in basedir and quickly see if we've
4
-	// got any parse errors in our application files.
2
+// Tired of chasing typos and finding them after a commit.
3
+// Run this from cmdline in basedir and quickly see if we've
4
+// got any parse errors in our application files.
5 5
 
6 6
 
7
-	error_reporting(E_ERROR | E_WARNING | E_PARSE );
8
-	ini_set('display_errors', '1');
9
-	ini_set('log_errors','0');
7
+error_reporting(E_ERROR | E_WARNING | E_PARSE );
8
+ini_set('display_errors', '1');
9
+ini_set('log_errors','0');
10 10
 
11
-	include 'boot.php';
11
+include 'boot.php';
12 12
 
13
-	$a = new App();
13
+$a = new App();
14 14
 
15
-	if(x($a->config,'php_path'))
16
-		$phpath = $a->config['php_path'];
17
-	else
18
-		$phpath = 'php';
15
+if(x($a->config,'php_path'))
16
+	$phpath = $a->config['php_path'];
17
+else
18
+	$phpath = 'php';
19 19
 
20 20
 
21
-	echo "Directory: mod\n";
22
-	$files = glob('mod/*.php');
23
-	foreach($files as $file) {
24
-        passthru("$phpath -l $file", $ret); $ret===0 or die();
25
-	}
21
+echo "Directory: mod\n";
22
+$files = glob('mod/*.php');
23
+foreach($files as $file) {
24
+	passthru("$phpath -l $file", $ret); $ret===0 or die();
25
+}
26 26
 
27
-	echo "Directory: include\n";
28
-	$files = glob('include/*.php');
29
-	foreach($files as $file) {
30
-        passthru("$phpath -l $file", $ret); $ret===0 or die();
31
-	}
27
+echo "Directory: include\n";
28
+$files = glob('include/*.php');
29
+foreach($files as $file) {
30
+	passthru("$phpath -l $file", $ret); $ret===0 or die();
31
+}
32 32
 
33
-    echo "Directory: object\n";
34
-	$files = glob('object/*.php');
35
-	foreach($files as $file) {
36
-        passthru("$phpath -l $file", $ret); $ret===0 or die();
37
-	}
33
+echo "Directory: object\n";
34
+$files = glob('object/*.php');
35
+foreach($files as $file) {
36
+	passthru("$phpath -l $file", $ret); $ret===0 or die();
37
+}
38 38
 
39
-	echo "Directory: addon\n";
40
-	$dirs = glob('addon/*');
39
+echo "Directory: addon\n";
40
+$dirs = glob('addon/*');
41 41
 
42
-	foreach($dirs as $dir) {
43
-		$addon = basename($dir);
44
-		$files = glob($dir . '/' . $addon . '.php');
45
-		foreach($files as $file) {
46
-            passthru("$phpath -l $file", $ret); $ret===0 or die();
47
-		}
42
+foreach($dirs as $dir) {
43
+	$addon = basename($dir);
44
+	$files = glob($dir . '/' . $addon . '.php');
45
+	foreach($files as $file) {
46
+		passthru("$phpath -l $file", $ret); $ret===0 or die();
48 47
 	}
48
+}
49 49
 
50 50
 
51
-	echo "String files\n";
51
+echo "String files\n";
52 52
 
53
-	echo 'util/strings.php' . "\n";
54
-    passthru("$phpath -l util/strings.php", $ret); $ret===0 or die();
53
+echo 'util/strings.php' . "\n";
54
+passthru("$phpath -l util/strings.php", $ret); $ret===0 or die();
55 55
 
56
-	$files = glob('view/lang/*/strings.php');
57
-	foreach($files as $file) {
58
-        passthru("$phpath -l $file", $ret); $ret===0 or die();
59
-	}
56
+$files = glob('view/lang/*/strings.php');
57
+foreach($files as $file) {
58
+	passthru("$phpath -l $file", $ret); $ret===0 or die();
59
+}

+ 1
- 0
view/theme/duepuntozero/config.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+
2 3
 /**
3 4
  * Theme settings
4 5
  */

+ 2
- 2
view/theme/frio/php/default.php View File

@@ -19,10 +19,10 @@
19 19
 	<script>var frio="<?php echo "view/theme/frio"; ?>";</script>
20 20
 	<?php $baseurl = App::get_baseurl(); ?>
21 21
 	<?php $frio = "view/theme/frio"; ?>
22
-	<?php 
22
+	<?php
23 23
 		// Because we use minimal for modals the header and the included js stuff should be only loaded
24 24
 		// if the page is an standard page (so we don't have it twice for modals)
25
-		// 
25
+		//
26 26
 		/// @todo Think about to move js stuff in the footer
27 27
 		if(!$minimal) {
28 28
 			if(x($page,'htmlhead')) echo $page['htmlhead'];

+ 1
- 1
view/theme/frio/php/frio_boot.php View File

@@ -3,7 +3,7 @@
3 3
 /**
4 4
  * @file view/theme/frio/php/frio_boot.php
5 5
  *
6
- * @brief This file contains functions for page contstruction
6
+ * @brief This file contains functions for page construction
7 7
  *
8 8
  */
9 9
 

+ 1
- 0
view/theme/quattro/config.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+
2 3
 /**
3 4
  * Theme settings
4 5
  */

+ 3
- 4
view/theme/smoothly/theme.php View File

@@ -16,7 +16,7 @@ function smoothly_init(App $a) {
16 16
 	$cssFile = null;
17 17
 	$ssl_state = null;
18 18
 	$baseurl = App::get_baseurl($ssl_state);
19
-$a->page['htmlhead'] .= <<< EOT
19
+	$a->page['htmlhead'] .= <<< EOT
20 20
 
21 21
 <script>
22 22
 function insertFormatting(BBcode, id) {
@@ -99,13 +99,12 @@ $(document).ready(function() {
99 99
 </script>
100 100
 EOT;
101 101
 
102
-    	/** custom css **/
102
+	/** custom css **/
103 103
 	if (!is_null($cssFile)) {
104 104
         $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
105 105
 	}
106 106
 
107
-_js_in_foot();
108
-
107
+	_js_in_foot();
109 108
 }
110 109
 
111 110
 if (! function_exists('_js_in_foot')) {

Loading…
Cancel
Save