Browse Source

downgrade hook to v1

master
ivan 1 year ago
parent
commit
55eb683b36
  1. 10
      link/link.php

10
link/link.php

@ -2,7 +2,7 @@
/**
* Name: Link
* Description: Using short links on whole hub
* Version: 0.66
* Version: 0.67
* Author: ivan zlax <@zlax@ussr.win>
* Maintainer: ivan zlax <@zlax@ussr.win>
*/
@ -14,13 +14,13 @@ use Zotlabs\Extend\Route;
function link_load() {
Route::register('addon/link/Mod_Link.php','link');
if (get_config('link','linkonhub'))
Hook::register('dropdown_extras', 'addon/link/link.php', 'dropdown_link', 1, 5000);
register_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link');
set_config('link','linkenabled',1);
}
function link_unload() {
Route::unregister('addon/link/Mod_Link.php','link');
Hook::unregister('dropdown_extras', 'addon/link/link.php', 'dropdown_link');
unregister_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link');
del_config('link','linkenabled');
}
@ -35,9 +35,9 @@ function link_plugin_admin(&$a,&$o) {
function link_plugin_admin_post(&$a) {
set_config('link','linkonhub',trim($_POST['linkonhub']));
if (get_config('link','linkonhub'))
Hook::register('dropdown_extras', 'addon/link/link.php', 'dropdown_link', 1, 5000);
register_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link');
else
Hook::unregister('dropdown_extras', 'addon/link/link.php', 'dropdown_link');
unregister_hook('dropdown_extras', 'addon/link/link.php', 'dropdown_link');
info( t('Settings updated.') . EOL );
}

Loading…
Cancel
Save