X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=krynn%2Fkrynn.php;h=fe25fdf75ce743e43c9cd39349aab6b97d723c5a;hb=b11e418f3570a5a61bab3fb3bc2660b92635b108;hp=4b6e1f7f74186bda3904655f90bc3d120ee669a4;hpb=a8282d143e43eaab9239c472fd42a5ecbf957d0d;p=friendica-addons.git
diff --git a/krynn/krynn.php b/krynn/krynn.php
index 4b6e1f7f..fe25fdf7 100644
--- a/krynn/krynn.php
+++ b/krynn/krynn.php
@@ -9,9 +9,9 @@
*
*"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere
*/
-use Friendica\Core\Addon;
-use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
+use Friendica\Core\Hook;
+use Friendica\Core\Logger;
+use Friendica\DI;
function krynn_install() {
@@ -22,7 +22,7 @@ function krynn_install() {
*
*/
- Addon::registerHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
+ Hook::register('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
/**
*
@@ -32,10 +32,10 @@ function krynn_install() {
*
*/
- Addon::registerHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
- Addon::registerHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+ Hook::register('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+ Hook::register('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
- logger("installed krynn");
+ Logger::log("installed krynn");
}
@@ -49,12 +49,12 @@ function krynn_uninstall() {
*
*/
- Addon::unregisterHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
- Addon::unregisterHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
- Addon::unregisterHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+ Hook::unregister('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
+ Hook::unregister('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+ Hook::unregister('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
- logger("removed krynn");
+ Logger::log("removed krynn");
}
@@ -70,7 +70,7 @@ function krynn_post_hook($a, &$item) {
*
*/
- logger('krynn invoked');
+ Logger::log('krynn invoked');
if(! local_user()) /* non-zero if this is a logged in user of this system */
return;
@@ -83,7 +83,7 @@ function krynn_post_hook($a, &$item) {
/* Retrieve our personal config setting */
- $active = PConfig::get(local_user(), 'krynn', 'enable');
+ $active = DI::pConfig()->get(local_user(), 'krynn', 'enable');
if(! $active)
return;
@@ -121,7 +121,7 @@ function krynn_settings_post($a,$post) {
if(! local_user())
return;
if($_POST['krynn-submit'])
- PConfig::set(local_user(),'krynn','enable',intval($_POST['krynn']));
+ DI::pConfig()->set(local_user(),'krynn','enable',intval($_POST['krynn']));
}
@@ -141,34 +141,34 @@ function krynn_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */
- $a->page['htmlhead'] .= '' . "\r\n";
+ DI::page()['htmlhead'] .= '' . "\r\n";
/* Get the current state of our config variable */
- $enabled = PConfig::get(local_user(),'krynn','enable');
+ $enabled = DI::pConfig()->get(local_user(),'krynn','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */
$s .= '';
- $s .= '' . L10n::t('Krynn') . '
';
+ $s .= '' . DI::l10n()->t('Krynn') . '
';
$s .= '';
$s .= '