Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Randem on March 15, 2019, 07:19:46 PM

Title: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: Randem on March 15, 2019, 07:19:46 PM
In the Admin.php file the code for integrate_admin_areas is missing. Is this an oversight?


// Let them modify admin areas easily.
call_integration_hook('integrate_admin_areas', array(&$admin_areas));


Is there some other way to achieve what this hook was for? or do I need to put it back with a MOD?
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: Arantor on March 15, 2019, 07:25:21 PM
There's a generic hook inside the menu code instead that replaces the equivalent hooks for admin and profile.
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: Randem on March 15, 2019, 08:02:53 PM
Would that be createMenu() in Subs-Menu.php?
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: vbgamer45 on March 15, 2019, 10:56:38 PM
Odd... I been using integrate_admin_areas in my mods for SMF 2.1 seems to still work for some reason...
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: Randem on March 15, 2019, 11:10:42 PM
It may have been there in 2.1 but the code is definitely missing in 2.1 RC1...
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: vbgamer45 on March 15, 2019, 11:52:47 PM
Yeah I meant RC1...
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: Sesquipedalian on March 15, 2019, 11:53:41 PM
It's here:
https://github.com/SimpleMachines/SMF2.1/blob/1280283d1e389fd1532f8cfa37d6e532d8777ed3/Sources/Subs-Menu.php#L67-L69

When building the admin menu, that will call the integrate_admin_menu hook. When building the moderation menu, it will call the integrate_moderate_menu hook, etc., etc.
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: vbgamer45 on March 16, 2019, 12:00:27 AM
That explains it! Thanks
Title: Re: integrate_admin_areas Hook Missing from 2.1 RC1
Post by: Sesquipedalian on March 16, 2019, 12:33:18 AM
I remember being confused about that myself once when I was getting started with 2.1's code, so I've just added some comments (https://github.com/SimpleMachines/SMF2.1/commit/596c66d59693042bcf39446bb1758de26ab1962f) to make it easier for others to find this in the future.