getChild('My Services Actions'); // Don't modify the secondary sidebar if the Unban Center module isn't // loaded, if the secondary sidebar doesn't exist, or if the "My Services // Actions" panel in the secondary sidebar doesn't exist. if (!$hasUnban || is_null($secondarySidebar) || is_null($myServicesActions)) { return []; } // Determine the contents of the "Unban IP Address" menu item. $uri = 'index.php?m=unbanCenter'; if (isset($templateVariables[0]['unbanId'])) { $uri .= "&id={$templateVariables[0]['unbanId']}"; } $label = isset($templateVariables[0]['mglang']) ? $templateVariables[0]['mglang']->_('integrationbtn') : 'Unban Your IP Address'; // Add the "Unban IP Address" menu item to the secondary sidebar's "My // Services Actions" panel. $unbanIpAddress = $myServicesActions->addChild( 'Unban Center', [ 'uri' => $uri, 'icon' => 'fa-unlock', 'label' => $label, ] ); $unbanIpAddress->moveToBack(); // Re-assign the secondary sidebar to the template. return ['secondarySidebar' => $secondarySidebar]; });