Merge pull request #1210 from MrPetovan/task/10978-settings-keyboard-actionable
[various] Convert connector/addon_settings hook functions to the new data format
This commit is contained in:
commit
d8c393b57a
147 changed files with 1747 additions and 2690 deletions
|
|
@ -159,19 +159,17 @@ function advancedcontentfilter_prepare_body_content_filter(App $a, &$hook_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function advancedcontentfilter_addon_settings(App $a, &$s)
|
function advancedcontentfilter_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$advancedcontentfilter = DI::l10n()->t('Advanced Content Filter');
|
$data = [
|
||||||
|
'addon' => 'advancedcontentfilter',
|
||||||
$s .= <<<HTML
|
'title' => DI::l10n()->t('Advanced Content Filter'),
|
||||||
<span class="settings-block fakelink" style="display: block;"><h3><a href="advancedcontentfilter">$advancedcontentfilter <i class="glyphicon glyphicon-share"></i></a></h3></span>
|
'href' => 'advancedcontentfilter',
|
||||||
HTML;
|
];
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -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-07-25 13:15+0000\n"
|
"POT-Creation-Date: 2021-11-21 19:13-0500\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,28 +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"
|
||||||
|
|
||||||
#: advancedcontentfilter.php:153
|
#: advancedcontentfilter.php:154
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Filtered by rule: %s"
|
msgid "Filtered by rule: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:167 advancedcontentfilter.php:224
|
#: advancedcontentfilter.php:170 advancedcontentfilter.php:225
|
||||||
msgid "Advanced Content Filter"
|
msgid "Advanced Content Filter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:223
|
#: advancedcontentfilter.php:224
|
||||||
msgid "Back to Addon Settings"
|
msgid "Back to Addon Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:225
|
#: advancedcontentfilter.php:226
|
||||||
msgid "Add a Rule"
|
msgid "Add a Rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:226
|
#: advancedcontentfilter.php:227
|
||||||
msgid "Help"
|
msgid "Help"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:227
|
#: advancedcontentfilter.php:228
|
||||||
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. "
|
||||||
|
|
@ -46,108 +46,108 @@ msgid ""
|
||||||
"the help page."
|
"the help page."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:228
|
#: advancedcontentfilter.php:229
|
||||||
msgid "Your rules"
|
msgid "Your rules"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:229
|
#: advancedcontentfilter.php:230
|
||||||
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:230
|
#: advancedcontentfilter.php:231
|
||||||
msgid "Disabled"
|
msgid "Disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:231
|
#: advancedcontentfilter.php:232
|
||||||
msgid "Enabled"
|
msgid "Enabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:232
|
#: advancedcontentfilter.php:233
|
||||||
msgid "Disable this rule"
|
msgid "Disable this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:233
|
#: advancedcontentfilter.php:234
|
||||||
msgid "Enable this rule"
|
msgid "Enable this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:234
|
#: advancedcontentfilter.php:235
|
||||||
msgid "Edit this rule"
|
msgid "Edit this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:235
|
#: advancedcontentfilter.php:236
|
||||||
msgid "Edit the rule"
|
msgid "Edit the rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:236
|
#: advancedcontentfilter.php:237
|
||||||
msgid "Save this rule"
|
msgid "Save this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:237
|
#: advancedcontentfilter.php:238
|
||||||
msgid "Delete this rule"
|
msgid "Delete this rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:238
|
#: advancedcontentfilter.php:239
|
||||||
msgid "Rule"
|
msgid "Rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:239
|
#: advancedcontentfilter.php:240
|
||||||
msgid "Close"
|
msgid "Close"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:240
|
#: advancedcontentfilter.php:241
|
||||||
msgid "Add new rule"
|
msgid "Add new rule"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:241
|
#: advancedcontentfilter.php:242
|
||||||
msgid "Rule Name"
|
msgid "Rule Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:242
|
#: advancedcontentfilter.php:243
|
||||||
msgid "Rule Expression"
|
msgid "Rule Expression"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:243
|
#: advancedcontentfilter.php:244
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:310 advancedcontentfilter.php:321
|
#: advancedcontentfilter.php:312 advancedcontentfilter.php:323
|
||||||
#: advancedcontentfilter.php:332 advancedcontentfilter.php:366
|
#: advancedcontentfilter.php:334 advancedcontentfilter.php:370
|
||||||
#: advancedcontentfilter.php:395 advancedcontentfilter.php:416
|
#: advancedcontentfilter.php:401 advancedcontentfilter.php:424
|
||||||
msgid "You must be logged in to use this method"
|
msgid "You must be logged in to use this method"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:336 advancedcontentfilter.php:370
|
#: advancedcontentfilter.php:338 advancedcontentfilter.php:374
|
||||||
#: advancedcontentfilter.php:399
|
#: advancedcontentfilter.php:405
|
||||||
msgid "Invalid form security token, please refresh the page."
|
msgid "Invalid form security token, please refresh the page."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:348
|
#: advancedcontentfilter.php:350
|
||||||
msgid "The rule name and expression are required."
|
msgid "The rule name and expression are required."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:360
|
#: advancedcontentfilter.php:364
|
||||||
msgid "Rule successfully added"
|
msgid "Rule successfully added"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:374 advancedcontentfilter.php:403
|
#: advancedcontentfilter.php:378 advancedcontentfilter.php:409
|
||||||
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:389
|
#: advancedcontentfilter.php:395
|
||||||
msgid "Rule successfully updated"
|
msgid "Rule successfully updated"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:410
|
#: advancedcontentfilter.php:418
|
||||||
msgid "Rule successfully deleted"
|
msgid "Rule successfully deleted"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:420
|
#: advancedcontentfilter.php:428
|
||||||
msgid "Missing argument: guid."
|
msgid "Missing argument: guid."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: advancedcontentfilter.php:428
|
#: advancedcontentfilter.php:436
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Unknown post with guid: %s"
|
msgid "Unknown post with guid: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ define("BIRDAVATAR_SIZE", 256);
|
||||||
*/
|
*/
|
||||||
function birdavatar_install()
|
function birdavatar_install()
|
||||||
{
|
{
|
||||||
Hook::register('avatar_lookup', 'addon/birdavatar/birdavatar.php', 'birdavatar_lookup');
|
Hook::register('avatar_lookup', __FILE__, 'birdavatar_lookup');
|
||||||
Hook::register('addon_settings', 'addon/birdavatar/birdavatar.php', 'birdavatar_addon_settings');
|
Hook::register('addon_settings', __FILE__, 'birdavatar_addon_settings');
|
||||||
Hook::register('addon_settings_post', 'addon/birdavatar/birdavatar.php', 'birdavatar_addon_settings_post');
|
Hook::register('addon_settings_post', __FILE__, 'birdavatar_addon_settings_post');
|
||||||
|
|
||||||
Logger::log('registered birdavatar');
|
Logger::log('registered birdavatar');
|
||||||
}
|
}
|
||||||
|
|
@ -34,24 +34,29 @@ function birdavatar_install()
|
||||||
/**
|
/**
|
||||||
* Bird avatar user settings page
|
* Bird avatar user settings page
|
||||||
*/
|
*/
|
||||||
function birdavatar_addon_settings(App $a, &$s)
|
function birdavatar_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/birdavatar/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/birdavatar/');
|
||||||
$s .= Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$postpost' => !empty($_POST['birdavatar-morebird']) || !empty($_POST['birdavatar-emailbird']),
|
|
||||||
'$uncache' => time(),
|
'$uncache' => time(),
|
||||||
'$uid' => local_user(),
|
'$uid' => local_user(),
|
||||||
'$usebird' => DI::l10n()->t('Use Bird as Avatar'),
|
|
||||||
'$morebird' => DI::l10n()->t('More Random Bird!'),
|
|
||||||
'$emailbird' => DI::l10n()->t('Reset to email Bird'),
|
|
||||||
'$seed' => DI::pConfig()->get(local_user(), 'birdavatar', 'seed', false),
|
|
||||||
'$header' => DI::l10n()->t('Bird Avatar Settings'),
|
|
||||||
'$setrandomize' => DI::l10n()->t('Set default profile avatar or randomize the bird.'),
|
'$setrandomize' => DI::l10n()->t('Set default profile avatar or randomize the bird.'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'birdavar',
|
||||||
|
'title' => DI::l10n()->t('Bird Avatar Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
'submit' => [
|
||||||
|
'birdavatar-usebird' => DI::l10n()->t('Use Bird as Avatar'),
|
||||||
|
'birdavatar-morebird' => DI::l10n()->t('More Random Bird!'),
|
||||||
|
'birdavatar-emailbird' => DI::pConfig()->get(local_user(), 'birdavatar', 'seed', false) ? DI::l10n()->t('Reset to email Bird') : null,
|
||||||
|
],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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-11-24 12:04+0100\n"
|
"POT-Creation-Date: 2021-11-24 08:50-0500\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"
|
||||||
|
|
||||||
#: birdavatar.php:49
|
#: birdavatar.php:47
|
||||||
msgid "Use Bird as Avatar"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: birdavatar.php:50
|
|
||||||
msgid "More Random Bird!"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: birdavatar.php:51
|
|
||||||
msgid "Reset to email Bird"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: birdavatar.php:53
|
|
||||||
msgid "Bird Avatar Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: birdavatar.php:54
|
|
||||||
msgid "Set default profile avatar or randomize the bird."
|
msgid "Set default profile avatar or randomize the bird."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: birdavatar.php:72
|
#: birdavatar.php:52
|
||||||
|
msgid "Bird Avatar Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: birdavatar.php:55
|
||||||
|
msgid "Use Bird as Avatar"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: birdavatar.php:56
|
||||||
|
msgid "More Random Bird!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: birdavatar.php:57
|
||||||
|
msgid "Reset to email Bird"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: birdavatar.php:76
|
||||||
msgid "The bird has not found itself."
|
msgid "The bird has not found itself."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: birdavatar.php:81
|
#: birdavatar.php:85
|
||||||
msgid "There was an error, the bird flew away."
|
msgid "There was an error, the bird flew away."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: birdavatar.php:87
|
#: birdavatar.php:91
|
||||||
msgid "Profile Photos"
|
msgid "Profile Photos"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: birdavatar.php:97
|
#: birdavatar.php:101
|
||||||
msgid "Meow!"
|
msgid "Meow!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,2 @@
|
||||||
<span id="settings_birdavatar_inflated" class="settings-block fakelink"
|
<p>{{$setrandomize}}</p>
|
||||||
style="{{if $postpost}}display: none;{{else}}display: block;{{/if}}"
|
<p><img src="{{$basepath}}/birdavatar/{{$uid}}?{{$uncache}}"></p>
|
||||||
onclick="openClose('settings_birdavatar_expanded'); openClose('settings_birdavatar_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_birdavatar_expanded" class="settings-block"
|
|
||||||
style="{{if $postpost}}display: block;{{else}}display: none;{{/if}}">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_birdavatar_expanded'); openClose('settings_birdavatar_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<img src="{{$basepath}}/birdavatar/{{$uid}}?{{$uncache}}">
|
|
||||||
<p>{{$setrandomize}}</p>
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<button type="submit" name="birdavatar-usebird"
|
|
||||||
class="btn btn-primary settings-submit" value="{{$usebird}}">{{$usebird}}</button>
|
|
||||||
|
|
||||||
<div class="btn-group" role="group" aria-label="...">
|
|
||||||
<button type="submit" name="birdavatar-morebird"
|
|
||||||
class="btn btn-default settings-submit" value="{{$morebird}}">{{$morebird}}</button>
|
|
||||||
<button type="submit" name="birdavatar-emailbird" {{if !$seed}}disabled{{/if}}
|
|
||||||
class="btn btn-default settings-submit" value="{{$emailbird}}">{{$emailbird}}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
|
|
||||||
#blockem-label {
|
|
||||||
float: left;
|
|
||||||
width: 300px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#blockem-words {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
width: 400px;
|
|
||||||
height: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#blockem-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
|
@ -25,39 +26,25 @@ function blockem_install()
|
||||||
Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store');
|
Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store');
|
||||||
}
|
}
|
||||||
|
|
||||||
function blockem_addon_settings (App $a, &$s)
|
function blockem_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$words = DI::pConfig()->get(local_user(), 'blockem', 'words', '');
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
$words = DI::pConfig()->get(local_user(), 'blockem', 'words');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/blockem/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
if (!$words) {
|
'$info' => DI::l10n()->t("Hides user's content by collapsing posts. Also replaces their avatar with generic image."),
|
||||||
$words = '';
|
'$words' => ['blockem-words', DI::l10n()->t('Comma separated profile URLS:'), $words],
|
||||||
}
|
]);
|
||||||
|
|
||||||
$s .= '<span id="settings_blockem_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_blockem_expanded\'); openClose(\'settings_blockem_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Blockem') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_blockem_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_blockem_expanded\'); openClose(\'settings_blockem_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Blockem') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="blockem-wrapper">';
|
|
||||||
$s .= '<div id="blockem-desc">'. DI::l10n()->t("Hides user's content by collapsing posts. Also replaces their avatar with generic image.") . ' </div>';
|
|
||||||
$s .= '<label id="blockem-label" for="blockem-words">' . DI::l10n()->t('Comma separated profile URLS:') . ' </label>';
|
|
||||||
$s .= '<textarea id="blockem-words" type="text" name="blockem-words" >' . htmlspecialchars($words) . '</textarea>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="blockem-submit" name="blockem-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'blockem',
|
||||||
|
'title' => DI::l10n()->t('Blockem'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function blockem_addon_settings_post(App $a, array &$b)
|
function blockem_addon_settings_post(App $a, array &$b)
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:13-0500\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,33 +17,29 @@ 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"
|
||||||
|
|
||||||
#: blockem.php:42 blockem.php:46
|
#: blockem.php:39
|
||||||
msgid "Blockem"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: blockem.php:50
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
"Hides user's content by collapsing posts. Also replaces their avatar with "
|
||||||
"generic image."
|
"generic image."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: blockem.php:51
|
#: blockem.php:40
|
||||||
msgid "Comma separated profile URLS:"
|
msgid "Comma separated profile URLS:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: blockem.php:55
|
#: blockem.php:45
|
||||||
msgid "Save Settings"
|
msgid "Blockem"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: blockem.php:131
|
#: blockem.php:120
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Filtered user: %s"
|
msgid "Filtered user: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: blockem.php:190
|
#: blockem.php:183
|
||||||
msgid "Unblock Author"
|
msgid "Unblock Author"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: blockem.php:192
|
#: blockem.php:185
|
||||||
msgid "Block Author"
|
msgid "Block Author"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
1
blockem/templates/settings.tpl
Normal file
1
blockem/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_textarea.tpl" field=$words}}
|
||||||
|
|
@ -25,9 +25,9 @@ define("CATAVATAR_SIZE", 256);
|
||||||
*/
|
*/
|
||||||
function catavatar_install()
|
function catavatar_install()
|
||||||
{
|
{
|
||||||
Hook::register('avatar_lookup', 'addon/catavatar/catavatar.php', 'catavatar_lookup');
|
Hook::register('avatar_lookup', __FILE__, 'catavatar_lookup');
|
||||||
Hook::register('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings');
|
Hook::register('addon_settings', __FILE__, 'catavatar_addon_settings');
|
||||||
Hook::register('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post');
|
Hook::register('addon_settings_post', __FILE__, 'catavatar_addon_settings_post');
|
||||||
|
|
||||||
Logger::notice('registered catavatar');
|
Logger::notice('registered catavatar');
|
||||||
}
|
}
|
||||||
|
|
@ -35,24 +35,29 @@ function catavatar_install()
|
||||||
/**
|
/**
|
||||||
* Cat avatar user settings page
|
* Cat avatar user settings page
|
||||||
*/
|
*/
|
||||||
function catavatar_addon_settings(App $a, &$s)
|
function catavatar_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/catavatar/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/catavatar/');
|
||||||
$s .= Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$postpost' => !empty($_POST['catavatar-morecat']) || !empty($_POST['catavatar-emailcat']),
|
|
||||||
'$uncache' => time(),
|
'$uncache' => time(),
|
||||||
'$uid' => local_user(),
|
'$uid' => local_user(),
|
||||||
'$usecat' => DI::l10n()->t('Use Cat as Avatar'),
|
|
||||||
'$morecat' => DI::l10n()->t('More Random Cat!'),
|
|
||||||
'$emailcat' => DI::l10n()->t('Reset to email Cat'),
|
|
||||||
'$seed' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false),
|
|
||||||
'$header' => DI::l10n()->t('Cat Avatar Settings'),
|
|
||||||
'$setrandomize' => DI::l10n()->t('Set default profile avatar or randomize the cat.'),
|
'$setrandomize' => DI::l10n()->t('Set default profile avatar or randomize the cat.'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'catavar',
|
||||||
|
'title' => DI::l10n()->t('Cat Avatar Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
'submit' => [
|
||||||
|
'catavatar-usecat' => DI::l10n()->t('Use Cat as Avatar'),
|
||||||
|
'catavatar-morecat' => DI::l10n()->t('Another random Cat!'),
|
||||||
|
'catavatar-emailcat' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
|
||||||
|
],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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-07-25 13:16+0000\n"
|
"POT-Creation-Date: 2021-11-21 19:14-0500\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:49
|
#: catavatar.php:48
|
||||||
msgid "Use Cat as Avatar"
|
msgid "Set default profile avatar or randomize the cat."
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: catavatar.php:50
|
|
||||||
msgid "More Random Cat!"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: catavatar.php:51
|
|
||||||
msgid "Reset to email Cat"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:53
|
#: catavatar.php:53
|
||||||
msgid "Cat Avatar Settings"
|
msgid "Cat Avatar Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:54
|
#: catavatar.php:56
|
||||||
msgid "Set default profile avatar or randomize the cat."
|
msgid "Use Cat as Avatar"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:72
|
#: catavatar.php:57
|
||||||
|
msgid "Another random Cat!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: catavatar.php:58
|
||||||
|
msgid "Reset to email Cat"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: catavatar.php:77
|
||||||
msgid "The cat hadn't found itself."
|
msgid "The cat hadn't found itself."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:81
|
#: catavatar.php:86
|
||||||
msgid "There was an error, the cat ran away."
|
msgid "There was an error, the cat ran away."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:87
|
#: catavatar.php:92
|
||||||
msgid "Profile Photos"
|
msgid "Profile Photos"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: catavatar.php:97
|
#: catavatar.php:102
|
||||||
msgid "Meow!"
|
msgid "Meow!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,2 @@
|
||||||
<span id="settings_catavatar_inflated" class="settings-block fakelink"
|
<p>{{$setrandomize}}</p>
|
||||||
style="{{if $postpost}}display: none;{{else}}display: block;{{/if}}"
|
<p><img src="{{$basepath}}/catavatar/{{$uid}}?{{$uncache}}"></p>
|
||||||
onclick="openClose('settings_catavatar_expanded'); openClose('settings_catavatar_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_catavatar_expanded" class="settings-block"
|
|
||||||
style="{{if $postpost}}display: block;{{else}}display: none;{{/if}}">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_catavatar_expanded'); openClose('settings_catavatar_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<img src="{{$basepath}}/catavatar/{{$uid}}?{{$uncache}}">
|
|
||||||
<p>{{$setrandomize}}</p>
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<button type="submit" name="catavatar-usecat"
|
|
||||||
class="btn btn-primary settings-submit" value="{{$usecat}}">{{$usecat}}</button>
|
|
||||||
|
|
||||||
<div class="btn-group" role="group" aria-label="...">
|
|
||||||
<button type="submit" name="catavatar-morecat"
|
|
||||||
class="btn btn-default settings-submit" value="{{$morecat}}">{{$morecat}}</button>
|
|
||||||
<button type="submit" name="catavatar-emailcat" {{if !$seed}}disabled{{/if}}
|
|
||||||
class="btn btn-default settings-submit" value="{{$emailcat}}">{{$emailcat}}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -85,11 +85,8 @@ function cookienotice_addon_admin_post(App $a)
|
||||||
*/
|
*/
|
||||||
function cookienotice_page_content_top(App $a, &$b)
|
function cookienotice_page_content_top(App $a, &$b)
|
||||||
{
|
{
|
||||||
$stylesheetPath = __DIR__ . '/cookienotice.css';
|
DI::page()->registerStylesheet(__DIR__ . '/cookienotice.css');
|
||||||
$footerscriptPath = __DIR__ . '/cookienotice.js';
|
DI::page()->registerFooterScript(__DIR__ . '/cookienotice.js');
|
||||||
|
|
||||||
DI::page()->registerStylesheet($stylesheetPath);
|
|
||||||
DI::page()->registerFooterScript($footerscriptPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -164,40 +164,38 @@ function curweather_addon_settings_post(App $a, $post)
|
||||||
DI::pConfig()->set(local_user(), 'curweather', 'curweather_units' , trim($_POST['curweather_units']));
|
DI::pConfig()->set(local_user(), 'curweather', 'curweather_units' , trim($_POST['curweather_units']));
|
||||||
}
|
}
|
||||||
|
|
||||||
function curweather_addon_settings(App $a, &$s)
|
function curweather_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
$curweather_loc = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc');
|
$curweather_loc = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc');
|
||||||
$curweather_units = DI::pConfig()->get(local_user(), 'curweather', 'curweather_units');
|
$curweather_units = DI::pConfig()->get(local_user(), 'curweather', 'curweather_units');
|
||||||
$appid = DI::config()->get('curweather', 'appid');
|
$appid = DI::config()->get('curweather', 'appid');
|
||||||
|
|
||||||
if ($appid == "") {
|
if ($appid == '') {
|
||||||
$noappidtext = DI::l10n()->t('No APPID found, please contact your admin to obtain one.');
|
$noappidtext = DI::l10n()->t('No APPID found, please contact your admin to obtain one.');
|
||||||
} else {
|
} else {
|
||||||
$noappidtext = '';
|
$noappidtext = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$enable = intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable'));
|
$enabled = intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable'));
|
||||||
$enable_checked = (($enable) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
// load template and replace the macros
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/curweather/');
|
||||||
$t = Renderer::getMarkupTemplate("settings.tpl", "addon/curweather/" );
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
|
||||||
$s = Renderer::replaceMacros($t, [
|
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
'$header' => DI::l10n()->t('Current Weather').' '.DI::l10n()->t('Settings'),
|
|
||||||
'$noappidtext' => $noappidtext,
|
'$noappidtext' => $noappidtext,
|
||||||
'$info' => DI::l10n()->t('Enter either the name of your location or the zip code.'),
|
'$info' => DI::l10n()->t('Enter either the name of your location or the zip code.'),
|
||||||
'$curweather_loc' => [ 'curweather_loc', DI::l10n()->t('Your Location'), $curweather_loc, DI::l10n()->t('Identifier of your location (name or zip code), e.g. <em>Berlin,DE</em> or <em>14476,DE</em>.') ],
|
'$curweather_loc' => ['curweather_loc', DI::l10n()->t('Your Location'), $curweather_loc, DI::l10n()->t('Identifier of your location (name or zip code), e.g. <em>Berlin,DE</em> or <em>14476,DE</em>.')],
|
||||||
'$curweather_units' => [ 'curweather_units', DI::l10n()->t('Units'), $curweather_units, DI::l10n()->t('select if the temperature should be displayed in °C or °F'), ['metric'=>'°C', 'imperial'=>'°F']],
|
'$curweather_units' => ['curweather_units', DI::l10n()->t('Units'), $curweather_units, DI::l10n()->t('select if the temperature should be displayed in °C or °F'), ['metric' => '°C', 'imperial' => '°F']],
|
||||||
'$enabled' => [ 'curweather_enable', DI::l10n()->t('Show weather data'), $enable, '']
|
'$enabled' => ['curweather_enable', DI::l10n()->t('Show weather data'), $enabled, ''],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return;
|
$data = [
|
||||||
|
'addon' => 'curweather',
|
||||||
|
'title' => DI::l10n()->t('Current Weather Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config stuff for the admin panel to let the admin of the node set a APPID
|
// Config stuff for the admin panel to let the admin of the node set a APPID
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:14-0500\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"
|
||||||
|
|
@ -21,7 +21,7 @@ msgstr ""
|
||||||
msgid "Error fetching weather data. Error was: "
|
msgid "Error fetching weather data. Error was: "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:130 curweather.php:192
|
#: curweather.php:130
|
||||||
msgid "Current Weather"
|
msgid "Current Weather"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
@ -57,66 +57,66 @@ msgstr ""
|
||||||
msgid "at OpenWeatherMap"
|
msgid "at OpenWeatherMap"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:179
|
#: curweather.php:178
|
||||||
msgid "No APPID found, please contact your admin to obtain one."
|
msgid "No APPID found, please contact your admin to obtain one."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:191 curweather.php:229
|
#: curweather.php:188
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: curweather.php:192
|
|
||||||
msgid "Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: curweather.php:194
|
|
||||||
msgid "Enter either the name of your location or the zip code."
|
msgid "Enter either the name of your location or the zip code."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:195
|
#: curweather.php:189
|
||||||
msgid "Your Location"
|
msgid "Your Location"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:195
|
#: curweather.php:189
|
||||||
msgid ""
|
msgid ""
|
||||||
"Identifier of your location (name or zip code), e.g. <em>Berlin,DE</em> or "
|
"Identifier of your location (name or zip code), e.g. <em>Berlin,DE</em> or "
|
||||||
"<em>14476,DE</em>."
|
"<em>14476,DE</em>."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:196
|
#: curweather.php:190
|
||||||
msgid "Units"
|
msgid "Units"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:196
|
#: curweather.php:190
|
||||||
msgid "select if the temperature should be displayed in °C or °F"
|
msgid "select if the temperature should be displayed in °C or °F"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:197
|
#: curweather.php:191
|
||||||
msgid "Show weather data"
|
msgid "Show weather data"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:232
|
#: curweather.php:196
|
||||||
|
msgid "Current Weather Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: curweather.php:227
|
||||||
|
msgid "Save Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: curweather.php:230
|
||||||
msgid "Caching Interval"
|
msgid "Caching Interval"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:234
|
#: curweather.php:232
|
||||||
msgid ""
|
msgid ""
|
||||||
"For how long should the weather data be cached? Choose according your "
|
"For how long should the weather data be cached? Choose according your "
|
||||||
"OpenWeatherMap account type."
|
"OpenWeatherMap account type."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:235
|
#: curweather.php:233
|
||||||
msgid "no cache"
|
msgid "no cache"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:236 curweather.php:237 curweather.php:238 curweather.php:239
|
#: curweather.php:234 curweather.php:235 curweather.php:236 curweather.php:237
|
||||||
msgid "minutes"
|
msgid "minutes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:242
|
#: curweather.php:240
|
||||||
msgid "Your APPID"
|
msgid "Your APPID"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: curweather.php:242
|
#: curweather.php:240
|
||||||
msgid "Your API key provided by OpenWeatherMap"
|
msgid "Your API key provided by OpenWeatherMap"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,6 @@
|
||||||
<span id="settings_curweather_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_curweather_expanded'); openClose('settings_curweather_inflated');">
|
{{if $noappidtext}}
|
||||||
<h3>{{$header}}</h3>
|
<p style="color: red; font-weight: bold;">{{$noappidtext}}</p>
|
||||||
</span>
|
{{/if}}
|
||||||
<div id="settings_curweather_expanded" class="settings-block" style="display: none;">
|
{{include file="field_input.tpl" field=$curweather_loc}}
|
||||||
<span class="fakelink" onclick="openClose('settings_curweather_expanded'); openClose('settings_curweather_inflated');">
|
{{include file="field_select.tpl" field=$curweather_units}}
|
||||||
<h3>{{$header}}</h3>
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
</span>
|
|
||||||
<div style="color: red; font-weight: bold;">{{$noappidtext}}</div>
|
|
||||||
{{include file="field_input.tpl" field=$curweather_loc}}
|
|
||||||
{{include file="field_select.tpl" field=$curweather_units}}
|
|
||||||
{{include file="field_checkbox.tpl" field=$enabled}}
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" id="curweather-settings-submit" name="curweather-settings-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
#diaspora-enable-label, #diaspora-username-label, #diaspora-password-label, #diaspora-bydefault-label, #diaspora-aspect-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#diaspora-checkbox, #diaspora-username, #diaspora-password, #diaspora-bydefault, #diaspora-aspect {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#diaspora-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -48,20 +48,18 @@ function diaspora_jot_nets(App $a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function diaspora_settings(App $a, &$s)
|
function diaspora_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (! local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
$enabled = DI::pConfig()->get(local_user(), 'diaspora', 'post', false);
|
||||||
|
$def_enabled = DI::pConfig()->get(local_user(), 'diaspora', 'post_by_default');
|
||||||
$enabled = DI::pConfig()->get(local_user(),'diaspora','post');
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(),'diaspora','post_by_default');
|
|
||||||
|
|
||||||
$handle = DI::pConfig()->get(local_user(), 'diaspora', 'handle');
|
$handle = DI::pConfig()->get(local_user(), 'diaspora', 'handle');
|
||||||
$password = DI::pConfig()->get(local_user(), 'diaspora', 'password');
|
$password = DI::pConfig()->get(local_user(), 'diaspora', 'password');
|
||||||
$aspect = DI::pConfig()->get(local_user(),'diaspora','aspect');
|
$aspect = DI::pConfig()->get(local_user(), 'diaspora', 'aspect');
|
||||||
|
|
||||||
$info = '';
|
$info = '';
|
||||||
$error = '';
|
$error = '';
|
||||||
|
|
@ -93,23 +91,30 @@ function diaspora_settings(App $a, &$s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::page()->registerStylesheet('addon/diaspora/diaspora.css');
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/diaspora/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$l10n' => [
|
||||||
|
'info_header' => DI::l10n()->t('Information'),
|
||||||
|
'error_header' => DI::l10n()->t('Error'),
|
||||||
|
],
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/diaspora/');
|
|
||||||
$s .= Renderer::replaceMacros($t, [
|
|
||||||
'$header' => DI::l10n()->t('Diaspora Export'),
|
|
||||||
'$info_header' => DI::l10n()->t('Information'),
|
|
||||||
'$error_header' => DI::l10n()->t('Error'),
|
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
'$info' => $info,
|
'$info' => $info,
|
||||||
'$error' => $error,
|
'$error' => $error,
|
||||||
'$enabled' => $enabled,
|
|
||||||
'$enabled_checkbox' => ['enabled', DI::l10n()->t('Enable Diaspora Post Addon'), $enabled],
|
'$enabled' => ['enabled', DI::l10n()->t('Enable Diaspora Post Addon'), $enabled],
|
||||||
'$handle' => ['handle', DI::l10n()->t('Diaspora handle'), $handle, null, null, 'placeholder="user@domain.tld"'],
|
'$handle' => ['handle', DI::l10n()->t('Diaspora handle'), $handle, null, null, 'placeholder="user@domain.tld"'],
|
||||||
'$password' => ['password', DI::l10n()->t('Diaspora password'), '', DI::l10n()->t('Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it.')],
|
'$password' => ['password', DI::l10n()->t('Diaspora password'), '', DI::l10n()->t('Privacy notice: Your Diaspora password will be stored unencrypted to authenticate you with your Diaspora pod. This means your Friendica node administrator can have access to it.')],
|
||||||
'$aspect_select' => $aspect_select,
|
'$aspect_select' => $aspect_select,
|
||||||
'$post_by_default' => ['post_by_default', DI::l10n()->t('Post to Diaspora by default'), $def_enabled],
|
'$post_by_default' => ['post_by_default', DI::l10n()->t('Post to Diaspora by default'), $def_enabled],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'connector' => 'diaspora',
|
||||||
|
'title' => DI::l10n()->t('Diaspora Export'),
|
||||||
|
'image' => 'images/diaspora-logo.png',
|
||||||
|
'enabled' => $enabled,
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:17-0500\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,88 +17,84 @@ 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"
|
||||||
|
|
||||||
#: diaspora.php:43
|
#: diaspora.php:44
|
||||||
msgid "Post to Diaspora"
|
msgid "Post to Diaspora"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:68
|
#: diaspora.php:67
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"Please remember: You can always be reached from Diaspora with your Friendica "
|
"Please remember: You can always be reached from Diaspora with your Friendica "
|
||||||
"handle <strong>%s</strong>. "
|
"handle <strong>%s</strong>. "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:69
|
#: diaspora.php:68
|
||||||
msgid ""
|
msgid ""
|
||||||
"This connector is only meant if you still want to use your old Diaspora "
|
"This connector is only meant if you still want to use your old Diaspora "
|
||||||
"account for some time. "
|
"account for some time. "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:70
|
#: diaspora.php:69
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"However, it is preferred that you tell your Diaspora contacts the new handle "
|
"However, it is preferred that you tell your Diaspora contacts the new handle "
|
||||||
"<strong>%s</strong> instead."
|
"<strong>%s</strong> instead."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:80
|
#: diaspora.php:79
|
||||||
msgid "All aspects"
|
msgid "All aspects"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:81
|
#: diaspora.php:80
|
||||||
msgid "Public"
|
msgid "Public"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:87
|
#: diaspora.php:86
|
||||||
msgid "Post to aspect:"
|
msgid "Post to aspect:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:88
|
#: diaspora.php:87
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Connected with your Diaspora account <strong>%s</strong>"
|
msgid "Connected with your Diaspora account <strong>%s</strong>"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:91
|
#: diaspora.php:90
|
||||||
msgid ""
|
msgid ""
|
||||||
"Can't login to your Diaspora account. Please check handle (in the format "
|
"Can't login to your Diaspora account. Please check handle (in the format "
|
||||||
"user@domain.tld) and password."
|
"user@domain.tld) and password."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:99
|
#: diaspora.php:97
|
||||||
msgid "Diaspora Export"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: diaspora.php:100
|
|
||||||
msgid "Information"
|
msgid "Information"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:101
|
#: diaspora.php:98
|
||||||
msgid "Error"
|
msgid "Error"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:102
|
#: diaspora.php:104
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: diaspora.php:106
|
|
||||||
msgid "Enable Diaspora Post Addon"
|
msgid "Enable Diaspora Post Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:107
|
#: diaspora.php:105
|
||||||
msgid "Diaspora handle"
|
msgid "Diaspora handle"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:108
|
#: diaspora.php:106
|
||||||
msgid "Diaspora password"
|
msgid "Diaspora password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:108
|
#: diaspora.php:106
|
||||||
msgid ""
|
msgid ""
|
||||||
"Privacy notice: Your Diaspora password will be stored unencrypted to "
|
"Privacy notice: Your Diaspora password will be stored unencrypted to "
|
||||||
"authenticate you with your Diaspora pod. This means your Friendica node "
|
"authenticate you with your Diaspora pod. This means your Friendica node "
|
||||||
"administrator can have access to it."
|
"administrator can have access to it."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: diaspora.php:110
|
#: diaspora.php:108
|
||||||
msgid "Post to Diaspora by default"
|
msgid "Post to Diaspora by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: diaspora.php:113
|
||||||
|
msgid "Diaspora Export"
|
||||||
|
msgstr ""
|
||||||
|
|
|
||||||
32
diaspora/templates/connector_settings.tpl
Normal file
32
diaspora/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{{if $info}}
|
||||||
|
<div class="panel panel-info">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h4 class="panel-title">{{$l10n.info_header}}</h4>
|
||||||
|
</div>
|
||||||
|
<p class="panel-body">
|
||||||
|
{{$info nofilter}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{if $error}}
|
||||||
|
<div class="panel panel-danger">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h4 class="panel-title">{{$l10n.error_header}}</h4>
|
||||||
|
</div>
|
||||||
|
<p class="panel-body">
|
||||||
|
{{$error nofilter}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
|
||||||
|
{{if $aspect_select}}
|
||||||
|
{{include file="field_select.tpl" field=$aspect_select}}
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$post_by_default}}
|
||||||
|
{{else}}
|
||||||
|
{{include file="field_input.tpl" field=$handle}}
|
||||||
|
|
||||||
|
{{include file="field_password.tpl" field=$password}}
|
||||||
|
{{/if}}
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
<span id="settings_diaspora_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_diaspora_expanded'); openClose('settings_diaspora_inflated');">
|
|
||||||
<img class="connector{{if !$enabled}}-disabled{{/if}}" src="images/diaspora-logo.png">
|
|
||||||
<h3 class="connector">{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_diaspora_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_diaspora_expanded'); openClose('settings_diaspora_inflated');">
|
|
||||||
<img class="connector{{if !$enabled}}-disabled{{/if}}" src="images/diaspora-logo.png">
|
|
||||||
<h3 class="connector">{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{{if $info}}
|
|
||||||
<div class="panel panel-info">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4 class="panel-title">{{$info_header}}</h4>
|
|
||||||
</div>
|
|
||||||
<p class="panel-body">
|
|
||||||
{{$info nofilter}}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{if $error}}
|
|
||||||
<div class="panel panel-danger">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<h4 class="panel-title">{{$error_header}}</h4>
|
|
||||||
</div>
|
|
||||||
<p class="panel-body">
|
|
||||||
{{$error nofilter}}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{include file="field_checkbox.tpl" field=$enabled_checkbox}}
|
|
||||||
|
|
||||||
{{if $aspect_select}}
|
|
||||||
{{include file="field_select.tpl" field=$aspect_select}}
|
|
||||||
|
|
||||||
{{include file="field_checkbox.tpl" field=$post_by_default}}
|
|
||||||
{{else}}
|
|
||||||
{{include file="field_input.tpl" field=$handle}}
|
|
||||||
|
|
||||||
{{include file="field_password.tpl" field=$password}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper">
|
|
||||||
<button type="submit" class="btn btn-primary settings-submit" id="diaspora-submit" name="diaspora-submit" value="diaspora-submit">{{$submit}}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -36,7 +36,7 @@ function discourse_install()
|
||||||
Hook::register('connector_settings_post', __FILE__, 'discourse_settings_post');
|
Hook::register('connector_settings_post', __FILE__, 'discourse_settings_post');
|
||||||
}
|
}
|
||||||
|
|
||||||
function discourse_settings(App $a, &$s)
|
function discourse_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -44,12 +44,18 @@ function discourse_settings(App $a, &$s)
|
||||||
|
|
||||||
$enabled = intval(DI::pConfig()->get(local_user(), 'discourse', 'enabled'));
|
$enabled = intval(DI::pConfig()->get(local_user(), 'discourse', 'enabled'));
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/discourse/');
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/discourse/');
|
||||||
$s .= Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$title' => DI::l10n()->t('Discourse'),
|
|
||||||
'$enabled' => ['enabled', DI::l10n()->t('Enable processing of Discourse mailing list mails'), $enabled, DI::l10n()->t('If enabled, incoming mails from Discourse will be improved so they look much better. To make it work, you have to configure the e-mail settings in Friendica. You also have to enable the mailing list mode in Discourse. Then you have to add the Discourse mail account as contact.')],
|
'$enabled' => ['enabled', DI::l10n()->t('Enable processing of Discourse mailing list mails'), $enabled, DI::l10n()->t('If enabled, incoming mails from Discourse will be improved so they look much better. To make it work, you have to configure the e-mail settings in Friendica. You also have to enable the mailing list mode in Discourse. Then you have to add the Discourse mail account as contact.')],
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'connector' => 'discourse',
|
||||||
|
'title' => DI::l10n()->t('Discourse'),
|
||||||
|
'image' => 'images/discourse.png',
|
||||||
|
'enabled' => $enabled,
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function discourse_settings_post(App $a)
|
function discourse_settings_post(App $a)
|
||||||
|
|
|
||||||
34
discourse/lang/C/messages.po
Normal file
34
discourse/lang/C/messages.po
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# ADDON discourse
|
||||||
|
# Copyright (C)
|
||||||
|
# This file is distributed under the same license as the Friendica discourse addon package.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: \n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2021-11-21 19:17-0500\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: discourse.php:49
|
||||||
|
msgid "Enable processing of Discourse mailing list mails"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: discourse.php:49
|
||||||
|
msgid ""
|
||||||
|
"If enabled, incoming mails from Discourse will be improved so they look much "
|
||||||
|
"better. To make it work, you have to configure the e-mail settings in "
|
||||||
|
"Friendica. You also have to enable the mailing list mode in Discourse. Then "
|
||||||
|
"you have to add the Discourse mail account as contact."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: discourse.php:54
|
||||||
|
msgid "Discourse"
|
||||||
|
msgstr ""
|
||||||
1
discourse/templates/connector_settings.tpl
Normal file
1
discourse/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
<span id="settings_discourse_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_discourse_expanded'); openClose('settings_discourse_inflated');">
|
|
||||||
<img class="connector{{if ! $enabled.2}}-disabled{{/if}}" src="images/discourse.png" /><h3 class="connector">{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_discourse_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_discourse_expanded'); openClose('settings_discourse_inflated');">
|
|
||||||
<img class="connector{{if ! $enabled.2}}-disabled{{/if}}" src="images/discourse.png" /><h3 class="connector">{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div id="discourse-wrapper">
|
|
||||||
{{include file="field_checkbox.tpl" field=$enabled}}
|
|
||||||
</div>
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" id="discourse-submit" name="discourse-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
|
|
||||||
#dwpost-enable-label, #dwpost-username-label, #dwpost-password-label, #dwpost-bydefault-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#dwpost-checkbox, #dwpost-username, #dwpost-password, #dwpost-bydefault {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#dwpost-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
@ -12,7 +12,7 @@ use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
use Friendica\Model\Tag;
|
use Friendica\Model\Tag;
|
||||||
|
|
@ -48,58 +48,31 @@ function dwpost_jot_nets(App $a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dwpost_settings(App $a, &$s)
|
function dwpost_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post', false);
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/dwpost/dwpost.css' . '" media="all" />' . "\r\n";
|
$dw_username = DI::pConfig()->get(local_user(), 'dwpost', 'dw_username');
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post');
|
|
||||||
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default');
|
$def_enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default');
|
||||||
|
|
||||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/dwpost/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$enabled' => ['dwpost', DI::l10n()->t('Enable Dreamwidth Post Addon'), $enabled],
|
||||||
|
'$username' => ['dw_username', DI::l10n()->t('Dreamwidth username'), $dw_username],
|
||||||
|
'$password' => ['dw_password', DI::l10n()->t('Dreamwidth password')],
|
||||||
|
'$bydefault' => ['dw_bydefault', DI::l10n()->t('Post to Dreamwidth by default'), $def_enabled],
|
||||||
|
]);
|
||||||
|
|
||||||
$dw_username = DI::pConfig()->get(local_user(), 'dwpost', 'dw_username');
|
$data = [
|
||||||
$dw_password = DI::pConfig()->get(local_user(), 'dwpost', 'dw_password');
|
'connector' => 'dwpost',
|
||||||
|
'title' => DI::l10n()->t('Dreamwidth Export'),
|
||||||
/* Add some HTML to the existing form */
|
'image' => 'images/dreamwidth.png',
|
||||||
$s .= '<span id="settings_dwpost_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_dwpost_expanded\'); openClose(\'settings_dwpost_inflated\');">';
|
'enabled' => $enabled,
|
||||||
$s .= '<img class="connector" src="images/dreamwidth.png" /><h3 class="connector">'. DI::l10n()->t("Dreamwidth Export").'</h3>';
|
'html' => $html,
|
||||||
$s .= '</span>';
|
];
|
||||||
$s .= '<div id="settings_dwpost_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_dwpost_expanded\'); openClose(\'settings_dwpost_inflated\');">';
|
|
||||||
$s .= '<img class="connector" src="images/dreamwidth.png" /><h3 class="connector">'. DI::l10n()->t("Dreamwidth Export").'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="dwpost-enable-wrapper">';
|
|
||||||
$s .= '<label id="dwpost-enable-label" for="dwpost-checkbox">' . DI::l10n()->t('Enable dreamwidth Post Addon') . '</label>';
|
|
||||||
$s .= '<input id="dwpost-checkbox" type="checkbox" name="dwpost" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="dwpost-username-wrapper">';
|
|
||||||
$s .= '<label id="dwpost-username-label" for="dwpost-username">' . DI::l10n()->t('dreamwidth username') . '</label>';
|
|
||||||
$s .= '<input id="dwpost-username" type="text" name="dw_username" value="' . $dw_username . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="dwpost-password-wrapper">';
|
|
||||||
$s .= '<label id="dwpost-password-label" for="dwpost-password">' . DI::l10n()->t('dreamwidth password') . '</label>';
|
|
||||||
$s .= '<input id="dwpost-password" type="password" name="dw_password" value="' . $dw_password . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="dwpost-bydefault-wrapper">';
|
|
||||||
$s .= '<label id="dwpost-bydefault-label" for="dwpost-bydefault">' . DI::l10n()->t('Post to dreamwidth by default') . '</label>';
|
|
||||||
$s .= '<input id="dwpost-bydefault" type="checkbox" name="dw_bydefault" value="1" ' . $def_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="dwpost-submit" name="dwpost-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:17-0500\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,30 +17,26 @@ 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"
|
||||||
|
|
||||||
#: dwpost.php:41
|
#: dwpost.php:43
|
||||||
msgid "Post to Dreamwidth"
|
msgid "Post to Dreamwidth"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dwpost.php:72 dwpost.php:76
|
#: dwpost.php:63
|
||||||
|
msgid "Enable Dreamwidth Post Addon"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: dwpost.php:64
|
||||||
|
msgid "Dreamwidth username"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: dwpost.php:65
|
||||||
|
msgid "Dreamwidth password"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: dwpost.php:66
|
||||||
|
msgid "Post to Dreamwidth by default"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: dwpost.php:71
|
||||||
msgid "Dreamwidth Export"
|
msgid "Dreamwidth Export"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dwpost.php:80
|
|
||||||
msgid "Enable dreamwidth Post Addon"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: dwpost.php:85
|
|
||||||
msgid "dreamwidth username"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: dwpost.php:90
|
|
||||||
msgid "dreamwidth password"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: dwpost.php:95
|
|
||||||
msgid "Post to dreamwidth by default"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: dwpost.php:100
|
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
|
||||||
4
dwpost/templates/connector_settings.tpl
Normal file
4
dwpost/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_input.tpl" field=$username}}
|
||||||
|
{{include file="field_password.tpl" field=$password}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#fromapp-label, #fromapp-force-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fromapp-input, #fromapp-force {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,8 +6,11 @@
|
||||||
* Author: Commander Zot
|
* Author: Commander Zot
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function fromapp_install()
|
function fromapp_install()
|
||||||
|
|
@ -28,47 +31,26 @@ function fromapp_settings_post($a, $post)
|
||||||
DI::pConfig()->set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force']));
|
DI::pConfig()->set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force']));
|
||||||
}
|
}
|
||||||
|
|
||||||
function fromapp_settings(&$a, &$s)
|
function fromapp_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/fromapp/fromapp.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
|
|
||||||
$fromapp = DI::pConfig()->get(local_user(), 'fromapp', 'app', '');
|
$fromapp = DI::pConfig()->get(local_user(), 'fromapp', 'app', '');
|
||||||
|
|
||||||
$force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force'));
|
$force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force'));
|
||||||
|
|
||||||
$force_enabled = (($force) ? ' checked="checked" ' : '');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/fromapp/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$fromapp' => ['fromapp-input', DI::l10n()->t('The application name you would like to show your posts originating from. Separate different app names with a comma. A random one will then be selected for every posting.'), $fromapp],
|
||||||
|
'$force' => ['fromapp-force', DI::l10n()->t('Use this application name even if another application was used.'), $force],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
/* Add some HTML to the existing form */
|
'addon' => 'fromapp',
|
||||||
|
'title' => DI::l10n()->t('FromApp Settings'),
|
||||||
$s .= '<span id="settings_fromapp_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_fromapp_expanded\'); openClose(\'settings_fromapp_inflated\');">';
|
'html' => $html,
|
||||||
$s .= '<h3>' . DI::l10n()->t('FromApp Settings') . '</h3>';
|
];
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_fromapp_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_fromapp_expanded\'); openClose(\'settings_fromapp_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('FromApp Settings') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="fromapp-wrapper">';
|
|
||||||
$s .= '<label id="fromapp-label" for="fromapp-input">' . DI::l10n()->t('The application name you would like to show your posts originating from. Separate different app names with a comma. A random one will then be selected for every posting.') . '</label>';
|
|
||||||
$s .= '<input id="fromapp-input" type="text" name="fromapp-input" value="' . $fromapp . '" ' . '/>';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<label id="fromapp-force-label" for="fromapp-force">' . DI::l10n()->t('Use this application name even if another application was used.') . '</label>';
|
|
||||||
$s .= '<input id="fromapp-force" type="checkbox" name="fromapp-force" value="1" ' . $force_enabled . '/>';
|
|
||||||
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="fromapp-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fromapp_post_hook(&$a, &$item)
|
function fromapp_post_hook(&$a, &$item)
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:14-0500\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,21 +17,17 @@ 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"
|
||||||
|
|
||||||
#: fromapp.php:53 fromapp.php:57
|
#: fromapp.php:45
|
||||||
msgid "FromApp Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: fromapp.php:60
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"The application name you would like to show your posts originating from. "
|
"The application name you would like to show your posts originating from. "
|
||||||
"Separate different app names with a comma. A random one will then be "
|
"Separate different app names with a comma. A random one will then be "
|
||||||
"selected for every posting."
|
"selected for every posting."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: fromapp.php:64
|
#: fromapp.php:46
|
||||||
msgid "Use this application name even if another application was used."
|
msgid "Use this application name even if another application was used."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: fromapp.php:71
|
#: fromapp.php:51
|
||||||
msgid "Save Settings"
|
msgid "FromApp Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
2
fromapp/templates/settings.tpl
Normal file
2
fromapp/templates/settings.tpl
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
{{include file="field_input.tpl" field=$fromapp}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$force}}
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#geonames-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#geonames-checkbox {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -114,33 +114,31 @@ function geonames_addon_settings_post(App $a, array $post)
|
||||||
* Add our own settings info to the page.
|
* Add our own settings info to the page.
|
||||||
*
|
*
|
||||||
* @param App $a
|
* @param App $a
|
||||||
* @param string $s
|
* @param array $data
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
function geonames_addon_settings(App $a, &$s)
|
function geonames_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$geo_account = DI::config()->get('geonames', 'username');
|
$geo_account = DI::config()->get('geonames', 'username');
|
||||||
|
|
||||||
if (!$geo_account) {
|
if (!$geo_account) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
$stylesheetPath = __DIR__ . '/geonames.css';
|
|
||||||
DI::page()->registerStylesheet($stylesheetPath);
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
$enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable'));
|
$enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable'));
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/geonames/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/geonames/');
|
||||||
$s .= Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$title' => DI::l10n()->t('Geonames Settings'),
|
'$info' => DI::l10n()->t('Replace numerical coordinates by the nearest populated location name in your posts.'),
|
||||||
'$description' => DI::l10n()->t('Replace numerical coordinates by the nearest populated location name in your posts.'),
|
|
||||||
'$enable' => ['geonames-enable', DI::l10n()->t('Enable Geonames Addon'), $enabled],
|
'$enable' => ['geonames-enable', DI::l10n()->t('Enable Geonames Addon'), $enabled],
|
||||||
'$submit' => DI::l10n()->t('Save Settings')
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'geonames',
|
||||||
|
'title' => DI::l10n()->t('Geonames Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:14-0500\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,20 +17,16 @@ 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"
|
||||||
|
|
||||||
#: geonames.php:141
|
#: geonames.php:135
|
||||||
msgid "Geonames Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: geonames.php:142
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Replace numerical coordinates by the nearest populated location name in your "
|
"Replace numerical coordinates by the nearest populated location name in your "
|
||||||
"posts."
|
"posts."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: geonames.php:143
|
#: geonames.php:136
|
||||||
msgid "Enable Geonames Addon"
|
msgid "Enable Geonames Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: geonames.php:144
|
#: geonames.php:141
|
||||||
msgid "Save Settings"
|
msgid "Geonames Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,2 @@
|
||||||
<span id="settings_geonames_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_geonames_expanded'); openClose('settings_geonames_inflated');">
|
<p>{{$info}}</p>
|
||||||
<h3>{{$title}}</h3>
|
{{include file="field_checkbox.tpl" field=$enable}}
|
||||||
</span>
|
|
||||||
<div id="settings_geonames_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_geonames_expanded'); openClose('settings_geonames_inflated');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<p>{{$description nofilter}}</p>
|
|
||||||
{{include file="field_checkbox.tpl" field=$enable}}
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" id="geonames-submit" name="geonames-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
#gnot-desc {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#gnot-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#gnot {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
|
@ -49,31 +50,25 @@ function gnot_settings_post($a,$post) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function gnot_settings(&$a,&$s) {
|
function gnot_settings(App &$a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$gnot = intval(DI::pConfig()->get(local_user(), 'gnot', 'enable'));
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/gnot/gnot.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
|
|
||||||
$gnot = intval(DI::pConfig()->get(local_user(),'gnot','enable'));
|
|
||||||
|
|
||||||
$gnot_checked = (($gnot) ? ' checked="checked" ' : '' );
|
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/gnot/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/gnot/');
|
||||||
/* Add some HTML to the existing form */
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$text' => DI::l10n()->t("Allows threading of email comment notifications on Gmail and anonymising the subject line."),
|
||||||
$s .= Renderer::replaceMacros($t, [
|
'$enabled' => ['gnot', DI::l10n()->t('Enable this addon?'), $gnot],
|
||||||
'$title' => DI::l10n()->t('Gnot Settings') ,
|
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
'$enable' => DI::l10n()->t('Enable this addon?'),
|
|
||||||
'$enabled' => $gnot_checked,
|
|
||||||
'$text' => DI::l10n()->t("Allows threading of email comment notifications on Gmail and anonymising the subject line.")
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'gnot',
|
||||||
|
'title' => DI::l10n()->t('Gnot Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:14-0500\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,25 +17,21 @@ 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"
|
||||||
|
|
||||||
#: gnot.php:71
|
#: gnot.php:63
|
||||||
msgid "Gnot Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: gnot.php:72
|
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: gnot.php:73
|
|
||||||
msgid "Enable this addon?"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: gnot.php:75
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Allows threading of email comment notifications on Gmail and anonymising the "
|
"Allows threading of email comment notifications on Gmail and anonymising the "
|
||||||
"subject line."
|
"subject line."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: gnot.php:84
|
#: gnot.php:64
|
||||||
|
msgid "Enable this addon?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: gnot.php:69
|
||||||
|
msgid "Gnot Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: gnot.php:79
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "[Friendica:Notify] Comment to conversation #%d"
|
msgid "[Friendica:Notify] Comment to conversation #%d"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,2 @@
|
||||||
<span id="settings_gnot_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_gnot_expanded\'); openClose(\'settings_gnot_inflated\');">
|
<p>{{$text}}</p>
|
||||||
<h3>{{$title}}</h3>
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
</span>
|
|
||||||
<div id="settings_gnot_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose(\'settings_gnot_expanded\'); openClose(\'settings_gnot_inflated\');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="gnot-wrapper">
|
|
||||||
<div id="gnot-desc">{{$text}}</div>
|
|
||||||
<label id="gnot-label" for="gnot">{{$enable}}</label>
|
|
||||||
<input id="gnot-input" type="checkbox" name="gnot" value="1" {{$enabled}} />
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" name="gnot-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#group_text-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#group_text-checkbox {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5,8 +5,11 @@
|
||||||
* Version: 1.0
|
* Version: 1.0
|
||||||
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
|
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function group_text_install() {
|
function group_text_install() {
|
||||||
|
|
@ -42,31 +45,22 @@ function group_text_settings_post($a,$post) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function group_text_settings(&$a,&$s) {
|
function group_text_settings(App &$a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/group_text/group_text.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(),'system','groupedit_image_limit');
|
$enabled = DI::pConfig()->get(local_user(),'system','groupedit_image_limit');
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/group_text/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
$s .= '<div class="settings-block">';
|
'$enabled' => ['group_text', DI::l10n()->t('Use a text only (non-image) group selector in the "group edit" menu'), $enabled],
|
||||||
$s .= '<h3>' . DI::l10n()->t('Group Text') . '</h3>';
|
]);
|
||||||
$s .= '<div id="group_text-enable-wrapper">';
|
|
||||||
$s .= '<label id="group_text-enable-label" for="group_text-checkbox">' . DI::l10n()->t('Use a text only (non-image) group selector in the "group edit" menu') . '</label>';
|
|
||||||
$s .= '<input id="group_text-checkbox" type="checkbox" name="group_text" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="group_text-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'group_text',
|
||||||
|
'title' => DI::l10n()->t('Group Text'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:14-0500\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,14 +17,10 @@ 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"
|
||||||
|
|
||||||
#: group_text.php:62
|
#: group_text.php:58
|
||||||
msgid "Group Text"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: group_text.php:64
|
|
||||||
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: group_text.php:70
|
#: group_text.php:63
|
||||||
msgid "Save Settings"
|
msgid "Group Text"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
1
group_text/templates/settings.tpl
Normal file
1
group_text/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
|
@ -11,6 +11,7 @@ use Friendica\Content\PageInfo;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
@ -33,55 +34,47 @@ function ifttt_content()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ifttt_settings(App $a, &$s)
|
function ifttt_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = DI::pConfig()->get(local_user(), 'ifttt', 'key');
|
$key = DI::pConfig()->get(local_user(), 'ifttt', 'key');
|
||||||
|
|
||||||
if (!$key) {
|
if (!$key) {
|
||||||
$key = Strings::getRandomHex(20);
|
$key = Strings::getRandomHex(20);
|
||||||
DI::pConfig()->set(local_user(), 'ifttt', 'key', $key);
|
DI::pConfig()->set(local_user(), 'ifttt', 'key', $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
$s .= '<span id="settings_ifttt_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_ifttt_expanded\'); openClose(\'settings_ifttt_inflated\');">';
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/ifttt/');
|
||||||
$s .= '<img class="connector" src="addon/ifttt/ifttt.png" /><h3 class="connector">' . DI::l10n()->t('IFTTT Mirror') . '</h3>';
|
$html = Renderer::replaceMacros($t, [
|
||||||
$s .= '</span>';
|
'$l10n' => [
|
||||||
$s .= '<div id="settings_ifttt_expanded" class="settings-block" style="display: none;">';
|
'intro' => DI::l10n()->t('Create an account at <a href="http://www.ifttt.com">IFTTT</a>. Create three Facebook recipes that are connected with <a href="https://ifttt.com/maker">Maker</a> (In the form "if Facebook then Maker") with the following parameters:'),
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_ifttt_expanded\'); openClose(\'settings_ifttt_inflated\');">';
|
'url' => DI::l10n()->t('URL'),
|
||||||
$s .= '<img class="connector" src="addon/ifttt/ifttt.png" /><h3 class="connector">' . DI::l10n()->t('IFTTT Mirror') . '</h3>';
|
'method' => DI::l10n()->t('Method'),
|
||||||
$s .= '</span>';
|
'content_type' => DI::l10n()->t('Content Type'),
|
||||||
|
'new_status_message_body' => DI::l10n()->t('Body for "new status message"'),
|
||||||
|
'new_photo_upload_body' => DI::l10n()->t('Body for "new photo upload"'),
|
||||||
|
'new_link_post_body' => DI::l10n()->t('Body for "new link post"'),
|
||||||
|
],
|
||||||
|
'$url' => DI::baseUrl()->get() . '/ifttt/' . $a->getLoggedInUserNickname(),
|
||||||
|
'$new_status_message_body' => 'key=' . $key . '&type=status&msg=<<<{{Message}}>>>&date=<<<{{UpdatedAt}}>>>&url=<<<{{PageUrl}}>>>',
|
||||||
|
'$new_photo_upload_body' => 'key=' . $key . '&type=photo&link=<<<{{Link}}>>>&image=<<<{{ImageSource}}>>>&msg=<<<{{Caption}}>>>&date=<<<{{CreatedAt}}>>>&url=<<<{{PageUrl}}>>>',
|
||||||
|
'$new_link_post_body' => 'key=' . $key . '&type=link&link=<<<{{Link}}>>>&title=<<<{{Title}}>>>&msg=<<<{{Message}}>>>&description=<<<{{Description}}>>>&date=<<<{{CreatedAt}}>>>&url=<<<{{PageUrl}}>>>',
|
||||||
|
]);
|
||||||
|
|
||||||
$s .= '<div id="ifttt-configuration-wrapper">';
|
$data = [
|
||||||
$s .= '<p>' . DI::l10n()->t('Create an account at <a href="http://www.ifttt.com">IFTTT</a>. Create three Facebook recipes that are connected with <a href="https://ifttt.com/maker">Maker</a> (In the form "if Facebook then Maker") with the following parameters:') . '</p>';
|
'connector' => 'ifttt',
|
||||||
$s .= '<h4>URL</h4>';
|
'title' => DI::l10n()->t('IFTTT Mirror'),
|
||||||
$s .= '<p>' . DI::baseUrl()->get() . '/ifttt/' . $a->getLoggedInUserNickname() . '</p>';
|
'image' => 'addon/ifttt/ifttt.png',
|
||||||
$s .= '<h4>Method</h4>';
|
'html' => $html,
|
||||||
$s .= '<p>POST</p>';
|
'submit' => DI::l10n()->t('Generate new key'),
|
||||||
$s .= '<h4>Content Type</h4>';
|
];
|
||||||
$s .= '<p>application/x-www-form-urlencoded</p>';
|
|
||||||
$s .= '<h4>' . DI::l10n()->t('Body for "new status message"') . '</h4>';
|
|
||||||
$s .= '<p><code>' . htmlentities('key=' . $key . '&type=status&msg=<<<{{Message}}>>>&date=<<<{{UpdatedAt}}>>>&url=<<<{{PageUrl}}>>>') . '</code></p>';
|
|
||||||
$s .= '<h4>' . DI::l10n()->t('Body for "new photo upload"') . '</h4>';
|
|
||||||
$s .= '<p><code>' . htmlentities('key=' . $key . '&type=photo&link=<<<{{Link}}>>>&image=<<<{{ImageSource}}>>>&msg=<<<{{Caption}}>>>&date=<<<{{CreatedAt}}>>>&url=<<<{{PageUrl}}>>>') . '</code></p>';
|
|
||||||
$s .= '<h4>' . DI::l10n()->t('Body for "new link post"') . '</h4>';
|
|
||||||
$s .= '<p><code>' . htmlentities('key=' . $key . '&type=link&link=<<<{{Link}}>>>&title=<<<{{Title}}>>>&msg=<<<{{Message}}>>>&description=<<<{{Description}}>>>&date=<<<{{CreatedAt}}>>>&url=<<<{{PageUrl}}>>>') . '</code></p>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="ifttt-rekey-wrapper">';
|
|
||||||
$s .= '<label id="ifttt-rekey-label" for="ifttt-checkbox">' . DI::l10n()->t('Generate new key') . '</label>';
|
|
||||||
$s .= '<input id="ifttt-checkbox" type="checkbox" name="ifttt-rekey" value="1" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="ifttt-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
$s .= '</div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ifttt_settings_post()
|
function ifttt_settings_post()
|
||||||
{
|
{
|
||||||
if (!empty($_POST['ifttt-submit']) && isset($_POST['ifttt-rekey'])) {
|
if (!empty($_POST['ifttt-submit'])) {
|
||||||
DI::pConfig()->delete(local_user(), 'ifttt', 'key');
|
DI::pConfig()->delete(local_user(), 'ifttt', 'key');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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-07-25 13:17+0000\n"
|
"POT-Creation-Date: 2021-11-21 19:17-0500\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,11 +17,7 @@ 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"
|
||||||
|
|
||||||
#: ifttt.php:50 ifttt.php:54
|
#: ifttt.php:52
|
||||||
msgid "IFTTT Mirror"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ifttt.php:58
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Create an account at <a href=\"http://www.ifttt.com\">IFTTT</a>. Create "
|
"Create an account at <a href=\"http://www.ifttt.com\">IFTTT</a>. Create "
|
||||||
"three Facebook recipes that are connected with <a href=\"https://ifttt.com/"
|
"three Facebook recipes that are connected with <a href=\"https://ifttt.com/"
|
||||||
|
|
@ -29,22 +25,34 @@ msgid ""
|
||||||
"following parameters:"
|
"following parameters:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ifttt.php:65
|
#: ifttt.php:53
|
||||||
|
msgid "URL"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ifttt.php:54
|
||||||
|
msgid "Method"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ifttt.php:55
|
||||||
|
msgid "Content Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: ifttt.php:56
|
||||||
msgid "Body for \"new status message\""
|
msgid "Body for \"new status message\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ifttt.php:67
|
#: ifttt.php:57
|
||||||
msgid "Body for \"new photo upload\""
|
msgid "Body for \"new photo upload\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ifttt.php:69
|
#: ifttt.php:58
|
||||||
msgid "Body for \"new link post\""
|
msgid "Body for \"new link post\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ifttt.php:74
|
#: ifttt.php:68
|
||||||
msgid "Generate new key"
|
msgid "IFTTT Mirror"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ifttt.php:78
|
#: ifttt.php:71
|
||||||
msgid "Save Settings"
|
msgid "Generate new key"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
15
ifttt/templates/connector_settings.tpl
Normal file
15
ifttt/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<p>{{$l10n.intro nofilter}}</p>
|
||||||
|
<dl>
|
||||||
|
<dt>{{$l10n.url}}</dt>
|
||||||
|
<dd>{{$url}}</dd>
|
||||||
|
<dt>{{$l10n.method}}</dt>
|
||||||
|
<dd>POST</dd>
|
||||||
|
<dt>{{$l10n.content_type}}</dt>
|
||||||
|
<dd>application/x-www-form-urlencoded</dd>
|
||||||
|
<dt>{{$l10n.new_status_message_body}}</dt>
|
||||||
|
<dd><code>{{$new_status_message_body}}</code></dd>
|
||||||
|
<dt>{{$l10n.new_photo_upload_body}}</dt>
|
||||||
|
<dd><code>{{$new_photo_upload_body}}</code></dd>
|
||||||
|
<dt>{{$l10n.new_link_post_body}}</dt>
|
||||||
|
<dd><code>{{$new_link_post_body}}</code></dd>
|
||||||
|
</dl>
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
|
|
||||||
#ijpost-enable-label, #ijpost-username-label, #ijpost-password-label, #ijpost-bydefault-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ijpost-checkbox, #ijpost-username, #ijpost-password, #ijpost-bydefault {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ijpost-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
@ -8,9 +8,11 @@
|
||||||
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Tag;
|
use Friendica\Model\Tag;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
|
@ -26,7 +28,7 @@ function ijpost_install()
|
||||||
Hook::register('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post');
|
Hook::register('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post');
|
||||||
}
|
}
|
||||||
|
|
||||||
function ijpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
|
function ijpost_jot_nets(App &$a, array &$jotnets_fields)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -44,60 +46,31 @@ function ijpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ijpost_settings(&$a, &$s)
|
function ijpost_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post', false);
|
||||||
|
$ij_username = DI::pConfig()->get(local_user(), 'ijpost', 'ij_username');
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/ijpost/ijpost.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post');
|
|
||||||
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default');
|
$def_enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default');
|
||||||
|
|
||||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/ijpost/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$enabled' => ['ijpost', DI::l10n()->t('Enable InsaneJournal Post Addon'), $enabled],
|
||||||
|
'$username' => ['ij_username', DI::l10n()->t('InsaneJournal username'), $ij_username],
|
||||||
|
'$password' => ['ij_password', DI::l10n()->t('InsaneJournal password')],
|
||||||
|
'$bydefault' => ['ij_bydefault', DI::l10n()->t('Post to InsaneJournal by default'), $def_enabled],
|
||||||
|
]);
|
||||||
|
|
||||||
$ij_username = DI::pConfig()->get(local_user(), 'ijpost', 'ij_username');
|
$data = [
|
||||||
$ij_password = DI::pConfig()->get(local_user(), 'ijpost', 'ij_password');
|
'connector' => 'ijpost',
|
||||||
|
'title' => DI::l10n()->t('InsaneJournal Export'),
|
||||||
/* Add some HTML to the existing form */
|
'image' => 'images/insanejournal.gif',
|
||||||
$s .= '<span id="settings_ijpost_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_ijpost_expanded\'); openClose(\'settings_ijpost_inflated\');">';
|
'enabled' => $enabled,
|
||||||
$s .= '<img class="connector" src="images/insanejournal.gif" /><h3 class="connector">'. DI::l10n()->t("InsaneJournal Export").'</h3>';
|
'html' => $html,
|
||||||
$s .= '</span>';
|
];
|
||||||
$s .= '<div id="settings_ijpost_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_ijpost_expanded\'); openClose(\'settings_ijpost_inflated\');">';
|
|
||||||
$s .= '<img class="connector" src="images/insanejournal.gif" /><h3 class="connector">'. DI::l10n()->t("InsaneJournal Export").'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="ijpost-enable-wrapper">';
|
|
||||||
$s .= '<label id="ijpost-enable-label" for="ijpost-checkbox">' . DI::l10n()->t('Enable InsaneJournal Post Addon') . '</label>';
|
|
||||||
$s .= '<input id="ijpost-checkbox" type="checkbox" name="ijpost" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="ijpost-username-wrapper">';
|
|
||||||
$s .= '<label id="ijpost-username-label" for="ijpost-username">' . DI::l10n()->t('InsaneJournal username') . '</label>';
|
|
||||||
$s .= '<input id="ijpost-username" type="text" name="ij_username" value="' . $ij_username . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="ijpost-password-wrapper">';
|
|
||||||
$s .= '<label id="ijpost-password-label" for="ijpost-password">' . DI::l10n()->t('InsaneJournal password') . '</label>';
|
|
||||||
$s .= '<input id="ijpost-password" type="password" name="ij_password" value="' . $ij_password . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="ijpost-bydefault-wrapper">';
|
|
||||||
$s .= '<label id="ijpost-bydefault-label" for="ijpost-bydefault">' . DI::l10n()->t('Post to InsaneJournal by default') . '</label>';
|
|
||||||
$s .= '<input id="ijpost-bydefault" type="checkbox" name="ij_bydefault" value="1" ' . $def_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="ijpost-submit" name="ijpost-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ijpost_settings_post(&$a, &$b)
|
function ijpost_settings_post(&$a, &$b)
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:17-0500\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,30 +17,26 @@ 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"
|
||||||
|
|
||||||
#: ijpost.php:39
|
#: ijpost.php:42
|
||||||
msgid "Post to Insanejournal"
|
msgid "Post to Insanejournal"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ijpost.php:71 ijpost.php:75
|
#: ijpost.php:61
|
||||||
msgid "InsaneJournal Export"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ijpost.php:79
|
|
||||||
msgid "Enable InsaneJournal Post Addon"
|
msgid "Enable InsaneJournal Post Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ijpost.php:84
|
#: ijpost.php:62
|
||||||
msgid "InsaneJournal username"
|
msgid "InsaneJournal username"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ijpost.php:89
|
#: ijpost.php:63
|
||||||
msgid "InsaneJournal password"
|
msgid "InsaneJournal password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ijpost.php:94
|
#: ijpost.php:64
|
||||||
msgid "Post to InsaneJournal by default"
|
msgid "Post to InsaneJournal by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ijpost.php:99
|
#: ijpost.php:69
|
||||||
msgid "Save Settings"
|
msgid "InsaneJournal Export"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
4
ijpost/templates/connector_settings.tpl
Normal file
4
ijpost/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_input.tpl" field=$username}}
|
||||||
|
{{include file="field_password.tpl" field=$password}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||||
34
irc/irc.php
34
irc/irc.php
|
|
@ -7,6 +7,7 @@
|
||||||
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
|
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
@ -17,30 +18,27 @@ function irc_install() {
|
||||||
Hook::register('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
|
Hook::register('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
|
||||||
}
|
}
|
||||||
|
|
||||||
function irc_addon_settings(&$a,&$s) {
|
function irc_addon_settings(App &$a, array &$data)
|
||||||
if(! local_user())
|
{
|
||||||
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$sitechats = DI::pConfig()->get(local_user(), 'irc', 'sitechats'); /* popular channels */
|
||||||
|
$autochans = DI::pConfig()->get(local_user(), 'irc', 'autochans'); /* auto connect chans */
|
||||||
|
|
||||||
// DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n";
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/irc/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
/* setting popular channels, auto connect channels */
|
|
||||||
$sitechats = DI::pConfig()->get( local_user(), 'irc','sitechats'); /* popular channels */
|
|
||||||
$autochans = DI::pConfig()->get( local_user(), 'irc','autochans'); /* auto connect chans */
|
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" );
|
|
||||||
$s .= Renderer::replaceMacros($t, [
|
|
||||||
'$header' => DI::l10n()->t('IRC Settings'),
|
|
||||||
'$info' => DI::l10n()->t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'),
|
'$info' => DI::l10n()->t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'),
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
'$autochans' => ['autochans', DI::l10n()->t('Channel(s) to auto connect (comma separated)'), $autochans, DI::l10n()->t('List of channels that shall automatically connected to when the app is launched.')],
|
||||||
'$autochans' => [ 'autochans', DI::l10n()->t('Channel(s) to auto connect (comma separated)'), $autochans, DI::l10n()->t('List of channels that shall automatically connected to when the app is launched.')],
|
'$sitechats' => ['sitechats', DI::l10n()->t('Popular Channels (comma separated)'), $sitechats, DI::l10n()->t('List of popular channels, will be displayed at the side and hotlinked for easy joining.')],
|
||||||
'$sitechats' => [ 'sitechats', DI::l10n()->t('Popular Channels (comma separated)'), $sitechats, DI::l10n()->t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ]
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
return;
|
'addon' => 'irc',
|
||||||
|
'title' => DI::l10n()->t('IRC Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function irc_addon_settings_post(&$a, &$b) {
|
function irc_addon_settings_post(&$a, &$b) {
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:14-0500\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,45 +17,45 @@ 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"
|
||||||
|
|
||||||
#: irc.php:34
|
#: irc.php:32
|
||||||
msgid "IRC Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: irc.php:35
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Here you can change the system wide settings for the channels to "
|
"Here you can change the system wide settings for the channels to "
|
||||||
"automatically join and access via the side bar. Note the changes you do "
|
"automatically join and access via the side bar. Note the changes you do "
|
||||||
"here, only effect the channel selection if you are logged in."
|
"here, only effect the channel selection if you are logged in."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: irc.php:36 irc.php:134
|
#: irc.php:33 irc.php:133
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: irc.php:37 irc.php:135
|
|
||||||
msgid "Channel(s) to auto connect (comma separated)"
|
msgid "Channel(s) to auto connect (comma separated)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: irc.php:37 irc.php:135
|
#: irc.php:33 irc.php:133
|
||||||
msgid ""
|
msgid ""
|
||||||
"List of channels that shall automatically connected to when the app is "
|
"List of channels that shall automatically connected to when the app is "
|
||||||
"launched."
|
"launched."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: irc.php:38 irc.php:136
|
#: irc.php:34 irc.php:134
|
||||||
msgid "Popular Channels (comma separated)"
|
msgid "Popular Channels (comma separated)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: irc.php:38 irc.php:136
|
#: irc.php:34 irc.php:134
|
||||||
msgid ""
|
msgid ""
|
||||||
"List of popular channels, will be displayed at the side and hotlinked for "
|
"List of popular channels, will be displayed at the side and hotlinked for "
|
||||||
"easy joining."
|
"easy joining."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: irc.php:62
|
#: irc.php:39
|
||||||
|
msgid "IRC Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: irc.php:60
|
||||||
msgid "IRC Chatroom"
|
msgid "IRC Chatroom"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: irc.php:90
|
#: irc.php:88
|
||||||
msgid "Popular Channels"
|
msgid "Popular Channels"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: irc.php:132
|
||||||
|
msgid "Save Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,3 @@
|
||||||
<span id="settings_irc_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_irc_expanded'); openClose('settings_irc_inflated');">
|
<p>{{$info}}</p>
|
||||||
<h3>{{$header}}</h3>
|
{{include file="field_input.tpl" field=$autochans}}
|
||||||
</span>
|
{{include file="field_input.tpl" field=$sitechats}}
|
||||||
<div id="settings_irc_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_irc_expanded'); openClose('settings_irc_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<p>{{$info}}</p>
|
|
||||||
{{include file="field_input.tpl" field=$autochans}}
|
|
||||||
{{include file="field_input.tpl" field=$sitechats}}
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" id="irc-submit" name="irc-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ function js_upload_form(App $a, array &$b)
|
||||||
{
|
{
|
||||||
$b['default_upload'] = false;
|
$b['default_upload'] = false;
|
||||||
|
|
||||||
DI::page()->registerStylesheet('addon/js_upload/file-uploader/client/fileuploader.css');
|
DI::page()->registerStylesheet(__DIR__ . '/file-uploader/client/fileuploader.css');
|
||||||
DI::page()->registerFooterScript('addon/js_upload/file-uploader/client/fileuploader.js');
|
DI::page()->registerFooterScript(__DIR__ . '/file-uploader/client/fileuploader.js');
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload');
|
$tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload');
|
||||||
$b['addon_text'] .= Renderer::replaceMacros($tpl, [
|
$b['addon_text'] .= Renderer::replaceMacros($tpl, [
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#krynn-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#krynn-checkbox {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -9,8 +9,11 @@
|
||||||
*
|
*
|
||||||
*"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere
|
*"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function krynn_install() {
|
function krynn_install() {
|
||||||
|
|
@ -111,42 +114,24 @@ function krynn_settings_post($a,$post) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function krynn_settings(&$a,&$s) {
|
function krynn_settings(App &$a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if(! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/krynn/krynn.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(),'krynn','enable');
|
$enabled = DI::pConfig()->get(local_user(),'krynn','enable');
|
||||||
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/krynn/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
/* Add some HTML to the existing form */
|
'$enabled' => ['krynn', DI::l10n()->t('Enable Krynn Addon'), $enabled],
|
||||||
|
]);
|
||||||
$s .= '<span id="settings_krynn_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_krynn_expanded\'); openClose(\'settings_krynn_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Krynn') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_krynn_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_krynn_expanded\'); openClose(\'settings_krynn_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Krynn') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
|
|
||||||
$s .= '<div class="settings-block">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Krynn Settings') . '</h3>';
|
|
||||||
$s .= '<div id="krynn-enable-wrapper">';
|
|
||||||
$s .= '<label id="krynn-enable-label" for="krynn-checkbox">' . DI::l10n()->t('Enable Krynn Addon') . '</label>';
|
|
||||||
$s .= '<input id="krynn-checkbox" type="checkbox" name="krynn" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div></div>';
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="krynn-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'krynn',
|
||||||
|
'title' => DI::l10n()->t('Krynn Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:14-0500\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,18 +17,10 @@ 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"
|
||||||
|
|
||||||
#: krynn.php:132 krynn.php:136
|
#: krynn.php:127
|
||||||
msgid "Krynn"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: krynn.php:141
|
|
||||||
msgid "Krynn Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: krynn.php:143
|
|
||||||
msgid "Enable Krynn Addon"
|
msgid "Enable Krynn Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: krynn.php:148
|
#: krynn.php:132
|
||||||
msgid "Save Settings"
|
msgid "Krynn Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
1
krynn/templates/settings.tpl
Normal file
1
krynn/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
|
@ -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-11-21 19:15-0500\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,58 +17,58 @@ 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"
|
||||||
|
|
||||||
#: langfilter.php:50
|
#: langfilter.php:49
|
||||||
msgid "Language Filter"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: langfilter.php:51
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"This addon tries to identify the language posts are written in. If it does "
|
"This addon tries to identify the language posts are written in. If it does "
|
||||||
"not match any language specified below, posts will be hidden by collapsing "
|
"not match any language specified below, posts will be hidden by collapsing "
|
||||||
"them."
|
"them."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:52
|
#: langfilter.php:50
|
||||||
msgid "Use the language filter"
|
msgid "Use the language filter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:53
|
#: langfilter.php:51
|
||||||
msgid "Able to read"
|
msgid "Able to read"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:53
|
#: langfilter.php:51
|
||||||
msgid ""
|
msgid ""
|
||||||
"List of abbreviations (ISO 639-1 codes) for languages you speak, comma "
|
"List of abbreviations (ISO 639-1 codes) for languages you speak, comma "
|
||||||
"separated. For example \"de,it\"."
|
"separated. For example \"de,it\"."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:54
|
#: langfilter.php:52
|
||||||
msgid "Minimum confidence in language detection"
|
msgid "Minimum confidence in language detection"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:54
|
#: langfilter.php:52
|
||||||
msgid ""
|
msgid ""
|
||||||
"Minimum confidence in language detection being correct, from 0 to 100. Posts "
|
"Minimum confidence in language detection being correct, from 0 to 100. Posts "
|
||||||
"will not be filtered when the confidence of language detection is below this "
|
"will not be filtered when the confidence of language detection is below this "
|
||||||
"percent value."
|
"percent value."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:55
|
#: langfilter.php:53
|
||||||
msgid "Minimum length of message body"
|
msgid "Minimum length of message body"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:55
|
#: langfilter.php:53
|
||||||
msgid ""
|
msgid ""
|
||||||
"Minimum number of characters in message body for filter to be used. Posts "
|
"Minimum number of characters in message body for filter to be used. Posts "
|
||||||
"shorter than this will not be filtered. Note: Language detection is "
|
"shorter than this will not be filtered. Note: Language detection is "
|
||||||
"unreliable for short content (<200 characters)."
|
"unreliable for short content (<200 characters)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:56
|
#: langfilter.php:58
|
||||||
|
msgid "Language Filter"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: langfilter.php:60
|
||||||
msgid "Save Settings"
|
msgid "Save Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: langfilter.php:187
|
#: langfilter.php:193
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Filtered language: %s"
|
msgid "Filtered language: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ function langfilter_install()
|
||||||
* 3rd parse a SMARTY3 template, replacing some translateable strings for the form
|
* 3rd parse a SMARTY3 template, replacing some translateable strings for the form
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function langfilter_addon_settings(App $a, &$s)
|
function langfilter_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -40,23 +40,25 @@ function langfilter_addon_settings(App $a, &$s)
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'langfilter', 'enable',
|
$enabled = DI::pConfig()->get(local_user(), 'langfilter', 'enable',
|
||||||
!DI::pConfig()->get(local_user(), 'langfilter', 'disable'));
|
!DI::pConfig()->get(local_user(), 'langfilter', 'disable'));
|
||||||
|
|
||||||
$enable_checked = $enabled ? ' checked="checked"' : '';
|
|
||||||
$languages = DI::pConfig()->get(local_user(), 'langfilter', 'languages');
|
$languages = DI::pConfig()->get(local_user(), 'langfilter', 'languages');
|
||||||
$minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence', 0) * 100;
|
$minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence', 0) * 100;
|
||||||
$minlength = DI::pConfig()->get(local_user(), 'langfilter', 'minlength' , 32);
|
$minlength = DI::pConfig()->get(local_user(), 'langfilter', 'minlength', 32);
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate("settings.tpl", "addon/langfilter/");
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/langfilter/');
|
||||||
$s .= Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$title' => DI::l10n()->t("Language Filter"),
|
|
||||||
'$intro' => DI::l10n()->t('This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'),
|
'$intro' => DI::l10n()->t('This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'),
|
||||||
'$enabled' => ['langfilter_enable', DI::l10n()->t('Use the language filter'), $enable_checked, ''],
|
'$enabled' => ['langfilter_enable', DI::l10n()->t('Use the language filter'), $enabled],
|
||||||
'$languages' => ['langfilter_languages', DI::l10n()->t('Able to read'), $languages, DI::l10n()->t('List of abbreviations (ISO 639-1 codes) for languages you speak, comma separated. For example "de,it".')],
|
'$languages' => ['langfilter_languages', DI::l10n()->t('Able to read'), $languages, DI::l10n()->t('List of abbreviations (ISO 639-1 codes) for languages you speak, comma separated. For example "de,it".')],
|
||||||
'$minconfidence' => ['langfilter_minconfidence', DI::l10n()->t('Minimum confidence in language detection'), $minconfidence, DI::l10n()->t('Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.')],
|
'$minconfidence' => ['langfilter_minconfidence', DI::l10n()->t('Minimum confidence in language detection'), $minconfidence, DI::l10n()->t('Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.')],
|
||||||
'$minlength' => ['langfilter_minlength', DI::l10n()->t('Minimum length of message body'), $minlength, DI::l10n()->t('Minimum number of characters in message body for filter to be used. Posts shorter than this will not be filtered. Note: Language detection is unreliable for short content (<200 characters).')],
|
'$minlength' => ['langfilter_minlength', DI::l10n()->t('Minimum length of message body'), $minlength, DI::l10n()->t('Minimum number of characters in message body for filter to be used. Posts shorter than this will not be filtered. Note: Language detection is unreliable for short content (<200 characters).')],
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return;
|
$data = [
|
||||||
|
'addon' => 'langfilter',
|
||||||
|
'title' => DI::l10n()->t('Language Filter'),
|
||||||
|
'html' => $html,
|
||||||
|
'submit' => ['langfilter-settings-submit' => DI::l10n()->t('Save Settings')],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save the settings
|
/* Save the settings
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,5 @@
|
||||||
<span id="settings_langfilter_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_langfilter_expanded'); openClose('settings_langfilter_inflated');">
|
<p>{{$intro}}</p>
|
||||||
<h3>{{$title}}</h3>
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
</span>
|
{{include file="field_input.tpl" field=$languages}}
|
||||||
<div id="settings_langfilter_expanded" class="settings-block" style="display: none;">
|
{{include file="field/range_percent.tpl" field=$minconfidence}}
|
||||||
<span class="fakelink" onclick="openClose('settings_langfilter_expanded'); openClose('settings_langfilter_inflated');">
|
{{include file="field_input.tpl" field=$minlength}}
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div id="langfilter-wrapper">
|
|
||||||
<p>{{$intro}}</p>
|
|
||||||
{{include file="field_checkbox.tpl" field=$enabled}}
|
|
||||||
{{include file="field_input.tpl" field=$languages}}
|
|
||||||
{{include file="field/range_percent.tpl" field=$minconfidence}}
|
|
||||||
{{include file="field_input.tpl" field=$minlength}}
|
|
||||||
</div>
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" id="langfilter-settings-submit" name="langfilter-settings-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:17-0500\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,30 +17,26 @@ 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"
|
||||||
|
|
||||||
#: libertree.php:37
|
#: libertree.php:39
|
||||||
msgid "Post to libertree"
|
msgid "Post to libertree"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: libertree.php:71 libertree.php:75
|
#: libertree.php:60
|
||||||
msgid "libertree Export"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: libertree.php:79
|
|
||||||
msgid "Enable Libertree Post Addon"
|
msgid "Enable Libertree Post Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: libertree.php:84
|
#: libertree.php:61
|
||||||
msgid "Libertree API token"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: libertree.php:89
|
|
||||||
msgid "Libertree site URL"
|
msgid "Libertree site URL"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: libertree.php:94
|
#: libertree.php:62
|
||||||
|
msgid "Libertree API token"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: libertree.php:63
|
||||||
msgid "Post to Libertree by default"
|
msgid "Post to Libertree by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: libertree.php:100
|
#: libertree.php:68
|
||||||
msgid "Save Settings"
|
msgid "Libertree Export"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
#libertree-enable-label, #libertree-api_token-label, #libertree-url-label, #libertree-bydefault-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#libertree-checkbox, #libertree-api_token, #libertree-url, #libertree-bydefault {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#libertree-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -10,6 +10,7 @@ use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
|
|
@ -43,63 +44,32 @@ function libertree_jot_nets(App &$a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function libertree_settings(&$a,&$s) {
|
function libertree_settings(App $a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$enabled = DI::pConfig()->get(local_user(), 'libertree', 'post', false);
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/libertree/libertree.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(),'libertree','post');
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
$css = (($enabled) ? '' : '-disabled');
|
|
||||||
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(),'libertree','post_by_default');
|
|
||||||
|
|
||||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$ltree_api_token = DI::pConfig()->get(local_user(), 'libertree', 'libertree_api_token');
|
$ltree_api_token = DI::pConfig()->get(local_user(), 'libertree', 'libertree_api_token');
|
||||||
$ltree_url = DI::pConfig()->get(local_user(), 'libertree', 'libertree_url');
|
$ltree_url = DI::pConfig()->get(local_user(), 'libertree', 'libertree_url');
|
||||||
|
$def_enabled = DI::pConfig()->get(local_user(), 'libertree', 'post_by_default');
|
||||||
|
|
||||||
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/libertree/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$enabled' => ['libertree', DI::l10n()->t('Enable Libertree Post Addon'), $enabled],
|
||||||
|
'$ltree_url' => ['libertree_url', DI::l10n()->t('Libertree site URL'), $ltree_url],
|
||||||
|
'$ltree_api_token' => ['libertree_api_token', DI::l10n()->t('Libertree API token'), $ltree_api_token],
|
||||||
|
'$bydefault' => ['ij_bydefault', DI::l10n()->t('Post to Libertree by default'), $def_enabled],
|
||||||
|
]);
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
$data = [
|
||||||
|
'connector' => 'libertree',
|
||||||
$s .= '<span id="settings_libertree_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_libertree_expanded\'); openClose(\'settings_libertree_inflated\');">';
|
'title' => DI::l10n()->t('Libertree Export'),
|
||||||
$s .= '<img class="connector'.$css.'" src="images/libertree.png" /><h3 class="connector">'. DI::l10n()->t('libertree Export').'</h3>';
|
'image' => 'images/libertree.png',
|
||||||
$s .= '</span>';
|
'enabled' => $enabled,
|
||||||
$s .= '<div id="settings_libertree_expanded" class="settings-block" style="display: none;">';
|
'html' => $html,
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_libertree_expanded\'); openClose(\'settings_libertree_inflated\');">';
|
];
|
||||||
$s .= '<img class="connector'.$css.'" src="images/libertree.png" /><h3 class="connector">'. DI::l10n()->t('libertree Export').'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="libertree-enable-wrapper">';
|
|
||||||
$s .= '<label id="libertree-enable-label" for="libertree-checkbox">' . DI::l10n()->t('Enable Libertree Post Addon') . '</label>';
|
|
||||||
$s .= '<input id="libertree-checkbox" type="checkbox" name="libertree" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="libertree-api_token-wrapper">';
|
|
||||||
$s .= '<label id="libertree-api_token-label" for="libertree-api_token">' . DI::l10n()->t('Libertree API token') . '</label>';
|
|
||||||
$s .= '<input id="libertree-api_token" type="text" name="libertree_api_token" value="' . $ltree_api_token . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="libertree-url-wrapper">';
|
|
||||||
$s .= '<label id="libertree-url-label" for="libertree-url">' . DI::l10n()->t('Libertree site URL') . '</label>';
|
|
||||||
$s .= '<input id="libertree-url" type="text" name="libertree_url" value="' . $ltree_url . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="libertree-bydefault-wrapper">';
|
|
||||||
$s .= '<label id="libertree-bydefault-label" for="libertree-bydefault">' . DI::l10n()->t('Post to Libertree by default') . '</label>';
|
|
||||||
$s .= '<input id="libertree-bydefault" type="checkbox" name="libertree_bydefault" value="1" ' . $def_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="libertree-submit" name="libertree-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
4
libertree/templates/connector_settings.tpl
Normal file
4
libertree/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_input.tpl" field=$ltree_url}}
|
||||||
|
{{include file="field_input.tpl" field=$ltree_api_token}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||||
|
|
@ -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-11-21 19:17-0500\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,30 +17,26 @@ 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"
|
||||||
|
|
||||||
#: ljpost.php:39
|
#: ljpost.php:43
|
||||||
msgid "Post to LiveJournal"
|
msgid "Post to LiveJournal"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ljpost.php:73
|
#: ljpost.php:63
|
||||||
msgid "LiveJournal Post Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ljpost.php:75
|
|
||||||
msgid "Enable LiveJournal Post Addon"
|
msgid "Enable LiveJournal Post Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ljpost.php:80
|
#: ljpost.php:64
|
||||||
msgid "LiveJournal username"
|
msgid "LiveJournal username"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ljpost.php:85
|
#: ljpost.php:65
|
||||||
msgid "LiveJournal password"
|
msgid "LiveJournal password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ljpost.php:90
|
#: ljpost.php:66
|
||||||
msgid "Post to LiveJournal by default"
|
msgid "Post to LiveJournal by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ljpost.php:96
|
#: ljpost.php:71
|
||||||
msgid "Save Settings"
|
msgid "LiveJournal Export"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
BIN
ljpost/livejournal.png
Normal file
BIN
ljpost/livejournal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
|
|
@ -8,9 +8,11 @@
|
||||||
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
use Friendica\Model\Tag;
|
use Friendica\Model\Tag;
|
||||||
|
|
@ -27,7 +29,7 @@ function ljpost_install() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ljpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
|
function ljpost_jot_nets(App &$a, array &$jotnets_fields)
|
||||||
{
|
{
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -46,57 +48,31 @@ function ljpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ljpost_settings(&$a,&$s) {
|
function ljpost_settings(App &$a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$enabled = DI::pConfig()->get(local_user(), 'ljpost', 'post', false);
|
||||||
|
$ij_username = DI::pConfig()->get(local_user(), 'ljpost', 'ij_username');
|
||||||
|
$def_enabled = DI::pConfig()->get(local_user(), 'ljpost', 'post_by_default');
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/ljpost/ljpost.css' . '" media="all" />' . "\r\n";
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/ljpost/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
/* Get the current state of our config variables */
|
'$enabled' => ['ljpost', DI::l10n()->t('Enable LiveJournal Post Addon'), $enabled],
|
||||||
|
'$username' => ['ij_username', DI::l10n()->t('LiveJournal username'), $ij_username],
|
||||||
$enabled = DI::pConfig()->get(local_user(),'ljpost','post');
|
'$password' => ['ij_password', DI::l10n()->t('LiveJournal password')],
|
||||||
|
'$bydefault' => ['ij_bydefault', DI::l10n()->t('Post to LiveJournal by default'), $def_enabled],
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
]);
|
||||||
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(),'ljpost','post_by_default');
|
|
||||||
|
|
||||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$lj_username = DI::pConfig()->get(local_user(), 'ljpost', 'lj_username');
|
|
||||||
$lj_password = DI::pConfig()->get(local_user(), 'ljpost', 'lj_password');
|
|
||||||
|
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-block">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('LiveJournal Post Settings') . '</h3>';
|
|
||||||
$s .= '<div id="ljpost-enable-wrapper">';
|
|
||||||
$s .= '<label id="ljpost-enable-label" for="ljpost-checkbox">' . DI::l10n()->t('Enable LiveJournal Post Addon') . '</label>';
|
|
||||||
$s .= '<input id="ljpost-checkbox" type="checkbox" name="ljpost" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="ljpost-username-wrapper">';
|
|
||||||
$s .= '<label id="ljpost-username-label" for="ljpost-username">' . DI::l10n()->t('LiveJournal username') . '</label>';
|
|
||||||
$s .= '<input id="ljpost-username" type="text" name="lj_username" value="' . $lj_username . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="ljpost-password-wrapper">';
|
|
||||||
$s .= '<label id="ljpost-password-label" for="ljpost-password">' . DI::l10n()->t('LiveJournal password') . '</label>';
|
|
||||||
$s .= '<input id="ljpost-password" type="password" name="lj_password" value="' . $lj_password . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="ljpost-bydefault-wrapper">';
|
|
||||||
$s .= '<label id="ljpost-bydefault-label" for="ljpost-bydefault">' . DI::l10n()->t('Post to LiveJournal by default') . '</label>';
|
|
||||||
$s .= '<input id="ljpost-bydefault" type="checkbox" name="lj_bydefault" value="1" ' . $def_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="ljpost-submit" name="ljpost-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'connector' => 'ljpost',
|
||||||
|
'title' => DI::l10n()->t('LiveJournal Export'),
|
||||||
|
'image' => 'addon/ljpost/livejournal.png',
|
||||||
|
'enabled' => $enabled,
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
4
ljpost/templates/connector_settings.tpl
Normal file
4
ljpost/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_input.tpl" field=$username}}
|
||||||
|
{{include file="field_password.tpl" field=$password}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||||
|
|
@ -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-11-21 19:15-0500\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,80 +17,80 @@ 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"
|
||||||
|
|
||||||
#: mailstream.php:66
|
#: mailstream.php:77
|
||||||
msgid "From Address"
|
msgid "From Address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:68
|
#: mailstream.php:79
|
||||||
msgid "Email address that stream items will appear to be from."
|
msgid "Email address that stream items will appear to be from."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:71 mailstream.php:382
|
#: mailstream.php:82
|
||||||
msgid "Save Settings"
|
msgid "Save Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:225
|
#: mailstream.php:301
|
||||||
msgid "Re:"
|
msgid "Re:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:233
|
#: mailstream.php:314 mailstream.php:317
|
||||||
msgid "Friendica post"
|
msgid "Friendica post"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:236
|
#: mailstream.php:320
|
||||||
msgid "Diaspora post"
|
msgid "Diaspora post"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:246
|
#: mailstream.php:330
|
||||||
msgid "Feed item"
|
msgid "Feed item"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:249
|
#: mailstream.php:333
|
||||||
msgid "Email"
|
msgid "Email"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:251
|
#: mailstream.php:335
|
||||||
msgid "Friendica Item"
|
msgid "Friendica Item"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:296
|
#: mailstream.php:404
|
||||||
msgid "Upstream"
|
msgid "Upstream"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:297
|
#: mailstream.php:405
|
||||||
msgid "Local"
|
msgid "Local"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:364
|
#: mailstream.php:481
|
||||||
msgid "Enabled"
|
msgid "Enabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:368
|
#: mailstream.php:486
|
||||||
msgid "Email Address"
|
msgid "Email Address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:370
|
#: mailstream.php:488
|
||||||
msgid "Leave blank to use your account email address"
|
msgid "Leave blank to use your account email address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:373
|
#: mailstream.php:492
|
||||||
msgid "Exclude Likes"
|
msgid "Exclude Likes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:375
|
#: mailstream.php:494
|
||||||
msgid "Check this to omit mailing \"Like\" notifications"
|
msgid "Check this to omit mailing \"Like\" notifications"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:378
|
#: mailstream.php:498
|
||||||
msgid "Attach Images"
|
msgid "Attach Images"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:380
|
#: mailstream.php:500
|
||||||
msgid ""
|
msgid ""
|
||||||
"Download images in posts and attach them to the email. Useful for reading "
|
"Download images in posts and attach them to the email. Useful for reading "
|
||||||
"email while offline."
|
"email while offline."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mailstream.php:381
|
#: mailstream.php:507
|
||||||
msgid "Mail Stream Settings"
|
msgid "Mail Stream Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
* Author: Matthew Exon <http://mat.exon.name>
|
* Author: Matthew Exon <http://mat.exon.name>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
|
@ -462,17 +463,19 @@ function mailstream_convert_table_entries()
|
||||||
/**
|
/**
|
||||||
* Form for configuring mailstream features for a user
|
* Form for configuring mailstream features for a user
|
||||||
*
|
*
|
||||||
* @param Friendica\App $a App object
|
* @param App $a App object
|
||||||
* @param string $o HTML form data
|
* @param array $data Hook data array
|
||||||
|
* @throws \Friendica\Network\HTTPException\ServiceUnavailableException
|
||||||
*/
|
*/
|
||||||
function mailstream_addon_settings(&$a, &$s)
|
function mailstream_addon_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'mailstream', 'enabled');
|
$enabled = DI::pConfig()->get(local_user(), 'mailstream', 'enabled');
|
||||||
$address = DI::pConfig()->get(local_user(), 'mailstream', 'address');
|
$address = DI::pConfig()->get(local_user(), 'mailstream', 'address');
|
||||||
$nolikes = DI::pConfig()->get(local_user(), 'mailstream', 'nolikes');
|
$nolikes = DI::pConfig()->get(local_user(), 'mailstream', 'nolikes');
|
||||||
$attachimg= DI::pConfig()->get(local_user(), 'mailstream', 'attachimg');
|
$attachimg = DI::pConfig()->get(local_user(), 'mailstream', 'attachimg');
|
||||||
|
|
||||||
$template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/');
|
$template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/');
|
||||||
$s .= Renderer::replaceMacros($template, [
|
$html = Renderer::replaceMacros($template, [
|
||||||
'$enabled' => [
|
'$enabled' => [
|
||||||
'mailstream_enabled',
|
'mailstream_enabled',
|
||||||
DI::l10n()->t('Enabled'),
|
DI::l10n()->t('Enabled'),
|
||||||
|
|
@ -482,31 +485,36 @@ function mailstream_addon_settings(&$a, &$s)
|
||||||
'mailstream_address',
|
'mailstream_address',
|
||||||
DI::l10n()->t('Email Address'),
|
DI::l10n()->t('Email Address'),
|
||||||
$address,
|
$address,
|
||||||
DI::l10n()->t("Leave blank to use your account email address")
|
DI::l10n()->t('Leave blank to use your account email address')
|
||||||
],
|
],
|
||||||
'$nolikes' => [
|
'$nolikes' => [
|
||||||
'mailstream_nolikes',
|
'mailstream_nolikes',
|
||||||
DI::l10n()->t('Exclude Likes'),
|
DI::l10n()->t('Exclude Likes'),
|
||||||
$nolikes,
|
$nolikes,
|
||||||
DI::l10n()->t("Check this to omit mailing \"Like\" notifications")
|
DI::l10n()->t('Check this to omit mailing "Like" notifications')
|
||||||
],
|
],
|
||||||
'$attachimg' => [
|
'$attachimg' => [
|
||||||
'mailstream_attachimg',
|
'mailstream_attachimg',
|
||||||
DI::l10n()->t('Attach Images'),
|
DI::l10n()->t('Attach Images'),
|
||||||
$attachimg,
|
$attachimg,
|
||||||
DI::l10n()->t("Download images in posts and attach them to the email. " .
|
DI::l10n()->t('Download images in posts and attach them to the email. ' .
|
||||||
"Useful for reading email while offline.")
|
'Useful for reading email while offline.')
|
||||||
],
|
],
|
||||||
'$title' => DI::l10n()->t('Mail Stream Settings'),
|
]);
|
||||||
'$submit' => DI::l10n()->t('Save Settings')]);
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'mailstream',
|
||||||
|
'title' => DI::l10n()->t('Mail Stream Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process data submitted to user's mailstream features form
|
* Process data submitted to user's mailstream features form
|
||||||
* @param \Friendica\App $a
|
* @param App $a
|
||||||
* @param array $post POST data
|
* @param array $post POST data
|
||||||
*/
|
*/
|
||||||
function mailstream_addon_settings_post(\Friendica\App $a, array $post)
|
function mailstream_addon_settings_post(App $a, array $post)
|
||||||
{
|
{
|
||||||
if (!local_user() || empty($post['mailstream-submit'])) {
|
if (!local_user() || empty($post['mailstream-submit'])) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,4 @@
|
||||||
<span id="settings_mailstream_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_mailstream_expanded'); openClose('settings_mailstream_inflated');">
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
<h3>{{$title}}</h3>
|
{{include file="field_input.tpl" field=$address}}
|
||||||
</span>
|
{{include file="field_checkbox.tpl" field=$nolikes}}
|
||||||
<div id="settings_mailstream_expanded" class="settings-block" style="display: none;">
|
{{include file="field_checkbox.tpl" field=$attachimg}}
|
||||||
<span class="fakelink" onclick="openClose('settings_mailstream_expanded'); openClose('settings_mailstream_inflated');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
{{include file="field_checkbox.tpl" field=$enabled}}
|
|
||||||
{{include file="field_input.tpl" field=$address}}
|
|
||||||
{{include file="field_checkbox.tpl" field=$nolikes}}
|
|
||||||
{{include file="field_checkbox.tpl" field=$attachimg}}
|
|
||||||
<input type="submit" name="mailstream-submit" value="{{$submit}}">
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:15-0500\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"
|
||||||
|
|
@ -18,18 +18,13 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: markdown.php:30
|
#: markdown.php:30
|
||||||
msgid "Markdown"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: markdown.php:31
|
|
||||||
msgid "Enable Markdown parsing"
|
msgid "Enable Markdown parsing"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: markdown.php:31
|
#: markdown.php:30
|
||||||
msgid ""
|
msgid "If enabled, adds Markdown support to the Compose Post form."
|
||||||
"If enabled, self created items will additionally be parsed via Markdown."
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: markdown.php:32
|
#: markdown.php:35
|
||||||
msgid "Save Settings"
|
msgid "Markdown Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ function markdown_install() {
|
||||||
Hook::register('addon_settings_post', __FILE__, 'markdown_addon_settings_post');
|
Hook::register('addon_settings_post', __FILE__, 'markdown_addon_settings_post');
|
||||||
}
|
}
|
||||||
|
|
||||||
function markdown_addon_settings(App $a, &$s)
|
function markdown_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -26,11 +26,15 @@ function markdown_addon_settings(App $a, &$s)
|
||||||
$enabled = intval(DI::pConfig()->get(local_user(), 'markdown', 'enabled'));
|
$enabled = intval(DI::pConfig()->get(local_user(), 'markdown', 'enabled'));
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
|
||||||
$s .= Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$title' => DI::l10n()->t('Markdown'),
|
'$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')],
|
||||||
'$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, self created items will additionally be parsed via Markdown.')],
|
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'markdown',
|
||||||
|
'title' => DI::l10n()->t('Markdown Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function markdown_addon_settings_post(App $a, &$b)
|
function markdown_addon_settings_post(App $a, &$b)
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1 @@
|
||||||
<span id="settings_markdown_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_markdown_expanded'); openClose('settings_markdown_inflated');">
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_markdown_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_markdown_expanded'); openClose('settings_markdown_inflated');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div id="markdown-wrapper">
|
|
||||||
{{include file="field_checkbox.tpl" field=$enabled}}
|
|
||||||
</div>
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" id="markdown-submit" name="markdown-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:15-0500\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,17 +17,13 @@ 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"
|
||||||
|
|
||||||
#: mathjax.php:43
|
#: mathjax.php:42
|
||||||
msgid ""
|
msgid ""
|
||||||
"The MathJax addon renders mathematical formulae written using the LaTeX "
|
"The MathJax addon renders mathematical formulae written using the LaTeX "
|
||||||
"syntax surrounded by the usual $$ or an eqnarray block in the postings of "
|
"syntax surrounded by the usual $$ or an eqnarray block in the postings of "
|
||||||
"your wall,network tab and private mail."
|
"your wall,network tab and private mail."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mathjax.php:44
|
#: mathjax.php:43
|
||||||
msgid "Use the MathJax renderer"
|
msgid "Use the MathJax renderer"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: mathjax.php:45
|
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ function mathjax_settings_post($a)
|
||||||
DI::pConfig()->set(local_user(), 'mathjax', 'use', intval($_POST['mathjax_use']));
|
DI::pConfig()->set(local_user(), 'mathjax', 'use', intval($_POST['mathjax_use']));
|
||||||
}
|
}
|
||||||
|
|
||||||
function mathjax_settings(App $a, &$s)
|
function mathjax_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -38,12 +38,16 @@ function mathjax_settings(App $a, &$s)
|
||||||
$use = DI::pConfig()->get(local_user(), 'mathjax', 'use', false);
|
$use = DI::pConfig()->get(local_user(), 'mathjax', 'use', false);
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('settings.tpl', 'addon/mathjax');
|
$tpl = Renderer::getMarkupTemplate('settings.tpl', 'addon/mathjax');
|
||||||
$s .= Renderer::replaceMacros($tpl, [
|
$html = Renderer::replaceMacros($tpl, [
|
||||||
'$title' => 'MathJax',
|
|
||||||
'$description' => DI::l10n()->t('The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail.'),
|
'$description' => DI::l10n()->t('The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail.'),
|
||||||
'$mathjax_use' => ['mathjax_use', DI::l10n()->t('Use the MathJax renderer'), $use, ''],
|
'$mathjax_use' => ['mathjax_use', DI::l10n()->t('Use the MathJax renderer'), $use, ''],
|
||||||
'$savesettings' => DI::l10n()->t('Save Settings'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'mathjax',
|
||||||
|
'title' => 'MathJax',
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function mathjax_footer(App $a, &$b)
|
function mathjax_footer(App $a, &$b)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,2 @@
|
||||||
|
<p>{{$description}}</p>
|
||||||
<span id="settings_mathjax_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_mathjax_expanded'); openClose('settings_mathjax_inflated');">
|
{{include file="field_checkbox.tpl" field=$mathjax_use}}
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_mathjax_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_mathjax_expanded'); openClose('settings_mathjax_inflated');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<p>{{$description nofilter}}</p>
|
|
||||||
{{include file="field_checkbox.tpl" field=$mathjax_use}}
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper">
|
|
||||||
<button type="submit" id="mathjax-submit" name="mathjax-submit" class="settings-submit" value="1">{{$savesettings}}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
1
notimeline/templates/settings.tpl
Normal file
1
notimeline/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
|
@ -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-11-21 19:15-0500\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,11 +17,7 @@ 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"
|
||||||
|
|
||||||
#: nsfw.php:68 nsfw.php:72
|
#: nsfw.php:65
|
||||||
msgid "Content Filter (NSFW and more)"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: nsfw.php:76
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"This addon searches for specified words/text in posts and collapses them. It "
|
"This addon searches for specified words/text in posts and collapses them. It "
|
||||||
"can be used to filter content tagged with for instance #NSFW that may be "
|
"can be used to filter content tagged with for instance #NSFW that may be "
|
||||||
|
|
@ -29,28 +25,28 @@ msgid ""
|
||||||
"is also useful for hiding irrelevant or annoying content from direct view."
|
"is also useful for hiding irrelevant or annoying content from direct view."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nsfw.php:77
|
#: nsfw.php:66
|
||||||
msgid "Enable Content filter"
|
msgid "Enable Content filter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nsfw.php:80
|
#: nsfw.php:67
|
||||||
msgid "Comma separated list of keywords to hide"
|
msgid "Comma separated list of keywords to hide"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nsfw.php:84
|
#: nsfw.php:67
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: nsfw.php:85
|
|
||||||
msgid "Use /expression/ to provide regular expressions"
|
msgid "Use /expression/ to provide regular expressions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nsfw.php:152
|
#: nsfw.php:72
|
||||||
|
msgid "Content Filter (NSFW and more)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: nsfw.php:140
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Filtered tag: %s"
|
msgid "Filtered tag: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nsfw.php:154
|
#: nsfw.php:142
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Filtered word: %s"
|
msgid "Filtered word: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
|
|
||||||
#nsfw-label, #nsfw-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 300px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nsfw-words, #nsfw-enable {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nsfw-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nsfw-desc {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,10 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function nsfw_install()
|
function nsfw_install()
|
||||||
|
|
@ -48,42 +51,27 @@ function nsfw_extract_photos($body)
|
||||||
return $new_body;
|
return $new_body;
|
||||||
}
|
}
|
||||||
|
|
||||||
function nsfw_addon_settings(&$a, &$s)
|
function nsfw_addon_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$enabled = !DI::pConfig()->get(local_user(), 'nsfw', 'disable');
|
||||||
|
$words = DI::pConfig()->get(local_user(), 'nsfw', 'words', 'nsfw,');
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/nsfw/nsfw.css' . '" media="all" />' . "\r\n";
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/nsfw/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$info' => DI::l10n()->t('This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.'),
|
||||||
|
'$enabled' => ['nsfw-enable', DI::l10n()->t('Enable Content filter'), $enabled],
|
||||||
|
'$words' => ['nsfw-words', DI::l10n()->t('Comma separated list of keywords to hide'), $words, DI::l10n()->t('Use /expression/ to provide regular expressions')],
|
||||||
|
]);
|
||||||
|
|
||||||
$enable_checked = (intval(DI::pConfig()->get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
|
$data = [
|
||||||
$words = DI::pConfig()->get(local_user(), 'nsfw', 'words');
|
'addon' => 'nsfw',
|
||||||
if (!$words) {
|
'title' => DI::l10n()->t('Content Filter (NSFW and more)'),
|
||||||
$words = 'nsfw,';
|
'html' => $html,
|
||||||
}
|
];
|
||||||
|
|
||||||
$s .= '<span id="settings_nsfw_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_nsfw_expanded\'); openClose(\'settings_nsfw_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Content Filter (NSFW and more)') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_nsfw_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_nsfw_expanded\'); openClose(\'settings_nsfw_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Content Filter (NSFW and more)') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="nsfw-wrapper">';
|
|
||||||
$s .= '<p>' . DI::l10n()->t('This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.') . '</p>';
|
|
||||||
$s .= '<label id="nsfw-enable-label" for="nsfw-enable">' . DI::l10n()->t('Enable Content filter') . ' </label>';
|
|
||||||
$s .= '<input id="nsfw-enable" type="checkbox" name="nsfw-enable" value="1"' . $enable_checked . ' />';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
$s .= '<label id="nsfw-label" for="nsfw-words">' . DI::l10n()->t('Comma separated list of keywords to hide') . ' </label>';
|
|
||||||
$s .= '<textarea id="nsfw-words" type="text" name="nsfw-words">' . $words . '</textarea>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="nsfw-submit" name="nsfw-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
$s .= '<div class="nsfw-desc">' . DI::l10n()->t('Use /expression/ to provide regular expressions') . '</div></div>';
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function nsfw_addon_settings_post(&$a, &$b)
|
function nsfw_addon_settings_post(&$a, &$b)
|
||||||
|
|
@ -100,7 +88,7 @@ function nsfw_addon_settings_post(&$a, &$b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function nsfw_prepare_body_content_filter(\Friendica\App $a, &$hook_data)
|
function nsfw_prepare_body_content_filter(App $a, &$hook_data)
|
||||||
{
|
{
|
||||||
$words = null;
|
$words = null;
|
||||||
if (DI::pConfig()->get(local_user(), 'nsfw', 'disable')) {
|
if (DI::pConfig()->get(local_user(), 'nsfw', 'disable')) {
|
||||||
|
|
|
||||||
3
nsfw/templates/settings.tpl
Normal file
3
nsfw/templates/settings.tpl
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<p>{{$info}}</p>
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_textarea.tpl" field=$words}}
|
||||||
|
|
@ -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-11-21 19:15-0500\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,14 +17,10 @@ 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"
|
||||||
|
|
||||||
#: numfriends.php:59
|
#: numfriends.php:55
|
||||||
msgid "Numfriends Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: numfriends.php:61
|
|
||||||
msgid "How many contacts to display on profile sidebar"
|
msgid "How many contacts to display on profile sidebar"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: numfriends.php:67
|
#: numfriends.php:60
|
||||||
msgid "Save Settings"
|
msgid "Numfriends Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#numfriends-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#numfriends {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5,8 +5,11 @@
|
||||||
* Version: 1.0
|
* Version: 1.0
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function numfriends_install() {
|
function numfriends_install() {
|
||||||
|
|
@ -39,30 +42,22 @@ function numfriends_settings_post($a,$post) {
|
||||||
* Add our own settings info to the page.
|
* Add our own settings info to the page.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function numfriends_settings(&$a, &$s)
|
function numfriends_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/numfriends/numfriends.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
|
|
||||||
$numfriends = DI::pConfig()->get(local_user(), 'system', 'display_friend_count', 24);
|
$numfriends = DI::pConfig()->get(local_user(), 'system', 'display_friend_count', 24);
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/numfriends/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$numfriends' => ['numfriends', DI::l10n()->t('How many contacts to display on profile sidebar'), $numfriends],
|
||||||
|
]);
|
||||||
|
|
||||||
$s .= '<div class="settings-block">';
|
$data = [
|
||||||
$s .= '<h3>' . DI::l10n()->t('Numfriends Settings') . '</h3>';
|
'addon' => 'numfriends',
|
||||||
$s .= '<div id="numfriends-wrapper">';
|
'title' => DI::l10n()->t('Numfriends Settings'),
|
||||||
$s .= '<label id="numfriends-label" for="numfriends">' . DI::l10n()->t('How many contacts to display on profile sidebar') . '</label>';
|
'html' => $html,
|
||||||
$s .= '<input id="numfriends-input" type="text" name="numfriends" value="' . intval($numfriends) . '" ' . '/>';
|
];
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="numfriends-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
numfriends/templates/settings.tpl
Normal file
1
numfriends/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_input.tpl" field=$numfriends}}
|
||||||
26
opmlexport/lang/C/messages.po
Normal file
26
opmlexport/lang/C/messages.po
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
# ADDON opmlexport
|
||||||
|
# Copyright (C)
|
||||||
|
# This file is distributed under the same license as the Friendica opmlexport addon package.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: \n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2021-11-21 19:15-0500\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: opmlexport.php:79
|
||||||
|
msgid "OPML Export"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: opmlexport.php:80
|
||||||
|
msgid "Export RSS/Atom contacts"
|
||||||
|
msgstr ""
|
||||||
|
|
@ -68,17 +68,17 @@ function opmlexport(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function opmlexport_addon_settings(App $a, &$s)
|
function opmlexport_addon_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/opmlexport/');
|
$data = [
|
||||||
$s .= Renderer::replaceMacros($t, [
|
'addon' => 'opmlexport',
|
||||||
'$title' => DI::l10n()->t('OPML Export'),
|
'title' => DI::l10n()->t('OPML Export'),
|
||||||
'$submit' => DI::l10n()->t('Export RSS/Atom contacts'),
|
'submit' => DI::l10n()->t('Export RSS/Atom contacts'),
|
||||||
]);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<span id="settings_opmlexport_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_opmlexport_expanded'); openClose('settings_opmlexport_inflated');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_opmlexport_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_opmlexport_expanded'); openClose('settings_opmlexport_inflated');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper" >
|
|
||||||
<input type="submit" id="opmlexport-submit" name="opmlexport-submit" class="settings-submit" value="{{$submit}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -23,9 +23,7 @@ function pageheader_addon_admin(App &$a, &$s)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
DI::page()->registerStylesheet(__DIR__ . '/pageheader.css');
|
||||||
$stylesheetPath = __DIR__ . '/pageheader.css';
|
|
||||||
DI::page()->registerStylesheet($stylesheetPath);
|
|
||||||
|
|
||||||
$words = DI::config()->get('pageheader','text');
|
$words = DI::config()->get('pageheader','text');
|
||||||
if(! $words)
|
if(! $words)
|
||||||
|
|
@ -62,8 +60,7 @@ function pageheader_fetch(App $a, &$b)
|
||||||
$s = DI::config()->get('pageheader', 'text');
|
$s = DI::config()->get('pageheader', 'text');
|
||||||
}
|
}
|
||||||
|
|
||||||
$stylesheetPath = __DIR__ .'/pageheader.css';
|
DI::page()->registerStylesheet(__DIR__ .'/pageheader.css');
|
||||||
DI::page()->registerStylesheet($stylesheetPath);
|
|
||||||
|
|
||||||
if ($s) {
|
if ($s) {
|
||||||
$b .= '<div class="pageheader">' . $s . '</div>';
|
$b .= '<div class="pageheader">' . $s . '</div>';
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:15-0500\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,18 +17,10 @@ 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"
|
||||||
|
|
||||||
#: planets.php:131 planets.php:135
|
#: planets.php:126
|
||||||
msgid "Planets"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: planets.php:139
|
|
||||||
msgid "Planets Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: planets.php:141
|
|
||||||
msgid "Enable Planets Addon"
|
msgid "Enable Planets Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: planets.php:147
|
#: planets.php:131
|
||||||
msgid "Save Settings"
|
msgid "Planets Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#planets-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#planets-checkbox {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,8 +6,11 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
* Author: Tony Baldwin <https://free-haven.org/profile/tony>
|
* Author: Tony Baldwin <https://free-haven.org/profile/tony>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function planets_install() {
|
function planets_install() {
|
||||||
|
|
@ -110,40 +113,22 @@ function planets_settings_post($a,$post) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function planets_settings(&$a,&$s) {
|
function planets_settings(App &$a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if(! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/planets/planets.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(),'planets','enable');
|
$enabled = DI::pConfig()->get(local_user(),'planets','enable');
|
||||||
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/planets/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
/* Add some HTML to the existing form */
|
'$enabled' => ['planets', DI::l10n()->t('Enable Planets Addon'), $enabled],
|
||||||
|
]);
|
||||||
$s .= '<span id="settings_planets_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_planets_expanded\'); openClose(\'settings_planets_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Planets') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_planets_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_planets_expanded\'); openClose(\'settings_planets_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Planets') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div class="settings-block">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Planets Settings') . '</h3>';
|
|
||||||
$s .= '<div id="planets-enable-wrapper">';
|
|
||||||
$s .= '<label id="planets-enable-label" for="planets-checkbox">' . DI::l10n()->t('Enable Planets Addon') . '</label>';
|
|
||||||
$s .= '<input id="planets-checkbox" type="checkbox" name="planets" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="planets-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'planets',
|
||||||
|
'title' => DI::l10n()->t('Planets Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
planets/templates/settings.tpl
Normal file
1
planets/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
|
@ -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-07-25 13:16+0000\n"
|
"POT-Creation-Date: 2021-11-21 19:17-0500\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,76 +17,76 @@ 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"
|
||||||
|
|
||||||
#: pumpio.php:54
|
#: pumpio.php:57
|
||||||
msgid "Permission denied."
|
msgid "Permission denied."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:149
|
#: pumpio.php:152
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "Unable to register the client at the pump.io server '%s'."
|
msgid "Unable to register the client at the pump.io server '%s'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:189
|
#: pumpio.php:192
|
||||||
msgid "You are now authenticated to pumpio."
|
msgid "You are now authenticated to pumpio."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:190
|
#: pumpio.php:193
|
||||||
msgid "return to the connector page"
|
msgid "return to the connector page"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:210
|
#: pumpio.php:213
|
||||||
msgid "Post to pumpio"
|
msgid "Post to pumpio"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:251 pumpio.php:255
|
#: pumpio.php:237
|
||||||
msgid "Pump.io Import/Export/Mirror"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:259
|
|
||||||
msgid "pump.io username (without the servername)"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:264
|
|
||||||
msgid "pump.io servername (without \"http://\" or \"https://\" )"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:275
|
|
||||||
msgid "Authenticate your pump.io connection"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:279
|
|
||||||
msgid "Import the remote timeline"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:284
|
|
||||||
msgid "Enable pump.io Post Addon"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:289
|
|
||||||
msgid "Post to pump.io by default"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:294
|
|
||||||
msgid "Should posts be public?"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:299
|
|
||||||
msgid "Mirror all public posts"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:304
|
|
||||||
msgid "Check to delete this preset"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: pumpio.php:314
|
|
||||||
msgid "Save Settings"
|
msgid "Save Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:983
|
#: pumpio.php:239
|
||||||
|
msgid "Delete this preset"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:245
|
||||||
|
msgid "Authenticate your pump.io connection"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:252
|
||||||
|
msgid "Pump.io servername (without \"http://\" or \"https://\" )"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:253
|
||||||
|
msgid "Pump.io username (without the servername)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:254
|
||||||
|
msgid "Import the remote timeline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:255
|
||||||
|
msgid "Enable Pump.io Post Addon"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:256
|
||||||
|
msgid "Post to Pump.io by default"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:257
|
||||||
|
msgid "Should posts be public?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:258
|
||||||
|
msgid "Mirror all public posts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:263
|
||||||
|
msgid "Pump.io Import/Export/Mirror"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: pumpio.php:920
|
||||||
msgid "status"
|
msgid "status"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: pumpio.php:987
|
#: pumpio.php:924
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "%1$s likes %2$s's %3$s"
|
msgid "%1$s likes %2$s's %3$s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
#pumpio-import-label,#pumpio-mirror-label,#pumpio-public-label, #pumpio-enable-label, #pumpio-username-label, #pumpio-servername-label, #pumpio-bydefault-label, #pumpio-delete-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pumpio-import,#pumpio-mirror,#pumpio-public, #pumpio-checkbox, #pumpio-username, #pumpio-servername, #pumpio-bydefault, #pumpio-delete {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pumpio-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -13,6 +13,7 @@ use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
@ -216,109 +217,59 @@ function pumpio_jot_nets(App $a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function pumpio_settings(App $a, &$s)
|
function pumpio_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$pumpio_host = DI::pConfig()->get(local_user(), 'pumpio', 'host');
|
||||||
|
$pumpio_user = DI::pConfig()->get(local_user(), 'pumpio', 'user');
|
||||||
|
$oauth_token = DI::pConfig()->get(local_user(), 'pumpio', 'oauth_token');
|
||||||
|
$oauth_token_secret = DI::pConfig()->get(local_user(), 'pumpio', 'oauth_token_secret');
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/pumpio/pumpio.css' . '" media="all" />' . "\r\n";
|
$import_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'import', false);
|
||||||
|
$enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post', false);
|
||||||
|
$def_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post_by_default', false);
|
||||||
|
$public_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'public', false);
|
||||||
|
$mirror_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'mirror', false);
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
$submit = ['pumpio-submit' => DI::l10n()->t('Save Settings')];
|
||||||
|
if ($oauth_token && $oauth_token_secret) {
|
||||||
$import_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'import');
|
$submit['pumpio-delete'] = DI::l10n()->t('Delete this preset');
|
||||||
$import_checked = (($import_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post');
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
$css = (($enabled) ? '' : '-disabled');
|
|
||||||
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post_by_default');
|
|
||||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$public_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'public');
|
|
||||||
$public_checked = (($public_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$mirror_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'mirror');
|
|
||||||
$mirror_checked = (($mirror_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$servername = DI::pConfig()->get(local_user(), "pumpio", "host");
|
|
||||||
$username = DI::pConfig()->get(local_user(), "pumpio", "user");
|
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
|
||||||
|
|
||||||
$s .= '<span id="settings_pumpio_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_pumpio_expanded\'); openClose(\'settings_pumpio_inflated\');">';
|
|
||||||
$s .= '<img class="connector'.$css.'" src="images/pumpio.png" /><h3 class="connector">'. DI::l10n()->t('Pump.io Import/Export/Mirror').'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_pumpio_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_pumpio_expanded\'); openClose(\'settings_pumpio_inflated\');">';
|
|
||||||
$s .= '<img class="connector'.$css.'" src="images/pumpio.png" /><h3 class="connector">'. DI::l10n()->t('Pump.io Import/Export/Mirror').'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-username-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-username-label" for="pumpio-username">'.DI::l10n()->t('pump.io username (without the servername)').'</label>';
|
|
||||||
$s .= '<input id="pumpio-username" type="text" name="pumpio_user" value="'.$username.'" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-servername-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-servername-label" for="pumpio-servername">'.DI::l10n()->t('pump.io servername (without "http://" or "https://" )').'</label>';
|
|
||||||
$s .= '<input id="pumpio-servername" type="text" name="pumpio_host" value="'.$servername.'" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
if (($username != '') && ($servername != '')) {
|
|
||||||
$oauth_token = DI::pConfig()->get(local_user(), "pumpio", "oauth_token");
|
|
||||||
$oauth_token_secret = DI::pConfig()->get(local_user(), "pumpio", "oauth_token_secret");
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-password-wrapper">';
|
|
||||||
if (($oauth_token == "") || ($oauth_token_secret == "")) {
|
|
||||||
$s .= '<div id="pumpio-authenticate-wrapper">';
|
|
||||||
$s .= '<a href="'.DI::baseUrl()->get().'/pumpio/connect">'.DI::l10n()->t("Authenticate your pump.io connection").'</a>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
} else {
|
|
||||||
$s .= '<div id="pumpio-import-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-import-label" for="pumpio-import">' . DI::l10n()->t('Import the remote timeline') . '</label>';
|
|
||||||
$s .= '<input id="pumpio-import" type="checkbox" name="pumpio_import" value="1" ' . $import_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-enable-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-enable-label" for="pumpio-checkbox">' . DI::l10n()->t('Enable pump.io Post Addon') . '</label>';
|
|
||||||
$s .= '<input id="pumpio-checkbox" type="checkbox" name="pumpio" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-bydefault-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-bydefault-label" for="pumpio-bydefault">' . DI::l10n()->t('Post to pump.io by default') . '</label>';
|
|
||||||
$s .= '<input id="pumpio-bydefault" type="checkbox" name="pumpio_bydefault" value="1" ' . $def_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-public-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-public-label" for="pumpio-public">' . DI::l10n()->t('Should posts be public?') . '</label>';
|
|
||||||
$s .= '<input id="pumpio-public" type="checkbox" name="pumpio_public" value="1" ' . $public_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-mirror-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-mirror-label" for="pumpio-mirror">' . DI::l10n()->t('Mirror all public posts') . '</label>';
|
|
||||||
$s .= '<input id="pumpio-mirror" type="checkbox" name="pumpio_mirror" value="1" ' . $mirror_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="pumpio-delete-wrapper">';
|
|
||||||
$s .= '<label id="pumpio-delete-label" for="pumpio-delete">' . DI::l10n()->t('Check to delete this preset') . '</label>';
|
|
||||||
$s .= '<input id="pumpio-delete" type="checkbox" name="pumpio_delete" value="1" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/pumpio/');
|
||||||
}
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$l10n' => [
|
||||||
|
'authenticate' => DI::l10n()->t('Authenticate your pump.io connection'),
|
||||||
|
],
|
||||||
|
'$pumpio_host' => $pumpio_host,
|
||||||
|
'$pumpio_user' => $pumpio_user,
|
||||||
|
'$oauth_token' => $oauth_token,
|
||||||
|
'$oauth_token_secret' => $oauth_token_secret,
|
||||||
|
'$authenticate_url' => DI::baseUrl()->get() . '/pumpio/connect',
|
||||||
|
'$servername' => ['pumpio_host', DI::l10n()->t('Pump.io servername (without "http://" or "https://" )'), $pumpio_host],
|
||||||
|
'$username' => ['pumpio_user', DI::l10n()->t('Pump.io username (without the servername)'), $pumpio_user],
|
||||||
|
'$import' => ['pumpio_import', DI::l10n()->t('Import the remote timeline'), $import_enabled],
|
||||||
|
'$enabled' => ['pumpio', DI::l10n()->t('Enable Pump.io Post Addon'), $enabled],
|
||||||
|
'$bydefault' => ['pumpio_bydefault', DI::l10n()->t('Post to Pump.io by default'), $def_enabled],
|
||||||
|
'$public' => ['pumpio_public', DI::l10n()->t('Should posts be public?'), $public_enabled],
|
||||||
|
'$mirror' => ['pumpio_mirror', DI::l10n()->t('Mirror all public posts'), $mirror_enabled],
|
||||||
|
]);
|
||||||
|
|
||||||
/* provide a submit button */
|
$data = [
|
||||||
|
'connector' => 'pumpio',
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="pumpio-submit" name="pumpio-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
'title' => DI::l10n()->t('Pump.io Import/Export/Mirror'),
|
||||||
|
'image' => 'images/pumpio.png',
|
||||||
|
'enabled' => $enabled,
|
||||||
|
'html' => $html,
|
||||||
|
'submit' => $submit,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function pumpio_settings_post(App $a, array &$b)
|
function pumpio_settings_post(App $a, array &$b)
|
||||||
{
|
{
|
||||||
if (!empty($_POST['pumpio-submit'])) {
|
|
||||||
if (!empty($_POST['pumpio_delete'])) {
|
if (!empty($_POST['pumpio_delete'])) {
|
||||||
DI::pConfig()->set(local_user(), 'pumpio', 'consumer_key' , '');
|
DI::pConfig()->set(local_user(), 'pumpio', 'consumer_key' , '');
|
||||||
DI::pConfig()->set(local_user(), 'pumpio', 'consumer_secret' , '');
|
DI::pConfig()->set(local_user(), 'pumpio', 'consumer_secret' , '');
|
||||||
|
|
@ -333,7 +284,7 @@ function pumpio_settings_post(App $a, array &$b)
|
||||||
DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default' , false);
|
DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default' , false);
|
||||||
DI::pConfig()->set(local_user(), 'pumpio', 'lastdate' , 0);
|
DI::pConfig()->set(local_user(), 'pumpio', 'lastdate' , 0);
|
||||||
DI::pConfig()->set(local_user(), 'pumpio', 'last_id' , '');
|
DI::pConfig()->set(local_user(), 'pumpio', 'last_id' , '');
|
||||||
} else {
|
} elseif (!empty($_POST['pumpio-submit'])) {
|
||||||
// filtering the username if it is filled wrong
|
// filtering the username if it is filled wrong
|
||||||
$user = $_POST['pumpio_user'];
|
$user = $_POST['pumpio_user'];
|
||||||
if (strstr($user, "@")) {
|
if (strstr($user, "@")) {
|
||||||
|
|
@ -361,7 +312,6 @@ function pumpio_settings_post(App $a, array &$b)
|
||||||
DI::pConfig()->delete(local_user(), 'pumpio', 'lastdate');
|
DI::pConfig()->delete(local_user(), 'pumpio', 'lastdate');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function pumpio_load_config(App $a, ConfigFileLoader $loader)
|
function pumpio_load_config(App $a, ConfigFileLoader $loader)
|
||||||
|
|
|
||||||
13
pumpio/templates/connector_settings.tpl
Normal file
13
pumpio/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{{include file="field_input.tpl" field=$servername}}
|
||||||
|
{{include file="field_input.tpl" field=$username}}
|
||||||
|
|
||||||
|
{{if $oauth_token && $oauth_token_secret}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$public}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$mirror}}
|
||||||
|
{{elseif $pumpio_host && $pumpio_user}}
|
||||||
|
<div id="pumpio-authenticate-wrapper">
|
||||||
|
<a href="{{$authenticate_url}}">{{$l10n.authenticate}}</a>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
@ -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-11-21 19:16-0500\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"
|
||||||
|
|
||||||
#: qcomment.php:42
|
#: qcomment.php:45
|
||||||
msgid ":-)"
|
msgid ":-)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: qcomment.php:42
|
#: qcomment.php:45
|
||||||
msgid ":-("
|
msgid ":-("
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: qcomment.php:42
|
#: qcomment.php:45
|
||||||
msgid "lol"
|
msgid "lol"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: qcomment.php:47
|
#: qcomment.php:49
|
||||||
msgid "Quick Comment Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: qcomment.php:48
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Quick comments are found near comment boxes, sometimes hidden. Click them to "
|
"Quick comments are found near comment boxes, sometimes hidden. Click them to "
|
||||||
"provide simple replies."
|
"provide simple replies."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: qcomment.php:49
|
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: qcomment.php:50
|
#: qcomment.php:50
|
||||||
msgid "Enter quick comments, one per line"
|
msgid "Enter quick comments, one per line"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: qcomment.php:55
|
||||||
|
msgid "Quick Comment Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,10 @@
|
||||||
* them to open the comment window fully and insert the qcomment. Then "Submit" will submit it.
|
* them to open the comment window fully and insert the qcomment. Then "Submit" will submit it.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\XML;
|
use Friendica\Util\XML;
|
||||||
|
|
||||||
|
|
@ -28,27 +31,30 @@ function qcomment_install()
|
||||||
Hook::register('footer' , __FILE__, 'qcomment_footer');
|
Hook::register('footer' , __FILE__, 'qcomment_footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
function qcomment_footer(\Friendica\App $a, &$b)
|
function qcomment_footer(App $a, &$b)
|
||||||
{
|
{
|
||||||
DI::page()->registerFooterScript(__DIR__ . '/qcomment.js');
|
DI::page()->registerFooterScript('addon/qcomment/qcomment.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
function qcomment_addon_settings(&$a, &$s)
|
function qcomment_addon_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (! local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words', DI::l10n()->t(':-)') . "\n" . DI::l10n()->t(':-(') . "\n" . DI::l10n()->t('lol'));
|
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words', DI::l10n()->t(':-)') . "\n" . DI::l10n()->t(':-(') . "\n" . DI::l10n()->t('lol'));
|
||||||
|
|
||||||
$t = \Friendica\Core\Renderer::getMarkupTemplate('settings.tpl', 'addon/qcomment/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/qcomment/');
|
||||||
$s .= \Friendica\Core\Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$postpost' => isset($_POST['qcomment-words']),
|
'$description' => DI::l10n()->t('Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.'),
|
||||||
'$header' => DI::l10n()->t('Quick Comment Settings'),
|
|
||||||
'$description' => DI::l10n()->t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies."),
|
|
||||||
'$save' => DI::l10n()->t('Save Settings'),
|
|
||||||
'$words' => ['qcomment-words', DI::l10n()->t('Enter quick comments, one per line'), $words, null, ' rows="10"'],
|
'$words' => ['qcomment-words', DI::l10n()->t('Enter quick comments, one per line'), $words, null, ' rows="10"'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'qcomment',
|
||||||
|
'title' => DI::l10n()->t('Quick Comment Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function qcomment_addon_settings_post(&$a, &$b)
|
function qcomment_addon_settings_post(&$a, &$b)
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,2 @@
|
||||||
<span id="settings_qcomment_inflated" class="settings-block fakelink"
|
<p>{{$description}}</p>
|
||||||
style="{{if $postpost}}display: none;{{else}}display: block;{{/if}}"
|
{{include file="field_textarea.tpl" field=$words}}
|
||||||
onclick="openClose('settings_qcomment_expanded'); openClose('settings_qcomment_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_qcomment_expanded" class="settings-block"
|
|
||||||
style="{{if $postpost}}display: block;{{else}}display: none;{{/if}}">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_qcomment_expanded'); openClose('settings_qcomment_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div id="qcomment-wrapper">
|
|
||||||
<p id="qcomment-desc">{{$description}}</p>
|
|
||||||
|
|
||||||
{{include file="field_textarea.tpl" field=$words}}
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper">
|
|
||||||
<button type="submit" id="qcomment-submit" name="qcomment-submit" class="btn btn-primary settings-submit">{{$save}}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:16-0500\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,14 +17,10 @@ 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"
|
||||||
|
|
||||||
#: randplace.php:166
|
#: randplace.php:161
|
||||||
msgid "Randplace Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: randplace.php:168
|
|
||||||
msgid "Enable Randplace Addon"
|
msgid "Enable Randplace Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: randplace.php:174
|
#: randplace.php:166
|
||||||
msgid "Save Settings"
|
msgid "Randplace Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#randplace-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#randplace-checkbox {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,8 +18,11 @@
|
||||||
* system will call the name_uninstall() function.
|
* system will call the name_uninstall() function.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function randplace_install() {
|
function randplace_install() {
|
||||||
|
|
@ -145,32 +148,22 @@ function randplace_settings_post($a,$post) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function randplace_settings(&$a,&$s) {
|
function randplace_settings(App &$a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if(! local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/randplace/randplace.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(),'randplace','enable');
|
$enabled = DI::pConfig()->get(local_user(),'randplace','enable');
|
||||||
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/randplace/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
/* Add some HTML to the existing form */
|
'$enabled' => ['randplace', DI::l10n()->t('Enable Randplace Addon'), $enabled],
|
||||||
|
]);
|
||||||
$s .= '<div class="settings-block">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Randplace Settings') . '</h3>';
|
|
||||||
$s .= '<div id="randplace-enable-wrapper">';
|
|
||||||
$s .= '<label id="randplace-enable-label" for="randplace-checkbox">' . DI::l10n()->t('Enable Randplace Addon') . '</label>';
|
|
||||||
$s .= '<input id="randplace-checkbox" type="checkbox" name="randplace" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="randplace-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'randplace',
|
||||||
|
'title' => DI::l10n()->t('Randplace Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
randplace/templates/settings.tpl
Normal file
1
randplace/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
|
@ -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-11-21 19:16-0500\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,34 +17,34 @@ 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"
|
||||||
|
|
||||||
#: securemail.php:51
|
#: securemail.php:50
|
||||||
msgid "\"Secure Mail\" Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: securemail.php:52
|
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: securemail.php:53 securemail.php:80
|
|
||||||
msgid "Save and send test"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: securemail.php:54
|
|
||||||
msgid "Enable Secure Mail"
|
msgid "Enable Secure Mail"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: securemail.php:55
|
#: securemail.php:51
|
||||||
msgid "Public key"
|
msgid "Public key"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: securemail.php:55
|
#: securemail.php:51
|
||||||
msgid "Your public PGP key, ascii armored format"
|
msgid "Your public PGP key, ascii armored format"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: securemail.php:88
|
#: securemail.php:56
|
||||||
|
msgid "\"Secure Mail\" Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: securemail.php:59
|
||||||
|
msgid "Save Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: securemail.php:60
|
||||||
|
msgid "Save and send test"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: securemail.php:93
|
||||||
msgid "Test email sent"
|
msgid "Test email sent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: securemail.php:90
|
#: securemail.php:95
|
||||||
msgid "There was an error sending the test email"
|
msgid "There was an error sending the test email"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -36,24 +36,30 @@ function securemail_install()
|
||||||
*
|
*
|
||||||
* @see App
|
* @see App
|
||||||
*/
|
*/
|
||||||
function securemail_settings(App &$a, &$s)
|
function securemail_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$enable = intval(DI::pConfig()->get(local_user(), 'securemail', 'enable'));
|
$enabled = intval(DI::pConfig()->get(local_user(), 'securemail', 'enable'));
|
||||||
$publickey = DI::pConfig()->get(local_user(), 'securemail', 'pkey');
|
$publickey = DI::pConfig()->get(local_user(), 'securemail', 'pkey');
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/securemail/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/securemail/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
$s .= Renderer::replaceMacros($t, [
|
'$enabled' => ['securemail-enable', DI::l10n()->t('Enable Secure Mail'), $enabled],
|
||||||
'$title' => DI::l10n()->t('"Secure Mail" Settings'),
|
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
'$test' => DI::l10n()->t('Save and send test'), //NOTE: update also in 'post'
|
|
||||||
'$enable' => ['securemail-enable', DI::l10n()->t('Enable Secure Mail'), $enable, ''],
|
|
||||||
'$publickey' => ['securemail-pkey', DI::l10n()->t('Public key'), $publickey, DI::l10n()->t('Your public PGP key, ascii armored format')]
|
'$publickey' => ['securemail-pkey', DI::l10n()->t('Public key'), $publickey, DI::l10n()->t('Your public PGP key, ascii armored format')]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'securemail',
|
||||||
|
'title' => DI::l10n()->t('"Secure Mail" Settings'),
|
||||||
|
'html' => $html,
|
||||||
|
'submit' => [
|
||||||
|
'securemail-submit' => DI::l10n()->t('Save Settings'),
|
||||||
|
'securemail-test' => DI::l10n()->t('Save and send test'),
|
||||||
|
],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -72,13 +78,12 @@ function securemail_settings_post(App &$a, array &$b)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['securemail-submit']) {
|
if (!empty($_POST['securemail-submit']) || !empty($_POST['securemail-test'])) {
|
||||||
DI::pConfig()->set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey']));
|
DI::pConfig()->set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey']));
|
||||||
$enable = (!empty($_POST['securemail-enable']) ? 1 : 0);
|
$enable = (!empty($_POST['securemail-enable']) ? 1 : 0);
|
||||||
DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable);
|
DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable);
|
||||||
|
|
||||||
if ($_POST['securemail-submit'] == 'test') {
|
if (!empty($_POST['securemail-test'])) {
|
||||||
|
|
||||||
$res = DI::emailer()->send(new SecureTestEmail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl()));
|
$res = DI::emailer()->send(new SecureTestEmail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl()));
|
||||||
|
|
||||||
// revert to saved value
|
// revert to saved value
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<span id="settings_securemail_inflated" class="settings-block fakelink" style="display: block" onclick="openClose('settings_securemail_expanded'); openClose('settings_securemail_inflated');">
|
|
||||||
<h3>{{$title}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_securemail_expanded" class="settings-block" style="display: none">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_securemail_expanded'); openClose('settings_securemail_inflated');"><h3>{{$title}}</h3></span>
|
|
||||||
<div id="securemail-wrapper">
|
|
||||||
{{include file="field_checkbox.tpl" field=$enable}}
|
|
||||||
{{include file="field_textarea.tpl" field=$publickey}}
|
|
||||||
|
|
||||||
<div class="form-group pull-right settings-submit-wrapper" >
|
|
||||||
<button type="submit" name="securemail-submit" class="btn btn-primary" value="submit">{{$submit}}</button>
|
|
||||||
<button type="submit" name="securemail-submit" class="btn btn-default" value="test">{{$test}}</button>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
2
securemail/templates/settings.tpl
Normal file
2
securemail/templates/settings.tpl
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_textarea.tpl" field=$publickey}}
|
||||||
|
|
@ -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-11-21 19:16-0500\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,22 +17,18 @@ 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"
|
||||||
|
|
||||||
#: showmore.php:35 showmore.php:39
|
#: showmore.php:37
|
||||||
msgid "\"Show more\" Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: showmore.php:44
|
|
||||||
msgid "Enable Show More"
|
msgid "Enable Show More"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: showmore.php:47
|
#: showmore.php:38
|
||||||
msgid "Cutting posts after how much characters"
|
msgid "Cutting posts after how many characters"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: showmore.php:51
|
#: showmore.php:43
|
||||||
msgid "Save Settings"
|
msgid "\"Show more\" Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: showmore.php:129
|
#: showmore.php:119
|
||||||
msgid "show more"
|
msgid "show more"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@
|
||||||
* based upon NSFW from Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* based upon NSFW from Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
|
@ -18,41 +21,28 @@ function showmore_install()
|
||||||
Hook::register('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
|
Hook::register('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
|
||||||
}
|
}
|
||||||
|
|
||||||
function showmore_addon_settings(&$a, &$s)
|
function showmore_addon_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
DI::page()->registerStylesheet(__DIR__ . '/showmore.css', 'all');
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/showmore/showmore.css'.'" media="all"/>'."\r\n";
|
$enabled = !DI::pConfig()->get(local_user(), 'showmore', 'disable');
|
||||||
|
|
||||||
$enable_checked = (intval(DI::pConfig()->get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"');
|
|
||||||
$chars = DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100);
|
$chars = DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100);
|
||||||
|
|
||||||
$s .= '<span id="settings_showmore_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_showmore_expanded\'); openClose(\'settings_showmore_inflated\');">';
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore/');
|
||||||
$s .= '<h3>' . DI::l10n()->t('"Show more" Settings').'</h3>';
|
$html = Renderer::replaceMacros($t, [
|
||||||
$s .= '</span>';
|
'$enabled' => ['showmore-enable', DI::l10n()->t('Enable Show More'), $enabled],
|
||||||
$s .= '<div id="settings_showmore_expanded" class="settings-block" style="display: none;">';
|
'$chars' => ['showmore-chars', DI::l10n()->t('Cutting posts after how many characters'), $chars],
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_showmore_expanded\'); openClose(\'settings_showmore_inflated\');">';
|
]);
|
||||||
$s .= '<h3>' . DI::l10n()->t('"Show more" Settings').'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="showmore-wrapper">';
|
$data = [
|
||||||
|
'addon' => 'showmore',
|
||||||
$s .= '<label id="showmore-enable-label" for="showmore-enable">'.DI::l10n()->t('Enable Show More').'</label>';
|
'title' => DI::l10n()->t('"Show more" Settings'),
|
||||||
$s .= '<input id="showmore-enable" type="checkbox" name="showmore-enable" value="1"'.$enable_checked.' />';
|
'html' => $html,
|
||||||
$s .= '<div class="clear"></div>';
|
];
|
||||||
$s .= '<label id="showmore-label" for="showmore-chars">'.DI::l10n()->t('Cutting posts after how much characters').' </label>';
|
|
||||||
$s .= '<input id="showmore-words" type="text" name="showmore-chars" value="'.$chars.'" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="showmore-submit" name="showmore-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
// $s .= '<div class="showmore-desc">' . DI::l10n()->t('Use /expression/ to provide regular expressions') . '</div>';
|
|
||||||
$s .= '</div>';
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showmore_addon_settings_post(&$a, &$b)
|
function showmore_addon_settings_post(&$a, &$b)
|
||||||
|
|
@ -103,7 +93,7 @@ function get_body_length($body)
|
||||||
return strlen($string);
|
return strlen($string);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showmore_prepare_body(\Friendica\App $a, &$hook_data)
|
function showmore_prepare_body(App $a, &$hook_data)
|
||||||
{
|
{
|
||||||
// No combination with content filters
|
// No combination with content filters
|
||||||
if (!empty($hook_data['filter_reasons'])) {
|
if (!empty($hook_data['filter_reasons'])) {
|
||||||
|
|
|
||||||
3
showmore/templates/settings.tpl
Normal file
3
showmore/templates/settings.tpl
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<p>{{$info}}</p>
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_input.tpl" field=$chars}}
|
||||||
|
|
@ -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-11-21 19:16-0500\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"
|
||||||
|
|
@ -18,23 +18,19 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: showmore_dyn.php:59
|
#: showmore_dyn.php:59
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: showmore_dyn.php:60
|
|
||||||
msgid "Show More Dynamic"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: showmore_dyn.php:61
|
|
||||||
msgid "Limit Height"
|
msgid "Limit Height"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: showmore_dyn.php:61
|
#: showmore_dyn.php:59
|
||||||
msgid ""
|
msgid ""
|
||||||
"The maximal pixel height of posts before the Show More link is added, 0 to "
|
"The maximal pixel height of posts before the Show More link is added, 0 to "
|
||||||
"disable"
|
"disable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: showmore_dyn.php:69
|
#: showmore_dyn.php:64
|
||||||
|
msgid "Show More Dynamic"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: showmore_dyn.php:72
|
||||||
msgid "Show more..."
|
msgid "Show more..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function showmore_dyn_settings_post()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showmore_dyn_settings(App &$a, &$o)
|
function showmore_dyn_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if(!local_user()) {
|
if(!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -55,12 +55,15 @@ function showmore_dyn_settings(App &$a, &$o)
|
||||||
DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight);
|
DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight);
|
||||||
|
|
||||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/');
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/');
|
||||||
$o .= Renderer::replaceMacros($t, [
|
$html = Renderer::replaceMacros($t, [
|
||||||
'$submit' => DI::l10n()->t('Save Settings'),
|
|
||||||
'$header' => DI::l10n()->t('Show More Dynamic'),
|
|
||||||
'$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, DI::l10n()->t('The maximal pixel height of posts before the Show More link is added, 0 to disable'), '', '', 'number'],
|
'$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, DI::l10n()->t('The maximal pixel height of posts before the Show More link is added, 0 to disable'), '', '', 'number'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'addon' => 'showmore_dyn',
|
||||||
|
'title' => DI::l10n()->t('Show More Dynamic'),
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function showmore_dyn_script()
|
function showmore_dyn_script()
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1 @@
|
||||||
<span id="settings_showmore_dyn_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_showmore_dyn_expanded'); openClose('settings_showmore_dyn_inflated');">
|
{{include file="field_input.tpl" field=$limitHeight}}
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
<div id="settings_showmore_dyn_expanded" class="settings-block" style="display: none;">
|
|
||||||
<span class="fakelink" onclick="openClose('settings_showmore_dyn_expanded'); openClose('settings_showmore_dyn_inflated');">
|
|
||||||
<h3>{{$header}}</h3>
|
|
||||||
</span>
|
|
||||||
{{include file="field_input.tpl" field=$limitHeight}}
|
|
||||||
|
|
||||||
<div class="settings-submit-wrapper">
|
|
||||||
<input type="submit" value="{{$submit}}" class="settings-submit" name="showmore_dyn-submit" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
|
|
@ -97,9 +97,9 @@ function smileybutton_jot_tool(Friendica\App $a, &$b)
|
||||||
$s .= '</tr></table>';
|
$s .= '</tr></table>';
|
||||||
|
|
||||||
//Add css to header
|
//Add css to header
|
||||||
$css_file = 'addon/smileybutton/view/' . $a->getCurrentTheme() . '.css';
|
$css_file = __DIR__ . '/view/' . $a->getCurrentTheme() . '.css';
|
||||||
if (!file_exists($css_file)) {
|
if (!file_exists($css_file)) {
|
||||||
$css_file = 'addon/smileybutton/view/default.css';
|
$css_file = __DIR__ . '/view/default.css';
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::page()->registerStylesheet($css_file);
|
DI::page()->registerStylesheet($css_file);
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:16-0500\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,18 +17,14 @@ 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"
|
||||||
|
|
||||||
#: startpage.php:74 startpage.php:78
|
#: startpage.php:70
|
||||||
msgid "Startpage"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: startpage.php:81
|
|
||||||
msgid "Home page to load after login - leave blank for profile wall"
|
msgid "Home page to load after login - leave blank for profile wall"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: startpage.php:84
|
#: startpage.php:70
|
||||||
msgid "Examples: "network" or "notifications/system""
|
msgid "Examples: \"network\" or \"notifications/system\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: startpage.php:88
|
#: startpage.php:75
|
||||||
msgid "Save Settings"
|
msgid "Startpage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#startpage-page-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#startpage-page {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#startpage-desc {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
@ -6,7 +6,10 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
function startpage_install() {
|
function startpage_install() {
|
||||||
|
|
@ -54,36 +57,22 @@ function startpage_settings_post($a, $post)
|
||||||
* Add our own settings info to the page.
|
* Add our own settings info to the page.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function startpage_settings(&$a, &$s)
|
function startpage_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$startpage = DI::pConfig()->get(local_user(), 'startpage', 'startpage');
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/startpage/startpage.css' . '" media="all" />' . "\r\n";
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/startpage/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$startpage' => ['startpage', DI::l10n()->t('Home page to load after login - leave blank for profile wall'), $startpage, DI::l10n()->t('Examples: "network" or "notifications/system"')],
|
||||||
|
]);
|
||||||
|
|
||||||
/* Get the current state of our config variable */
|
$data = [
|
||||||
|
'addon' => 'startpage',
|
||||||
$page = DI::pConfig()->get(local_user(), 'startpage', 'startpage');
|
'title' => DI::l10n()->t('Startpage'),
|
||||||
|
'html' => $html,
|
||||||
/* Add some HTML to the existing form */
|
];
|
||||||
|
|
||||||
$s .= '<span id="settings_startpage_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_startpage_expanded\'); openClose(\'settings_startpage_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Startpage') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_startpage_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_startpage_expanded\'); openClose(\'settings_startpage_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Startpage') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="startpage-page-wrapper">';
|
|
||||||
$s .= '<label id="startpage-page-label" for="startpage-page">' . DI::l10n()->t('Home page to load after login - leave blank for profile wall') . '</label>';
|
|
||||||
$s .= '<input id="startpage-page" type="text" name="startpage" value="' . $page . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
$s .= '<div id="startpage-desc">' . DI::l10n()->t('Examples: "network" or "notifications/system"') . '</div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="startpage-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
startpage/templates/settings.tpl
Normal file
1
startpage/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_input.tpl" field=$startpage}}
|
||||||
|
|
@ -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-11-21 19:17-0500\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,105 +17,30 @@ 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"
|
||||||
|
|
||||||
#: statusnet.php:95
|
#: statusnet.php:97
|
||||||
msgid "Post to GNU Social"
|
msgid "Post to GNU Social"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:146
|
#: statusnet.php:148
|
||||||
msgid ""
|
msgid ""
|
||||||
"Please contact your site administrator.<br />The provided API URL is not "
|
"Please contact your site administrator.<br />The provided API URL is not "
|
||||||
"valid."
|
"valid."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:175
|
#: statusnet.php:176
|
||||||
msgid "We could not contact the GNU Social API with the Path you entered."
|
msgid "We could not contact the GNU Social API with the Path you entered."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:248 statusnet.php:252
|
#: statusnet.php:243 statusnet.php:656
|
||||||
msgid "GNU Social Import/Export/Mirror"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:267
|
|
||||||
msgid "Globally Available GNU Social OAuthKeys"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:268
|
|
||||||
msgid ""
|
|
||||||
"There are preconfigured OAuth key pairs for some GNU Social servers "
|
|
||||||
"available. If you are using one of them, please use these credentials. If "
|
|
||||||
"not feel free to connect to any other GNU Social instance (see below)."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:274 statusnet.php:291 statusnet.php:318 statusnet.php:325
|
|
||||||
#: statusnet.php:372 statusnet.php:698
|
|
||||||
msgid "Save Settings"
|
msgid "Save Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:276
|
#: statusnet.php:255
|
||||||
msgid "Provide your own OAuth Credentials"
|
#, php-format
|
||||||
|
msgid "Currently connected to: <a href=\"%s\" target=\"_statusnet\">%s</a>"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:277
|
#: statusnet.php:260
|
||||||
msgid ""
|
|
||||||
"No consumer key pair for GNU Social found. Register your Friendica Account "
|
|
||||||
"as an desktop client on your GNU Social account, copy the consumer key pair "
|
|
||||||
"here and enter the API base root.<br />Before you register your own OAuth "
|
|
||||||
"key pair ask the administrator if there is already a key pair for this "
|
|
||||||
"Friendica installation at your favorited GNU Social installation."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:279
|
|
||||||
msgid "OAuth Consumer Key"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:282
|
|
||||||
msgid "OAuth Consumer Secret"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:285 statusnet.php:678 statusnet.php:690
|
|
||||||
msgid "Base API Path (remember the trailing /)"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:310
|
|
||||||
msgid ""
|
|
||||||
"To connect to your GNU Social account click the button below to get a "
|
|
||||||
"security code from GNU Social which you have to copy into the input box "
|
|
||||||
"below and submit the form. Only your <strong>public</strong> posts will be "
|
|
||||||
"posted to GNU Social."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:311
|
|
||||||
msgid "Log in with GNU Social"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:313
|
|
||||||
msgid "Copy the security code from GNU Social here"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:319
|
|
||||||
msgid "Cancel Connection Process"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:321
|
|
||||||
msgid "Current GNU Social API is"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:322
|
|
||||||
msgid "Cancel GNU Social Connection"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:334
|
|
||||||
msgid "Currently connected to: "
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:336
|
|
||||||
msgid ""
|
|
||||||
"If enabled all your <strong>public</strong> postings can be posted to the "
|
|
||||||
"associated GNU Social account. You can choose to do so by default (here) or "
|
|
||||||
"for every posting separately in the posting options when writing the entry."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:338
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"<strong>Note</strong>: Due your privacy settings (<em>Hide your profile "
|
"<strong>Note</strong>: Due your privacy settings (<em>Hide your profile "
|
||||||
"details from unknown viewers?</em>) the link potentially included in public "
|
"details from unknown viewers?</em>) the link potentially included in public "
|
||||||
|
|
@ -123,47 +48,126 @@ msgid ""
|
||||||
"informing the visitor that the access to your profile has been restricted."
|
"informing the visitor that the access to your profile has been restricted."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:341
|
#: statusnet.php:263
|
||||||
msgid "Allow posting to GNU Social"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:344
|
|
||||||
msgid "Send public postings to GNU Social by default"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:348
|
|
||||||
msgid ""
|
|
||||||
"Mirror all posts from GNU Social that are no replies or repeated messages"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:354
|
|
||||||
msgid "Import the remote timeline"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:358
|
|
||||||
msgid "Disabled"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:359
|
|
||||||
msgid "Full Timeline"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:360
|
|
||||||
msgid "Only Mentions"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: statusnet.php:369
|
|
||||||
msgid "Clear OAuth configuration"
|
msgid "Clear OAuth configuration"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:689
|
#: statusnet.php:275
|
||||||
|
msgid "Cancel GNU Social Connection"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:283
|
||||||
|
msgid "Globally Available GNU Social OAuthKeys"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:284
|
||||||
|
msgid ""
|
||||||
|
"There are preconfigured OAuth key pairs for some GNU Social servers "
|
||||||
|
"available. If you are using one of them, please use these credentials. If "
|
||||||
|
"not feel free to connect to any other GNU Social instance (see below)."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:285
|
||||||
|
msgid "Provide your own OAuth Credentials"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:286
|
||||||
|
msgid ""
|
||||||
|
"No consumer key pair for GNU Social found. Register your Friendica Account "
|
||||||
|
"as a desktop application on your GNU Social account, copy the consumer key "
|
||||||
|
"pair here and enter the API base root.<br />Before you register your own "
|
||||||
|
"OAuth key pair ask the administrator if there is already a key pair for this "
|
||||||
|
"Friendica installation at your favorite GNU Social installation."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:287
|
||||||
|
msgid ""
|
||||||
|
"To connect to your GNU Social account click the button below to get a "
|
||||||
|
"security code from GNU Social which you have to copy into the input box "
|
||||||
|
"below and submit the form. Only your <strong>public</strong> posts will be "
|
||||||
|
"posted to GNU Social."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:288
|
||||||
|
msgid "Log in with GNU Social"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:289
|
||||||
|
msgid "Cancel Connection Process"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:290
|
||||||
|
#, php-format
|
||||||
|
msgid "Current GNU Social API is: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:307
|
||||||
|
msgid "OAuth Consumer Key"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:308
|
||||||
|
msgid "OAuth Consumer Secret"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:310 statusnet.php:636 statusnet.php:648
|
||||||
|
msgid "Base API Path (remember the trailing /)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:311
|
||||||
|
msgid "Copy the security code from GNU Social here"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:313
|
||||||
|
msgid "Allow posting to GNU Social"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:313
|
||||||
|
msgid ""
|
||||||
|
"If enabled all your <strong>public</strong> postings can be posted to the "
|
||||||
|
"associated GNU Social account. You can choose to do so by default (here) or "
|
||||||
|
"for every posting separately in the posting options when writing the entry."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:314
|
||||||
|
msgid "Post to GNU Social by default"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:315
|
||||||
|
msgid "Mirror all public posts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:316
|
||||||
|
msgid "Automatically create contacts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:317
|
||||||
|
msgid "Import the remote timeline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:318
|
||||||
|
msgid "Disabled"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:319
|
||||||
|
msgid "Full Timeline"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:320
|
||||||
|
msgid "Only Mentions"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:326
|
||||||
|
msgid "GNU Social Import/Export/Mirror"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: statusnet.php:647
|
||||||
msgid "Site name"
|
msgid "Site name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:691
|
#: statusnet.php:649
|
||||||
msgid "Consumer Secret"
|
msgid "Consumer Secret"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: statusnet.php:692
|
#: statusnet.php:650
|
||||||
msgid "Consumer Key"
|
msgid "Consumer Key"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -10,62 +10,3 @@
|
||||||
height: 52px;
|
height: 52px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
#statusnet-disconnect-label {
|
|
||||||
float: left;
|
|
||||||
width: 250px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
#statusnet-disconnect {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#statusnet-default-label,
|
|
||||||
#statusnet-applicationname-label,
|
|
||||||
#statusnet-sendtaglinks-label,
|
|
||||||
#statusnet-shortening-label,
|
|
||||||
#statusnet-mirror-label,
|
|
||||||
#statusnet-import-label,
|
|
||||||
#statusnet-create_user-label,
|
|
||||||
#statusnet-pin-label,
|
|
||||||
#statusnet-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 250px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#statusnet-checkbox {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#statusnet-pin {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#statusnet-consumerkey-label {
|
|
||||||
float: left;
|
|
||||||
width: 250px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
#statusnet-consumerkey {
|
|
||||||
float: left;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
#statusnet-consumersecret-label {
|
|
||||||
float: left;
|
|
||||||
width: 250px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
#statusnet-consumersecret {
|
|
||||||
float: left;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
#statusnet-baseapi-label {
|
|
||||||
float: left;
|
|
||||||
width: 250px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
#statusnet-baseapi {
|
|
||||||
float: left;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -107,13 +107,13 @@ function statusnet_settings_post(App $a, $post)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// don't check GNU Social settings if GNU Social submit button is not clicked
|
// don't check GNU Social settings if GNU Social submit button is not clicked
|
||||||
if (empty($_POST['statusnet-submit'])) {
|
if (empty($_POST['statusnet-submit']) && empty($_POST['statusnet-disconnect'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['statusnet-disconnect'])) {
|
if (!empty($_POST['statusnet-disconnect'])) {
|
||||||
/* * *
|
/* * *
|
||||||
* if the GNU Social-disconnect checkbox is set, clear the GNU Social configuration
|
* if the GNU Social-disconnect button is clicked, clear the GNU Social configuration
|
||||||
*/
|
*/
|
||||||
DI::pConfig()->delete(local_user(), 'statusnet', 'consumerkey');
|
DI::pConfig()->delete(local_user(), 'statusnet', 'consumerkey');
|
||||||
DI::pConfig()->delete(local_user(), 'statusnet', 'consumersecret');
|
DI::pConfig()->delete(local_user(), 'statusnet', 'consumersecret');
|
||||||
|
|
@ -149,7 +149,6 @@ function statusnet_settings_post(App $a, $post)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DI::baseUrl()->redirect('settings/connectors');
|
|
||||||
} else {
|
} else {
|
||||||
if (isset($_POST['statusnet-consumersecret'])) {
|
if (isset($_POST['statusnet-consumersecret'])) {
|
||||||
// check if we can reach the API of the GNU Social server
|
// check if we can reach the API of the GNU Social server
|
||||||
|
|
@ -177,7 +176,6 @@ function statusnet_settings_post(App $a, $post)
|
||||||
notice(DI::l10n()->t('We could not contact the GNU Social API with the Path you entered.') . EOL);
|
notice(DI::l10n()->t('We could not contact the GNU Social API with the Path you entered.') . EOL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DI::baseUrl()->redirect('settings/connectors');
|
|
||||||
} else {
|
} else {
|
||||||
if (isset($_POST['statusnet-pin'])) {
|
if (isset($_POST['statusnet-pin'])) {
|
||||||
// if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen
|
// if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen
|
||||||
|
|
@ -195,7 +193,6 @@ function statusnet_settings_post(App $a, $post)
|
||||||
DI::pConfig()->set(local_user(), 'statusnet', 'post', 1);
|
DI::pConfig()->set(local_user(), 'statusnet', 'post', 1);
|
||||||
DI::pConfig()->set(local_user(), 'statusnet', 'post_taglinks', 1);
|
DI::pConfig()->set(local_user(), 'statusnet', 'post_taglinks', 1);
|
||||||
// reload the Addon Settings page, if we don't do it see Bug #42
|
// reload the Addon Settings page, if we don't do it see Bug #42
|
||||||
DI::baseUrl()->redirect('settings/connectors');
|
|
||||||
} else {
|
} else {
|
||||||
// if no PIN is supplied in the POST variables, the user has changed the setting
|
// if no PIN is supplied in the POST variables, the user has changed the setting
|
||||||
// to post a dent for every new __public__ posting to the wall
|
// to post a dent for every new __public__ posting to the wall
|
||||||
|
|
@ -213,171 +210,125 @@ function statusnet_settings_post(App $a, $post)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusnet_settings(App $a, &$s)
|
function statusnet_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getById(local_user());
|
DI::page()->registerStylesheet(__DIR__ . '/statusnet.css', 'all');
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/statusnet/statusnet.css' . '" media="all" />' . "\r\n";
|
|
||||||
/* * *
|
/* * *
|
||||||
* 1) Check that we have a base api url and a consumer key & secret
|
* 1) Check that we have a base api url and a consumer key & secret
|
||||||
* 2) If no OAuthtoken & stuff is present, generate button to get some
|
* 2) If no OAuthtoken & stuff is present, generate button to get some
|
||||||
* allow the user to cancel the connection process at this step
|
* allow the user to cancel the connection process at this step
|
||||||
* 3) Checkbox for "Send public notices (respect size limitation)
|
* 3) Checkbox for "Send public notices (respect size limitation)
|
||||||
*/
|
*/
|
||||||
$api = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi');
|
$baseapi = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi');
|
||||||
$ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey');
|
$ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey');
|
||||||
$csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret');
|
$csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret');
|
||||||
$otoken = DI::pConfig()->get(local_user(), 'statusnet', 'oauthtoken');
|
$otoken = DI::pConfig()->get(local_user(), 'statusnet', 'oauthtoken');
|
||||||
$osecret = DI::pConfig()->get(local_user(), 'statusnet', 'oauthsecret');
|
$osecret = DI::pConfig()->get(local_user(), 'statusnet', 'oauthsecret');
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post');
|
$enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post', false);
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
$def_enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default', false);
|
||||||
$defenabled = DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default');
|
$mirror_enabled = DI::pConfig()->get(local_user(), 'statusnet', 'mirror_posts', false);
|
||||||
$defchecked = (($defenabled) ? ' checked="checked" ' : '');
|
$createuser_enabled = DI::pConfig()->get(local_user(), 'statusnet', 'create_user', false);
|
||||||
$mirrorenabled = DI::pConfig()->get(local_user(), 'statusnet', 'mirror_posts');
|
|
||||||
$mirrorchecked = (($mirrorenabled) ? ' checked="checked" ' : '');
|
|
||||||
$import = DI::pConfig()->get(local_user(), 'statusnet', 'import');
|
$import = DI::pConfig()->get(local_user(), 'statusnet', 'import');
|
||||||
$importselected = ["", "", ""];
|
|
||||||
$importselected[$import] = ' selected="selected"';
|
|
||||||
//$importenabled = DI::pConfig()->get(local_user(),'statusnet','import');
|
|
||||||
//$importchecked = (($importenabled) ? ' checked="checked" ' : '');
|
|
||||||
$create_userenabled = DI::pConfig()->get(local_user(), 'statusnet', 'create_user');
|
|
||||||
$create_userchecked = (($create_userenabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$css = (($enabled) ? '' : '-disabled');
|
// Radio button list to select existing application credentials
|
||||||
|
$sites = array_map(function ($site) {
|
||||||
|
return ['statusnet-preconf-apiurl', $site['sitename'], $site['apiurl']];
|
||||||
|
}, DI::config()->get('statusnet', 'sites', []));
|
||||||
|
|
||||||
$s .= '<span id="settings_statusnet_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_statusnet_expanded\'); openClose(\'settings_statusnet_inflated\');">';
|
$submit = ['statusnet-submit' => DI::l10n()->t('Save Settings')];
|
||||||
$s .= '<img class="connector' . $css . '" src="images/gnusocial.png" /><h3 class="connector">' . DI::l10n()->t('GNU Social Import/Export/Mirror') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_statusnet_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_statusnet_expanded\'); openClose(\'settings_statusnet_inflated\');">';
|
|
||||||
$s .= '<img class="connector' . $css . '" src="images/gnusocial.png" /><h3 class="connector">' . DI::l10n()->t('GNU Social Import/Export/Mirror') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
if ((!$ckey) && (!$csecret)) {
|
if ($ckey && $csecret) {
|
||||||
|
if ($otoken && $osecret) {
|
||||||
/* * *
|
/* * *
|
||||||
* no consumer keys
|
* we have an OAuth key / secret pair for the user
|
||||||
|
* so let's give a chance to disable the postings to GNU Social
|
||||||
*/
|
*/
|
||||||
$globalsn = DI::config()->get('statusnet', 'sites');
|
$connection = new StatusNetOAuth($baseapi, $ckey, $csecret, $otoken, $osecret);
|
||||||
/* * *
|
$account = $connection->get('account/verify_credentials');
|
||||||
* lets check if we have one or more globally configured GNU Social
|
|
||||||
* server OAuth credentials in the configuration. If so offer them
|
if (!empty($account)) {
|
||||||
* with a little explanation to the user as choice - otherwise
|
$connected_account = DI::l10n()->t('Currently connected to: <a href="%s" target="_statusnet">%s</a>', $account->statusnet_profile_url, $account->screen_name);
|
||||||
* ignore this option entirely.
|
|
||||||
*/
|
|
||||||
if (!$globalsn == null) {
|
|
||||||
$s .= '<h4>' . DI::l10n()->t('Globally Available GNU Social OAuthKeys') . '</h4>';
|
|
||||||
$s .= '<p>' . DI::l10n()->t("There are preconfigured OAuth key pairs for some GNU Social servers available. If you are using one of them, please use these credentials. If not feel free to connect to any other GNU Social instance \x28see below\x29.") . '</p>';
|
|
||||||
$s .= '<div id="statusnet-preconf-wrapper">';
|
|
||||||
foreach ($globalsn as $asn) {
|
|
||||||
$s .= '<input type="radio" name="statusnet-preconf-apiurl" value="' . $asn['apiurl'] . '">' . $asn['sitename'] . '<br />';
|
|
||||||
}
|
}
|
||||||
$s .= '<p></p><div class="clear"></div></div>';
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="statusnet-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
$user = User::getById(local_user());
|
||||||
|
if ($user['hidewall']) {
|
||||||
|
$privacy_warning = DI::l10n()->t('<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to GNU Social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.');
|
||||||
}
|
}
|
||||||
$s .= '<h4>' . DI::l10n()->t('Provide your own OAuth Credentials') . '</h4>';
|
|
||||||
$s .= '<p>' . DI::l10n()->t('No consumer key pair for GNU Social found. Register your Friendica Account as an desktop client on your GNU Social account, copy the consumer key pair here and enter the API base root.<br />Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendica installation at your favorited GNU Social installation.') . '</p>';
|
$submit['statusnet-disconnect'] = DI::l10n()->t('Clear OAuth configuration');
|
||||||
$s .= '<div id="statusnet-consumer-wrapper">';
|
|
||||||
$s .= '<label id="statusnet-consumerkey-label" for="statusnet-consumerkey">' . DI::l10n()->t('OAuth Consumer Key') . '</label>';
|
|
||||||
$s .= '<input id="statusnet-consumerkey" type="text" name="statusnet-consumerkey" size="35" /><br />';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
$s .= '<label id="statusnet-consumersecret-label" for="statusnet-consumersecret">' . DI::l10n()->t('OAuth Consumer Secret') . '</label>';
|
|
||||||
$s .= '<input id="statusnet-consumersecret" type="text" name="statusnet-consumersecret" size="35" /><br />';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
$s .= '<label id="statusnet-baseapi-label" for="statusnet-baseapi">' . DI::l10n()->t("Base API Path \x28remember the trailing /\x29") . '</label>';
|
|
||||||
$s .= '<input id="statusnet-baseapi" type="text" name="statusnet-baseapi" size="35" /><br />';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
//$s .= '<label id="statusnet-applicationname-label" for="statusnet-applicationname">'.DI::l10n()->t('GNU Socialapplication name').'</label>';
|
|
||||||
//$s .= '<input id="statusnet-applicationname" type="text" name="statusnet-applicationname" size="35" /><br />';
|
|
||||||
$s .= '<p></p><div class="clear"></div>';
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="statusnet-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
$s .= '</div>';
|
|
||||||
} else {
|
} else {
|
||||||
/* * *
|
|
||||||
* ok we have a consumer key pair now look into the OAuth stuff
|
|
||||||
*/
|
|
||||||
if ((!$otoken) && (!$osecret)) {
|
|
||||||
/* * *
|
/* * *
|
||||||
* the user has not yet connected the account to GNU Social
|
* the user has not yet connected the account to GNU Social
|
||||||
* get a temporary OAuth key/secret pair and display a button with
|
* get a temporary OAuth key/secret pair and display a button with
|
||||||
* which the user can request a PIN to connect the account to a
|
* which the user can request a PIN to connect the account to a
|
||||||
* account at GNU Social
|
* account at GNU Social
|
||||||
*/
|
*/
|
||||||
$connection = new StatusNetOAuth($api, $ckey, $csecret);
|
$connection = new StatusNetOAuth($baseapi, $ckey, $csecret);
|
||||||
$request_token = $connection->getRequestToken('oob');
|
$request_token = $connection->getRequestToken('oob');
|
||||||
$token = $request_token['oauth_token'];
|
$authorize_url = $connection->getAuthorizeURL($request_token['oauth_token'], false);
|
||||||
/* * *
|
|
||||||
* make some nice form
|
|
||||||
*/
|
|
||||||
$s .= '<p>' . DI::l10n()->t('To connect to your GNU Social account click the button below to get a security code from GNU Social which you have to copy into the input box below and submit the form. Only your <strong>public</strong> posts will be posted to GNU Social.') . '</p>';
|
|
||||||
$s .= '<a href="' . $connection->getAuthorizeURL($token, False) . '" target="_statusnet"><img src="addon/statusnet/signinwithstatusnet.png" alt="' . DI::l10n()->t('Log in with GNU Social') . '"></a>';
|
|
||||||
$s .= '<div id="statusnet-pin-wrapper">';
|
|
||||||
$s .= '<label id="statusnet-pin-label" for="statusnet-pin">' . DI::l10n()->t('Copy the security code from GNU Social here') . '</label>';
|
|
||||||
$s .= '<input id="statusnet-pin" type="text" name="statusnet-pin" />';
|
|
||||||
$s .= '<input id="statusnet-token" type="hidden" name="statusnet-token" value="' . $token . '" />';
|
|
||||||
$s .= '<input id="statusnet-token2" type="hidden" name="statusnet-token2" value="' . $request_token['oauth_token_secret'] . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="statusnet-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
$s .= '<h4>' . DI::l10n()->t('Cancel Connection Process') . '</h4>';
|
|
||||||
$s .= '<div id="statusnet-cancel-wrapper">';
|
|
||||||
$s .= '<p>' . DI::l10n()->t('Current GNU Social API is') . ': ' . $api . '</p>';
|
|
||||||
$s .= '<label id="statusnet-cancel-label" for="statusnet-cancel">' . DI::l10n()->t('Cancel GNU Social Connection') . '</label>';
|
|
||||||
$s .= '<input id="statusnet-cancel" type="checkbox" name="statusnet-disconnect" value="1" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="statusnet-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
} else {
|
|
||||||
/* * *
|
|
||||||
* we have an OAuth key / secret pair for the user
|
|
||||||
* so let's give a chance to disable the postings to GNU Social
|
|
||||||
*/
|
|
||||||
$connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret);
|
|
||||||
$details = $connection->get('account/verify_credentials');
|
|
||||||
if (!empty($details)) {
|
|
||||||
$s .= '<div id="statusnet-info" ><img id="statusnet-avatar" src="' . $details->profile_image_url . '" /><p id="statusnet-info-block">' . DI::l10n()->t('Currently connected to: ') . '<a href="' . $details->statusnet_profile_url . '" target="_statusnet">' . $details->screen_name . '</a><br /><em>' . $details->description . '</em></p></div>';
|
|
||||||
}
|
|
||||||
$s .= '<p>' . DI::l10n()->t('If enabled all your <strong>public</strong> postings can be posted to the associated GNU Social account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') . '</p>';
|
|
||||||
if ($user['hidewall']) {
|
|
||||||
$s .= '<p>' . DI::l10n()->t('<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to GNU Social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '</p>';
|
|
||||||
}
|
|
||||||
$s .= '<div id="statusnet-enable-wrapper">';
|
|
||||||
$s .= '<label id="statusnet-enable-label" for="statusnet-checkbox">' . DI::l10n()->t('Allow posting to GNU Social') . '</label>';
|
|
||||||
$s .= '<input id="statusnet-checkbox" type="checkbox" name="statusnet-enable" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
$s .= '<label id="statusnet-default-label" for="statusnet-default">' . DI::l10n()->t('Send public postings to GNU Social by default') . '</label>';
|
|
||||||
$s .= '<input id="statusnet-default" type="checkbox" name="statusnet-default" value="1" ' . $defchecked . '/>';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<label id="statusnet-mirror-label" for="statusnet-mirror">' . DI::l10n()->t('Mirror all posts from GNU Social that are no replies or repeated messages') . '</label>';
|
$submit['statusnet-disconnect'] = DI::l10n()->t('Cancel GNU Social Connection');
|
||||||
$s .= '<input id="statusnet-mirror" type="checkbox" name="statusnet-mirror" value="1" ' . $mirrorchecked . '/>';
|
|
||||||
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
$s .= '</div>';
|
|
||||||
|
|
||||||
$s .= '<label id="statusnet-import-label" for="statusnet-import">' . DI::l10n()->t('Import the remote timeline') . '</label>';
|
|
||||||
//$s .= '<input id="statusnet-import" type="checkbox" name="statusnet-import" value="1" '. $importchecked . '/>';
|
|
||||||
|
|
||||||
$s .= '<select name="statusnet-import" id="statusnet-import" />';
|
|
||||||
$s .= '<option value="0" ' . $importselected[0] . '>' . DI::l10n()->t("Disabled") . '</option>';
|
|
||||||
$s .= '<option value="1" ' . $importselected[1] . '>' . DI::l10n()->t("Full Timeline") . '</option>';
|
|
||||||
$s .= '<option value="2" ' . $importselected[2] . '>' . DI::l10n()->t("Only Mentions") . '</option>';
|
|
||||||
$s .= '</select>';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
/*
|
|
||||||
$s .= '<label id="statusnet-create_user-label" for="statusnet-create_user">'.DI::l10n()->t('Automatically create contacts').'</label>';
|
|
||||||
$s .= '<input id="statusnet-create_user" type="checkbox" name="statusnet-create_user" value="1" '. $create_userchecked . '/>';
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
*/
|
|
||||||
$s .= '<div id="statusnet-disconnect-wrapper">';
|
|
||||||
$s .= '<label id="statusnet-disconnect-label" for="statusnet-disconnect">' . DI::l10n()->t('Clear OAuth configuration') . '</label>';
|
|
||||||
$s .= '<input id="statusnet-disconnect" type="checkbox" name="statusnet-disconnect" value="1" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="statusnet-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/statusnet/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$l10n' => [
|
||||||
|
'global_title' => DI::l10n()->t('Globally Available GNU Social OAuthKeys'),
|
||||||
|
'global_info' => DI::l10n()->t(DI::l10n()->t('There are preconfigured OAuth key pairs for some GNU Social servers available. If you are using one of them, please use these credentials. If not feel free to connect to any other GNU Social instance (see below).')),
|
||||||
|
'credentials_title' => DI::l10n()->t('Provide your own OAuth Credentials'),
|
||||||
|
'credentials_info' => DI::l10n()->t('No consumer key pair for GNU Social found. Register your Friendica Account as a desktop application on your GNU Social account, copy the consumer key pair here and enter the API base root.<br />Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendica installation at your favorite GNU Social installation.'),
|
||||||
|
'oauth_info' => DI::l10n()->t('To connect to your GNU Social account click the button below to get a security code from GNU Social which you have to copy into the input box below and submit the form. Only your <strong>public</strong> posts will be posted to GNU Social.'),
|
||||||
|
'oauth_alt' => DI::l10n()->t('Log in with GNU Social'),
|
||||||
|
'oauth_cancel' => DI::l10n()->t('Cancel Connection Process'),
|
||||||
|
'oauth_api' => DI::l10n()->t('Current GNU Social API is: %s', $baseapi),
|
||||||
|
'connected_account' => $connected_account ?? '',
|
||||||
|
'privacy_warning' => $privacy_warning ?? '',
|
||||||
|
],
|
||||||
|
|
||||||
|
'$ckey' => $ckey,
|
||||||
|
'$csecret' => $csecret,
|
||||||
|
'$otoken' => $otoken,
|
||||||
|
'$osecret' => $osecret,
|
||||||
|
'$sites' => $sites,
|
||||||
|
|
||||||
|
'$authorize_url' => $authorize_url ?? '',
|
||||||
|
'$request_token' => $request_token ?? null,
|
||||||
|
'$account' => $account ?? null,
|
||||||
|
|
||||||
|
'$authenticate_url' => DI::baseUrl()->get() . '/statusnet/connect',
|
||||||
|
|
||||||
|
'$consumerkey' => ['statusnet-consumerkey', DI::l10n()->t('OAuth Consumer Key'), '', '', false, ' size="35'],
|
||||||
|
'$consumersecret' => ['statusnet-consumersecret', DI::l10n()->t('OAuth Consumer Secret'), '', '', false, ' size="35'],
|
||||||
|
|
||||||
|
'$baseapi' => ['statusnet-baseapi', DI::l10n()->t('Base API Path (remember the trailing /)'), '', '', false, ' size="35'],
|
||||||
|
'$pin' => ['statusnet-pin', DI::l10n()->t('Copy the security code from GNU Social here')],
|
||||||
|
|
||||||
|
'$enable' => ['statusnet-enabled', DI::l10n()->t('Allow posting to GNU Social'), $enabled, DI::l10n()->t('If enabled all your <strong>public</strong> postings can be posted to the associated GNU Social account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.')],
|
||||||
|
'$default' => ['statusnet-default', DI::l10n()->t('Post to GNU Social by default'), $def_enabled],
|
||||||
|
'$mirror' => ['statusnet-mirror', DI::l10n()->t('Mirror all public posts'), $mirror_enabled],
|
||||||
|
'$create_user' => ['statusnet-create_user', DI::l10n()->t('Automatically create contacts'), $createuser_enabled],
|
||||||
|
'$import' => ['statusnet-import', DI::l10n()->t('Import the remote timeline'), $import, '', [
|
||||||
|
0 => DI::l10n()->t('Disabled'),
|
||||||
|
1 => DI::l10n()->t('Full Timeline'),
|
||||||
|
2 => DI::l10n()->t('Only Mentions'),
|
||||||
|
]],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'connector' => 'statusnet',
|
||||||
|
'title' => DI::l10n()->t('GNU Social Import/Export/Mirror'),
|
||||||
|
'image' => 'images/gnusocial.png',
|
||||||
|
'enabled' => $enabled,
|
||||||
|
'html' => $html,
|
||||||
|
'submit' => $submit,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusnet_hook_fork(App $a, array &$b)
|
function statusnet_hook_fork(App $a, array &$b)
|
||||||
|
|
|
||||||
50
statusnet/templates/connector_settings.tpl
Normal file
50
statusnet/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
{{if $ckey && $csecret}}
|
||||||
|
{{if $otoken && $osecret}}
|
||||||
|
{{if $account}}
|
||||||
|
<div id="statusnet-info">
|
||||||
|
<img id="statusnet-avatar" src="{{$account->profile_image_url}}" />
|
||||||
|
<p id="statusnet-info-block">
|
||||||
|
{{$l10n.connected_account nofilter}}<br />
|
||||||
|
<em>{{$account->description}}</em>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$enable}}
|
||||||
|
<p>{{$l10n.connected_public nofilter}}</p>
|
||||||
|
{{if $l10n.privacy_warning}}
|
||||||
|
<p>{{$l10n.privacy_warning nofilter}}</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$default}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$mirror}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$import}}
|
||||||
|
{{*include file="field_checkbox.tpl" field=$create_user*}}
|
||||||
|
{{else}}
|
||||||
|
<p>{{$l10n.oauth_info}}</p>
|
||||||
|
<a href="{{$authorize_url}}" target="_statusnet"><img src="addon/statusnet/signinwithstatusnet.png" alt="{{$l10n.oauth_alt}}"></a>
|
||||||
|
<div id="statusnet-pin-wrapper">
|
||||||
|
<input id="statusnet-token" type="hidden" name="statusnet-token" value="{{$request_token.oauth_token}}" />
|
||||||
|
<input id="statusnet-token2" type="hidden" name="statusnet-token2" value="{{$request_token.oauth_token_secret}}" />
|
||||||
|
{{include file="field_input.tpl" field=$pin}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>{{$l10n.oauth_api}}</p>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
{{if $sites}}
|
||||||
|
<h4>{{$l10n.global_title}}</h4>
|
||||||
|
<p>{{$l10n.global_info}}</p>
|
||||||
|
<div id="statusnet-preconf-wrapper">
|
||||||
|
{{foreach $sites as $site}}
|
||||||
|
{{include file="field_radio.tpl" field=$site}}
|
||||||
|
{{/foreach}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
<h4>{{$l10n.credentials_title}}</h4>
|
||||||
|
<p>{{$l10n.credentials_info nofilter}}</p>
|
||||||
|
<div id="statusnet-consumer-wrapper">
|
||||||
|
{{include file="field_input.tpl" field=$consumerkey}}
|
||||||
|
{{include file="field_input.tpl" field=$consumersecret}}
|
||||||
|
{{include file="field_input.tpl" field=$baseapi}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
@ -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-11-21 19:16-0500\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,18 +17,14 @@ 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"
|
||||||
|
|
||||||
#: superblock.php:38 superblock.php:42
|
#: superblock.php:35
|
||||||
|
msgid "Comma separated profile URLs to block"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: superblock.php:40
|
||||||
msgid "Superblock"
|
msgid "Superblock"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: superblock.php:45
|
#: superblock.php:129
|
||||||
msgid "Comma separated profile URLS to block"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: superblock.php:49
|
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: superblock.php:138
|
|
||||||
msgid "Block Completely"
|
msgid "Block Completely"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
|
|
||||||
#superblock-label {
|
|
||||||
float: left;
|
|
||||||
width: 300px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#superblock-words {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
width: 400px;
|
|
||||||
height: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#superblock-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -6,7 +6,10 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
|
@ -19,36 +22,24 @@ function superblock_install()
|
||||||
Hook::register('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store');
|
Hook::register('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store');
|
||||||
}
|
}
|
||||||
|
|
||||||
function superblock_addon_settings(&$a, &$s)
|
function superblock_addon_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$blocked = DI::pConfig()->get(local_user(), 'system', 'blocked', '');
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/superblock/superblock.css' . '" media="all" />' . "\r\n";
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/superblock/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$urls' => ['superblock-words', DI::l10n()->t('Comma separated profile URLs to block'), $blocked],
|
||||||
|
]);
|
||||||
|
|
||||||
$words = DI::pConfig()->get(local_user(), 'system', 'blocked');
|
$data = [
|
||||||
if (!$words) {
|
'addon' => 'superblock',
|
||||||
$words = '';
|
'title' => DI::l10n()->t('Superblock'),
|
||||||
}
|
'html' => $html,
|
||||||
|
];
|
||||||
$s .= '<span id="settings_superblock_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_superblock_expanded\'); openClose(\'settings_superblock_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Superblock') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_superblock_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_superblock_expanded\'); openClose(\'settings_superblock_inflated\');">';
|
|
||||||
$s .= '<h3>' . DI::l10n()->t('Superblock') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="superblock-wrapper">';
|
|
||||||
$s .= '<label id="superblock-label" for="superblock-words">' . DI::l10n()->t('Comma separated profile URLS to block') . ' </label>';
|
|
||||||
$s .= '<textarea id="superblock-words" type="text" name="superblock-words" >' . htmlspecialchars($words) . '</textarea>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="superblock-submit" name="superblock-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function superblock_addon_settings_post(&$a, &$b)
|
function superblock_addon_settings_post(&$a, &$b)
|
||||||
|
|
|
||||||
1
superblock/templates/settings.tpl
Normal file
1
superblock/templates/settings.tpl
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{include file="field_textarea.tpl" field=$urls}}
|
||||||
|
|
@ -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-07-25 13:15+0000\n"
|
"POT-Creation-Date: 2021-11-21 19:17-0500\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:40
|
#: tumblr.php:39
|
||||||
msgid "Permission denied."
|
msgid "Permission denied."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:70 tumblr.php:284
|
#: tumblr.php:69
|
||||||
msgid "Save Settings"
|
msgid "Save Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:72
|
#: tumblr.php:71
|
||||||
msgid "Consumer Key"
|
msgid "Consumer Key"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:73
|
#: tumblr.php:72
|
||||||
msgid "Consumer Secret"
|
msgid "Consumer Secret"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:178
|
#: tumblr.php:177
|
||||||
msgid "You are now authenticated to tumblr."
|
msgid "You are now authenticated to tumblr."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:179
|
#: tumblr.php:178
|
||||||
msgid "return to the connector page"
|
msgid "return to the connector page"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:195
|
#: tumblr.php:194
|
||||||
msgid "Post to Tumblr"
|
msgid "Post to Tumblr"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:225 tumblr.php:229
|
#: tumblr.php:225
|
||||||
msgid "Tumblr Export"
|
msgid "Post to page:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:233
|
#: tumblr.php:231
|
||||||
msgid "(Re-)Authenticate your tumblr page"
|
msgid "(Re-)Authenticate your tumblr page"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: tumblr.php:232
|
||||||
|
msgid "You are not authenticated to tumblr"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:237
|
#: tumblr.php:237
|
||||||
msgid "Enable Tumblr Post Addon"
|
msgid "Enable Tumblr Post Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:243
|
#: tumblr.php:238
|
||||||
msgid "Post to Tumblr by default"
|
msgid "Post to Tumblr by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: tumblr.php:264
|
#: tumblr.php:244
|
||||||
msgid "Post to page:"
|
msgid "Tumblr Export"
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: tumblr.php:278
|
|
||||||
msgid "You are not authenticated to tumblr"
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
10
tumblr/templates/connector_settings.tpl
Normal file
10
tumblr/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<p><a href="{{$authenticate_url}}">{{$l10n.connect}}</a></p>
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$enable}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||||
|
|
||||||
|
{{if $page_select}}
|
||||||
|
{{include file="field_select.tpl" field=$page_select}}
|
||||||
|
{{else}}
|
||||||
|
{{$l10n.noconnect}}
|
||||||
|
{{/if}}
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
#tumblr-enable-label, #tumblr-username-label, #tumblr-page-label, #tumblr-bydefault-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tumblr-checkbox, #tumblr-username, #tumblr-page, #tumblr-bydefault {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tumblr-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -198,89 +198,54 @@ function tumblr_jot_nets(App $a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function tumblr_settings(App $a, &$s)
|
function tumblr_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (! local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post', false);
|
||||||
|
$def_enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post_by_default', false);
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/tumblr/tumblr.css' . '" media="all" />' . "\r\n";
|
$oauth_token = DI::pConfig()->get(local_user(), 'tumblr', 'oauth_token');
|
||||||
|
$oauth_token_secret = DI::pConfig()->get(local_user(), 'tumblr', 'oauth_token_secret');
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
if ($oauth_token && $oauth_token_secret) {
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post');
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
$css = (($enabled) ? '' : '-disabled');
|
|
||||||
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post_by_default');
|
|
||||||
|
|
||||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
|
||||||
|
|
||||||
$s .= '<span id="settings_tumblr_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_tumblr_expanded\'); openClose(\'settings_tumblr_inflated\');">';
|
|
||||||
$s .= '<img class="connector'.$css.'" src="images/tumblr.png" /><h3 class="connector">'. DI::l10n()->t('Tumblr Export').'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_tumblr_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_tumblr_expanded\'); openClose(\'settings_tumblr_inflated\');">';
|
|
||||||
$s .= '<img class="connector'.$css.'" src="images/tumblr.png" /><h3 class="connector">'. DI::l10n()->t('Tumblr Export').'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
$s .= '<div id="tumblr-username-wrapper">';
|
|
||||||
$s .= '<a href="'.DI::baseUrl()->get().'/tumblr/connect">'.DI::l10n()->t("(Re-)Authenticate your tumblr page").'</a>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="tumblr-enable-wrapper">';
|
|
||||||
$s .= '<label id="tumblr-enable-label" for="tumblr-checkbox">' . DI::l10n()->t('Enable Tumblr Post Addon') . '</label>';
|
|
||||||
$s .= '<input type="hidden" name="tumblr" value="0"/>';
|
|
||||||
$s .= '<input id="tumblr-checkbox" type="checkbox" name="tumblr" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="tumblr-bydefault-wrapper">';
|
|
||||||
$s .= '<label id="tumblr-bydefault-label" for="tumblr-bydefault">' . DI::l10n()->t('Post to Tumblr by default') . '</label>';
|
|
||||||
$s .= '<input type="hidden" name="tumblr_bydefault" value="0"/>';
|
|
||||||
$s .= '<input id="tumblr-bydefault" type="checkbox" name="tumblr_bydefault" value="1" ' . $def_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$oauth_token = DI::pConfig()->get(local_user(), "tumblr", "oauth_token");
|
|
||||||
$oauth_token_secret = DI::pConfig()->get(local_user(), "tumblr", "oauth_token_secret");
|
|
||||||
|
|
||||||
$s .= '<div id="tumblr-page-wrapper">';
|
|
||||||
|
|
||||||
if (($oauth_token != "") && ($oauth_token_secret != "")) {
|
|
||||||
$page = DI::pConfig()->get(local_user(), 'tumblr', 'page');
|
$page = DI::pConfig()->get(local_user(), 'tumblr', 'page');
|
||||||
$consumer_key = DI::config()->get('tumblr', 'consumer_key');
|
$consumer_key = DI::config()->get('tumblr', 'consumer_key');
|
||||||
$consumer_secret = DI::config()->get('tumblr', 'consumer_secret');
|
$consumer_secret = DI::config()->get('tumblr', 'consumer_secret');
|
||||||
|
|
||||||
$tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
|
$tum_oauth = new TumblrOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
|
||||||
|
|
||||||
$userinfo = $tum_oauth->get('user/info');
|
$userinfo = $tum_oauth->get('user/info');
|
||||||
|
|
||||||
$blogs = [];
|
$blogs = array_map(function ($blog) {
|
||||||
|
return substr(str_replace(["http://", "https://"], ["", ""], $blog->url), 0, -1);
|
||||||
|
}, $userinfo->response->user->blogs);
|
||||||
|
|
||||||
$s .= '<label id="tumblr-page-label" for="tumblr-page">' . DI::l10n()->t('Post to page:') . '</label>';
|
$page_select = ['tumblr-page', DI::l10n()->t('Post to page:'), $page, '', $blogs];
|
||||||
$s .= '<select name="tumblr_page" id="tumblr-page">';
|
|
||||||
foreach($userinfo->response->user->blogs as $blog) {
|
|
||||||
$blogurl = substr(str_replace(["http://", "https://"], ["", ""], $blog->url), 0, -1);
|
|
||||||
|
|
||||||
if ($page == $blogurl) {
|
|
||||||
$s .= "<option value='".$blogurl."' selected>".$blogurl."</option>";
|
|
||||||
} else {
|
|
||||||
$s .= "<option value='".$blogurl."'>".$blogurl."</option>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$s .= "</select>";
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/tumblr/');
|
||||||
} else {
|
$html = Renderer::replaceMacros($t, [
|
||||||
$s .= DI::l10n()->t("You are not authenticated to tumblr");
|
'$l10n' => [
|
||||||
}
|
'connect' => DI::l10n()->t('(Re-)Authenticate your tumblr page'),
|
||||||
|
'noconnect' => DI::l10n()->t('You are not authenticated to tumblr'),
|
||||||
|
],
|
||||||
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
'$authenticate_url' => DI::baseUrl()->get() . '/tumblr/connect',
|
||||||
|
|
||||||
/* provide a submit button */
|
'$enable' => ['tumblr', DI::l10n()->t('Enable Tumblr Post Addon'), $enabled],
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="tumblr-submit" name="tumblr-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
'$bydefault' => ['tumblr_bydefault', DI::l10n()->t('Post to Tumblr by default'), $def_enabled],
|
||||||
|
'$page_select' => $page_select ?? '',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'connector' => 'tumblr',
|
||||||
|
'title' => DI::l10n()->t('Tumblr Export'),
|
||||||
|
'image' => 'images/tumblr.png',
|
||||||
|
'enabled' => $enabled,
|
||||||
|
'html' => $html,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function tumblr_settings_post(App $a, array &$b)
|
function tumblr_settings_post(App $a, array &$b)
|
||||||
|
|
|
||||||
|
|
@ -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-11-23 18:33-0500\n"
|
"POT-Creation-Date: 2021-11-27 10:25-0500\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"
|
||||||
|
|
@ -27,17 +27,13 @@ msgid ""
|
||||||
"one."
|
"one."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:318 twitter.php:322
|
#: twitter.php:321
|
||||||
msgid "Twitter Import/Export/Mirror"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: twitter.php:329
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"No consumer key pair for Twitter found. Please contact your site "
|
"No consumer key pair for Twitter found. Please contact your site "
|
||||||
"administrator."
|
"administrator."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:341
|
#: twitter.php:334
|
||||||
msgid ""
|
msgid ""
|
||||||
"At this Friendica instance the Twitter addon was enabled but you have not "
|
"At this Friendica instance the Twitter addon was enabled but you have not "
|
||||||
"yet connected your account to your Twitter account. To do so click the "
|
"yet connected your account to your Twitter account. To do so click the "
|
||||||
|
|
@ -46,42 +42,26 @@ msgid ""
|
||||||
"be posted to Twitter."
|
"be posted to Twitter."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:342
|
#: twitter.php:335
|
||||||
msgid "Log in with Twitter"
|
msgid "Log in with Twitter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:344
|
#: twitter.php:337
|
||||||
msgid "Copy the PIN from Twitter here"
|
msgid "Copy the PIN from Twitter here"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:349 twitter.php:404 twitter.php:924
|
#: twitter.php:345 twitter.php:388
|
||||||
msgid "Save Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: twitter.php:351 twitter.php:406
|
|
||||||
msgid "An error occured: "
|
msgid "An error occured: "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:368
|
#: twitter.php:359
|
||||||
msgid "Currently connected to: "
|
#, php-format
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: twitter.php:369 twitter.php:379
|
|
||||||
msgid "Disconnect"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: twitter.php:386
|
|
||||||
msgid "Allow posting to Twitter"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: twitter.php:386
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"If enabled all your <strong>public</strong> postings can be posted to the "
|
"Currently connected to: <a href=\"https://twitter.com/%1$s\" target="
|
||||||
"associated Twitter account. You can choose to do so by default (here) or for "
|
"\"_twitter\">%1$s</a>"
|
||||||
"every posting separately in the posting options when writing the entry."
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:389
|
#: twitter.php:365
|
||||||
msgid ""
|
msgid ""
|
||||||
"<strong>Note</strong>: Due to your privacy settings (<em>Hide your profile "
|
"<strong>Note</strong>: Due to your privacy settings (<em>Hide your profile "
|
||||||
"details from unknown viewers?</em>) the link potentially included in public "
|
"details from unknown viewers?</em>) the link potentially included in public "
|
||||||
|
|
@ -89,23 +69,42 @@ msgid ""
|
||||||
"the visitor that the access to your profile has been restricted."
|
"the visitor that the access to your profile has been restricted."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:392
|
#: twitter.php:372
|
||||||
|
msgid "Invalid Twitter info"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: twitter.php:373
|
||||||
|
msgid "Disconnect"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: twitter.php:378
|
||||||
|
msgid "Allow posting to Twitter"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: twitter.php:378
|
||||||
|
msgid ""
|
||||||
|
"If enabled all your <strong>public</strong> postings can be posted to the "
|
||||||
|
"associated Twitter account. You can choose to do so by default (here) or for "
|
||||||
|
"every posting separately in the posting options when writing the entry."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: twitter.php:379
|
||||||
msgid "Send public postings to Twitter by default"
|
msgid "Send public postings to Twitter by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:395
|
#: twitter.php:380
|
||||||
msgid "Mirror all posts from twitter that are no replies"
|
msgid "Mirror all posts from twitter that are no replies"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:398
|
#: twitter.php:381
|
||||||
msgid "Import the remote timeline"
|
msgid "Import the remote timeline"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:401
|
#: twitter.php:382
|
||||||
msgid "Automatically create contacts"
|
msgid "Automatically create contacts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:401
|
#: twitter.php:382
|
||||||
msgid ""
|
msgid ""
|
||||||
"This will automatically create a contact in Friendica as soon as you receive "
|
"This will automatically create a contact in Friendica as soon as you receive "
|
||||||
"a message from an existing contact via the Twitter network. If you do not "
|
"a message from an existing contact via the Twitter network. If you do not "
|
||||||
|
|
@ -113,25 +112,33 @@ msgid ""
|
||||||
"from whom you would like to see posts here."
|
"from whom you would like to see posts here."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:557
|
#: twitter.php:395
|
||||||
|
msgid "Twitter Import/Export/Mirror"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: twitter.php:547
|
||||||
msgid ""
|
msgid ""
|
||||||
"Please connect a Twitter account in your Social Network settings to import "
|
"Please connect a Twitter account in your Social Network settings to import "
|
||||||
"Twitter posts."
|
"Twitter posts."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:564
|
#: twitter.php:554
|
||||||
msgid "Twitter post not found."
|
msgid "Twitter post not found."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:926
|
#: twitter.php:914
|
||||||
|
msgid "Save Settings"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: twitter.php:916
|
||||||
msgid "Consumer key"
|
msgid "Consumer key"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:927
|
#: twitter.php:917
|
||||||
msgid "Consumer secret"
|
msgid "Consumer secret"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: twitter.php:1123
|
#: twitter.php:1113
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid "%s on Twitter"
|
msgid "%s on Twitter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
23
twitter/templates/connector_settings.tpl
Normal file
23
twitter/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<div id="twitter-info" >
|
||||||
|
{{if $l10n.connected}}
|
||||||
|
<p>{{$l10n.connected nofilter}} <button type="submit" name="twitter-disconnect" value="1">{{$l10n.disconnect}}</button></p>
|
||||||
|
<p id="twitter-info-block">
|
||||||
|
<a href="https://twitter.com/{{$account->screen_name}}" target="_twitter"><img id="twitter-avatar" src="{{$account->profile_image_url}}" /></a>
|
||||||
|
<em>{{$account->description}}</em>
|
||||||
|
</p>
|
||||||
|
{{else}}
|
||||||
|
<p>{{$l10n.invalid}}</p>
|
||||||
|
<button type="submit" name="twitter-disconnect" value="1">{{$l10n.disconnect}}</button>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$enable}}
|
||||||
|
{{if $l10n.privacy_warning}}
|
||||||
|
<p>{{$l10n.privacy_warning nofilter}}</p>
|
||||||
|
{{/if}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$default}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$mirror}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$import}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$create_user}}
|
||||||
|
|
@ -10,34 +10,3 @@
|
||||||
height: 52px;
|
height: 52px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
#twitter-disconnect-label {
|
|
||||||
float: left;
|
|
||||||
width: 250px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#twitter-disconnect {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
#twitter-default-label,
|
|
||||||
#twitter-sendtaglinks-label,
|
|
||||||
#twitter-enable-label,
|
|
||||||
#twitter-shortening-label,
|
|
||||||
#twitter-mirror-label,
|
|
||||||
#twitter-import-label,
|
|
||||||
#twitter-create_user-label,
|
|
||||||
#twitter-pin-label {
|
|
||||||
float: left;
|
|
||||||
width: 250px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#twitter-checkbox {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#twitter-pin {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -269,8 +269,6 @@ function twitter_settings_post(App $a)
|
||||||
} catch(TwitterOAuthException $e) {
|
} catch(TwitterOAuthException $e) {
|
||||||
notice($e->getMessage());
|
notice($e->getMessage());
|
||||||
}
|
}
|
||||||
// reload the Addon Settings page, if we don't do it see Bug #42
|
|
||||||
DI::baseUrl()->redirect('settings/connectors');
|
|
||||||
} else {
|
} else {
|
||||||
// if no PIN is supplied in the POST variables, the user has changed the setting
|
// if no PIN is supplied in the POST variables, the user has changed the setting
|
||||||
// to post a tweet for every new __public__ posting to the wall
|
// to post a tweet for every new __public__ posting to the wall
|
||||||
|
|
@ -287,7 +285,7 @@ function twitter_settings_post(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function twitter_settings(App $a, &$s)
|
function twitter_settings(App $a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -295,7 +293,8 @@ function twitter_settings(App $a, &$s)
|
||||||
|
|
||||||
$user = User::getById(local_user());
|
$user = User::getById(local_user());
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/twitter/twitter.css' . '" media="all" />' . "\r\n";
|
DI::page()->registerStylesheet(__DIR__ . '/twitter.css', 'all');
|
||||||
|
|
||||||
/* * *
|
/* * *
|
||||||
* 1) Check that we have global consumer key & secret
|
* 1) Check that we have global consumer key & secret
|
||||||
* 2) If no OAuthtoken & stuff is present, generate button to get some
|
* 2) If no OAuthtoken & stuff is present, generate button to get some
|
||||||
|
|
@ -312,21 +311,14 @@ function twitter_settings(App $a, &$s)
|
||||||
$importenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'import'));
|
$importenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'import'));
|
||||||
$create_userenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'create_user'));
|
$create_userenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'create_user'));
|
||||||
|
|
||||||
$css = (($enabled) ? '' : '-disabled');
|
// Hide the submit button by default
|
||||||
|
$submit = '';
|
||||||
$s .= '<span id="settings_twitter_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_twitter_expanded\'); openClose(\'settings_twitter_inflated\');">';
|
|
||||||
$s .= '<img class="connector' . $css . '" src="images/twitter.png" /><h3 class="connector">' . DI::l10n()->t('Twitter Import/Export/Mirror') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="settings_twitter_expanded" class="settings-block" style="display: none;">';
|
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_twitter_expanded\'); openClose(\'settings_twitter_inflated\');">';
|
|
||||||
$s .= '<img class="connector' . $css . '" src="images/twitter.png" /><h3 class="connector">' . DI::l10n()->t('Twitter Import/Export/Mirror') . '</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
|
|
||||||
if ((!$ckey) && (!$csecret)) {
|
if ((!$ckey) && (!$csecret)) {
|
||||||
/* no global consumer keys
|
/* no global consumer keys
|
||||||
* display warning and skip personal config
|
* display warning and skip personal config
|
||||||
*/
|
*/
|
||||||
$s .= '<p>' . DI::l10n()->t('No consumer key pair for Twitter found. Please contact your site administrator.') . '</p>';
|
$html = '<p>' . DI::l10n()->t('No consumer key pair for Twitter found. Please contact your site administrator.') . '</p>';
|
||||||
} else {
|
} else {
|
||||||
// ok we have a consumer key pair now look into the OAuth stuff
|
// ok we have a consumer key pair now look into the OAuth stuff
|
||||||
if ((!$otoken) && (!$osecret)) {
|
if ((!$otoken) && (!$osecret)) {
|
||||||
|
|
@ -338,17 +330,19 @@ function twitter_settings(App $a, &$s)
|
||||||
$connection = new TwitterOAuth($ckey, $csecret);
|
$connection = new TwitterOAuth($ckey, $csecret);
|
||||||
try {
|
try {
|
||||||
$result = $connection->oauth('oauth/request_token', ['oauth_callback' => 'oob']);
|
$result = $connection->oauth('oauth/request_token', ['oauth_callback' => 'oob']);
|
||||||
$s .= '<p>' . DI::l10n()->t('At this Friendica instance the Twitter addon was enabled but you have not yet connected your account to your Twitter account. To do so click the button below to get a PIN from Twitter which you have to copy into the input box below and submit the form. Only your <strong>public</strong> posts will be posted to Twitter.') . '</p>';
|
|
||||||
$s .= '<a href="' . $connection->url('oauth/authorize', ['oauth_token' => $result['oauth_token']]) . '" target="_twitter"><img src="addon/twitter/lighter.png" alt="' . DI::l10n()->t('Log in with Twitter') . '"></a>';
|
$html = '<p>' . DI::l10n()->t('At this Friendica instance the Twitter addon was enabled but you have not yet connected your account to your Twitter account. To do so click the button below to get a PIN from Twitter which you have to copy into the input box below and submit the form. Only your <strong>public</strong> posts will be posted to Twitter.') . '</p>';
|
||||||
$s .= '<div id="twitter-pin-wrapper">';
|
$html .= '<a href="' . $connection->url('oauth/authorize', ['oauth_token' => $result['oauth_token']]) . '" target="_twitter"><img src="addon/twitter/lighter.png" alt="' . DI::l10n()->t('Log in with Twitter') . '"></a>';
|
||||||
$s .= '<label id="twitter-pin-label" for="twitter-pin">' . DI::l10n()->t('Copy the PIN from Twitter here') . '</label>';
|
$html .= '<div id="twitter-pin-wrapper">';
|
||||||
$s .= '<input id="twitter-pin" type="text" name="twitter-pin" />';
|
$html .= '<label id="twitter-pin-label" for="twitter-pin">' . DI::l10n()->t('Copy the PIN from Twitter here') . '</label>';
|
||||||
$s .= '<input id="twitter-token" type="hidden" name="twitter-token" value="' . $result['oauth_token'] . '" />';
|
$html .= '<input id="twitter-pin" type="text" name="twitter-pin" />';
|
||||||
$s .= '<input id="twitter-token2" type="hidden" name="twitter-token2" value="' . $result['oauth_token_secret'] . '" />';
|
$html .= '<input id="twitter-token" type="hidden" name="twitter-token" value="' . $result['oauth_token'] . '" />';
|
||||||
$s .= '</div><div class="clear"></div>';
|
$html .= '<input id="twitter-token2" type="hidden" name="twitter-token2" value="' . $result['oauth_token_secret'] . '" />';
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="twitter-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
|
$submit = null;
|
||||||
} catch (TwitterOAuthException $e) {
|
} catch (TwitterOAuthException $e) {
|
||||||
$s .= '<p>' . DI::l10n()->t('An error occured: ') . $e->getMessage() . '</p>';
|
$html = '<p>' . DI::l10n()->t('An error occured: ') . $e->getMessage() . '</p>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* * *
|
/* * *
|
||||||
|
|
@ -357,57 +351,53 @@ function twitter_settings(App $a, &$s)
|
||||||
*/
|
*/
|
||||||
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
|
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
|
||||||
try {
|
try {
|
||||||
$details = $connection->get('account/verify_credentials');
|
$account = $connection->get('account/verify_credentials');
|
||||||
|
if (property_exists($account, 'screen_name') &&
|
||||||
$field_checkbox = Renderer::getMarkupTemplate('field_checkbox.tpl');
|
property_exists($account, 'description') &&
|
||||||
|
property_exists($account, 'profile_image_url')
|
||||||
if (property_exists($details, 'screen_name') &&
|
) {
|
||||||
property_exists($details, 'description') &&
|
$connected = DI::l10n()->t('Currently connected to: <a href="https://twitter.com/%1$s" target="_twitter">%1$s</a>', $account->screen_name);
|
||||||
property_exists($details, 'profile_image_url')) {
|
|
||||||
$s .= '<div id="twitter-info" >
|
|
||||||
<p>' . DI::l10n()->t('Currently connected to: ') . '<a href="https://twitter.com/' . $details->screen_name . '" target="_twitter">' . $details->screen_name . '</a>
|
|
||||||
<button type="submit" name="twitter-disconnect" value="1">' . DI::l10n()->t('Disconnect') . '</button>
|
|
||||||
</p>
|
|
||||||
<p id="twitter-info-block">
|
|
||||||
<a href="https://twitter.com/' . $details->screen_name . '" target="_twitter"><img id="twitter-avatar" src="' . $details->profile_image_url . '" /></a>
|
|
||||||
<em>' . $details->description . '</em>
|
|
||||||
</p>
|
|
||||||
</div>';
|
|
||||||
} else {
|
} else {
|
||||||
$s .= '<div id="twitter-info" >
|
|
||||||
<p>Invalid Twitter info</p>
|
|
||||||
<button type="submit" name="twitter-disconnect" value="1">' . DI::l10n()->t('Disconnect') . '</button>
|
|
||||||
</div>';
|
|
||||||
Logger::notice('Invalid twitter info (verify credentials).', ['auth' => TwitterOAuth::class]);
|
Logger::notice('Invalid twitter info (verify credentials).', ['auth' => TwitterOAuth::class]);
|
||||||
}
|
}
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= Renderer::replaceMacros($field_checkbox, [
|
|
||||||
'$field' => ['twitter-enable', DI::l10n()->t('Allow posting to Twitter'), $enabled, DI::l10n()->t('If enabled all your <strong>public</strong> postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.')]
|
|
||||||
]);
|
|
||||||
if ($user['hidewall']) {
|
if ($user['hidewall']) {
|
||||||
$s .= '<p>' . DI::l10n()->t('<strong>Note</strong>: Due to your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to Twitter will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '</p>';
|
$privacy_warning = DI::l10n()->t('<strong>Note</strong>: Due to your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to Twitter will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.');
|
||||||
}
|
}
|
||||||
$s .= Renderer::replaceMacros($field_checkbox, [
|
|
||||||
'$field' => ['twitter-default', DI::l10n()->t('Send public postings to Twitter by default'), $defenabled, '']
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/twitter/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$l10n' => [
|
||||||
|
'connected' => $connected ?? '',
|
||||||
|
'invalid' => DI::l10n()->t('Invalid Twitter info'),
|
||||||
|
'disconnect' => DI::l10n()->t('Disconnect'),
|
||||||
|
'privacy_warning' => $privacy_warning ?? '',
|
||||||
|
],
|
||||||
|
|
||||||
|
'$account' => $account,
|
||||||
|
'$enable' => ['twitter-enable', DI::l10n()->t('Allow posting to Twitter'), $enabled, DI::l10n()->t('If enabled all your <strong>public</strong> postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.')],
|
||||||
|
'$default' => ['twitter-default', DI::l10n()->t('Send public postings to Twitter by default'), $defenabled],
|
||||||
|
'$mirror' => ['twitter-mirror', DI::l10n()->t('Mirror all posts from twitter that are no replies'), $mirrorenabled],
|
||||||
|
'$import' => ['twitter-import', DI::l10n()->t('Import the remote timeline'), $importenabled],
|
||||||
|
'$create_user' => ['twitter-create_user', DI::l10n()->t('Automatically create contacts'), $create_userenabled, DI::l10n()->t('This will automatically create a contact in Friendica as soon as you receive a message from an existing contact via the Twitter network. If you do not enable this, you need to manually add those Twitter contacts in Friendica from whom you would like to see posts here.')],
|
||||||
]);
|
]);
|
||||||
$s .= Renderer::replaceMacros($field_checkbox, [
|
|
||||||
'$field' => ['twitter-mirror', DI::l10n()->t('Mirror all posts from twitter that are no replies'), $mirrorenabled, '']
|
// Enable the default submit button
|
||||||
]);
|
$submit = null;
|
||||||
$s .= Renderer::replaceMacros($field_checkbox, [
|
|
||||||
'$field' => ['twitter-import', DI::l10n()->t('Import the remote timeline'), $importenabled, '']
|
|
||||||
]);
|
|
||||||
$s .= Renderer::replaceMacros($field_checkbox, [
|
|
||||||
'$field' => ['twitter-create_user', DI::l10n()->t('Automatically create contacts'), $create_userenabled, DI::l10n()->t('This will automatically create a contact in Friendica as soon as you receive a message from an existing contact via the Twitter network. If you do not enable this, you need to manually add those Twitter contacts in Friendica from whom you would like to see posts here.')]
|
|
||||||
]);
|
|
||||||
$s .= '<div class="clear"></div>';
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="twitter-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div>';
|
|
||||||
} catch (TwitterOAuthException $e) {
|
} catch (TwitterOAuthException $e) {
|
||||||
$s .= '<p>' . DI::l10n()->t('An error occured: ') . $e->getMessage() . '</p>';
|
$html = '<p>' . DI::l10n()->t('An error occured: ') . $e->getMessage() . '</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
$data = [
|
||||||
|
'connector' => 'twitter',
|
||||||
|
'title' => DI::l10n()->t('Twitter Import/Export/Mirror'),
|
||||||
|
'enabled' => $enabled,
|
||||||
|
'image' => 'images/twitter.png',
|
||||||
|
'html' => $html,
|
||||||
|
'submit' => $submit ?? null,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function twitter_hook_fork(App $a, array &$b)
|
function twitter_hook_fork(App $a, array &$b)
|
||||||
|
|
|
||||||
|
|
@ -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-07-25 13:16+0000\n"
|
"POT-Creation-Date: 2021-11-21 19:16-0500\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,18 +17,18 @@ 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"
|
||||||
|
|
||||||
#: windowsphonepush.php:108
|
#: windowsphonepush.php:102
|
||||||
msgid "WindowsPhonePush Settings"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: windowsphonepush.php:111
|
|
||||||
msgid "Enable WindowsPhonePush Addon"
|
msgid "Enable WindowsPhonePush Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: windowsphonepush.php:116
|
#: windowsphonepush.php:103
|
||||||
msgid "Push text of new item"
|
msgid "Push text of new item"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: windowsphonepush.php:121
|
#: windowsphonepush.php:104
|
||||||
msgid "Save Settings"
|
msgid "Device URL"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: windowsphonepush.php:109
|
||||||
|
msgid "WindowsPhonePush Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
3
windowsphonepush/templates/settings.tpl
Normal file
3
windowsphonepush/templates/settings.tpl
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$senditemtext}}
|
||||||
|
{{include file="field_input.tpl" field=$device_url}}
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
#windowsphonepush-device_url-wrapper {
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#windowsphonepush-enable-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#windowsphonepush-enable-chk {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#windowsphonepush-device_url-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#windowsphonepush-device_url-text {
|
|
||||||
float: left;
|
|
||||||
background-color: #C0C0C0;
|
|
||||||
width: 500px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#windowsphonepush-senditemtext-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#windowsphonepush-senditemtext-chk {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
@ -31,6 +31,7 @@ use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Content\Text\HTML;
|
use Friendica\Content\Text\HTML;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
@ -86,48 +87,28 @@ function windowsphonepush_settings_post($a, $post)
|
||||||
/* Called from the Addon Setting form.
|
/* Called from the Addon Setting form.
|
||||||
* Add our own settings info to the page.
|
* Add our own settings info to the page.
|
||||||
*/
|
*/
|
||||||
function windowsphonepush_settings(&$a, &$s)
|
function windowsphonepush_settings(App &$a, array &$data)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/windowsphonepush/windowsphonepush.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
|
||||||
$enabled = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable');
|
$enabled = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable');
|
||||||
$checked_enabled = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$senditemtext = DI::pConfig()->get(local_user(), 'windowsphonepush', 'senditemtext');
|
$senditemtext = DI::pConfig()->get(local_user(), 'windowsphonepush', 'senditemtext');
|
||||||
$checked_senditemtext = (($senditemtext) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$device_url = DI::pConfig()->get(local_user(), 'windowsphonepush', 'device_url');
|
$device_url = DI::pConfig()->get(local_user(), 'windowsphonepush', 'device_url');
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/windowsphonepush/');
|
||||||
$s .= '<div class="settings-block">';
|
$html = Renderer::replaceMacros($t, [
|
||||||
$s .= '<h3>' . DI::l10n()->t('WindowsPhonePush Settings') . '</h3>';
|
'$enabled' => ['windowsphonepush', DI::l10n()->t('Enable WindowsPhonePush Addon'), $enabled],
|
||||||
|
'$senditemtext' => ['windowsphonepush-senditemtext', DI::l10n()->t('Push text of new item'), $senditemtext],
|
||||||
|
'$device_url' => ['', DI::l10n()->t('Device URL'), $device_url, '', false, ' readonly'],
|
||||||
|
]);
|
||||||
|
|
||||||
$s .= '<div id="windowsphonepush-enable-wrapper">';
|
$data = [
|
||||||
$s .= '<label id="windowsphonepush-enable-label" for="windowsphonepush-enable-chk">' . DI::l10n()->t('Enable WindowsPhonePush Addon') . '</label>';
|
'addon' => 'windowsphonepush',
|
||||||
$s .= '<input id="windowsphonepush-enable-chk" type="checkbox" name="windowsphonepush" value="1" ' . $checked_enabled . '/>';
|
'title' => DI::l10n()->t('WindowsPhonePush Settings'),
|
||||||
$s .= '</div><div class="clear"></div>';
|
'html' => $html,
|
||||||
|
];
|
||||||
$s .= '<div id="windowsphonepush-senditemtext-wrapper">';
|
|
||||||
$s .= '<label id="windowsphonepush-senditemtext-label" for="windowsphonepush-senditemtext-chk">' . DI::l10n()->t('Push text of new item') . '</label>';
|
|
||||||
$s .= '<input id="windowsphonepush-senditemtext-chk" type="checkbox" name="windowsphonepush-senditemtext" value="1" ' . $checked_senditemtext . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button - enable und senditemtext can be changed by the user */
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="windowsphonepush-submit" name="windowsphonepush-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide further read-only information concerning the addon (useful for */
|
|
||||||
$s .= '<div id="windowsphonepush-device_url-wrapper">';
|
|
||||||
$s .= '<label id="windowsphonepush-device_url-label" for="windowsphonepush-device_url-text">Device-URL</label>';
|
|
||||||
$s .= '<input id="windowsphonepush-device_url-text" type="text" readonly value=' . $device_url . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div></div>';
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cron function used to regularly check all users on the server with active windowsphonepushaddon and send
|
/* Cron function used to regularly check all users on the server with active windowsphonepushaddon and send
|
||||||
|
|
|
||||||
|
|
@ -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-11-21 19:18-0500\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,56 +17,52 @@ 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"
|
||||||
|
|
||||||
#: wppost.php:39
|
#: wppost.php:41
|
||||||
msgid "Post to Wordpress"
|
msgid "Post to Wordpress"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:80 wppost.php:84
|
#: wppost.php:65
|
||||||
msgid "Wordpress Export"
|
msgid "Enable Wordpress Post Addon"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:87
|
#: wppost.php:66
|
||||||
msgid "Enable WordPress Post Addon"
|
msgid "Wordpress username"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:93
|
#: wppost.php:67
|
||||||
msgid "WordPress username"
|
msgid "Wordpress password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:98
|
#: wppost.php:68
|
||||||
msgid "WordPress password"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: wppost.php:103
|
|
||||||
msgid "WordPress API URL"
|
msgid "WordPress API URL"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:108
|
#: wppost.php:69
|
||||||
msgid "Post to WordPress by default"
|
msgid "Post to Wordpress by default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:114
|
#: wppost.php:70
|
||||||
msgid "Provide a backlink to the Friendica post"
|
msgid "Provide a backlink to the Friendica post"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:119
|
#: wppost.php:71
|
||||||
msgid ""
|
msgid ""
|
||||||
"Text for the backlink, e.g. Read the original post and comment stream on "
|
"Text for the backlink, e.g. Read the original post and comment stream on "
|
||||||
"Friendica."
|
"Friendica."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:124
|
#: wppost.php:72
|
||||||
msgid "Don't post messages that are too short"
|
msgid "Don't post messages that are too short"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:131
|
#: wppost.php:77
|
||||||
msgid "Save Settings"
|
msgid "Wordpress Export"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:231
|
#: wppost.php:182
|
||||||
msgid "Read the original post and comment stream on Friendica"
|
msgid "Read the original post and comment stream on Friendica"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: wppost.php:289
|
#: wppost.php:240
|
||||||
msgid "Post from Friendica"
|
msgid "Post from Friendica"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
5
wppost/templates/connector_settings.tpl
Normal file
5
wppost/templates/connector_settings.tpl
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||||
|
{{include file="field_input.tpl" field=$username}}
|
||||||
|
{{include file="field_password.tpl" field=$password}}
|
||||||
|
{{include file="field_input.tpl" field=$blog}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$bydefault}}
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
|
|
||||||
#wppost-enable-label, #wppost-username-label, #wppost-password-label,
|
|
||||||
#wppost-blog-label, #wppost-bydefault-label,
|
|
||||||
#wppost-backlink-label, #wppost-shortcheck-label {
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wppost-checkbox, #wppost-username, #wppost-password,
|
|
||||||
#wppost-blog, #wppost-bydefault,
|
|
||||||
#wppost-shortcheck, #wppost-backlink {
|
|
||||||
float: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wppost-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -6,10 +6,12 @@
|
||||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Content\Text\HTML;
|
use Friendica\Content\Text\HTML;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
|
|
@ -25,7 +27,7 @@ function wppost_install()
|
||||||
Hook::register('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post');
|
Hook::register('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post');
|
||||||
}
|
}
|
||||||
|
|
||||||
function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
|
function wppost_jot_nets(App &$a, array &$jotnets_fields)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -44,92 +46,39 @@ function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function wppost_settings(&$a, &$s) {
|
function wppost_settings(App &$a, array &$data)
|
||||||
|
{
|
||||||
if(! local_user())
|
if (!local_user()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Add our stylesheet to the page so we can make our settings look nice */
|
$enabled = DI::pConfig()->get(local_user(), 'wppost', 'post', false);
|
||||||
|
|
||||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/wppost/wppost.css' . '" media="all" />' . "\r\n";
|
|
||||||
|
|
||||||
/* Get the current state of our config variables */
|
|
||||||
|
|
||||||
$enabled = DI::pConfig()->get(local_user(),'wppost','post');
|
|
||||||
$checked = (($enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$css = (($enabled) ? '' : '-disabled');
|
|
||||||
|
|
||||||
$def_enabled = DI::pConfig()->get(local_user(),'wppost','post_by_default');
|
|
||||||
$back_enabled = DI::pConfig()->get(local_user(),'wppost','backlink');
|
|
||||||
$shortcheck_enabled = DI::pConfig()->get(local_user(),'wppost','shortcheck');
|
|
||||||
|
|
||||||
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
|
|
||||||
$back_checked = (($back_enabled) ? ' checked="checked" ' : '');
|
|
||||||
$shortcheck_checked = (($shortcheck_enabled) ? ' checked="checked" ' : '');
|
|
||||||
|
|
||||||
$wp_username = DI::pConfig()->get(local_user(), 'wppost', 'wp_username');
|
$wp_username = DI::pConfig()->get(local_user(), 'wppost', 'wp_username');
|
||||||
$wp_password = DI::pConfig()->get(local_user(), 'wppost', 'wp_password');
|
|
||||||
$wp_blog = DI::pConfig()->get(local_user(), 'wppost', 'wp_blog');
|
$wp_blog = DI::pConfig()->get(local_user(), 'wppost', 'wp_blog');
|
||||||
|
$def_enabled = DI::pConfig()->get(local_user(), 'wppost', 'post_by_default', false);
|
||||||
|
$back_enabled = DI::pConfig()->get(local_user(), 'wppost', 'backlink', false);
|
||||||
$wp_backlink_text = DI::pConfig()->get(local_user(), 'wppost', 'wp_backlink_text');
|
$wp_backlink_text = DI::pConfig()->get(local_user(), 'wppost', 'wp_backlink_text');
|
||||||
|
$shortcheck_enabled = DI::pConfig()->get(local_user(), 'wppost', 'shortcheck', false);
|
||||||
|
|
||||||
|
$t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/wppost/');
|
||||||
|
$html = Renderer::replaceMacros($t, [
|
||||||
|
'$enabled' => ['wppost', DI::l10n()->t('Enable Wordpress Post Addon'), $enabled],
|
||||||
|
'$username' => ['wp_username', DI::l10n()->t('Wordpress username'), $wp_username],
|
||||||
|
'$password' => ['wp_password', DI::l10n()->t('Wordpress password')],
|
||||||
|
'$blog' => ['wp_blog', DI::l10n()->t('WordPress API URL'), $wp_blog],
|
||||||
|
'$bydefault' => ['wp_bydefault', DI::l10n()->t('Post to Wordpress by default'), $def_enabled],
|
||||||
|
'$backlink' => ['wp_backlink', DI::l10n()->t('Provide a backlink to the Friendica post'), $back_enabled],
|
||||||
|
'$backlink_text' => ['wp_backlink_text', DI::l10n()->t('Text for the backlink, e.g. Read the original post and comment stream on Friendica.'), $wp_backlink_text],
|
||||||
|
'$shortcheck' => ['wp_shortcheck', DI::l10n()->t('Don\'t post messages that are too short'), $shortcheck_enabled],
|
||||||
|
]);
|
||||||
|
|
||||||
/* Add some HTML to the existing form */
|
$data = [
|
||||||
|
'connector' => 'wppost',
|
||||||
$s .= '<span id="settings_wppost_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_wppost_expanded\'); openClose(\'settings_wppost_inflated\');">';
|
'title' => DI::l10n()->t('Wordpress Export'),
|
||||||
$s .= '<img class="connector'.$css.'" src="images/wordpress.png" /><h3 class="connector">'. DI::l10n()->t('Wordpress Export').'</h3>';
|
'image' => 'images/wordpress.png',
|
||||||
$s .= '</span>';
|
'enabled' => $enabled,
|
||||||
$s .= '<div id="settings_wppost_expanded" class="settings-block" style="display: none;">';
|
'html' => $html,
|
||||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_wppost_expanded\'); openClose(\'settings_wppost_inflated\');">';
|
];
|
||||||
$s .= '<img class="connector'.$css.'" src="images/wordpress.png" /><h3 class="connector">'. DI::l10n()->t('Wordpress Export').'</h3>';
|
|
||||||
$s .= '</span>';
|
|
||||||
$s .= '<div id="wppost-enable-wrapper">';
|
|
||||||
$s .= '<label id="wppost-enable-label" for="wppost-enable">' . DI::l10n()->t('Enable WordPress Post Addon') . '</label>';
|
|
||||||
$s .= '<input type="hidden" name="wppost" value="0"/>';
|
|
||||||
$s .= '<input id="wppost-enable" type="checkbox" name="wppost" value="1" ' . $checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="wppost-username-wrapper">';
|
|
||||||
$s .= '<label id="wppost-username-label" for="wppost-username">' . DI::l10n()->t('WordPress username') . '</label>';
|
|
||||||
$s .= '<input id="wppost-username" type="text" name="wp_username" value="' . $wp_username . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="wppost-password-wrapper">';
|
|
||||||
$s .= '<label id="wppost-password-label" for="wppost-password">' . DI::l10n()->t('WordPress password') . '</label>';
|
|
||||||
$s .= '<input id="wppost-password" type="password" name="wp_password" value="' . $wp_password . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="wppost-blog-wrapper">';
|
|
||||||
$s .= '<label id="wppost-blog-label" for="wppost-blog">' . DI::l10n()->t('WordPress API URL') . '</label>';
|
|
||||||
$s .= '<input id="wppost-blog" type="text" name="wp_blog" value="' . $wp_blog . '" />';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="wppost-bydefault-wrapper">';
|
|
||||||
$s .= '<label id="wppost-bydefault-label" for="wppost-bydefault">' . DI::l10n()->t('Post to WordPress by default') . '</label>';
|
|
||||||
$s .= '<input type="hidden" name="wp_bydefault" value="0"/>';
|
|
||||||
$s .= '<input id="wppost-bydefault" type="checkbox" name="wp_bydefault" value="1" ' . $def_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="wppost-backlink-wrapper">';
|
|
||||||
$s .= '<label id="wppost-backlink-label" for="wppost-backlink">' . DI::l10n()->t('Provide a backlink to the Friendica post') . '</label>';
|
|
||||||
$s .= '<input type="hidden" name="wp_backlink" value="0"/>';
|
|
||||||
$s .= '<input id="wppost-backlink" type="checkbox" name="wp_backlink" value="1" ' . $back_checked . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
$s .= '<div id="wppost-backlinktext-wrapper">';
|
|
||||||
$s .= '<label id="wppost-backlinktext-label" for="wp_backlink_text">' . DI::l10n()->t('Text for the backlink, e.g. Read the original post and comment stream on Friendica.') . '</label>';
|
|
||||||
$s .= '<input id="wppost-backlinktext" type="text" name="wp_backlink_text" value="'. $wp_backlink_text.'" ' . $wp_backlink_text . '/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
$s .= '<div id="wppost-shortcheck-wrapper">';
|
|
||||||
$s .= '<label id="wppost-shortcheck-label" for="wppost-shortcheck">' . DI::l10n()->t("Don't post messages that are too short") . '</label>';
|
|
||||||
$s .= '<input type="hidden" name="wp_shortcheck" value="0"/>';
|
|
||||||
$s .= '<input id="wppost-shortcheck" type="checkbox" name="wp_shortcheck" value="1" '.$shortcheck_checked.'/>';
|
|
||||||
$s .= '</div><div class="clear"></div>';
|
|
||||||
|
|
||||||
/* provide a submit button */
|
|
||||||
|
|
||||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="wppost-submit" name="wppost-submit" class="settings-submit" value="' . DI::l10n()->t('Save Settings') . '" /></div></div>';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue