$val) { if(!empty($exclusion_array) && in_array($val,$exclude )) { continue; } else { if (file_exists('modules/'.$val.'/Menu.php')) { $mod_strings = return_module_language($current_language, $val); $module_menu = array(); include('modules/'.$val.'/Menu.php'); $tmp_menu_items = array(); foreach($module_menu as $menu) { if(isset($menu[0]) && !empty($menu[0]) && isset($menu[1]) && !empty($menu[1]) && trim($menu[0]) !='#') { $tmp_menu_items[$menu[1]] =$menu[0]; } } $mstr_array[$val] = $tmp_menu_items; } } } //reset the modstrings to current module $mod_strings = $orig_modstrings ; //store master array into session variable $_SESSION['SM_ARRAY'] = $mstr_array; return $mstr_array; } function sm_builder($tpl='modules/Home/sitemap.tpl') { global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once('include/Sugar_Smarty.php'); $sm = sm_build_array(); $sm_smarty = new Sugar_Smarty(); $sm_smarty->assign('IMAGE_PATH',$image_path); global $sugar_config; if(isset($_SESSION['authenticated_user_language']) && $_SESSION['authenticated_user_language'] != '') { $current_language = $_SESSION['authenticated_user_language']; } else { $current_language = $sugar_config['default_language']; } $mod_strings = return_module_language($current_language, 'Home'); $sm_smarty->assign('CLOSE', isset($mod_strings['LBL_CLOSE_SITEMAP']) ? $mod_strings['LBL_CLOSE_SITEMAP'] : ''); // get the list_strings in order for module friendly name display. $app_list_strings = return_app_list_strings_language($current_language); foreach ($sm as $mod_dir_name => $links) { $module_friendly_name = $app_list_strings['moduleList'][$mod_dir_name]; $temphtml = ""; $temphtml .= '

' . $module_friendly_name .'

'; $sm_smarty->assign(strtoupper($mod_dir_name), $temphtml); } return $sm_smarty->fetch($tpl); }