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
|
@ -11,9 +11,9 @@ use Friendica\Content\ContactSelector;
|
|||
use Friendica\Content\Feature;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Authentication;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\NotificationsManager;
|
||||
|
@ -174,7 +174,7 @@ function api_login(App $a)
|
|||
list($consumer, $token) = $oauth1->verify_request($request);
|
||||
if (!is_null($token)) {
|
||||
$oauth1->loginUser($token->uid);
|
||||
Addon::callHooks('logged_in', $a->user);
|
||||
Hook::callAll('logged_in', $a->user);
|
||||
return;
|
||||
}
|
||||
echo __FILE__.__LINE__.__FUNCTION__ . "<pre>";
|
||||
|
@ -224,7 +224,7 @@ function api_login(App $a)
|
|||
* Addons should never set 'authenticated' except to indicate success - as hooks may be chained
|
||||
* and later addons should not interfere with an earlier one that succeeded.
|
||||
*/
|
||||
Addon::callHooks('authenticate', $addon_auth);
|
||||
Hook::callAll('authenticate', $addon_auth);
|
||||
|
||||
if ($addon_auth['authenticated'] && count($addon_auth['user_record'])) {
|
||||
$record = $addon_auth['user_record'];
|
||||
|
@ -247,7 +247,7 @@ function api_login(App $a)
|
|||
|
||||
$_SESSION["allow_api"] = true;
|
||||
|
||||
Addon::callHooks('logged_in', $a->user);
|
||||
Hook::callAll('logged_in', $a->user);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,8 +8,8 @@ use Friendica\Content\ContactSelector;
|
|||
use Friendica\Content\Feature;
|
||||
use Friendica\Content\Pager;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -543,7 +543,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
|
|||
}
|
||||
|
||||
$cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
|
||||
Addon::callHooks('conversation_start',$cb);
|
||||
Hook::callAll('conversation_start',$cb);
|
||||
|
||||
$items = $cb['items'];
|
||||
|
||||
|
@ -615,7 +615,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
|
|||
}
|
||||
|
||||
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
|
||||
Addon::callHooks('render_location',$locate);
|
||||
Hook::callAll('render_location',$locate);
|
||||
|
||||
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
|
||||
|
||||
|
@ -706,7 +706,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
|
|||
];
|
||||
|
||||
$arr = ['item' => $item, 'output' => $tmp_item];
|
||||
Addon::callHooks('display_item', $arr);
|
||||
Hook::callAll('display_item', $arr);
|
||||
|
||||
$threads[$threadsid]['id'] = $item['id'];
|
||||
$threads[$threadsid]['network'] = $item['network'];
|
||||
|
@ -743,7 +743,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
|
|||
|
||||
/// @todo Check if this call is needed or not
|
||||
$arr = ['item' => $item];
|
||||
Addon::callHooks('display_item', $arr);
|
||||
Hook::callAll('display_item', $arr);
|
||||
|
||||
$item['pagedrop'] = $page_dropping;
|
||||
|
||||
|
@ -892,7 +892,7 @@ function item_photo_menu($item) {
|
|||
|
||||
$args = ['item' => $item, 'menu' => $menu];
|
||||
|
||||
Addon::callHooks('item_photo_menu', $args);
|
||||
Hook::callAll('item_photo_menu', $args);
|
||||
|
||||
$menu = $args['menu'];
|
||||
|
||||
|
@ -1097,7 +1097,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
|
|||
]);
|
||||
|
||||
$jotplugins = '';
|
||||
Addon::callHooks('jot_tool', $jotplugins);
|
||||
Hook::callAll('jot_tool', $jotplugins);
|
||||
|
||||
// Private/public post links for the non-JS ACL form
|
||||
$private_post = 1;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
*/
|
||||
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
|
@ -441,7 +441,7 @@ function notification($params)
|
|||
'itemlink' => $itemlink
|
||||
];
|
||||
|
||||
Addon::callHooks('enotify', $h);
|
||||
Hook::callAll('enotify', $h);
|
||||
|
||||
$subject = $h['subject'];
|
||||
|
||||
|
@ -481,7 +481,7 @@ function notification($params)
|
|||
$datarray['otype'] = $params['otype'];
|
||||
$datarray['abort'] = false;
|
||||
|
||||
Addon::callHooks('enotify_store', $datarray);
|
||||
Hook::callAll('enotify_store', $datarray);
|
||||
|
||||
if ($datarray['abort']) {
|
||||
L10n::popLang();
|
||||
|
@ -584,7 +584,7 @@ function notification($params)
|
|||
$datarray['subject'] = $subject;
|
||||
$datarray['headers'] = $additional_mail_header;
|
||||
|
||||
Addon::callHooks('enotify_mail', $datarray);
|
||||
Hook::callAll('enotify_mail', $datarray);
|
||||
|
||||
// check whether sending post content in email notifications is allowed
|
||||
// always true for SYSTEM_EMAIL
|
||||
|
@ -677,7 +677,7 @@ function check_user_notification($itemid) {
|
|||
*/
|
||||
function check_item_notification($itemid, $uid, $defaulttype = "") {
|
||||
$notification_data = ["uid" => $uid, "profiles" => []];
|
||||
Addon::callHooks('check_item_notification', $notification_data);
|
||||
Hook::callAll('check_item_notification', $notification_data);
|
||||
|
||||
$profiles = $notification_data["profiles"];
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -27,7 +27,7 @@ use Friendica\Util\Temporal;
|
|||
require_once 'mod/share.php';
|
||||
function add_page_info_data(array $data, $no_photos = false)
|
||||
{
|
||||
Addon::callHooks('page_info_data', $data);
|
||||
Hook::callAll('page_info_data', $data);
|
||||
|
||||
if (empty($data['type'])) {
|
||||
return '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue