Replace deprecated Addon::callHooks with Hook::callAll

- Update documentation
This commit is contained in:
Hypolite Petovan 2018-12-26 01:06:24 -05:00
parent 895b3abf32
commit 55e54bb950
58 changed files with 450 additions and 475 deletions

View file

@ -8,8 +8,6 @@ namespace Friendica\Core;
use Friendica\BaseObject;
use Friendica\Content\Feature;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
@ -69,7 +67,7 @@ class ACL extends BaseObject
$x = ['options' => $options, 'size' => $size, 'single' => $single, 'mutual' => $mutual, 'exclude' => $exclude, 'networks' => $networks];
Addon::callHooks('contact_select_options', $x);
Hook::callAll('contact_select_options', $x);
$o = '';
@ -111,7 +109,7 @@ class ACL extends BaseObject
$arr = ['contact' => $contacts, 'entry' => $o];
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
Hook::callAll($a->module . '_pre_' . $selname, $arr);
if (DBA::isResult($contacts)) {
foreach ($contacts as $contact) {
@ -129,7 +127,7 @@ class ACL extends BaseObject
$o .= '</select>' . PHP_EOL;
Addon::callHooks($a->module . '_post_' . $selname, $o);
Hook::callAll($a->module . '_post_' . $selname, $o);
return $o;
}
@ -176,7 +174,7 @@ class ACL extends BaseObject
$arr = ['contact' => $contacts, 'entry' => $o];
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
Hook::callAll($a->module . '_pre_' . $selname, $arr);
$receiverlist = [];
@ -202,7 +200,7 @@ class ACL extends BaseObject
$o .= implode(', ', $receiverlist);
}
Addon::callHooks($a->module . '_post_' . $selname, $o);
Hook::callAll($a->module . '_post_' . $selname, $o);
return $o;
}
@ -285,7 +283,7 @@ class ACL extends BaseObject
$jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> ' . L10n::t("Post to Email") . '</div>';
}
Addon::callHooks('jot_networks', $jotnets);
Hook::callAll('jot_networks', $jotnets);
} else {
$jotnets .= L10n::t('Connectors disabled, since "%s" is enabled.',
L10n::t('Hide your profile details from unknown viewers?'));

View file

@ -6,11 +6,6 @@
namespace Friendica\Core;
use Friendica\BaseObject;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Database\DBA;
use Friendica\Model\User;
use Friendica\Util\DateTimeFormat;
@ -154,7 +149,7 @@ class Authentication extends BaseObject
}
if ($login_initial) {
Addon::callHooks('logged_in', $a->user);
Hook::callAll('logged_in', $a->user);
if (($a->module !== 'home') && isset($_SESSION['return_path'])) {
$a->internalRedirect($_SESSION['return_path']);

View file

@ -6,9 +6,6 @@ namespace Friendica\Core;
use Friendica\BaseObject;
use Friendica\Database\DBA;
use Friendica\Core\Addon;
use Friendica\Core\Logger;
use Friendica\Core\System;
/**
* Provide Language, Translation, and Localization functions to the application
@ -402,7 +399,7 @@ class L10n extends BaseObject
'rebuff' => ['rebuffed', self::t('rebuff'), self::t('rebuffed')],
];
Addon::callHooks('poke_verbs', $arr);
Hook::callAll('poke_verbs', $arr);
return $arr;
}

View file

@ -5,7 +5,6 @@
namespace Friendica\Core;
use Friendica\BaseObject;
use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\Model\Process;
use Friendica\Util\DateTimeFormat;
@ -1070,7 +1069,7 @@ class Worker
$arr = ['args' => $args, 'run_cmd' => true];
Addon::callHooks("proc_run", $arr);
Hook::callAll("proc_run", $arr);
if (!$arr['run_cmd'] || !count($args)) {
return true;
}