Minerva nav_urls are used only when OverflowMenu is present

There is no need to call SkinTemplate::buildNavUrls() as the 'nav_urls'
from QuickTemplate are used only when OverlfowMenu is present. There is
no need to do that heavy calculation unless we really need it.

Change-Id: I003efcdeffe10f6a3a155932a20c09e8f62c747e
This commit is contained in:
Piotr Miazga 2019-05-07 22:42:49 +02:00
parent 4ad1b511c0
commit f4fa534b9d
1 changed files with 14 additions and 0 deletions

View File

@ -1026,6 +1026,20 @@ class SkinMinerva extends SkinTemplate {
] ) );
}
/**
* Unless the OverflowMenu is enabled, Minerva doesn't use nav_urls from QuikcTemplate.
* We can skip that heavy operation
* @return array
*/
protected function buildNavUrls() {
if ( $this->isAllowedPageAction( SkinOptions::OPTION_OVERFLOW_SUBMENU ) ) {
// the OverflowMenu uses nav_urls, use the value from SkinTemplate
return parent::buildNavUrls();
} else {
return [];
}
}
/**
* @param BaseTemplate $tpl
* @return array