mirror of
https://github.com/friendica/friendica
synced 2025-05-02 10:24:22 +02:00
Replace deprecated Addon::callHooks with Hook::callAll
- Update documentation
This commit is contained in:
parent
895b3abf32
commit
55e54bb950
58 changed files with 450 additions and 475 deletions
|
@ -4,10 +4,9 @@
|
|||
*/
|
||||
namespace Friendica\Content;
|
||||
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Strings;
|
||||
|
@ -96,7 +95,7 @@ class ContactSelector
|
|||
Protocol::PNUT => L10n::t('pnut'),
|
||||
];
|
||||
|
||||
Addon::callHooks('network_to_name', $nets);
|
||||
Hook::callAll('network_to_name', $nets);
|
||||
|
||||
$search = array_keys($nets);
|
||||
$replace = array_values($nets);
|
||||
|
@ -141,6 +140,7 @@ class ContactSelector
|
|||
/**
|
||||
* @param string $current optional, default empty
|
||||
* @param string $suffix optionsl, default empty
|
||||
* @return string
|
||||
*/
|
||||
public static function gender($current = "", $suffix = "")
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ class ContactSelector
|
|||
'Undecided' => L10n::t('Undecided'),
|
||||
];
|
||||
|
||||
Addon::callHooks('gender_selector', $select);
|
||||
Hook::callAll('gender_selector', $select);
|
||||
|
||||
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
|
||||
foreach ($select as $neutral => $selection) {
|
||||
|
@ -179,6 +179,7 @@ class ContactSelector
|
|||
/**
|
||||
* @param string $current optional, default empty
|
||||
* @param string $suffix optionsl, default empty
|
||||
* @return string
|
||||
*/
|
||||
public static function sexualPreference($current = "", $suffix = "")
|
||||
{
|
||||
|
@ -200,7 +201,7 @@ class ContactSelector
|
|||
'Nonsexual' => L10n::t('Nonsexual'),
|
||||
];
|
||||
|
||||
Addon::callHooks('sexpref_selector', $select);
|
||||
Hook::callAll('sexpref_selector', $select);
|
||||
|
||||
$o .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
|
||||
foreach ($select as $neutral => $selection) {
|
||||
|
@ -215,6 +216,7 @@ class ContactSelector
|
|||
|
||||
/**
|
||||
* @param string $current optional, default empty
|
||||
* @return string
|
||||
*/
|
||||
public static function maritalStatus($current = "")
|
||||
{
|
||||
|
@ -254,7 +256,7 @@ class ContactSelector
|
|||
'Ask me' => L10n::t('Ask me'),
|
||||
];
|
||||
|
||||
Addon::callHooks('marital_selector', $select);
|
||||
Hook::callAll('marital_selector', $select);
|
||||
|
||||
$o .= '<select name="marital" id="marital-select" size="1" >';
|
||||
foreach ($select as $neutral => $selection) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*/
|
||||
namespace Friendica\Content;
|
||||
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
|
@ -36,7 +36,7 @@ class Feature
|
|||
}
|
||||
|
||||
$arr = ['uid' => $uid, 'feature' => $feature, 'enabled' => $x];
|
||||
Addon::callHooks('isEnabled', $arr);
|
||||
Hook::callAll('isEnabled', $arr);
|
||||
return($arr['enabled']);
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ class Feature
|
|||
}
|
||||
}
|
||||
|
||||
Addon::callHooks('get', $arr);
|
||||
Hook::callAll('get', $arr);
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
namespace Friendica\Content;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
|
@ -74,7 +73,7 @@ class Nav
|
|||
'$search_hint' => L10n::t('@name, !forum, #tags, content')
|
||||
]);
|
||||
|
||||
Addon::callHooks('page_header', $nav);
|
||||
Hook::callAll('page_header', $nav);
|
||||
|
||||
return $nav;
|
||||
}
|
||||
|
@ -105,7 +104,7 @@ class Nav
|
|||
if (local_user() || !$privateapps) {
|
||||
$arr = ['app_menu' => self::$app_menu];
|
||||
|
||||
Addon::callHooks('app_menu', $arr);
|
||||
Hook::callAll('app_menu', $arr);
|
||||
|
||||
self::$app_menu = $arr['app_menu'];
|
||||
}
|
||||
|
@ -276,7 +275,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>';
|
||||
}
|
||||
|
||||
Addon::callHooks('nav_info', $nav);
|
||||
Hook::callAll('nav_info', $nav);
|
||||
|
||||
return [
|
||||
'sitelocation' => $sitelocation,
|
||||
|
|
|
@ -10,9 +10,9 @@ use DOMNode;
|
|||
use DOMText;
|
||||
use DOMXPath;
|
||||
use Exception;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
|
@ -159,7 +159,7 @@ class OEmbed
|
|||
}
|
||||
}
|
||||
|
||||
Addon::callHooks('oembed_fetch_url', $embedurl, $oembed);
|
||||
Hook::callAll('oembed_fetch_url', $embedurl, $oembed);
|
||||
|
||||
return $oembed;
|
||||
}
|
||||
|
|
|
@ -14,9 +14,8 @@
|
|||
*/
|
||||
namespace Friendica\Content;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Util\Strings;
|
||||
|
@ -141,7 +140,7 @@ class Smilies
|
|||
];
|
||||
|
||||
$params = ['texts' => $texts, 'icons' => $icons];
|
||||
Addon::callHooks('smilie', $params);
|
||||
Hook::callAll('smilie', $params);
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ use Exception;
|
|||
use Friendica\BaseObject;
|
||||
use Friendica\Content\OEmbed;
|
||||
use Friendica\Content\Smilies;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
|
@ -1756,7 +1756,7 @@ class BBCode extends BaseObject
|
|||
//$Text = str_replace('<br /><li>', '<li>', $Text);
|
||||
//$Text = str_replace('<br /><ul', '<ul ', $Text);
|
||||
|
||||
Addon::callHooks('bbcode', $text);
|
||||
Hook::callAll('bbcode', $text);
|
||||
|
||||
return trim($text);
|
||||
}
|
||||
|
@ -1917,7 +1917,7 @@ class BBCode extends BaseObject
|
|||
);
|
||||
}
|
||||
|
||||
Addon::callHooks('bb2diaspora', $text);
|
||||
Hook::callAll('bb2diaspora', $text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ namespace Friendica\Content\Text;
|
|||
|
||||
use DOMDocument;
|
||||
use DOMXPath;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -315,7 +314,7 @@ class HTML
|
|||
$message = preg_replace('=\r *\r=i', "\n", $message);
|
||||
$message = str_replace("\r", "\n", $message);
|
||||
|
||||
Addon::callHooks('html2bbcode', $message);
|
||||
Hook::callAll('html2bbcode', $message);
|
||||
|
||||
$message = strip_tags($message);
|
||||
|
||||
|
@ -883,7 +882,7 @@ class HTML
|
|||
|
||||
$arr = ['contacts' => $r, 'output' => $o];
|
||||
|
||||
Addon::callHooks('contact_block_end', $arr);
|
||||
Hook::callAll('contact_block_end', $arr);
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue