diff --git a/modules/Vtiger/views/Header.php b/modules/Vtiger/views/Header.php index 1051ed4debb4bb52bfc0d952b6fecd877c7df537..7cffac2a341adc838c3865f15f2ee08c64773cb7 100644 --- a/modules/Vtiger/views/Header.php +++ b/modules/Vtiger/views/Header.php @@ -144,10 +144,15 @@ abstract class Vtiger_Header_View extends Vtiger_View_Controller { } $headerLinkInstances[$index++] = $headerLinkInstance; } + + // Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/49 + // Push HEADERLINKS to drop-down menu shown with username (last-one) as structured above. + $lastindex = count($headerLinkInstances)-1; $headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERLINK')); + if ($headerLinks) $headerLinkInstances[$lastindex]->addChildLink(Vtiger_Link_Model::getInstanceFromValues(array())); // Separator foreach($headerLinks as $headerType => $headerLinks) { foreach($headerLinks as $headerLink) { - $headerLinkInstances[$index++] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink); + $headerLinkInstances[$lastindex]->addChildLink(Vtiger_Link_Model::getInstanceFromLinkObject($headerLink)); } } return $headerLinkInstances;