Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla's use of Base_GetAppSettingsMenuItems_Handler

LincLinc Detroit Admin
edited June 2010 in Vanilla 2.0 - 2.8
I wanted to make a dashboard panel for my new app, so I went and grabbed Base_GetAppSettingsMenuItems_Handler from Vanilla's /settings/class.hooks.php file, copied it into my hooks file, and customized it.
public function Base_GetAppSettingsMenuItems_Handler(&$Sender) {
$Menu = &$Sender->EventArguments['SideMenu'];
$Menu->AddLink('Directory', T('Hierarchy'), 'directory/settings/hierarchy', 'Directory.Hierarchy.Manage');
$Menu->AddLink('Directory', T('Listings'), 'directory/settings/listings', 'Directory.Listings.Manage');
...and out came a mis-formatted mess.

After a half hour of slogging through code, I realized Vanilla isn't consistent - there's this little line tucked into the Dashboard's version of that function:
$Menu->AddItem('Forum', T('Forum Settings'));
That means (as far as I can tell) Vanilla has favored-nation status because A) it's the only app that can put its controls somewhere other than the end of the list since the Dashboard reserves its spot and B) it doesn't have to make the AddItem call in its plugin function (so good luck copying the example - Conversations doesn't have a Dashboard panel).

Just an FYI if anyone cares.


  • Options
    LincLinc Detroit Admin
    Related: Why does the panel group get the title "Forum" and not "Forum Settings"? Shouldn't it be grabbing that translated text for the h4 rather than the $GroupName?

    /dashboard/modules/class.sidemenumodule.php around line 203.
Sign In or Register to comment.