I was told by AlexT, that to override a function in BxBaseMenu.php, that all you have to do, is copy it to BxTmplMenu.php in your templates /scripts directory, and make the changes.
Here's his exact words:
If you need to modify menu html you need to override appropriate method in BxTemplMenu.php file. For example to add custom class to topMenu table you can copy genTopHeader method from BxBaseMenu.php and insert it to BxTemplMenu.php file:
/*
* Generate top header part
*/
function genTopHeader() {
$iCurrent = $this->checkShowCurSub() ? 0 : $this->aMenuInfo['currentTop'];
$this->sCode .= '<table class="topMenu MY_SUPER_CLASS_HERE" cellpadding="0" cellspacing="0" style="width:' . $this->sWidth . '"><tr>';
}
So why doesn't this work, when copied to my BxTmplMenu.php? (Top menu search item removed)
/*
* Generate search element
*/
function genSearchElement() {
$sSearchC = process_line_output(_t('_Search'));
ob_start();
?>
<script language="javascript">
$(document).ready( function() {
$('#keyword').blur(function() {
$('#keyword').removeClass();
$('#keyword').addClass('input_main');
if ('' == $('#keyword').val())
$('#keyword').val('<?= $sSearchC ?>');
}
);
$('#keyword').focus(function() {
$('#keyword').removeClass();
$('#keyword').addClass('input_focus');
if ('<?= $sSearchC ?>' == $('#keyword').val())
$('#keyword').val('');
}
);
});
</script>
<?
}
It's the same concept.... isn't it?
