• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Event Code Listener

Mythotical

Well-known member
#1
For what I need to do I discovered that I would need to use:

PHP:
XenForo_CodeEvent::fire('navigation_tabs', array(&$extraTabs, $selectedTabId));
Would it be possible to do an array merge with the $tabs array:
PHP:
        $tabs = array();
        foreach ($showTabs AS $tabId => $show)
        {
            if (!$show)
            {
                continue;
            }

            switch ($tabId)
            {
                case 'lorem':
                    $tab = array(
                        'title' => new XenForo_Phrase('xportal'),
                        'href' => XenForo_Link::buildPublicLink('full:xportal')
                    );
Cheers
 

Mythotical

Well-known member
#4
Replace the Home tab so that when I am on my portal page it will highlight the home tab instead without having to run extraTabs cuz that would look weird being Forums | Home

I found that adding the code to Public.php would solve that and I want to see about an array merge so that I can just include the extra code in an event listener.
 

Mythotical

Well-known member
#5
Better explanation: I am trying to replace the Home tab with one that will properly link to my portal and show as selected when viewing the portal. The only problem is that the home tab doesn't have a way to identify it for selecting. I am trying to avoid having people who install my portal addon to have to edit php files. Would be much easier to make it all automatic.