public function getNodesByNavigationId($navId, $locale = null)
{
// Fallback to current locale
$locale = is_null($locale) ? craft()->language : $locale;
// Set necessary variables
$this->_siteUrl = craft()->getSiteUrl();
$this->_addTrailingSlash = craft()->config->get('addTrailingSlashesToUrls');
// Start at the root by default
$parentId = 0;
// Do we have to start from a specific node ID?
$startFromId = $this->_getParam('startFromId', false);
if ($startFromId !== false) {
$parentId = $startFromId;
}
// Get nodes
$nodes = craft()->amNav_node->getAllNodesByNavigationId($navId, $locale);
// Find the active nodes if needed
if ($this->_parseEnvironment) {
$this->_setActiveNodes($nodes);
}
// Return the navigation
if ($this->_parseHtml) {
return $this->_buildNavHtml($nodes, $parentId);
}
return $this->_buildNav($nodes, $parentId);
}