mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-17 05:48:49 +00:00
Continued:
- even more App and array as type-hints added (cleaner code) Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
5f02272cf9
commit
6c3a37efda
15 changed files with 63 additions and 52 deletions
|
@ -109,7 +109,7 @@ function buffer_connect(&$a) {
|
|||
return($o);
|
||||
}
|
||||
|
||||
function buffer_jot_nets(&$a,&$b) {
|
||||
function buffer_jot_nets(App $a, array &$b) {
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
|
@ -205,7 +205,7 @@ function buffer_settings(&$a,&$s) {
|
|||
}
|
||||
|
||||
|
||||
function buffer_settings_post(&$a,&$b) {
|
||||
function buffer_settings_post(App $a, array &$b) {
|
||||
|
||||
if(x($_POST,'buffer-submit')) {
|
||||
if(x($_POST,'buffer_delete')) {
|
||||
|
@ -219,7 +219,7 @@ function buffer_settings_post(&$a,&$b) {
|
|||
}
|
||||
}
|
||||
|
||||
function buffer_post_local(&$a,&$b) {
|
||||
function buffer_post_local(App $a, array &$b) {
|
||||
|
||||
if (!local_user() || (local_user() != $b['uid'])) {
|
||||
return;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
require_once 'addon/diaspora/Diaspora_Connection.php';
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -35,7 +36,7 @@ function diaspora_uninstall() {
|
|||
}
|
||||
|
||||
|
||||
function diaspora_jot_nets(&$a,&$b) {
|
||||
function diaspora_jot_nets(App $a, array &$b) {
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
|
@ -48,7 +49,7 @@ function diaspora_jot_nets(&$a,&$b) {
|
|||
}
|
||||
}
|
||||
|
||||
function diaspora_queue_hook(&$a,&$b) {
|
||||
function diaspora_queue_hook(App $a, array &$b) {
|
||||
$hostname = $a->get_hostname();
|
||||
|
||||
$qi = q("SELECT * FROM `queue` WHERE `network` = '%s'",
|
||||
|
@ -225,7 +226,7 @@ function diaspora_settings(&$a,&$s) {
|
|||
}
|
||||
|
||||
|
||||
function diaspora_settings_post(&$a,&$b) {
|
||||
function diaspora_settings_post(App $a, array &$b) {
|
||||
|
||||
if(x($_POST,'diaspora-submit')) {
|
||||
|
||||
|
@ -238,7 +239,7 @@ function diaspora_settings_post(&$a,&$b) {
|
|||
|
||||
}
|
||||
|
||||
function diaspora_post_local(&$a,&$b) {
|
||||
function diaspora_post_local(App $a, array &$b) {
|
||||
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
|
@ -274,7 +275,7 @@ function diaspora_post_local(&$a,&$b) {
|
|||
|
||||
|
||||
|
||||
function diaspora_send(&$a,&$b) {
|
||||
function diaspora_send(App $a, array &$b) {
|
||||
$hostname = $a->get_hostname();
|
||||
|
||||
logger('diaspora_send: invoked');
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* Description: Thread email comment notifications on Gmail and anonymise them
|
||||
* Version: 1.0
|
||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -92,7 +92,7 @@ function gnot_settings(&$a,&$s) {
|
|||
}
|
||||
|
||||
|
||||
function gnot_enotify_mail(&$a,&$b) {
|
||||
function gnot_enotify_mail(App $a, array &$b) {
|
||||
if((! $b['uid']) || (! intval(PConfig::get($b['uid'], 'gnot','enable'))))
|
||||
return;
|
||||
if($b['type'] == NOTIFY_COMMENT)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -33,7 +34,7 @@ function ijpost_uninstall() {
|
|||
}
|
||||
|
||||
|
||||
function ijpost_jot_nets(&$a,&$b) {
|
||||
function ijpost_jot_nets(App $a, array &$b) {
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
|
@ -106,7 +107,7 @@ function ijpost_settings(&$a,&$s) {
|
|||
}
|
||||
|
||||
|
||||
function ijpost_settings_post(&$a,&$b) {
|
||||
function ijpost_settings_post(App $a, array &$b) {
|
||||
|
||||
if(x($_POST,'ijpost-submit')) {
|
||||
|
||||
|
@ -119,7 +120,7 @@ function ijpost_settings_post(&$a,&$b) {
|
|||
|
||||
}
|
||||
|
||||
function ijpost_post_local(&$a,&$b) {
|
||||
function ijpost_post_local(App $a, array &$b) {
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
|
||||
|
@ -150,7 +151,7 @@ function ijpost_post_local(&$a,&$b) {
|
|||
|
||||
|
||||
|
||||
function ijpost_send(&$a,&$b) {
|
||||
function ijpost_send(App $a, array &$b) {
|
||||
|
||||
if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
|
||||
return;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Author: Tony Baldwin <https://free-haven.org/u/tony>
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -30,7 +31,7 @@ function libertree_uninstall() {
|
|||
}
|
||||
|
||||
|
||||
function libertree_jot_nets(&$a,&$b) {
|
||||
function libertree_jot_nets(App $a, array &$b) {
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
|
@ -104,7 +105,7 @@ function libertree_settings(&$a,&$s) {
|
|||
}
|
||||
|
||||
|
||||
function libertree_settings_post(&$a,&$b) {
|
||||
function libertree_settings_post(App $a, array &$b) {
|
||||
|
||||
if(x($_POST,'libertree-submit')) {
|
||||
|
||||
|
@ -117,7 +118,7 @@ function libertree_settings_post(&$a,&$b) {
|
|||
|
||||
}
|
||||
|
||||
function libertree_post_local(&$a,&$b) {
|
||||
function libertree_post_local(App $a, array &$b) {
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
|
||||
|
@ -155,7 +156,7 @@ function libertree_post_local(&$a,&$b) {
|
|||
|
||||
|
||||
|
||||
function libertree_send(&$a,&$b) {
|
||||
function libertree_send(App $a, array &$b) {
|
||||
|
||||
logger('libertree_send: invoked');
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -33,7 +34,7 @@ function ljpost_uninstall() {
|
|||
}
|
||||
|
||||
|
||||
function ljpost_jot_nets(&$a,&$b) {
|
||||
function ljpost_jot_nets(App $a, array &$b) {
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
|
@ -101,7 +102,7 @@ function ljpost_settings(&$a,&$s) {
|
|||
}
|
||||
|
||||
|
||||
function ljpost_settings_post(&$a,&$b) {
|
||||
function ljpost_settings_post(App $a, array &$b) {
|
||||
|
||||
if(x($_POST,'ljpost-submit')) {
|
||||
|
||||
|
@ -114,7 +115,7 @@ function ljpost_settings_post(&$a,&$b) {
|
|||
|
||||
}
|
||||
|
||||
function ljpost_post_local(&$a,&$b) {
|
||||
function ljpost_post_local(App $a, array &$b) {
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
|
||||
|
@ -145,7 +146,7 @@ function ljpost_post_local(&$a,&$b) {
|
|||
|
||||
|
||||
|
||||
function ljpost_send(&$a,&$b) {
|
||||
function ljpost_send(App $a, array &$b) {
|
||||
|
||||
if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
|
||||
return;
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
* Version: 1.1
|
||||
* Author: tony baldwin <tony@free-haven.org>
|
||||
* Hauke Altmann <https://snarl.de/profile/tugelblend>
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -58,7 +59,7 @@ function pledgie_addon_settings(&$a,&$s) {
|
|||
return;
|
||||
}
|
||||
|
||||
function pledgie_addon_settings_post(&$a,&$b) {
|
||||
function pledgie_addon_settings_post(App $a, array &$b) {
|
||||
|
||||
if(! is_site_admin())
|
||||
return;
|
||||
|
@ -70,7 +71,7 @@ function pledgie_addon_settings_post(&$a,&$b) {
|
|||
}
|
||||
}
|
||||
|
||||
function pledgie_active(&$a,&$b) {
|
||||
function pledgie_active(App $a, array &$b) {
|
||||
$campaign = Config::get('pledgie-campaign','text');
|
||||
$describe = Config::get('pledgie-describe','text');
|
||||
$b .= '<div style="position: fixed; padding:5px; border-style:dotted; border-width:1px; background-color: white; line-height: 1; bottom: 5px; left: 20px; z-index: 1000; width: 150px; font-size: 12px;">';
|
||||
|
|
|
@ -212,9 +212,9 @@ function pumpio_connect(&$a)
|
|||
return $o;
|
||||
}
|
||||
|
||||
function pumpio_jot_nets(&$a, &$b)
|
||||
function pumpio_jot_nets(App $a, array &$b)
|
||||
{
|
||||
if (!local_user()) {
|
||||
if(! local_user())
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -327,10 +327,10 @@ function pumpio_settings(&$a, &$s)
|
|||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="pumpio-submit" name="pumpio-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
|
||||
}
|
||||
|
||||
function pumpio_settings_post(&$a, &$b)
|
||||
{
|
||||
if (x($_POST, 'pumpio-submit')) {
|
||||
if (x($_POST, 'pumpio_delete')) {
|
||||
function pumpio_settings_post(App $a, array &$b) {
|
||||
|
||||
if (x($_POST,'pumpio-submit')) {
|
||||
if (x($_POST,'pumpio_delete')) {
|
||||
PConfig::set(local_user(), 'pumpio', 'consumer_key', '');
|
||||
PConfig::set(local_user(), 'pumpio', 'consumer_secret', '');
|
||||
PConfig::set(local_user(), 'pumpio', 'oauth_token', '');
|
||||
|
@ -405,7 +405,7 @@ function pumpio_post_local(App $a, array &$b)
|
|||
$b['postopts'] .= 'pumpio';
|
||||
}
|
||||
|
||||
function pumpio_send(&$a, &$b)
|
||||
function pumpio_send(App $a, array &$b)
|
||||
{
|
||||
if (!PConfig::get($b["uid"], 'pumpio', 'import')) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
|
@ -1398,11 +1398,12 @@ function pumpio_getallusers(&$a, $uid)
|
|||
}
|
||||
}
|
||||
|
||||
function pumpio_queue_hook(&$a, &$b)
|
||||
function pumpio_queue_hook(App $a, array &$b)
|
||||
{
|
||||
$qi = q("SELECT * FROM `queue` WHERE `network` = '%s'",
|
||||
dbesc(NETWORK_PUMPIO)
|
||||
);
|
||||
|
||||
if (!DBM::is_result($qi)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
* you wish to use them. On some themes they may be visible.
|
||||
* Wave the mouse around near the comment input box and the qcomments will show up. Click on any of
|
||||
* them to open the comment window fully and insert the qcomment. Then "Submit" will submit it.
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -59,7 +60,7 @@ function qcomment_addon_settings(&$a, &$s)
|
|||
return;
|
||||
}
|
||||
|
||||
function qcomment_addon_settings_post(&$a,&$b) {
|
||||
function qcomment_addon_settings_post(App $a, array &$b) {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
* Version: 1.0
|
||||
* Author: Michael Vogel <ike@piratenpartei.de>
|
||||
* based upon NSFW from Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -61,7 +62,7 @@ function showmore_addon_settings(&$a,&$s) {
|
|||
return;
|
||||
}
|
||||
|
||||
function showmore_addon_settings_post(&$a,&$b) {
|
||||
function showmore_addon_settings_post(App $a, array &$b) {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
* Author: Thomas Willingham (based on Mike Macgirvin's Adult Smile template)
|
||||
* All smileys from sites offering them as Public Domain
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
|
||||
function smiley_pack_es_install() {
|
||||
|
@ -18,7 +20,7 @@ function smiley_pack_es_uninstall() {
|
|||
|
||||
|
||||
|
||||
function smiley_pack_smilies_es(&$a,&$b) {
|
||||
function smiley_pack_smilies_es(App $a, array &$b) {
|
||||
|
||||
#Smileys are split into various directories by the intended range of emotions. This is in case we get too big and need to modularise things. We can then cut and paste the right lines, move the right directory, and just change the name of the addon to happy_smilies or whatever.
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* Version: 1.01
|
||||
* Author: Thomas Willingham (based on Mike Macgirvin's Adult Smile template)
|
||||
* All smileys from sites offering them as Public Domain
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
|
||||
function smiley_pack_fr_install() {
|
||||
|
@ -20,7 +20,7 @@ function smiley_pack_fr_uninstall() {
|
|||
|
||||
|
||||
|
||||
function smiley_pack_fr_smilies(&$a,&$b) {
|
||||
function smiley_pack_fr_smilies(App $a, array &$b) {
|
||||
|
||||
#Smileys are split into various directories by the intended range of emotions. This is in case we get too big and need to modularise things. We can then cut and paste the right lines, move the right directory, and just change the name of the addon to happy_smilies or whatever.
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* All smileys from sites offering them as Public Domain
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
|
||||
function smiley_pack_install() {
|
||||
|
@ -19,7 +20,7 @@ function smiley_pack_uninstall() {
|
|||
|
||||
|
||||
|
||||
function smiley_pack_smilies(&$a,&$b) {
|
||||
function smiley_pack_smilies(App $a, array &$b) {
|
||||
|
||||
#Smileys are split into various directories by the intended range of emotions. This is in case we get too big and need to modularise things. We can then cut and paste the right lines, move the right directory, and just change the name of the addon to happy_smilies or whatever.
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Name: superblock
|
||||
* Description: block people
|
||||
|
@ -8,6 +6,8 @@
|
|||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||
*
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -69,7 +69,7 @@ function superblock_addon_settings(&$a,&$s) {
|
|||
return;
|
||||
}
|
||||
|
||||
function superblock_addon_settings_post(&$a,&$b) {
|
||||
function superblock_addon_settings_post(App $a, array &$b) {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
|
@ -80,7 +80,7 @@ function superblock_addon_settings_post(&$a,&$b) {
|
|||
}
|
||||
}
|
||||
|
||||
function superblock_enotify_store(&$a,&$b) {
|
||||
function superblock_enotify_store(App $a, array &$b) {
|
||||
|
||||
$words = PConfig::get($b['uid'],'system','blocked');
|
||||
if($words) {
|
||||
|
@ -109,7 +109,7 @@ function superblock_enotify_store(&$a,&$b) {
|
|||
}
|
||||
|
||||
|
||||
function superblock_conversation_start(&$a,&$b) {
|
||||
function superblock_conversation_start(App $a, array &$b) {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
|
@ -132,7 +132,7 @@ EOT;
|
|||
|
||||
}
|
||||
|
||||
function superblock_item_photo_menu(&$a,&$b) {
|
||||
function superblock_item_photo_menu(App $a, array &$b) {
|
||||
|
||||
if((! local_user()) || ($b['item']['self']))
|
||||
return;
|
||||
|
|
|
@ -38,7 +38,7 @@ function wppost_uninstall() {
|
|||
}
|
||||
|
||||
|
||||
function wppost_jot_nets(&$a,&$b) {
|
||||
function wppost_jot_nets(App $a, array &$b) {
|
||||
if(! local_user())
|
||||
return;
|
||||
|
||||
|
@ -137,7 +137,7 @@ function wppost_settings(&$a,&$s) {
|
|||
}
|
||||
|
||||
|
||||
function wppost_settings_post(&$a,&$b) {
|
||||
function wppost_settings_post(App $a, array &$b) {
|
||||
|
||||
if(x($_POST,'wppost-submit')) {
|
||||
|
||||
|
@ -195,7 +195,7 @@ function wppost_post_local(App $a, array &$b) {
|
|||
|
||||
|
||||
|
||||
function wppost_send(&$a,&$b) {
|
||||
function wppost_send(App $a, array &$b) {
|
||||
|
||||
if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue