Update Addon functions and calls

Update function names and calls for Addon class.
This commit is contained in:
Adam Magness 2018-01-17 13:42:40 -05:00
parent 213f6ae1a1
commit 11cf36105c
73 changed files with 544 additions and 464 deletions

View file

@ -4,6 +4,7 @@
*/
namespace Friendica\Content;
use Friendica\Core\Addon;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use dba;
@ -93,7 +94,7 @@ class ContactSelector
NETWORK_APPNET => t('App.net')
];
call_hooks('network_to_name', $nets);
Addon::callHooks('network_to_name', $nets);
$search = array_keys($nets);
$replace = array_values($nets);
@ -122,7 +123,7 @@ class ContactSelector
$o = '';
$select = ['', t('Male'), t('Female'), t('Currently Male'), t('Currently Female'), t('Mostly Male'), t('Mostly Female'), t('Transgender'), t('Intersex'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Non-specific'), t('Other'), t('Undecided')];
call_hooks('gender_selector', $select);
Addon::callHooks('gender_selector', $select);
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
foreach ($select as $selection) {
@ -145,7 +146,7 @@ class ContactSelector
$select = ['', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual')];
call_hooks('sexpref_selector', $select);
Addon::callHooks('sexpref_selector', $select);
$o .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
foreach ($select as $selection) {
@ -166,7 +167,7 @@ class ContactSelector
$o = '';
$select = ['', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Has crush'), t('Infatuated'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Imaginarily married'), t('Partners'), t('Cohabiting'), t('Common law'), t('Happy'), t('Not looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Imaginarily divorced'), t('Widowed'), t('Uncertain'), t('It\'s complicated'), t('Don\'t care'), t('Ask me')];
call_hooks('marital_selector', $select);
Addon::callHooks('marital_selector', $select);
$o .= '<select name="marital" id="marital-select" size="1" >';
foreach ($select as $selection) {

View file

@ -5,6 +5,7 @@
*/
namespace Friendica\Content;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
@ -36,7 +37,7 @@ class Feature
}
$arr = ['uid' => $uid, 'feature' => $feature, 'enabled' => $x];
call_hooks('isEnabled', $arr);
Addon::callHooks('isEnabled', $arr);
return($arr['enabled']);
}
@ -150,7 +151,7 @@ class Feature
}
}
call_hooks('get', $arr);
Addon::callHooks('get', $arr);
return $arr;
}
}

View file

@ -6,6 +6,7 @@ namespace Friendica\Content;
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -57,7 +58,7 @@ class Nav
'$search_hint' => t('@name, !forum, #tags, content')
]);
call_hooks('page_header', $a->page['nav']);
Addon::callHooks('page_header', $a->page['nav']);
}
/**
@ -224,7 +225,7 @@ class Nav
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
call_hooks('nav_info', $nav);
Addon::callHooks('nav_info', $nav);
return [
'sitelocation' => $sitelocation,

View file

@ -6,6 +6,7 @@
namespace Friendica\Content;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\System;
use Friendica\Core\Config;
@ -154,7 +155,7 @@ class OEmbed
}
}
call_hooks('oembed_fetch_url', $embedurl, $j);
Addon::callHooks('oembed_fetch_url', $embedurl, $j);
return $j;
}

View file

@ -15,6 +15,7 @@
namespace Friendica\Content;
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@ -139,7 +140,7 @@ class Smilies
];
$params = ['texts' => $texts, 'icons' => $icons];
call_hooks('smilie', $params);
Addon::callHooks('smilie', $params);
return $params;
}

View file

@ -6,6 +6,7 @@ namespace Friendica\Content;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@ -74,23 +75,23 @@ class Widget
{
$networks = array();
if (!plugin_enabled("appnet")) {
if (!Addon::isEnabled("appnet")) {
$networks[] = NETWORK_APPNET;
}
if (!plugin_enabled("fbpost") && !plugin_enabled("facebook")) {
if (!Addon::isEnabled("fbpost") && !Addon::isEnabled("facebook")) {
$networks[] = NETWORK_FACEBOOK;
}
if (!plugin_enabled("statusnet")) {
if (!Addon::isEnabled("statusnet")) {
$networks[] = NETWORK_STATUSNET;
}
if (!plugin_enabled("pumpio")) {
if (!Addon::isEnabled("pumpio")) {
$networks[] = NETWORK_PUMPIO;
}
if (!plugin_enabled("twitter")) {
if (!Addon::isEnabled("twitter")) {
$networks[] = NETWORK_TWITTER;
}
@ -102,7 +103,7 @@ class Widget
$networks[] = NETWORK_DIASPORA;
}
if (!plugin_enabled("pnut")) {
if (!Addon::isEnabled("pnut")) {
$networks[] = NETWORK_PNUT;
}