Addon class
[friendica-addons.git] / krynn / krynn.php
index ca2c426d594185ea52068f5f867e54cebc92d683..93082419c3535b4cd2dd4f121be002ffeaa92acf 100644 (file)
@@ -9,30 +9,30 @@
  *
  *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function krynn_install() {
 
        /**
-        * 
+        *
         * Our demo plugin will attach in three places.
         * The first is just prior to storing a local post.
         *
         */
 
-       register_hook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
+       Addon::registerHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
 
        /**
         *
-        * Then we'll attach into the plugin settings page, and also the 
+        * Then we'll attach into the plugin settings page, and also the
         * settings post hook so that we can create and update
         * user preferences.
         *
         */
 
-       register_hook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
-       register_hook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
 
        logger("installed krynn");
 }
@@ -48,9 +48,9 @@ function krynn_uninstall() {
         *
         */
 
-       unregister_hook('post_local',    'addon/krynn/krynn.php', 'krynn_post_hook');
-       unregister_hook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
-       unregister_hook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+       Addon::unregisterHook('post_local',    'addon/krynn/krynn.php', 'krynn_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
 
 
        logger("removed krynn");
@@ -96,7 +96,7 @@ function krynn_post_hook($a, &$item) {
         *
         */
 
-       $krynn = array('Ansalon','Abanasinia','Solace','Haven','Gateway','Qualinost','Ankatavaka','Pax Tharkas','Ergoth','Newsea','Straights of Schallsea','Plains of Dust','Tarsis','Barren Hills','Que Shu','Citadel of Light','Solinari','Hedge Maze','Tower of High Sorcery','Inn of the Last Home','Last Heroes Tomb','Academy of Sorcery','Gods Row','Temple of Majere','Temple of Kiri-Jolith','Temple of Mishakal','Temple of Zeboim','The Trough','Sad Town','Xak Tsaroth','Zhaman','Skullcap','Saifhum','Karthay','Mithas','Kothas','Silver Dragon Mountain','Silvanesti');
+       $krynn = ['Ansalon','Abanasinia','Solace','Haven','Gateway','Qualinost','Ankatavaka','Pax Tharkas','Ergoth','Newsea','Straights of Schallsea','Plains of Dust','Tarsis','Barren Hills','Que Shu','Citadel of Light','Solinari','Hedge Maze','Tower of High Sorcery','Inn of the Last Home','Last Heroes Tomb','Academy of Sorcery','Gods Row','Temple of Majere','Temple of Kiri-Jolith','Temple of Mishakal','Temple of Zeboim','The Trough','Sad Town','Xak Tsaroth','Zhaman','Skullcap','Saifhum','Karthay','Mithas','Kothas','Silver Dragon Mountain','Silvanesti'];
 
        $planet = array_rand($krynn,1);
        $item['location'] = $krynn[$planet];
@@ -126,7 +126,7 @@ function krynn_settings_post($a,$post) {
 
 /**
  *
- * Called from the Plugin Setting form. 
+ * Called from the Plugin Setting form.
  * Add our own settings info to the page.
  *
  */