Merge pull request #1148 from annando/args
Replaced argv/argc with replacement functions
This commit is contained in:
commit
2cc453ca52
|
@ -181,7 +181,7 @@ function advancedcontentfilter_module() {}
|
||||||
|
|
||||||
function advancedcontentfilter_init(App $a)
|
function advancedcontentfilter_init(App $a)
|
||||||
{
|
{
|
||||||
if ($a->argc > 1 && $a->argv[1] == 'api') {
|
if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'api') {
|
||||||
$slim = new \Slim\App();
|
$slim = new \Slim\App();
|
||||||
|
|
||||||
require __DIR__ . '/src/middlewares.php';
|
require __DIR__ . '/src/middlewares.php';
|
||||||
|
@ -196,10 +196,10 @@ function advancedcontentfilter_init(App $a)
|
||||||
function advancedcontentfilter_content(App $a)
|
function advancedcontentfilter_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return Login::form('/' . implode('/', $a->argv));
|
return Login::form('/' . implode('/', DI::args()->getArgv()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($a->argc > 1 && $a->argv[1] == 'help') {
|
if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'help') {
|
||||||
$lang = $a->user['language'];
|
$lang = $a->user['language'];
|
||||||
|
|
||||||
$default_dir = 'addon/advancedcontentfilter/doc/';
|
$default_dir = 'addon/advancedcontentfilter/doc/';
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:15+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -17,32 +17,28 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: src/middlewares.php:49
|
#: advancedcontentfilter.php:153
|
||||||
msgid "Method not found"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: advancedcontentfilter.php:136
|
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Filtered by rule: %s"
|
msgid "Filtered by rule: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:150 advancedcontentfilter.php:207
|
#: advancedcontentfilter.php:167 advancedcontentfilter.php:224
|
||||||
msgid "Advanced Content Filter"
|
msgid "Advanced Content Filter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:206
|
#: advancedcontentfilter.php:223
|
||||||
msgid "Back to Addon Settings"
|
msgid "Back to Addon Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:208
|
#: advancedcontentfilter.php:225
|
||||||
msgid "Add a Rule"
|
msgid "Add a Rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:209
|
#: advancedcontentfilter.php:226
|
||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:210
|
#: advancedcontentfilter.php:227
|
||||||
msgid ""
|
msgid ""
|
||||||
"Add and manage your personal content filter rules in this screen. Rules have "
|
"Add and manage your personal content filter rules in this screen. Rules have "
|
||||||
"a name and an arbitrary expression that will be matched against post data. "
|
"a name and an arbitrary expression that will be matched against post data. "
|
||||||
|
@ -50,108 +46,112 @@ msgid ""
|
||||||
"the help page."
|
"the help page."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:211
|
#: advancedcontentfilter.php:228
|
||||||
msgid "Your rules"
|
msgid "Your rules"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:212
|
#: advancedcontentfilter.php:229
|
||||||
msgid ""
|
msgid ""
|
||||||
"You have no rules yet! Start adding one by clicking on the button above next "
|
"You have no rules yet! Start adding one by clicking on the button above next "
|
||||||
"to the title."
|
"to the title."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:213
|
#: advancedcontentfilter.php:230
|
||||||
msgid "Disabled"
|
msgid "Disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:214
|
#: advancedcontentfilter.php:231
|
||||||
msgid "Enabled"
|
msgid "Enabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:215
|
#: advancedcontentfilter.php:232
|
||||||
msgid "Disable this rule"
|
msgid "Disable this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:216
|
#: advancedcontentfilter.php:233
|
||||||
msgid "Enable this rule"
|
msgid "Enable this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:217
|
#: advancedcontentfilter.php:234
|
||||||
msgid "Edit this rule"
|
msgid "Edit this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:218
|
#: advancedcontentfilter.php:235
|
||||||
msgid "Edit the rule"
|
msgid "Edit the rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:219
|
#: advancedcontentfilter.php:236
|
||||||
msgid "Save this rule"
|
msgid "Save this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:220
|
#: advancedcontentfilter.php:237
|
||||||
msgid "Delete this rule"
|
msgid "Delete this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:221
|
#: advancedcontentfilter.php:238
|
||||||
msgid "Rule"
|
msgid "Rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:222
|
#: advancedcontentfilter.php:239
|
||||||
msgid "Close"
|
msgid "Close"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:223
|
#: advancedcontentfilter.php:240
|
||||||
msgid "Add new rule"
|
msgid "Add new rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:224
|
#: advancedcontentfilter.php:241
|
||||||
msgid "Rule Name"
|
msgid "Rule Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:225
|
#: advancedcontentfilter.php:242
|
||||||
msgid "Rule Expression"
|
msgid "Rule Expression"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:226
|
#: advancedcontentfilter.php:243
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:293 advancedcontentfilter.php:304
|
#: advancedcontentfilter.php:310 advancedcontentfilter.php:321
|
||||||
#: advancedcontentfilter.php:315 advancedcontentfilter.php:349
|
#: advancedcontentfilter.php:332 advancedcontentfilter.php:366
|
||||||
#: advancedcontentfilter.php:378 advancedcontentfilter.php:399
|
#: advancedcontentfilter.php:395 advancedcontentfilter.php:416
|
||||||
msgid "You must be logged in to use this method"
|
msgid "You must be logged in to use this method"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:319 advancedcontentfilter.php:353
|
#: advancedcontentfilter.php:336 advancedcontentfilter.php:370
|
||||||
#: advancedcontentfilter.php:382
|
#: advancedcontentfilter.php:399
|
||||||
msgid "Invalid form security token, please refresh the page."
|
msgid "Invalid form security token, please refresh the page."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:331
|
#: advancedcontentfilter.php:348
|
||||||
msgid "The rule name and expression are required."
|
msgid "The rule name and expression are required."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:343
|
#: advancedcontentfilter.php:360
|
||||||
msgid "Rule successfully added"
|
msgid "Rule successfully added"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:357 advancedcontentfilter.php:386
|
#: advancedcontentfilter.php:374 advancedcontentfilter.php:403
|
||||||
msgid "Rule doesn't exist or doesn't belong to you."
|
msgid "Rule doesn't exist or doesn't belong to you."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:372
|
#: advancedcontentfilter.php:389
|
||||||
msgid "Rule successfully updated"
|
msgid "Rule successfully updated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:393
|
#: advancedcontentfilter.php:410
|
||||||
msgid "Rule successfully deleted"
|
msgid "Rule successfully deleted"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:403
|
#: advancedcontentfilter.php:420
|
||||||
msgid "Missing argument: guid."
|
msgid "Missing argument: guid."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:411
|
#: advancedcontentfilter.php:428
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Unknown post with guid: %s"
|
msgid "Unknown post with guid: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/middlewares.php:49
|
||||||
|
msgid "Method not found"
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -12,6 +12,8 @@ use Friendica\Core\Hook;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
global $blockem_words;
|
||||||
|
|
||||||
function blockem_install()
|
function blockem_install()
|
||||||
{
|
{
|
||||||
Hook::register('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
|
Hook::register('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
|
||||||
|
@ -141,6 +143,8 @@ function blockem_display_item(App $a, array &$b = null)
|
||||||
|
|
||||||
function blockem_conversation_start(App $a, array &$b)
|
function blockem_conversation_start(App $a, array &$b)
|
||||||
{
|
{
|
||||||
|
global $blockem_words;
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -148,7 +152,7 @@ function blockem_conversation_start(App $a, array &$b)
|
||||||
$words = DI::pConfig()->get(local_user(), 'blockem', 'words');
|
$words = DI::pConfig()->get(local_user(), 'blockem', 'words');
|
||||||
|
|
||||||
if ($words) {
|
if ($words) {
|
||||||
$a->data['blockem'] = explode(',', $words);
|
$blockem_words = explode(',', $words);
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= <<< EOT
|
DI::page()['htmlhead'] .= <<< EOT
|
||||||
|
@ -171,6 +175,8 @@ EOT;
|
||||||
|
|
||||||
function blockem_item_photo_menu(App $a, array &$b)
|
function blockem_item_photo_menu(App $a, array &$b)
|
||||||
{
|
{
|
||||||
|
global $blockem_words;
|
||||||
|
|
||||||
if (!local_user() || $b['item']['self']) {
|
if (!local_user() || $b['item']['self']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -178,8 +184,8 @@ function blockem_item_photo_menu(App $a, array &$b)
|
||||||
$blocked = false;
|
$blocked = false;
|
||||||
$author = $b['item']['author-link'];
|
$author = $b['item']['author-link'];
|
||||||
|
|
||||||
if (!empty($a->data['blockem'])) {
|
if (!empty($blockem_words)) {
|
||||||
foreach($a->data['blockem'] as $bloke) {
|
foreach($blockem_words as $bloke) {
|
||||||
if (Strings::compareLink($bloke,$author)) {
|
if (Strings::compareLink($bloke,$author)) {
|
||||||
$blocked = true;
|
$blocked = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,14 +43,14 @@ function buffer_content(App $a)
|
||||||
require_once "mod/settings.php";
|
require_once "mod/settings.php";
|
||||||
settings_init($a);
|
settings_init($a);
|
||||||
|
|
||||||
if (isset($a->argv[1])) {
|
if (isset(DI::args()->getArgv()[1])) {
|
||||||
switch ($a->argv[1]) {
|
switch (DI::args()->getArgv()[1]) {
|
||||||
case "connect":
|
case "connect":
|
||||||
$o = buffer_connect($a);
|
$o = buffer_connect($a);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$o = print_r($a->argv, true);
|
$o = print_r(DI::args()->getArgv(), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:17+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
|
@ -142,12 +142,12 @@ function catavatar_module() {}
|
||||||
*/
|
*/
|
||||||
function catavatar_content(App $a)
|
function catavatar_content(App $a)
|
||||||
{
|
{
|
||||||
if ($a->argc < 2 || $a->argc > 3) {
|
if (DI::args()->getArgc() < 2 || DI::args()->getArgc() > 3) {
|
||||||
throw new NotFoundException(); // this should be catched on index and show default "not found" page.
|
throw new NotFoundException(); // this should be catched on index and show default "not found" page.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_numeric($a->argv[1])) {
|
if (is_numeric(DI::args()->getArgv()[1])) {
|
||||||
$uid = intval($a->argv[1]);
|
$uid = intval(DI::args()->getArgv()[1]);
|
||||||
$condition = ['uid' => $uid,
|
$condition = ['uid' => $uid,
|
||||||
'account_expired' => false, 'account_removed' => false];
|
'account_expired' => false, 'account_removed' => false];
|
||||||
$user = DBA::selectFirst('user', ['email'], $condition);
|
$user = DBA::selectFirst('user', ['email'], $condition);
|
||||||
|
@ -157,15 +157,15 @@ function catavatar_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
$seed = DI::pConfig()->get($uid, "catavatar", "seed", md5(trim(strtolower($user['email']))));
|
$seed = DI::pConfig()->get($uid, "catavatar", "seed", md5(trim(strtolower($user['email']))));
|
||||||
} elseif (!empty($a->argv[1])) {
|
} elseif (!empty(DI::args()->getArgv()[1])) {
|
||||||
$seed = $a->argv[1];
|
$seed = DI::args()->getArgv()[1];
|
||||||
} else {
|
} else {
|
||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$size = 0;
|
$size = 0;
|
||||||
if ($a->argc == 3) {
|
if (DI::args()->getArgc() == 3) {
|
||||||
$size = intval($a->argv[2]);
|
$size = intval(DI::args()->getArgv()[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ...Or start generation
|
// ...Or start generation
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:16+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -17,38 +17,38 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: catavatar.php:48
|
#: catavatar.php:49
|
||||||
msgid "Use Cat as Avatar"
|
msgid "Use Cat as Avatar"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:49
|
#: catavatar.php:50
|
||||||
msgid "More Random Cat!"
|
msgid "More Random Cat!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:50
|
#: catavatar.php:51
|
||||||
msgid "Reset to email Cat"
|
msgid "Reset to email Cat"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:52
|
#: catavatar.php:53
|
||||||
msgid "Cat Avatar Settings"
|
msgid "Cat Avatar Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:53
|
#: catavatar.php:54
|
||||||
msgid "Set default profile avatar or randomize the cat."
|
msgid "Set default profile avatar or randomize the cat."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:78
|
#: catavatar.php:72
|
||||||
msgid "The cat hadn't found itself."
|
msgid "The cat hadn't found itself."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:87
|
#: catavatar.php:81
|
||||||
msgid "There was an error, the cat ran away."
|
msgid "There was an error, the cat ran away."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:93
|
#: catavatar.php:87
|
||||||
msgid "Profile Photos"
|
msgid "Profile Photos"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:108
|
#: catavatar.php:97
|
||||||
msgid "Meow!"
|
msgid "Meow!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -18,6 +18,8 @@ use Friendica\Model\Profile;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
global $forumdirectory_search;
|
||||||
|
|
||||||
function forumdirectory_install()
|
function forumdirectory_install()
|
||||||
{
|
{
|
||||||
Hook::register('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu');
|
Hook::register('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu');
|
||||||
|
@ -42,13 +44,17 @@ function forumdirectory_init(App $a)
|
||||||
|
|
||||||
function forumdirectory_post(App $a)
|
function forumdirectory_post(App $a)
|
||||||
{
|
{
|
||||||
|
global $forumdirectory_search;
|
||||||
|
|
||||||
if (!empty($_POST['search'])) {
|
if (!empty($_POST['search'])) {
|
||||||
$a->data['search'] = $_POST['search'];
|
$forumdirectory_search = $_POST['search'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function forumdirectory_content(App $a)
|
function forumdirectory_content(App $a)
|
||||||
{
|
{
|
||||||
|
global $forumdirectory_search;
|
||||||
|
|
||||||
if ((DI::config()->get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
|
if ((DI::config()->get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
|
||||||
notice(DI::l10n()->t('Public access denied.') . EOL);
|
notice(DI::l10n()->t('Public access denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -59,8 +65,8 @@ function forumdirectory_content(App $a)
|
||||||
|
|
||||||
Nav::setSelected('directory');
|
Nav::setSelected('directory');
|
||||||
|
|
||||||
if (!empty($a->data['search'])) {
|
if (!empty($forumdirectory_search)) {
|
||||||
$search = Strings::escapeTags(trim($a->data['search']));
|
$search = Strings::escapeTags(trim($forumdirectory_search));
|
||||||
} else {
|
} else {
|
||||||
$search = (!empty($_GET['search']) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : '');
|
$search = (!empty($_GET['search']) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : '');
|
||||||
}
|
}
|
||||||
|
@ -111,7 +117,7 @@ function forumdirectory_content(App $a)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBA::isResult($r)) {
|
if (DBA::isResult($r)) {
|
||||||
if (in_array('small', $a->argv)) {
|
if (in_array('small', DI::args()->getArgv())) {
|
||||||
$photo = 'thumb';
|
$photo = 'thumb';
|
||||||
} else {
|
} else {
|
||||||
$photo = 'photo';
|
$photo = 'photo';
|
||||||
|
|
|
@ -88,11 +88,11 @@ function ifttt_settings_post()
|
||||||
|
|
||||||
function ifttt_post(App $a)
|
function ifttt_post(App $a)
|
||||||
{
|
{
|
||||||
if ($a->argc != 2) {
|
if (DI::args()->getArgc() != 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname = $a->argv[1];
|
$nickname = DI::args()->getArgv()[1];
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]);
|
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]);
|
||||||
if (!DBA::isResult($user)) {
|
if (!DBA::isResult($user)) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:17+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
|
@ -14,6 +14,9 @@ use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
global $js_upload_jsonresponse;
|
||||||
|
global $js_upload_result;
|
||||||
|
|
||||||
function js_upload_install()
|
function js_upload_install()
|
||||||
{
|
{
|
||||||
Hook::register('photo_upload_form', __FILE__, 'js_upload_form');
|
Hook::register('photo_upload_form', __FILE__, 'js_upload_form');
|
||||||
|
@ -42,6 +45,8 @@ function js_upload_form(App $a, array &$b)
|
||||||
|
|
||||||
function js_upload_post_init(App $a, &$b)
|
function js_upload_post_init(App $a, &$b)
|
||||||
{
|
{
|
||||||
|
global $js_upload_result, $js_upload_jsonresponse;
|
||||||
|
|
||||||
// list of valid extensions
|
// list of valid extensions
|
||||||
$allowedExtensions = ['jpeg', 'gif', 'png', 'jpg'];
|
$allowedExtensions = ['jpeg', 'gif', 'png', 'jpg'];
|
||||||
|
|
||||||
|
@ -53,7 +58,7 @@ function js_upload_post_init(App $a, &$b)
|
||||||
$result = $uploader->handleUpload();
|
$result = $uploader->handleUpload();
|
||||||
|
|
||||||
// to pass data through iframe you will need to encode all html tags
|
// to pass data through iframe you will need to encode all html tags
|
||||||
$a->data['upload_jsonresponse'] = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
|
$js_upload_jsonresponse = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
|
||||||
|
|
||||||
if (isset($result['error'])) {
|
if (isset($result['error'])) {
|
||||||
Logger::log('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'], Logger::DEBUG);
|
Logger::log('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'], Logger::DEBUG);
|
||||||
|
@ -61,12 +66,14 @@ function js_upload_post_init(App $a, &$b)
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$a->data['upload_result'] = $result;
|
$js_upload_result = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function js_upload_post_file(App $a, &$b)
|
function js_upload_post_file(App $a, &$b)
|
||||||
{
|
{
|
||||||
$result = $a->data['upload_result'];
|
global $js_upload_result;
|
||||||
|
|
||||||
|
$result = $js_upload_result;
|
||||||
|
|
||||||
$b['src'] = $result['path'];
|
$b['src'] = $result['path'];
|
||||||
$b['filename'] = $result['filename'];
|
$b['filename'] = $result['filename'];
|
||||||
|
@ -76,9 +83,11 @@ function js_upload_post_file(App $a, &$b)
|
||||||
|
|
||||||
function js_upload_post_end(App $a, &$b)
|
function js_upload_post_end(App $a, &$b)
|
||||||
{
|
{
|
||||||
|
global $js_upload_jsonresponse;
|
||||||
|
|
||||||
Logger::log('upload_post_end');
|
Logger::log('upload_post_end');
|
||||||
if (!empty($a->data['upload_jsonresponse'])) {
|
if (!empty($js_upload_jsonresponse)) {
|
||||||
echo $a->data['upload_jsonresponse'];
|
echo $js_upload_jsonresponse;
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:16+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -82,11 +82,11 @@ msgstr ""
|
||||||
msgid "Save Settings"
|
msgid "Save Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:981
|
#: pumpio.php:983
|
||||||
msgid "status"
|
msgid "status"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:985
|
#: pumpio.php:987
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "%1$s likes %2$s's %3$s"
|
msgid "%1$s likes %2$s's %3$s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -58,13 +58,13 @@ function pumpio_content(App $a)
|
||||||
require_once("mod/settings.php");
|
require_once("mod/settings.php");
|
||||||
settings_init($a);
|
settings_init($a);
|
||||||
|
|
||||||
if (isset($a->argv[1])) {
|
if (isset(DI::args()->getArgv()[1])) {
|
||||||
switch ($a->argv[1]) {
|
switch (DI::args()->getArgv()[1]) {
|
||||||
case "connect":
|
case "connect":
|
||||||
$o = pumpio_connect($a);
|
$o = pumpio_connect($a);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$o = print_r($a->argv, true);
|
$o = print_r(DI::args()->getArgv(), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:16+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:15+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -17,54 +17,54 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: tumblr.php:39
|
#: tumblr.php:40
|
||||||
msgid "Permission denied."
|
msgid "Permission denied."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:69 tumblr.php:283
|
#: tumblr.php:70 tumblr.php:284
|
||||||
msgid "Save Settings"
|
msgid "Save Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:71
|
#: tumblr.php:72
|
||||||
msgid "Consumer Key"
|
msgid "Consumer Key"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:72
|
#: tumblr.php:73
|
||||||
msgid "Consumer Secret"
|
msgid "Consumer Secret"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:177
|
#: tumblr.php:178
|
||||||
msgid "You are now authenticated to tumblr."
|
msgid "You are now authenticated to tumblr."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:178
|
#: tumblr.php:179
|
||||||
msgid "return to the connector page"
|
msgid "return to the connector page"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:194
|
#: tumblr.php:195
|
||||||
msgid "Post to Tumblr"
|
msgid "Post to Tumblr"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:224 tumblr.php:228
|
#: tumblr.php:225 tumblr.php:229
|
||||||
msgid "Tumblr Export"
|
msgid "Tumblr Export"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:232
|
#: tumblr.php:233
|
||||||
msgid "(Re-)Authenticate your tumblr page"
|
msgid "(Re-)Authenticate your tumblr page"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:236
|
#: tumblr.php:237
|
||||||
msgid "Enable Tumblr Post Addon"
|
msgid "Enable Tumblr Post Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:242
|
#: tumblr.php:243
|
||||||
msgid "Post to Tumblr by default"
|
msgid "Post to Tumblr by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:263
|
#: tumblr.php:264
|
||||||
msgid "Post to page:"
|
msgid "Post to page:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:277
|
#: tumblr.php:278
|
||||||
msgid "You are not authenticated to tumblr"
|
msgid "You are not authenticated to tumblr"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -41,8 +41,8 @@ function tumblr_content(App $a)
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($a->argv[1])) {
|
if (isset(DI::args()->getArgv()[1])) {
|
||||||
switch ($a->argv[1]) {
|
switch (DI::args()->getArgv()[1]) {
|
||||||
case "connect":
|
case "connect":
|
||||||
$o = tumblr_connect($a);
|
$o = tumblr_connect($a);
|
||||||
break;
|
break;
|
||||||
|
@ -52,7 +52,7 @@ function tumblr_content(App $a)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$o = print_r($a->argv, true);
|
$o = print_r(DI::args()->getArgv(), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:16+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:16+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
|
@ -317,8 +317,8 @@ function windowsphonepush_content(App $a)
|
||||||
// Login with the specified Network credentials (like in api.php)
|
// Login with the specified Network credentials (like in api.php)
|
||||||
windowsphonepush_login($a);
|
windowsphonepush_login($a);
|
||||||
|
|
||||||
$path = $a->argv[0];
|
$path = DI::args()->getArgv()[0];
|
||||||
$path2 = $a->argv[1];
|
$path2 = DI::args()->getArgv()[1];
|
||||||
if ($path == "windowsphonepush") {
|
if ($path == "windowsphonepush") {
|
||||||
switch ($path2) {
|
switch ($path2) {
|
||||||
case "show_settings":
|
case "show_settings":
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-02-01 18:16+0100\n"
|
"POT-Creation-Date: 2021-07-25 13:16+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
|
@ -170,7 +170,7 @@ function xmpp_converse(App $a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($a->argv[0], ["delegation", "logout"])) {
|
if (in_array(DI::args()->getArgv()[0], ["delegation", "logout"])) {
|
||||||
$additional_commands = "converse.user.logout();\n";
|
$additional_commands = "converse.user.logout();\n";
|
||||||
} else {
|
} else {
|
||||||
$additional_commands = "";
|
$additional_commands = "";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user