mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-07 09:54:27 +02:00
Changes:
- added missing type-hints - avoided local variables - added some documentation - changed double-quotes to single
This commit is contained in:
parent
c0c15644a3
commit
06b15a6ed0
29 changed files with 191 additions and 204 deletions
|
@ -48,24 +48,21 @@ function newmemberwidget_network_mod_init (App $a, $b)
|
|||
|
||||
function newmemberwidget_addon_admin_post(App $a)
|
||||
{
|
||||
$ft = (!empty($_POST['freetext']) ? trim($_POST['freetext']) : "");
|
||||
$lsn = trim($_POST['localsupportname'] ?? '');
|
||||
$gs = intval($_POST['linkglobalsupport']);
|
||||
$ls = intval($_POST['linklocalsupport']);
|
||||
DI::config()->set('newmemberwidget', 'freetext', trim($ft));
|
||||
DI::config()->set('newmemberwidget', 'linkglobalsupport', $gs);
|
||||
DI::config()->set('newmemberwidget', 'linklocalsupport', $ls);
|
||||
DI::config()->set('newmemberwidget', 'localsupport', trim($lsn));
|
||||
DI::config()->set('newmemberwidget', 'freetext', (!empty($_POST['freetext']) ? trim($_POST['freetext']) : ""));
|
||||
DI::config()->set('newmemberwidget', 'linkglobalsupport', intval($_POST['linkglobalsupport']));
|
||||
DI::config()->set('newmemberwidget', 'linklocalsupport', intval($_POST['linklocalsupport']));
|
||||
DI::config()->set('newmemberwidget', 'localsupport', trim($_POST['localsupportname'] ?? ''));
|
||||
}
|
||||
|
||||
function newmemberwidget_addon_admin(App $a, &$o)
|
||||
function newmemberwidget_addon_admin(App $a, string &$o)
|
||||
{
|
||||
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/newmemberwidget');
|
||||
|
||||
$o = Renderer::replaceMacros($t, [
|
||||
'$submit' => DI::l10n()->t('Save Settings'),
|
||||
'$freetext' => [ "freetext", DI::l10n()->t("Message"), DI::config()->get("newmemberwidget", "freetext"), DI::l10n()->t("Your message for new members. You can use bbcode here.")],
|
||||
'$linkglobalsupport' => [ "linkglobalsupport", DI::l10n()->t('Add a link to global support forum'), DI::config()->get('newmemberwidget', 'linkglobalsupport'), DI::l10n()->t('Should a link to the global support forum be displayed?')." (<a href='https://forum.friendi.ca/profile/helpers'>@helpers</a>)"],
|
||||
'$linklocalsupport' => [ "linklocalsupport", DI::l10n()->t('Add a link to the local support forum'), DI::config()->get('newmemberwidget', 'linklocalsupport'), DI::l10n()->t('If you have a local support forum and want to have a link displayed in the widget, check this box.')],
|
||||
'$localsupportname' => [ "localsupportname", DI::l10n()->t('Name of the local support group'), DI::config()->get('newmemberwidget', 'localsupport'), DI::l10n()->t('If you checked the above, specify the <em>nickname</em> of the local support group here (i.e. helpers)')],
|
||||
'$submit' => DI::l10n()->t('Save Settings'),
|
||||
'$freetext' => ["freetext", DI::l10n()->t("Message"), DI::config()->get("newmemberwidget", "freetext"), DI::l10n()->t("Your message for new members. You can use bbcode here.")],
|
||||
'$linkglobalsupport' => ["linkglobalsupport", DI::l10n()->t('Add a link to global support forum'), DI::config()->get('newmemberwidget', 'linkglobalsupport'), DI::l10n()->t('Should a link to the global support forum be displayed?')." (<a href='https://forum.friendi.ca/profile/helpers'>@helpers</a>)"],
|
||||
'$linklocalsupport' => ["linklocalsupport", DI::l10n()->t('Add a link to the local support forum'), DI::config()->get('newmemberwidget', 'linklocalsupport'), DI::l10n()->t('If you have a local support forum and want to have a link displayed in the widget, check this box.')],
|
||||
'$localsupportname' => ["localsupportname", DI::l10n()->t('Name of the local support group'), DI::config()->get('newmemberwidget', 'localsupport'), DI::l10n()->t('If you checked the above, specify the <em>nickname</em> of the local support group here (i.e. helpers)')],
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue