static function getLinkFromMenuItem($itemId, $isLogout) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getItem($itemId); if ($item) { if ($item->type == 'url') { $redirect = $item->link; } else { if ($item->type == 'alias') { $aliasedId = $item->params->get('aliasoptions'); if ($isLogout && SCSocialUtilities::isMenuRegistered($aliasedId)) { $link = 'index.php'; } else { $link = SCSocialUtilities::getLinkWithItemId($item->link, $aliasedId); } $redirect = JRoute::_($link, false); } else { if ($isLogout && SCSocialUtilities::isMenuRegistered($itemId)) { $link = 'index.php'; } else { $link = SCSocialUtilities::getLinkWithItemId($item->link, $itemId); } $redirect = JRoute::_($link, false); } } } else { $redirect = ''; } return $redirect; }